7.0
general 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-2021 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  * Semi-private function prototypes
100  *
101  * The following functions are intended to be used by the postprocessing layer
102  * (cs_post.c), not directly by the user.
103  *============================================================================*/
104 
105 /*----------------------------------------------------------------------------*/
109 /*----------------------------------------------------------------------------*/
110 
111 void
112 cs_probe_finalize(void);
113 
114 /*----------------------------------------------------------------------------*/
126 /*----------------------------------------------------------------------------*/
127 
128 void
130  int *n_fields,
131  int **field_info);
132 
133 /*=============================================================================
134  * Public function prototypes.
135  *============================================================================*/
136 
137 /*----------------------------------------------------------------------------*/
143 /*----------------------------------------------------------------------------*/
144 
145 int
146 cs_probe_get_n_sets(void);
147 
148 /*----------------------------------------------------------------------------*/
156 /*----------------------------------------------------------------------------*/
157 
159 cs_probe_set_get(const char *name);
160 
161 /*----------------------------------------------------------------------------*/
169 /*----------------------------------------------------------------------------*/
170 
172 cs_probe_set_get_by_id(int pset_id);
173 
174 /*----------------------------------------------------------------------------*/
182 /*----------------------------------------------------------------------------*/
183 
184 const char *
186 
187 /*----------------------------------------------------------------------------*/
204 /*----------------------------------------------------------------------------*/
205 
206 void
208  bool *time_varying,
209  bool *on_boundary,
210  bool *on_curve,
211  bool *auto_variables,
212  bool *auto_curve_coo,
213  bool *auto_cart_coo,
214  int *n_writers,
215  int *writer_ids[]);
216 
217 /*----------------------------------------------------------------------------*/
226 /*----------------------------------------------------------------------------*/
227 
228 const char *
230 
231 /*----------------------------------------------------------------------------*/
241 /*----------------------------------------------------------------------------*/
242 
243 int
245 
246 /*----------------------------------------------------------------------------*/
254 /*----------------------------------------------------------------------------*/
255 
257 cs_probe_set_create(const char *name);
258 
259 /*----------------------------------------------------------------------------*/
269 /*----------------------------------------------------------------------------*/
270 
271 void
273  cs_real_t x,
274  cs_real_t y,
275  cs_real_t z,
276  const char *label);
277 
278 /*----------------------------------------------------------------------------*/
289 /*----------------------------------------------------------------------------*/
290 
292 cs_probe_set_create_from_array(const char *name,
293  int n_probes,
294  const cs_real_3_t *coords,
295  const char **labels);
296 
297 /*----------------------------------------------------------------------------*/
308 /*----------------------------------------------------------------------------*/
309 
311 cs_probe_set_create_from_segment(const char *name,
312  int n_probes,
313  const cs_real_t start_coords[3],
314  const cs_real_t end_coords[3]);
315 
316 /*----------------------------------------------------------------------------*/
334 /*----------------------------------------------------------------------------*/
335 
337 cs_probe_set_create_from_local(const char *name,
338  cs_probe_set_define_local_t *p_define_func,
339  void *p_define_input);
340 
341 /*----------------------------------------------------------------------------*/
349 /*----------------------------------------------------------------------------*/
350 
351 void
352 cs_probe_set_allow_overwrite(const char *name);
353 
354 /*----------------------------------------------------------------------------*/
373 /*----------------------------------------------------------------------------*/
374 
375 void
377  const cs_real_t *s);
378 
379 /*----------------------------------------------------------------------------*/
387 /*----------------------------------------------------------------------------*/
388 
389 void
391  int n_writers,
392  const int *writer_ids);
393 
394 /*----------------------------------------------------------------------------*/
410 /*----------------------------------------------------------------------------*/
411 
412 void
414  int writer_id,
415  int field_id,
416  int comp_id);
417 
418 /*----------------------------------------------------------------------------*/
425 /*----------------------------------------------------------------------------*/
426 
427 void
429  bool mode);
430 
431 /*----------------------------------------------------------------------------*/
438 /*----------------------------------------------------------------------------*/
439 
440 void
442  bool mode);
443 
444 /*----------------------------------------------------------------------------*/
451 /*----------------------------------------------------------------------------*/
452 
453 void
455  bool mode);
456 
457 /*----------------------------------------------------------------------------*/
464 /*----------------------------------------------------------------------------*/
465 
466 void
468  cs_probe_snap_t snap_mode);
469 
470 /*----------------------------------------------------------------------------*/
494 /*----------------------------------------------------------------------------*/
495 
496 void
498  const char *keyname,
499  const char *keyval);
500 
501 /*----------------------------------------------------------------------------*/
515 /*----------------------------------------------------------------------------*/
516 
517 void
519  const fvm_nodal_t *location_mesh);
520 
521 /*----------------------------------------------------------------------------*/
530 /*----------------------------------------------------------------------------*/
531 
532 fvm_nodal_t *
534  const char *mesh_name);
535 
536 /*----------------------------------------------------------------------------*/
545 /*----------------------------------------------------------------------------*/
546 
547 fvm_nodal_t *
549  const char *mesh_name);
550 
551 /*----------------------------------------------------------------------------*/
557 /*----------------------------------------------------------------------------*/
558 
559 void
560 cs_probe_set_dump(const cs_probe_set_t *pset);
561 
562 /*----------------------------------------------------------------------------*/
571 /*----------------------------------------------------------------------------*/
572 
573 void
575  cs_probe_snap_t *snap_mode,
576  int *n_probes,
577  cs_real_3_t *coords[]);
578 
579 /*----------------------------------------------------------------------------*/
587 /*----------------------------------------------------------------------------*/
588 
589 int
591 
592 /*----------------------------------------------------------------------------*/
600 /*----------------------------------------------------------------------------*/
601 
602 const cs_real_t *
604 
605 /*----------------------------------------------------------------------------*/
616 /*----------------------------------------------------------------------------*/
617 
618 cs_real_t *
620 
621 /*----------------------------------------------------------------------------*/
632 /*----------------------------------------------------------------------------*/
633 
634 const cs_lnum_t *
636  int mesh_location_id);
637 
638 /*----------------------------------------------------------------------------*/
639 
641 
642 #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:1050
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:1855
int cs_probe_set_get_interpolation(cs_probe_set_t *pset)
Return the interpolation option for a given probe set.
Definition: cs_probe.c:852
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:894
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:1708
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:2016
void cs_probe_set_associate_field(cs_probe_set_t *pset, int writer_id, int field_id, int comp_id)
Associate a field to a probe set.
Definition: cs_probe.c:1184
void cs_probe_set_auto_cartesian_coords(cs_probe_set_t *pset, bool mode)
Set automatic output of curvilinear coordinates.
Definition: cs_probe.c:1267
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:1291
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:1985
cs_probe_set_t * cs_probe_set_get(const char *name)
Retrieve a cs_probe_set_t structure.
Definition: cs_probe.c:709
void cs_probe_set_auto_curvilinear_coords(cs_probe_set_t *pset, bool mode)
Set automatic output of curvilinear coordinates.
Definition: cs_probe.c:1243
int cs_probe_get_n_sets(void)
Retrieve the number of probe sets defined.
Definition: cs_probe.c:693
#define BEGIN_C_DECLS
Definition: cs_defs.h:495
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, bool *auto_curve_coo, bool *auto_cart_coo, int *n_writers, int *writer_ids[])
Retrieve information useful for the postprocessing step.
Definition: cs_probe.c:787
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:759
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:1147
void cs_probe_set_allow_overwrite(const char *name)
allow overwriting the definition of a given probe set.
Definition: cs_probe.c:1077
double cs_real_t
Floating-point value.
Definition: cs_defs.h:307
void cs_probe_set_transfer_associated_field_info(cs_probe_set_t *pset, int *n_fields, int **field_info)
Transfer info on associated fields to the caller.
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:831
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:1421
cs_probe_snap_t
Definition: cs_probe.h:55
void cs_probe_set_assign_curvilinear_abscissa(cs_probe_set_t *pset, const cs_real_t *s)
Assign curvilinear abscissa for the given probe set.
Definition: cs_probe.c:1107
Definition: cs_probe.h:58
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:320
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:2037
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:2090
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:942
void cs_probe_set_dump(const cs_probe_set_t *pset)
Dump a cs_probe_set_t structure.
Definition: cs_probe.c:1935
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:301
void cs_probe_finalize(void)
Free all structures related to a set of probes.
cs_probe_set_t * cs_probe_set_create(const char *name)
Create a new set of probes.
Definition: cs_probe.c:870
Definition: cs_probe.h:59
#define END_C_DECLS
Definition: cs_defs.h:496
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:1327
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:982
cs_real_t * cs_probe_set_get_loc_curvilinear_abscissa(const cs_probe_set_t *pset)
Return the list of curvilinear abscissa of probes located on the local ranks for the given probe set...
Definition: cs_probe.c:2061
void cs_probe_set_auto_var(cs_probe_set_t *pset, bool mode)
Set automatic output of variables behavior.
Definition: cs_probe.c:1219
char * label
Definition: keywords.h:71
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:739
Definition: cs_probe.h:57
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