My Project
programmer's documentation
Loading...
Searching...
No Matches
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
53typedef struct _cs_probe_set_t cs_probe_set_t;
54
62
63/*============================================================================
64 * Local type definitions
65 *============================================================================*/
66
67/*----------------------------------------------------------------------------*/
86/*----------------------------------------------------------------------------*/
87
88typedef 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
108void
110
111/*----------------------------------------------------------------------------*/
117/*----------------------------------------------------------------------------*/
118
119int
121
122/*----------------------------------------------------------------------------*/
130/*----------------------------------------------------------------------------*/
131
133cs_probe_set_get(const char *name);
134
135/*----------------------------------------------------------------------------*/
143/*----------------------------------------------------------------------------*/
144
146cs_probe_set_get_by_id(int pset_id);
147
148/*----------------------------------------------------------------------------*/
156/*----------------------------------------------------------------------------*/
157
158const char *
160
161/*----------------------------------------------------------------------------*/
176/*----------------------------------------------------------------------------*/
177
178void
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
198const char *
200
201/*----------------------------------------------------------------------------*/
209/*----------------------------------------------------------------------------*/
210
212cs_probe_set_create(const char *name);
213
214/*----------------------------------------------------------------------------*/
224/*----------------------------------------------------------------------------*/
225
226void
228 cs_real_t x,
229 cs_real_t y,
230 cs_real_t z,
231 const char *label);
232
233/*----------------------------------------------------------------------------*/
244/*----------------------------------------------------------------------------*/
245
247cs_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
266cs_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
292cs_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
306void
307cs_probe_set_allow_overwrite(const char *name);
308
309/*----------------------------------------------------------------------------*/
317/*----------------------------------------------------------------------------*/
318
319void
321 int n_writers,
322 const int *writer_ids);
323
324/*----------------------------------------------------------------------------*/
331/*----------------------------------------------------------------------------*/
332
333void
335 bool mode);
336
337/*----------------------------------------------------------------------------*/
344/*----------------------------------------------------------------------------*/
345
346void
348 cs_probe_snap_t snap_mode);
349
350/*----------------------------------------------------------------------------*/
370/*----------------------------------------------------------------------------*/
371
372void
374 const char *keyname,
375 const char *keyval);
376
377/*----------------------------------------------------------------------------*/
391/*----------------------------------------------------------------------------*/
392
393void
395 const fvm_nodal_t *location_mesh);
396
397/*----------------------------------------------------------------------------*/
406/*----------------------------------------------------------------------------*/
407
408fvm_nodal_t *
410 const char *mesh_name);
411
412/*----------------------------------------------------------------------------*/
421/*----------------------------------------------------------------------------*/
422
423fvm_nodal_t *
425 const char *mesh_name);
426
427/*----------------------------------------------------------------------------*/
433/*----------------------------------------------------------------------------*/
434
435void
437
438/*----------------------------------------------------------------------------*/
447/*----------------------------------------------------------------------------*/
448
449void
451 cs_probe_snap_t *snap_mode,
452 int *n_probes,
453 cs_real_3_t *coords[]);
454
455/*----------------------------------------------------------------------------*/
463/*----------------------------------------------------------------------------*/
464
465int
467
468/*----------------------------------------------------------------------------*/
476/*----------------------------------------------------------------------------*/
477
478const cs_real_t *
480
481/*----------------------------------------------------------------------------*/
492/*----------------------------------------------------------------------------*/
493
494const cs_lnum_t *
496 int mesh_location_id);
497
498/*----------------------------------------------------------------------------*/
499
501
502#endif /* __CS_PROBE_H__ */
#define BEGIN_C_DECLS
Definition cs_defs.h:467
double cs_real_t
Floating-point value.
Definition cs_defs.h:302
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition cs_defs.h:315
#define END_C_DECLS
Definition cs_defs.h:468
int cs_lnum_t
local mesh entity id
Definition cs_defs.h:298
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_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
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_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_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
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_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_probe_snap_t
Definition cs_probe.h:55
@ CS_PROBE_SNAP_NONE
Definition cs_probe.h:57
@ CS_PROBE_SNAP_VERTEX
Definition cs_probe.h:59
@ CS_PROBE_SNAP_ELT_CENTER
Definition cs_probe.h:58
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
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
int cs_probe_get_n_sets(void)
Retrieve the number of probe sets defined.
Definition cs_probe.c:472
cs_probe_set_t * cs_probe_set_create(const char *name)
Create a new set of probes.
Definition cs_probe.c:621
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
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
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
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
struct _cs_probe_set_t cs_probe_set_t
Definition cs_probe.h:53
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
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
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_set_t * cs_probe_set_get(const char *name)
Retrieve a cs_probe_set_t structure.
Definition cs_probe.c:488
void cs_probe_set_allow_overwrite(const char *name)
allow overwriting the definition of a given probe set.
Definition cs_probe.c:828
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
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
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_dump(const cs_probe_set_t *pset)
Dump a cs_probe_set_t structure.
Definition cs_probe.c:1519
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
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
static int input(void)