My Project
programmer's documentation
cs_probe.h
Go to the documentation of this file.
1 #ifndef __CS_PROBE_H__
2 #define __CS_PROBE_H__
3 
4 /*============================================================================
5  * Set of structures and functions to handle probes and profiles
6  *============================================================================*/
7 
8 /*
9  This file is part of Code_Saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2019 EDF S.A.
12 
13  This program is free software; you can redistribute it and/or modify it under
14  the terms of the GNU General Public License as published by the Free Software
15  Foundation; either version 2 of the License, or (at your option) any later
16  version.
17 
18  This program is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21  details.
22 
23  You should have received a copy of the GNU General Public License along with
24  this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
25  Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 */
27 
28 /*----------------------------------------------------------------------------*/
29 
30 /*----------------------------------------------------------------------------
31  * Local headers
32  *----------------------------------------------------------------------------*/
33 
34 #include "fvm_nodal.h"
35 
36 #include "cs_base.h"
37 #include "cs_mesh.h"
38 #include "cs_mesh_location.h"
39 #include "fvm_nodal.h"
40 
41 /*----------------------------------------------------------------------------*/
42 
44 
45 /*============================================================================
46  * Macro definitions
47  *============================================================================*/
48 
49 /*============================================================================
50  * Type definitions
51  *============================================================================*/
52 
53 typedef struct _cs_probe_set_t cs_probe_set_t;
54 
55 typedef enum {
56 
62 
63 /*============================================================================
64  * Local type definitions
65  *============================================================================*/
66 
67 /*----------------------------------------------------------------------------*/
86 /*----------------------------------------------------------------------------*/
87 
88 typedef void
90  cs_lnum_t *n_elts,
92  cs_real_t **s);
93 
94 /*============================================================================
95  * Global variables
96  *============================================================================*/
97 
98 /*=============================================================================
99  * Public function prototypes for Fortran API
100  *============================================================================*/
101 
102 /*----------------------------------------------------------------------------*/
106 /*----------------------------------------------------------------------------*/
107 
108 void
109 cs_probe_finalize(void);
110 
111 /*----------------------------------------------------------------------------*/
117 /*----------------------------------------------------------------------------*/
118 
119 int
120 cs_probe_get_n_sets(void);
121 
122 /*----------------------------------------------------------------------------*/
130 /*----------------------------------------------------------------------------*/
131 
133 cs_probe_set_get(const char *name);
134 
135 /*----------------------------------------------------------------------------*/
143 /*----------------------------------------------------------------------------*/
144 
146 cs_probe_set_get_by_id(int pset_id);
147 
148 /*----------------------------------------------------------------------------*/
156 /*----------------------------------------------------------------------------*/
157 
158 const char *
160 
161 /*----------------------------------------------------------------------------*/
176 /*----------------------------------------------------------------------------*/
177 
178 void
180  bool *time_varying,
181  bool *on_boundary,
182  bool *on_curve,
183  bool *auto_variables,
184  int *n_writers,
185  int *writer_ids[]);
186 
187 /*----------------------------------------------------------------------------*/
196 /*----------------------------------------------------------------------------*/
197 
198 const char *
200 
201 /*----------------------------------------------------------------------------*/
209 /*----------------------------------------------------------------------------*/
210 
212 cs_probe_set_create(const char *name);
213 
214 /*----------------------------------------------------------------------------*/
224 /*----------------------------------------------------------------------------*/
225 
226 void
228  cs_real_t x,
229  cs_real_t y,
230  cs_real_t z,
231  const char *label);
232 
233 /*----------------------------------------------------------------------------*/
244 /*----------------------------------------------------------------------------*/
245 
247 cs_probe_set_create_from_array(const char *name,
248  int n_probes,
249  const cs_real_3_t *coords,
250  const char **labels);
251 
252 /*----------------------------------------------------------------------------*/
263 /*----------------------------------------------------------------------------*/
264 
266 cs_probe_set_create_from_segment(const char *name,
267  int n_probes,
268  const cs_real_t start_coords[3],
269  const cs_real_t end_coords[3]);
270 
271 /*----------------------------------------------------------------------------*/
289 /*----------------------------------------------------------------------------*/
290 
292 cs_probe_set_create_from_local(const char *name,
293  cs_probe_set_define_local_t *p_define_func,
294  void *p_define_input);
295 
296 /*----------------------------------------------------------------------------*/
304 /*----------------------------------------------------------------------------*/
305 
306 void
307 cs_probe_set_allow_overwrite(const char *name);
308 
309 /*----------------------------------------------------------------------------*/
317 /*----------------------------------------------------------------------------*/
318 
319 void
321  int n_writers,
322  const int *writer_ids);
323 
324 /*----------------------------------------------------------------------------*/
331 /*----------------------------------------------------------------------------*/
332 
333 void
335  bool mode);
336 
337 /*----------------------------------------------------------------------------*/
344 /*----------------------------------------------------------------------------*/
345 
346 void
348  cs_probe_snap_t snap_mode);
349 
350 /*----------------------------------------------------------------------------*/
370 /*----------------------------------------------------------------------------*/
371 
372 void
374  const char *keyname,
375  const char *keyval);
376 
377 /*----------------------------------------------------------------------------*/
391 /*----------------------------------------------------------------------------*/
392 
393 void
395  const fvm_nodal_t *location_mesh);
396 
397 /*----------------------------------------------------------------------------*/
406 /*----------------------------------------------------------------------------*/
407 
408 fvm_nodal_t *
410  const char *mesh_name);
411 
412 /*----------------------------------------------------------------------------*/
421 /*----------------------------------------------------------------------------*/
422 
423 fvm_nodal_t *
425  const char *mesh_name);
426 
427 /*----------------------------------------------------------------------------*/
433 /*----------------------------------------------------------------------------*/
434 
435 void
436 cs_probe_set_dump(const cs_probe_set_t *pset);
437 
438 /*----------------------------------------------------------------------------*/
447 /*----------------------------------------------------------------------------*/
448 
449 void
451  cs_probe_snap_t *snap_mode,
452  int *n_probes,
453  cs_real_3_t *coords[]);
454 
455 /*----------------------------------------------------------------------------*/
463 /*----------------------------------------------------------------------------*/
464 
465 int
467 
468 /*----------------------------------------------------------------------------*/
476 /*----------------------------------------------------------------------------*/
477 
478 const cs_real_t *
480 
481 /*----------------------------------------------------------------------------*/
492 /*----------------------------------------------------------------------------*/
493 
494 const cs_lnum_t *
496  int mesh_location_id);
497 
498 /*----------------------------------------------------------------------------*/
499 
501 
502 #endif /* __CS_PROBE_H__ */
cs_probe_set_add_probe
void cs_probe_set_add_probe(cs_probe_set_t *pset, cs_real_t x, cs_real_t y, cs_real_t z, const char *label)
Add a new probe to an existing set of probes.
Definition: cs_probe.c:645
input
static int input(void)
cs_probe_set_allow_overwrite
void cs_probe_set_allow_overwrite(const char *name)
allow overwriting the definition of a given probe set.
Definition: cs_probe.c:828
cs_probe_set_snap_mode
void cs_probe_set_snap_mode(cs_probe_set_t *pset, cs_probe_snap_t snap_mode)
Set snap mode related to the management of a set of probes.
Definition: cs_probe.c:899
CS_PROBE_SNAP_VERTEX
Definition: cs_probe.h:59
cs_probe_set_get_members
void cs_probe_set_get_members(const cs_probe_set_t *pset, cs_probe_snap_t *snap_mode, int *n_probes, cs_real_3_t *coords[])
Retrieve the main members of a cs_probe_set_t structure.
Definition: cs_probe.c:1569
cs_real_3_t
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:315
CS_PROBE_SNAP_NONE
Definition: cs_probe.h:57
cs_probe_set_get
cs_probe_set_t * cs_probe_set_get(const char *name)
Retrieve a cs_probe_set_t structure.
Definition: cs_probe.c:488
cs_probe_set_create_from_segment
cs_probe_set_t * cs_probe_set_create_from_segment(const char *name, int n_probes, const cs_real_t start_coords[3], const cs_real_t end_coords[3])
Define a new set of probes from the segment spanned by two points.
Definition: cs_probe.c:733
END_C_DECLS
#define END_C_DECLS
Definition: cs_defs.h:468
cs_probe_set_unlocated_export_mesh
fvm_nodal_t * cs_probe_set_unlocated_export_mesh(cs_probe_set_t *pset, const char *mesh_name)
Define a fvm_nodal_t structure from the set of unlocated probes.
Definition: cs_probe.c:1439
cs_probe_set_locate
void cs_probe_set_locate(cs_probe_set_t *pset, const fvm_nodal_t *location_mesh)
Try to locate each probe and define the coordinate really used for the postprocessing step.
Definition: cs_probe.c:1021
cs_probe_set_get_location_criteria
const char * cs_probe_set_get_location_criteria(cs_probe_set_t *pset)
Return the location filter selection criteria string for a given probe set.
Definition: cs_probe.c:602
cs_probe_set_get_elt_ids
const cs_lnum_t * cs_probe_set_get_elt_ids(const cs_probe_set_t *pset, int mesh_location_id)
Return the ids of a probe set's local matching elements, relative to a given mesh location.
Definition: cs_probe.c:1645
cs_probe_snap_t
cs_probe_snap_t
Definition: cs_probe.h:55
cs_real_t
double cs_real_t
Floating-point value.
Definition: cs_defs.h:302
cs_probe_set_define_local_t
void() cs_probe_set_define_local_t(void *input, cs_lnum_t *n_elts, cs_real_3_t **coords, cs_real_t **s)
Function pointer to definition of probes based on rank-local points.
Definition: cs_probe.h:89
BEGIN_C_DECLS
#define BEGIN_C_DECLS
Definition: cs_defs.h:467
cs_probe_set_dump
void cs_probe_set_dump(const cs_probe_set_t *pset)
Dump a cs_probe_set_t structure.
Definition: cs_probe.c:1519
cs_probe_set_get_post_info
void cs_probe_set_get_post_info(const cs_probe_set_t *pset, bool *time_varying, bool *on_boundary, bool *on_curve, bool *auto_variables, int *n_writers, int *writer_ids[])
Retrieve information useful for the postprocessing step.
Definition: cs_probe.c:564
cs_probe_set_get_by_id
cs_probe_set_t * cs_probe_set_get_by_id(int pset_id)
Retrieve a cs_probe_set_t structure from its id.
Definition: cs_probe.c:518
cs_probe_set_get_curvilinear_abscissa
const cs_real_t * cs_probe_set_get_curvilinear_abscissa(const cs_probe_set_t *pset)
Return the list of curvilinear abscissa for the given probe set.
Definition: cs_probe.c:1621
cs_mesh.h
cs_probe_set_export_mesh
fvm_nodal_t * cs_probe_set_export_mesh(cs_probe_set_t *pset, const char *mesh_name)
Define a fvm_nodal_t structure from the set of probes.
Definition: cs_probe.c:1302
CS_PROBE_SNAP_ELT_CENTER
Definition: cs_probe.h:58
mode
void const cs_int_t * mode
Definition: cs_syr_coupling.h:132
cs_probe_set_get_n_local
int cs_probe_set_get_n_local(const cs_probe_set_t *pset)
Return the number probes in the local domain.
Definition: cs_probe.c:1600
y
void const cs_lnum_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const const cs_real_t *const y
Definition: cs_wall_functions.h:1147
cs_probe_set_create_from_local
cs_probe_set_t * cs_probe_set_create_from_local(const char *name, cs_probe_set_define_local_t *p_define_func, void *p_define_input)
Define a new set of probes from rank-local definition function.
Definition: cs_probe.c:801
cs_lnum_t
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:298
cs_probe_set_t
struct _cs_probe_set_t cs_probe_set_t
Definition: cs_probe.h:53
cs_probe_set_option
void cs_probe_set_option(cs_probe_set_t *pset, const char *keyname, const char *keyval)
Set optional parameters related to the management of a set of probes.
Definition: cs_probe.c:931
cs_probe_set_auto_var
void cs_probe_set_auto_var(cs_probe_set_t *pset, bool mode)
Set to true or false the automatic post-processing of variables.
Definition: cs_probe.c:875
cs_probe_set_get_name
const char * cs_probe_set_get_name(cs_probe_set_t *pset)
Retrieve the name related to a cs_probe_set_t structure.
Definition: cs_probe.c:538
cs_probe_finalize
void cs_probe_finalize(void)
Free all structures related to a set of probes.
Definition: cs_probe.c:451
fvm_nodal.h
cs_probe_set_associate_writers
void cs_probe_set_associate_writers(cs_probe_set_t *pset, int n_writers, const int *writer_ids)
Associate a list of writers to a probe set.
Definition: cs_probe.c:847
cs_mesh_location.h
cs_probe_set_create
cs_probe_set_t * cs_probe_set_create(const char *name)
Create a new set of probes.
Definition: cs_probe.c:621
coords
void const cs_int_t const cs_real_t const cs_real_t * coords
Definition: cs_measures_util.h:360
cs_probe_set_create_from_array
cs_probe_set_t * cs_probe_set_create_from_array(const char *name, int n_probes, const cs_real_3_t *coords, const char **labels)
Define a new set of probes from an array of coordinates.
Definition: cs_probe.c:693
cs_base.h
cs_probe_get_n_sets
int cs_probe_get_n_sets(void)
Retrieve the number of probe sets defined.
Definition: cs_probe.c:472