8.3
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-2024 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#include "cs_cdo_connect.h"
36#include "cs_cdo_local.h"
37#include "cs_cdo_quantities.h"
38#include "cs_xdef.h"
39
40/*----------------------------------------------------------------------------*/
41
43
44/*============================================================================
45 * Macro definitions
46 *============================================================================*/
47
48/*============================================================================
49 * Type definitions
50 *============================================================================*/
51
52/*============================================================================
53 * Inline public function prototypes
54 *============================================================================*/
55
56/*============================================================================
57 * Public function prototypes
58 *============================================================================*/
59
60/*----------------------------------------------------------------------------*/
68/*----------------------------------------------------------------------------*/
69
70void
72 const cs_cdo_connect_t *connect,
73 const cs_mesh_t *mesh);
74
75/*----------------------------------------------------------------------------*/
90/*----------------------------------------------------------------------------*/
91
92void
94 cs_lnum_t n_x,
95 const cs_real_t *array,
96 const cs_real_t *w_x,
97 cs_real_t *min,
98 cs_real_t *max,
99 cs_real_t *wsum,
100 cs_real_t *asum,
101 cs_real_t *ssum);
102
103/*----------------------------------------------------------------------------*/
122/*----------------------------------------------------------------------------*/
123
124void
126 cs_lnum_t n_x,
127 const cs_real_t *array,
128 const cs_adjacency_t *c2x,
129 const cs_real_t *w_x,
130 cs_real_t *min,
131 cs_real_t *max,
132 cs_real_t *wsum,
133 cs_real_t *asum,
134 cs_real_t *ssum);
135
136/*----------------------------------------------------------------------------*/
147/*----------------------------------------------------------------------------*/
148
149void
151 const cs_xdef_t *def,
152 cs_real_t retval[]);
153
154/*----------------------------------------------------------------------------*/
165/*----------------------------------------------------------------------------*/
166
167void
169 const cs_xdef_t *def,
170 cs_real_t time_eval,
171 cs_real_t retval[]);
172
173/*----------------------------------------------------------------------------*/
183/*----------------------------------------------------------------------------*/
184
185void
187 const cs_lnum_t n_v_selected,
188 const cs_lnum_t *selected_lst,
189 cs_real_t retval[]);
190
191/*----------------------------------------------------------------------------*/
202/*----------------------------------------------------------------------------*/
203
204void
206 const cs_real_t time_eval,
207 const cs_lnum_t n_v_selected,
208 const cs_lnum_t *selected_lst,
209 cs_real_t retval[]);
210
211/*----------------------------------------------------------------------------*/
221/*----------------------------------------------------------------------------*/
222
223void
225 const cs_lnum_t n_v_selected,
226 const cs_lnum_t *selected_lst,
227 cs_real_t retval[]);
228
229/*----------------------------------------------------------------------------*/
239/*----------------------------------------------------------------------------*/
240
241void
243 const cs_lnum_t n_f_selected,
244 const cs_lnum_t *selected_lst,
245 cs_real_t retval[]);
246
247/*----------------------------------------------------------------------------*/
258/*----------------------------------------------------------------------------*/
259
260void
262 const cs_real_t time_eval,
263 const cs_lnum_t n_f_selected,
264 const cs_lnum_t *selected_lst,
265 cs_real_t retval[]);
266
267/*----------------------------------------------------------------------------*/
275/*----------------------------------------------------------------------------*/
276
277void
279 cs_real_t retval[]);
280
281/*----------------------------------------------------------------------------*/
289/*----------------------------------------------------------------------------*/
290
291void
293 cs_real_t retval[]);
294
295/*----------------------------------------------------------------------------*/
304/*----------------------------------------------------------------------------*/
305
306void
308 const cs_real_t time_eval,
309 cs_real_t retval[]);
310
311/*----------------------------------------------------------------------------*/
319/*----------------------------------------------------------------------------*/
320
321void
323 cs_real_t retval[]);
324
325/*----------------------------------------------------------------------------*/
337/*----------------------------------------------------------------------------*/
338
339void
341 const cs_xdef_t *def,
342 cs_real_t vvals[],
343 cs_real_t wvals[]);
344
345/*----------------------------------------------------------------------------*/
355/*----------------------------------------------------------------------------*/
356
357void
359 const cs_lnum_t n_e_selected,
360 const cs_lnum_t *selected_lst,
361 cs_real_t retval[]);
362
363/*----------------------------------------------------------------------------*/
373/*----------------------------------------------------------------------------*/
374
375void
377 const cs_lnum_t n_e_selected,
378 const cs_lnum_t *selected_lst,
379 cs_real_t retval[]);
380
381/*----------------------------------------------------------------------------*/
392/*----------------------------------------------------------------------------*/
393
394void
396 const cs_real_t time_eval,
397 const cs_lnum_t n_e_selected,
398 const cs_lnum_t *selected_lst,
399 cs_real_t retval[]);
400
401/*----------------------------------------------------------------------------*/
410/*----------------------------------------------------------------------------*/
411
412void
414 const cs_lnum_t n_f_selected,
415 const cs_lnum_t *selected_lst,
416 cs_real_t retval[]);
417
418/*----------------------------------------------------------------------------*/
429/*----------------------------------------------------------------------------*/
430
431void
433 const cs_real_t time_eval,
434 const cs_lnum_t n_f_selected,
435 const cs_lnum_t *selected_lst,
436 cs_real_t retval[]);
437
438/*----------------------------------------------------------------------------*/
448/*----------------------------------------------------------------------------*/
449
450void
452 cs_real_t time_eval,
453 const cs_lnum_t n_f_selected,
454 const cs_lnum_t *selected_lst,
455 cs_real_t retval[]);
456
457/*----------------------------------------------------------------------------*/
464/*----------------------------------------------------------------------------*/
465
466void
468 cs_real_t retval[]);
469
470/*----------------------------------------------------------------------------*/
477/*----------------------------------------------------------------------------*/
478
479void
481 cs_real_t retval[]);
482
483/*----------------------------------------------------------------------------*/
492/*----------------------------------------------------------------------------*/
493
494void
496 cs_real_t time_eval,
497 cs_real_t retval[]);
498
499/*----------------------------------------------------------------------------*/
509/*----------------------------------------------------------------------------*/
510
511void
513 cs_real_t time_eval,
514 cs_real_t retval[]);
515
516/*----------------------------------------------------------------------------*/
527/*----------------------------------------------------------------------------*/
528
531 const cs_real_t *array_val);
532
533/*----------------------------------------------------------------------------*/
534
536
537#endif /* __CS_EVALUATE_H__ */
#define BEGIN_C_DECLS
Definition: cs_defs.h:542
double cs_real_t
Floating-point value.
Definition: cs_defs.h:342
#define END_C_DECLS
Definition: cs_defs.h:543
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:335
unsigned short int cs_flag_t
Definition: cs_defs.h:344
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:1399
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:1922
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:1953
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:1816
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:1685
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:1578
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:2048
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:1905
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:1458
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:2114
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:2499
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:2407
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:2687
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:1999
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:2187
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:2568
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:1648
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:2443
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:1735
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:1780
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:2539
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:1514
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:2274
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:2620
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:1370
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:2728
Definition: mesh.f90:26
Definition: cs_mesh_adjacencies.h:68
Definition: cs_cdo_connect.h:61
Definition: cs_cdo_quantities.h:139
Definition: cs_mesh.h:85
Structure storing medata for defining a quantity in a very flexible way.
Definition: cs_xdef.h:160