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-2016 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 "cs_base.h"
35 
36 /*----------------------------------------------------------------------------*/
37 
39 
40 /*============================================================================
41  * Macro definitions
42  *============================================================================*/
43 
44 /*============================================================================
45  * Type definitions
46  *============================================================================*/
47 
48 typedef struct _cs_probe_set_t cs_probe_set_t;
49 
50 typedef enum {
51 
52  CS_PROBE_MODE_EXACT, /* Get the value exactly where it is
53  requested. This mode may require an
54  interpolation step. */
55  CS_PROBE_MODE_NEAREST_CELL_CENTER, /* Get the value at the nearest cell
56  center */
57  CS_PROBE_MODE_NEAREST_VERTEX, /* Get the value at the nearest vertex */
59 
61 
62 /*============================================================================
63  * Local type definitions
64  *============================================================================*/
65 
66 /*============================================================================
67  * Global variables
68  *============================================================================*/
69 
70 /*=============================================================================
71  * Public function prototypes for Fortran API
72  *============================================================================*/
73 
74 /*----------------------------------------------------------------------------*/
80 /*----------------------------------------------------------------------------*/
81 
82 int
84 
85 /*----------------------------------------------------------------------------*/
93 /*----------------------------------------------------------------------------*/
94 
96 cs_probe_set_get(const char *name);
97 
98 /*----------------------------------------------------------------------------*/
106 /*----------------------------------------------------------------------------*/
107 
109 cs_probe_set_get_by_id(int pset_id);
110 
111 /*----------------------------------------------------------------------------*/
119 /*----------------------------------------------------------------------------*/
120 
121 const char *
123 
124 /*----------------------------------------------------------------------------*/
136 /*----------------------------------------------------------------------------*/
137 
138 void
140  bool *time_varying,
141  bool *is_profile,
142  bool *on_boundary,
143  bool *is_automatic,
144  int *n_writers,
145  int *writer_ids[]);
146 
147 /*----------------------------------------------------------------------------*/
154 /*----------------------------------------------------------------------------*/
155 
156 bool
158 
159 /*----------------------------------------------------------------------------*/
167 /*----------------------------------------------------------------------------*/
168 
170 cs_probe_set_create(const char *name);
171 
172 /*----------------------------------------------------------------------------*/
180 /*----------------------------------------------------------------------------*/
181 
182 void
184  const cs_real_t *xyz,
185  const char *label);
186 
187 /*----------------------------------------------------------------------------*/
198 /*----------------------------------------------------------------------------*/
199 
201 cs_probe_set_create_from_array(const char *name,
202  int n_probes,
203  const cs_real_t *coords,
204  const char **labels);
205 
206 /*----------------------------------------------------------------------------*/
217 /*----------------------------------------------------------------------------*/
218 
220 cs_probe_set_create_from_segment(const char *name,
221  int n_probes,
222  const cs_real_t start_coords[3],
223  const cs_real_t end_coords[3]);
224 
225 /*----------------------------------------------------------------------------*/
233 /*----------------------------------------------------------------------------*/
234 
235 void
237  int n_writers,
238  const int *writer_ids);
239 
240 /*----------------------------------------------------------------------------*/
248 /*----------------------------------------------------------------------------*/
249 
250 void
252  const char *keyname,
253  const char *keyval);
254 
255 /*----------------------------------------------------------------------------*/
262 /*----------------------------------------------------------------------------*/
263 
264 void
266 
267 /*----------------------------------------------------------------------------*/
276 /*----------------------------------------------------------------------------*/
277 
278 fvm_nodal_t *
280  const char *mesh_name);
281 
282 /*----------------------------------------------------------------------------*/
286 /*----------------------------------------------------------------------------*/
287 
288 void
289 cs_probe_finalize(void);
290 
291 /*----------------------------------------------------------------------------*/
297 /*----------------------------------------------------------------------------*/
298 
299 void
300 cs_probe_set_dump(const cs_probe_set_t *pset);
301 
302 /*----------------------------------------------------------------------------*/
313 /*----------------------------------------------------------------------------*/
314 
315 void
317  int *mode,
318  int *n_probes,
319  cs_real_t *coords[],
320  cs_lnum_t *ent_num[],
321  float *distances[]);
322 
323 /*----------------------------------------------------------------------------*/
324 
326 
327 #endif /* __CS_PROBE_H__ */
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:1046
Definition: cs_probe.h:55
cs_probe_set_t * cs_probe_set_get(const char *name)
Retrieve a cs_probe_set_t structure.
Definition: cs_probe.c:424
int cs_probe_get_n_sets(void)
Retrieve the number of probe sets defined.
Definition: cs_probe.c:408
#define BEGIN_C_DECLS
Definition: cs_defs.h:448
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:474
cs_probe_mode_t
Definition: cs_probe.h:50
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:740
double cs_real_t
Floating-point value.
Definition: cs_defs.h:296
bool cs_probe_set_have_monitoring(void)
Check if a set of monitoring probes has been defined among all the probe sets.
Definition: cs_probe.c:527
Definition: cs_probe.h:58
Definition: cs_probe.h:52
void cs_probe_set_get_members(const cs_probe_set_t *pset, int *mode, int *n_probes, cs_real_t *coords[], cs_lnum_t *ent_num[], float *distances[])
Retrieve the main members of a cs_probe_set_t structure.
Definition: cs_probe.c:1287
Definition: cs_probe.h:57
void cs_probe_set_get_post_info(const cs_probe_set_t *pset, bool *time_varying, bool *is_profile, bool *on_boundary, bool *is_automatic, int *n_writers, int *writer_ids[])
Retrieve information useful for the postprocessing step.
Definition: cs_probe.c:497
void cs_probe_set_dump(const cs_probe_set_t *pset)
Dump a cs_probe_set_t structure.
Definition: cs_probe.c:1232
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:292
void cs_probe_finalize(void)
Free all structures related to a set of probes.
Definition: cs_probe.c:1214
cs_probe_set_t * cs_probe_set_create(const char *name)
Create a new set of probes.
Definition: cs_probe.c:551
void cs_probe_set_locate(cs_probe_set_t *pset)
Try to locate each probe and define the coordinate really use for the postprocessing step...
Definition: cs_probe.c:897
#define END_C_DECLS
Definition: cs_defs.h:449
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:777
struct _cs_probe_set_t cs_probe_set_t
Definition: cs_probe.h:48
void cs_probe_set_add_probe(cs_probe_set_t *pset, const cs_real_t *xyz, const char *label)
Add a new probe to an existing set of probes.
Definition: cs_probe.c:581
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:677
cs_probe_set_t * cs_probe_set_create_from_array(const char *name, int n_probes, const cs_real_t *coords, const char **labels)
Define a new set of probes from an array of coordinates.
Definition: cs_probe.c:627
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:454