9.2
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-2026 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/fvm_nodal.h"
35
36#include "base/cs_base.h"
37#include "mesh/cs_mesh.h"
39#include "fvm/fvm_nodal.h"
40
41/*============================================================================
42 * Macro definitions
43 *============================================================================*/
44
45/*============================================================================
46 * Type definitions
47 *============================================================================*/
48
49typedef struct _cs_probe_set_t cs_probe_set_t;
50
51typedef enum {
52
58
59/*============================================================================
60 * Local type definitions
61 *============================================================================*/
62
63/*----------------------------------------------------------------------------*/
82/*----------------------------------------------------------------------------*/
83
84typedef void
85(cs_probe_set_define_local_t) (void *input,
86 cs_lnum_t *n_elts,
87 cs_real_3_t **coords,
88 cs_real_t **s);
89
90/*============================================================================
91 * Global variables
92 *============================================================================*/
93
94/*============================================================================
95 * Semi-private function prototypes
96 *
97 * The following functions are intended to be used by the postprocessing layer
98 * (cs_post.c), not directly by the user.
99 *============================================================================*/
100
101/*----------------------------------------------------------------------------*/
105/*----------------------------------------------------------------------------*/
106
107void
109
110/*----------------------------------------------------------------------------*/
122/*----------------------------------------------------------------------------*/
123
124void
126 int *n_fields,
127 int **field_info);
128
129/*=============================================================================
130 * Public function prototypes.
131 *============================================================================*/
132
133/*----------------------------------------------------------------------------*/
139/*----------------------------------------------------------------------------*/
140
141int
143
144/*----------------------------------------------------------------------------*/
152/*----------------------------------------------------------------------------*/
153
155cs_probe_set_get(const char *name);
156
157/*----------------------------------------------------------------------------*/
165/*----------------------------------------------------------------------------*/
166
168cs_probe_set_get_by_id(int pset_id);
169
170/*----------------------------------------------------------------------------*/
178/*----------------------------------------------------------------------------*/
179
180const char *
182
183/*----------------------------------------------------------------------------*/
200/*----------------------------------------------------------------------------*/
201
202void
204 bool *time_varying,
205 bool *on_boundary,
206 bool *on_curve,
207 bool *auto_variables,
208 bool *auto_curve_coo,
209 bool *auto_cart_coo,
210 int *n_writers,
211 int *writer_ids[]);
212
213/*----------------------------------------------------------------------------*/
222/*----------------------------------------------------------------------------*/
223
224const char *
226
227/*----------------------------------------------------------------------------*/
237/*----------------------------------------------------------------------------*/
238
239int
241
242/*----------------------------------------------------------------------------*/
250/*----------------------------------------------------------------------------*/
251
253cs_probe_set_create(const char *name);
254
255/*----------------------------------------------------------------------------*/
265/*----------------------------------------------------------------------------*/
266
267void
269 cs_real_t x,
270 cs_real_t y,
271 cs_real_t z,
272 const char *label);
273
274/*----------------------------------------------------------------------------*/
285/*----------------------------------------------------------------------------*/
286
288cs_probe_set_create_from_array(const char *name,
289 int n_probes,
290 const cs_real_3_t *coords,
291 const char **labels);
292
293/*----------------------------------------------------------------------------*/
313/*----------------------------------------------------------------------------*/
314
316cs_probe_set_create_from_segment(const char *name,
317 int n_probes,
318 const cs_real_t start_coords[3],
319 const cs_real_t end_coords[3]);
320
321/*----------------------------------------------------------------------------*/
339/*----------------------------------------------------------------------------*/
340
342cs_probe_set_create_from_local(const char *name,
343 cs_probe_set_define_local_t *p_define_func,
344 void *p_define_input);
345
346/*----------------------------------------------------------------------------*/
354/*----------------------------------------------------------------------------*/
355
356void
357cs_probe_set_allow_overwrite(const char *name);
358
359/*----------------------------------------------------------------------------*/
378/*----------------------------------------------------------------------------*/
379
380void
382 const cs_real_t *s);
383
384/*----------------------------------------------------------------------------*/
392/*----------------------------------------------------------------------------*/
393
394void
396 int n_writers,
397 const int *writer_ids);
398
399/*----------------------------------------------------------------------------*/
415/*----------------------------------------------------------------------------*/
416
417void
419 int writer_id,
420 int field_id,
421 int comp_id);
422
423/*----------------------------------------------------------------------------*/
430/*----------------------------------------------------------------------------*/
431
432void
434 bool mode);
435
436/*----------------------------------------------------------------------------*/
443/*----------------------------------------------------------------------------*/
444
445void
447 bool mode);
448
449/*----------------------------------------------------------------------------*/
456/*----------------------------------------------------------------------------*/
457
458void
460 bool mode);
461
462/*----------------------------------------------------------------------------*/
469/*----------------------------------------------------------------------------*/
470
471void
473 cs_probe_snap_t snap_mode);
474
475/*----------------------------------------------------------------------------*/
499/*----------------------------------------------------------------------------*/
500
501void
503 const char *keyname,
504 const char *keyval);
505
506/*----------------------------------------------------------------------------*/
520/*----------------------------------------------------------------------------*/
521
522void
524 const fvm_nodal_t *location_mesh);
525
526/*----------------------------------------------------------------------------*/
535/*----------------------------------------------------------------------------*/
536
537fvm_nodal_t *
539 const char *mesh_name);
540
541/*----------------------------------------------------------------------------*/
550/*----------------------------------------------------------------------------*/
551
552fvm_nodal_t *
554 const char *mesh_name);
555
556/*----------------------------------------------------------------------------*/
562/*----------------------------------------------------------------------------*/
563
564void
566
567/*----------------------------------------------------------------------------*/
576/*----------------------------------------------------------------------------*/
577
578void
580 cs_probe_snap_t *snap_mode,
581 int *n_probes,
582 cs_real_3_t *coords[]);
583
584/*----------------------------------------------------------------------------*/
592/*----------------------------------------------------------------------------*/
593
594int
596
597/*----------------------------------------------------------------------------*/
605/*----------------------------------------------------------------------------*/
606
607const cs_real_t *
609
610/*----------------------------------------------------------------------------*/
621/*----------------------------------------------------------------------------*/
622
623cs_real_t *
625
626/*----------------------------------------------------------------------------*/
637/*----------------------------------------------------------------------------*/
638
639const cs_lnum_t *
641 int mesh_location_id);
642
643/*----------------------------------------------------------------------------*/
644
645#endif /* CS_PROBE_H */
double cs_real_t
Floating-point value.
Definition: cs_defs.h:332
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:349
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:325
const char * cs_probe_set_get_name(const cs_probe_set_t *pset)
Retrieve the name related to a cs_probe_set_t structure.
Definition: cs_probe.cpp:842
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.cpp:822
void cs_probe_finalize(void)
Free all structures related to a set of probes.
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.cpp:1074
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.cpp:870
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.cpp:2204
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.cpp:1440
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.cpp:1025
cs_probe_snap_t
Definition: cs_probe.h:51
@ CS_PROBE_SNAP_NONE
Definition: cs_probe.h:53
@ CS_PROBE_SNAP_VERTEX
Definition: cs_probe.h:55
@ CS_PROBE_SNAP_ELT_CENTER
Definition: cs_probe.h:54
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.cpp:1534
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.cpp:1847
int cs_probe_get_n_sets(void)
Retrieve the number of probe sets defined.
Definition: cs_probe.cpp:776
cs_probe_set_t * cs_probe_set_create(const char *name)
Create a new set of probes.
Definition: cs_probe.cpp:953
int cs_probe_set_get_n_local(const cs_probe_set_t *pset)
Return the number probes in the local domain.
Definition: cs_probe.cpp:2159
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.cpp:977
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.cpp:914
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.cpp:2233
struct _cs_probe_set_t cs_probe_set_t
Definition: cs_probe.h:49
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.
int cs_probe_set_get_interpolation(cs_probe_set_t *pset)
Return the interpolation option for a given probe set.
Definition: cs_probe.cpp:935
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.cpp:1220
void cs_probe_set_auto_curvilinear_coords(cs_probe_set_t *pset, bool mode)
Set automatic output of curvilinear coordinates.
Definition: cs_probe.cpp:1356
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.cpp:1297
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.cpp:1998
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.cpp:2128
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.cpp:1404
cs_probe_set_t * cs_probe_set_get(const char *name)
Retrieve a cs_probe_set_t structure.
Definition: cs_probe.cpp:792
void cs_probe_set_allow_overwrite(const char *name)
allow overwriting the definition of a given probe set.
Definition: cs_probe.cpp:1190
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.cpp:2180
void cs_probe_set_auto_var(cs_probe_set_t *pset, bool mode)
Set automatic output of variables behavior.
Definition: cs_probe.cpp:1332
void cs_probe_set_auto_cartesian_coords(cs_probe_set_t *pset, bool mode)
Set automatic output of cartesian coordinates.
Definition: cs_probe.cpp:1380
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:85
void cs_probe_set_dump(const cs_probe_set_t *pset)
Dump a cs_probe_set_t structure.
Definition: cs_probe.cpp:2078
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.cpp:1163
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.cpp:1260
char * label
Definition: keywords.h:58