9.2
general documentation
cs_evaluate.h
Go to the documentation of this file.
1#ifndef CS_EVALUATE_H
2#define CS_EVALUATE_H
3
4/*============================================================================
5 * Functions and structures to deal with evaluation of quantities
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 "base/cs_base.h"
35#include "cdo/cs_cdo_connect.h"
36#include "cdo/cs_cdo_local.h"
38#include "cdo/cs_xdef.h"
39
40/*============================================================================
41 * Macro definitions
42 *============================================================================*/
43
44/*============================================================================
45 * Type definitions
46 *============================================================================*/
47
48/*============================================================================
49 * Inline public function prototypes
50 *============================================================================*/
51
52/*============================================================================
53 * Public function prototypes
54 *============================================================================*/
55
56/*----------------------------------------------------------------------------*/
64/*----------------------------------------------------------------------------*/
65
66void
68 const cs_cdo_connect_t *connect,
69 const cs_mesh_t *mesh);
70
71/*----------------------------------------------------------------------------*/
86/*----------------------------------------------------------------------------*/
87
88void
90 cs_lnum_t n_x,
91 const cs_real_t *array,
92 const cs_real_t *w_x,
95 cs_real_t *wsum,
96 cs_real_t *asum,
97 cs_real_t *ssum);
98
99/*----------------------------------------------------------------------------*/
118/*----------------------------------------------------------------------------*/
119
120void
122 cs_lnum_t n_x,
123 const cs_real_t *array,
124 const cs_adjacency_t *c2x,
125 const cs_real_t *w_x,
126 cs_real_t *min,
127 cs_real_t *max,
128 cs_real_t *wsum,
129 cs_real_t *asum,
130 cs_real_t *ssum);
131
132/*----------------------------------------------------------------------------*/
143/*----------------------------------------------------------------------------*/
144
145void
147 const cs_xdef_t *def,
148 cs_real_t retval[]);
149
150/*----------------------------------------------------------------------------*/
161/*----------------------------------------------------------------------------*/
162
163void
165 const cs_xdef_t *def,
166 cs_real_t time_eval,
167 cs_real_t retval[]);
168
169/*----------------------------------------------------------------------------*/
179/*----------------------------------------------------------------------------*/
180
181void
183 const cs_lnum_t n_v_selected,
184 const cs_lnum_t *selected_lst,
185 cs_real_t retval[]);
186
187/*----------------------------------------------------------------------------*/
198/*----------------------------------------------------------------------------*/
199
200void
202 const cs_real_t time_eval,
203 const cs_lnum_t n_v_selected,
204 const cs_lnum_t *selected_lst,
205 cs_real_t retval[]);
206
207/*----------------------------------------------------------------------------*/
217/*----------------------------------------------------------------------------*/
218
219void
221 const cs_lnum_t n_v_selected,
222 const cs_lnum_t *selected_lst,
223 cs_real_t retval[]);
224
225/*----------------------------------------------------------------------------*/
235/*----------------------------------------------------------------------------*/
236
237void
239 const cs_lnum_t n_f_selected,
240 const cs_lnum_t *selected_lst,
241 cs_real_t retval[]);
242
243/*----------------------------------------------------------------------------*/
254/*----------------------------------------------------------------------------*/
255
256void
258 const cs_real_t time_eval,
259 const cs_lnum_t n_f_selected,
260 const cs_lnum_t *selected_lst,
261 cs_real_t retval[]);
262
263/*----------------------------------------------------------------------------*/
271/*----------------------------------------------------------------------------*/
272
273void
275 cs_real_t retval[]);
276
277/*----------------------------------------------------------------------------*/
285/*----------------------------------------------------------------------------*/
286
287void
289 cs_real_t retval[]);
290
291/*----------------------------------------------------------------------------*/
300/*----------------------------------------------------------------------------*/
301
302void
304 const cs_real_t time_eval,
305 cs_real_t retval[]);
306
307/*----------------------------------------------------------------------------*/
315/*----------------------------------------------------------------------------*/
316
317void
319 cs_real_t retval[]);
320
321/*----------------------------------------------------------------------------*/
333/*----------------------------------------------------------------------------*/
334
335void
337 const cs_xdef_t *def,
338 cs_real_t vvals[],
339 cs_real_t wvals[]);
340
341/*----------------------------------------------------------------------------*/
351/*----------------------------------------------------------------------------*/
352
353void
355 const cs_lnum_t n_e_selected,
356 const cs_lnum_t *selected_lst,
357 cs_real_t retval[]);
358
359/*----------------------------------------------------------------------------*/
369/*----------------------------------------------------------------------------*/
370
371void
373 const cs_lnum_t n_e_selected,
374 const cs_lnum_t *selected_lst,
375 cs_real_t retval[]);
376
377/*----------------------------------------------------------------------------*/
388/*----------------------------------------------------------------------------*/
389
390void
392 const cs_real_t time_eval,
393 const cs_lnum_t n_e_selected,
394 const cs_lnum_t *selected_lst,
395 cs_real_t retval[]);
396
397/*----------------------------------------------------------------------------*/
406/*----------------------------------------------------------------------------*/
407
408void
410 const cs_lnum_t n_f_selected,
411 const cs_lnum_t *selected_lst,
412 cs_real_t retval[]);
413
414/*----------------------------------------------------------------------------*/
425/*----------------------------------------------------------------------------*/
426
427void
429 const cs_real_t time_eval,
430 const cs_lnum_t n_f_selected,
431 const cs_lnum_t *selected_lst,
432 cs_real_t retval[]);
433
434/*----------------------------------------------------------------------------*/
444/*----------------------------------------------------------------------------*/
445
446void
448 cs_real_t time_eval,
449 const cs_lnum_t n_f_selected,
450 const cs_lnum_t *selected_lst,
451 cs_real_t retval[]);
452
453/*----------------------------------------------------------------------------*/
460/*----------------------------------------------------------------------------*/
461
462void
464 cs_real_t retval[]);
465
466/*----------------------------------------------------------------------------*/
473/*----------------------------------------------------------------------------*/
474
475void
477 cs_real_t retval[]);
478
479/*----------------------------------------------------------------------------*/
488/*----------------------------------------------------------------------------*/
489
490void
492 cs_real_t time_eval,
493 cs_real_t retval[]);
494
495/*----------------------------------------------------------------------------*/
505/*----------------------------------------------------------------------------*/
506
507void
509 cs_real_t time_eval,
510 cs_real_t retval[]);
511
512/*----------------------------------------------------------------------------*/
523/*----------------------------------------------------------------------------*/
524
527 const cs_real_t *array_val);
528
529#endif /* CS_EVALUATE_H */
double cs_real_t
Floating-point value.
Definition: cs_defs.h:332
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:325
unsigned short int cs_flag_t
Definition: cs_defs.h:334
void cs_evaluate_array_reduction(int dim, cs_lnum_t n_x, const cs_real_t *array, const cs_real_t *w_x, cs_real_t *min, cs_real_t *max, cs_real_t *wsum, cs_real_t *asum, cs_real_t *ssum)
Compute reduced quantities for an array of size equal to dim * n_x The computed quantities are synchr...
Definition: cs_evaluate.cpp:1354
void cs_evaluate_potential_at_cells_by_value(const cs_xdef_t *def, cs_real_t retval[])
Evaluate a potential field at cell centers from a definition by value.
Definition: cs_evaluate.cpp:1876
void cs_evaluate_potential_at_cells_by_analytic(const cs_xdef_t *def, const cs_real_t time_eval, cs_real_t retval[])
Evaluate the quantity attached to a potential field at cell centers when the definition relies on an ...
Definition: cs_evaluate.cpp:1907
void cs_evaluate_potential_at_faces_by_analytic(const cs_xdef_t *def, const cs_real_t time_eval, const cs_lnum_t n_f_selected, const cs_lnum_t *selected_lst, cs_real_t retval[])
Evaluate the quantity attached to a potential field at face centers when the definition relies on an ...
Definition: cs_evaluate.cpp:1767
void cs_evaluate_potential_at_vertices_by_analytic(const cs_xdef_t *def, const cs_real_t time_eval, const cs_lnum_t n_v_selected, const cs_lnum_t *selected_lst, cs_real_t retval[])
Evaluate the quantity attached to a potential field at vertices when the definition relies on an anal...
Definition: cs_evaluate.cpp:1636
void cs_evaluate_density_by_analytic(cs_flag_t dof_flag, const cs_xdef_t *def, cs_real_t time_eval, cs_real_t retval[])
Compute the value related to each DoF in the case of a density field The value defined by the analyti...
Definition: cs_evaluate.cpp:1529
void cs_evaluate_potential_by_qov(cs_flag_t dof_flag, const cs_xdef_t *def, cs_real_t vvals[], cs_real_t wvals[])
Define a value to each DoF in the case of a potential field in order to put a given quantity inside t...
Definition: cs_evaluate.cpp:2004
void cs_evaluate_potential_at_cells_by_array(const cs_xdef_t *def, cs_real_t retval[])
Evaluate a potential field at cell centers from a definition by array.
Definition: cs_evaluate.cpp:1859
void cs_evaluate_scatter_array_reduction(int dim, cs_lnum_t n_x, const cs_real_t *array, const cs_adjacency_t *c2x, const cs_real_t *w_x, cs_real_t *min, cs_real_t *max, cs_real_t *wsum, cs_real_t *asum, cs_real_t *ssum)
Compute reduced quantities for an array attached to either vertex, face or edge DoFs The weight to ap...
Definition: cs_evaluate.cpp:1411
void cs_evaluate_circulation_along_edges_by_value(const cs_xdef_t *def, const cs_lnum_t n_e_selected, const cs_lnum_t *selected_lst, cs_real_t retval[])
Evaluate the circulation along a selection of (primal) edges. Circulation is defined thanks to a cons...
Definition: cs_evaluate.cpp:2070
void cs_evaluate_average_on_faces(const cs_xdef_t *def, cs_real_t time_eval, const cs_lnum_t n_f_selected, const cs_lnum_t *selected_lst, cs_real_t retval[])
Evaluate the average value on faces following the given definition.
Definition: cs_evaluate.cpp:2455
void cs_evaluate_average_on_faces_by_value(const cs_xdef_t *def, const cs_lnum_t n_f_selected, const cs_lnum_t *selected_lst, cs_real_t retval[])
Evaluate the average of a function on the faces.
Definition: cs_evaluate.cpp:2363
void cs_evaluate_average_on_cells(const cs_xdef_t *def, cs_real_t time_eval, cs_real_t retval[])
Evaluate the average value on cells following the given definition The cells associated to this defin...
Definition: cs_evaluate.cpp:2643
void cs_evaluate_potential_at_cells_by_dof_func(const cs_xdef_t *def, cs_real_t retval[])
Evaluate the quantity attached to a potential field at cells when the definition relies on a DoF func...
Definition: cs_evaluate.cpp:1955
void cs_evaluate_circulation_along_edges_by_array(const cs_xdef_t *def, const cs_lnum_t n_e_selected, const cs_lnum_t *selected_lst, cs_real_t retval[])
Evaluate the circulation along a selection of (primal) edges. Circulation is defined thanks to an arr...
Definition: cs_evaluate.cpp:2143
void cs_evaluate_average_on_cells_by_array(const cs_xdef_t *def, cs_real_t retval[])
Evaluate the average of a function on the cells.
Definition: cs_evaluate.cpp:2524
void cs_evaluate_potential_at_vertices_by_value(const cs_xdef_t *def, const cs_lnum_t n_v_selected, const cs_lnum_t *selected_lst, cs_real_t retval[])
Evaluate a potential field at vertices from a definition by a constant value.
Definition: cs_evaluate.cpp:1599
void cs_evaluate_average_on_faces_by_analytic(const cs_xdef_t *def, const cs_real_t time_eval, const cs_lnum_t n_f_selected, const cs_lnum_t *selected_lst, cs_real_t retval[])
Evaluate the average of a function on the faces. Warning: retval has to be initialize before calling ...
Definition: cs_evaluate.cpp:2399
void cs_evaluate_potential_at_vertices_by_dof_func(const cs_xdef_t *def, const cs_lnum_t n_v_selected, const cs_lnum_t *selected_lst, cs_real_t retval[])
Evaluate the quantity attached to a potential field at vertices when the definition relies on a DoF f...
Definition: cs_evaluate.cpp:1686
void cs_evaluate_potential_at_faces_by_value(const cs_xdef_t *def, const cs_lnum_t n_f_selected, const cs_lnum_t *selected_lst, cs_real_t retval[])
Evaluate a potential field at face centers from a definition by a constant value.
Definition: cs_evaluate.cpp:1731
void cs_evaluate_average_on_cells_by_value(const cs_xdef_t *def, cs_real_t retval[])
Evaluate the average of a function on the cells.
Definition: cs_evaluate.cpp:2495
void cs_evaluate_density_by_value(cs_flag_t dof_flag, const cs_xdef_t *def, cs_real_t retval[])
Evaluate the quantity defined by a value in the case of a density field for all the degrees of freedo...
Definition: cs_evaluate.cpp:1465
void cs_evaluate_circulation_along_edges_by_analytic(const cs_xdef_t *def, const cs_real_t time_eval, const cs_lnum_t n_e_selected, const cs_lnum_t *selected_lst, cs_real_t retval[])
Evaluate the circulation along a selection of (primal) edges. Circulation is defined by an analytical...
Definition: cs_evaluate.cpp:2230
void cs_evaluate_average_on_cells_by_analytic(const cs_xdef_t *def, cs_real_t time_eval, cs_real_t retval[])
Evaluate the average of a function on the cells Warning: retval has to be initialize before calling t...
Definition: cs_evaluate.cpp:2576
void cs_evaluate_init_sharing(const cs_cdo_quantities_t *quant, const cs_cdo_connect_t *connect, const cs_mesh_t *mesh)
Set shared pointers to main domain members.
Definition: cs_evaluate.cpp:1325
cs_real_t cs_evaluate_scal_domain_integral_by_array(cs_flag_t array_loc, const cs_real_t *array_val)
Evaluate the integral over the full computational domain of a quantity defined by an array....
Definition: cs_evaluate.cpp:2684
CS_F_HOST_DEVICE T max(const T a, const T b)
Definition: cs_defs.h:735
CS_F_HOST_DEVICE T min(const T a, const T b)
Definition: cs_defs.h:712
Definition: mesh.f90:26
Definition: cs_mesh_adjacencies.h:68
Definition: cs_cdo_connect.h:57
Definition: cs_cdo_quantities.h:142
Definition: cs_mesh.h:85
Structure storing medata for defining a quantity in a very flexible way.
Definition: cs_xdef.h:156