programmer's documentation
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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-2017 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,
91  cs_real_3_t **coords,
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 /*----------------------------------------------------------------------------*/
372 /*----------------------------------------------------------------------------*/
373 
374 void
376  const char *keyname,
377  const char *keyval);
378 
379 /*----------------------------------------------------------------------------*/
393 /*----------------------------------------------------------------------------*/
394 
395 void
397  const fvm_nodal_t *location_mesh);
398 
399 /*----------------------------------------------------------------------------*/
408 /*----------------------------------------------------------------------------*/
409 
410 fvm_nodal_t *
412  const char *mesh_name);
413 
414 /*----------------------------------------------------------------------------*/
423 /*----------------------------------------------------------------------------*/
424 
425 fvm_nodal_t *
427  const char *mesh_name);
428 
429 /*----------------------------------------------------------------------------*/
435 /*----------------------------------------------------------------------------*/
436 
437 void
438 cs_probe_set_dump(const cs_probe_set_t *pset);
439 
440 /*----------------------------------------------------------------------------*/
449 /*----------------------------------------------------------------------------*/
450 
451 void
453  cs_probe_snap_t *snap_mode,
454  int *n_probes,
455  cs_real_3_t *coords[]);
456 
457 /*----------------------------------------------------------------------------*/
465 /*----------------------------------------------------------------------------*/
466 
467 int
469 
470 /*----------------------------------------------------------------------------*/
481 /*----------------------------------------------------------------------------*/
482 
483 const cs_lnum_t *
485  int mesh_location_id);
486 
487 /*----------------------------------------------------------------------------*/
488 
490 
491 #endif /* __CS_PROBE_H__ */
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
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:1441
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
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:1304
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:1602
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
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:1571
cs_probe_set_t * cs_probe_set_get(const char *name)
Retrieve a cs_probe_set_t structure.
Definition: cs_probe.c:488
int cs_probe_get_n_sets(void)
Retrieve the number of probe sets defined.
Definition: cs_probe.c:472
#define BEGIN_C_DECLS
Definition: cs_defs.h:453
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
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
void cs_probe_set_allow_overwrite(const char *name)
allow overwriting the definition of a given probe set.
Definition: cs_probe.c:828
double cs_real_t
Floating-point value.
Definition: cs_defs.h:297
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
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:1023
cs_probe_snap_t
Definition: cs_probe.h:55
Definition: cs_probe.h:58
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
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_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:309
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:1626
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
void cs_probe_set_dump(const cs_probe_set_t *pset)
Dump a cs_probe_set_t structure.
Definition: cs_probe.c:1521
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:293
void cs_probe_finalize(void)
Free all structures related to a set of probes.
Definition: cs_probe.c:451
cs_probe_set_t * cs_probe_set_create(const char *name)
Create a new set of probes.
Definition: cs_probe.c:621
Definition: cs_probe.h:59
#define END_C_DECLS
Definition: cs_defs.h:454
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:933
struct _cs_probe_set_t cs_probe_set_t
Definition: cs_probe.h:53
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
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_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
Definition: cs_probe.h:57