9.2
general documentation
cs_function_default.h
Go to the documentation of this file.
1#ifndef CS_FUNCTION_DEFAULT_H
2#define CS_FUNCTION_DEFAULT_H
3
4/*============================================================================
5 * Base predefined function objects.
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_defs.h"
35#include "base/cs_function.h"
36
37/*=============================================================================
38 * Macro definitions
39 *============================================================================*/
40
41/*============================================================================
42 * Type definitions
43 *============================================================================*/
44
47typedef enum {
48
53
54/*============================================================================
55 * Global variables
56 *============================================================================*/
57
58/*=============================================================================
59 * Public function prototypes
60 *============================================================================*/
61
62/*----------------------------------------------------------------------------*/
66/*----------------------------------------------------------------------------*/
67
68void
70
71/*----------------------------------------------------------------------------*/
80/*----------------------------------------------------------------------------*/
81
84
85/*----------------------------------------------------------------------------*/
86/*
87 * \brief Create or access a function for evaluation of mesh element's
88 * refinement generation.
89 *
90 * The refinement generation indicates at which refinement level a given
91 * vertex or interior face was inserted into the mesh. Cells and boundary
92 * faces always have a generation of 0.
93 *
94 * \param[in] location_id base associated mesh location id
95 *
96 * \return pointer to the associated function object in case of success,
97 * or null in case of error
98 */
99/*----------------------------------------------------------------------------*/
100
103
104/*----------------------------------------------------------------------------*/
105/*
106 * \brief Create or access a function for evaluation of mesh element's
107 * refinement level.
108 *
109 * For vertices, the refinement level equivalent to the refinement generation.
110 *
111 * \param[in] location_id base associated mesh location id
112 *
113 * \return pointer to the associated function object in case of success,
114 * or null in case of error
115 */
116/*----------------------------------------------------------------------------*/
117
120
121/*----------------------------------------------------------------------------*/
128/*----------------------------------------------------------------------------*/
129
132
133/*----------------------------------------------------------------------------*/
140/*----------------------------------------------------------------------------*/
141
144
145/*----------------------------------------------------------------------------*/
152/*----------------------------------------------------------------------------*/
153
156
157/*----------------------------------------------------------------------------*/
164/*----------------------------------------------------------------------------*/
165
168
169/*----------------------------------------------------------------------------*/
188/*----------------------------------------------------------------------------*/
189
190void
191cs_function_class_or_zone_id(int location_id,
192 cs_lnum_t n_elts,
193 const cs_lnum_t *elt_ids,
194 void *input,
195 void *vals);
196
197/*----------------------------------------------------------------------------*/
211/*----------------------------------------------------------------------------*/
212
213void
214cs_function_field_boundary_nr(int location_id,
215 cs_lnum_t n_elts,
216 const cs_lnum_t *elt_ids,
217 void *input,
218 void *vals);
219
220/*----------------------------------------------------------------------------*/
234/*----------------------------------------------------------------------------*/
235
236void
238 cs_lnum_t n_elts,
239 const cs_lnum_t *elt_ids,
240 void *input,
241 void *vals);
242
243/*----------------------------------------------------------------------------*/
257/*----------------------------------------------------------------------------*/
258
259void
261 cs_lnum_t n_elts,
262 const cs_lnum_t *elt_ids,
263 void *input,
264 void *vals);
265
266/*----------------------------------------------------------------------------*/
273/*----------------------------------------------------------------------------*/
274
277
278/*----------------------------------------------------------------------------*/
292/*----------------------------------------------------------------------------*/
293
294void
296 cs_lnum_t n_elts,
297 const cs_lnum_t *elt_ids,
298 void *input,
299 void *vals);
300
301/*----------------------------------------------------------------------------*/
315/*----------------------------------------------------------------------------*/
316
317void
318cs_function_boundary_nusselt(int location_id,
319 cs_lnum_t n_elts,
320 const cs_lnum_t *elt_ids,
321 void *input,
322 void *vals);
323
324/*----------------------------------------------------------------------------*/
347/*----------------------------------------------------------------------------*/
348
349void
350cs_function_q_criterion(int location_id,
351 cs_lnum_t n_elts,
352 const cs_lnum_t *elt_ids,
353 void *input,
354 void *vals);
355
356/*----------------------------------------------------------------------------*/
357/*
358 * \brief Define output function of a property (which is not a field).
359 */
360/*----------------------------------------------------------------------------*/
361
364(
365 char *property_name
366);
367
368/*----------------------------------------------------------------------------*/
369/*
370 * \brief Define output function for the vorticity.
371 */
372/*----------------------------------------------------------------------------*/
373
376(
377 cs_field_t *velocity_field
378);
379
380/*----------------------------------------------------------------------------*/
381
382#endif /* CS_FUNCTION_DEFAULT_H */
Field descriptor.
Definition: cs_field.h:275
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:325
cs_function_t * cs_function_define_property_cells(char *property_name)
Define output function of a property (which is not a field).
Definition: cs_function_default.cpp:1833
cs_function_t * cs_function_define_boundary_thermal_flux(void)
Define function object for computation of boundary thermal flux.
Definition: cs_function_default.cpp:1032
void cs_function_default_define(void)
Define functions based on code_saturne case setup.
Definition: cs_function_default.cpp:748
cs_function_t * cs_function_define_q_criterion(void)
Define function for computation of cell Q criterion.
Definition: cs_function_default.cpp:1146
cs_function_t * cs_function_define_mpi_rank_id(cs_mesh_location_type_t location_id)
Create or access a function for evaluation of element's MPI rank id.
Definition: cs_function_default.cpp:787
cs_function_t * cs_function_define_refinement_level(cs_mesh_location_type_t location_id)
Create or access a function for evaluation of mesh element's refinement level.
Definition: cs_function_default.cpp:909
void cs_function_q_criterion(int location_id, cs_lnum_t n_elts, const cs_lnum_t *elt_ids, void *input, void *vals)
Compute the Q-criterion from Hunt et. al over each cell of a specified volume region.
Definition: cs_function_default.cpp:1790
void cs_function_boundary_stress_normal(int location_id, cs_lnum_t n_elts, const cs_lnum_t *elt_ids, void *input, void *vals)
Compute normal stress at boundary.
Definition: cs_function_default.cpp:1388
cs_function_t * cs_function_define_refinement_generation(cs_mesh_location_type_t location_id)
Create or access a function for evaluation of mesh element's refinement generation.
Definition: cs_function_default.cpp:849
cs_function_t * cs_function_define_boundary_stress_tangential(void)
Define function object for computation of tangential boundary stress.
Definition: cs_function_default.cpp:998
void cs_function_boundary_thermal_flux(int location_id, cs_lnum_t n_elts, const cs_lnum_t *elt_ids, void *input, void *vals)
Compute thermal flux at boundary (in ),.
Definition: cs_function_default.cpp:1492
cs_function_t * cs_function_define_vorticity(cs_field_t *velocity_field)
Define output function for the vorticity.
Definition: cs_function_default.cpp:1870
cs_function_t * cs_function_define_boundary_nusselt(void)
Define function for computation of boundary layer Nusselt.
Definition: cs_function_default.cpp:1086
void cs_function_class_or_zone_id(int location_id, cs_lnum_t n_elts, const cs_lnum_t *elt_ids, void *input, void *vals)
Extract optional boundary face class of element zone id.
Definition: cs_function_default.cpp:1188
cs_function_t * cs_function_define_boundary_stress_normal(void)
Define function object for computation of normal boundary stress.
Definition: cs_function_default.cpp:964
void cs_function_field_boundary_nr(int location_id, cs_lnum_t n_elts, const cs_lnum_t *elt_ids, void *input, void *vals)
Compute non-reconstructed cell-based field values at boundary.
Definition: cs_function_default.cpp:1238
cs_function_predefined_t
Definition: cs_function_default.h:47
@ CS_FUNCTION_CELL_RANK_ID
Definition: cs_function_default.h:49
@ CS_FUNCTION_B_FACE_RANK_ID
Definition: cs_function_default.h:50
void cs_function_boundary_nusselt(int location_id, cs_lnum_t n_elts, const cs_lnum_t *elt_ids, void *input, void *vals)
Compute local Nusselt number near boundary.
Definition: cs_function_default.cpp:1563
void cs_function_boundary_stress_tangential(int location_id, cs_lnum_t n_elts, const cs_lnum_t *elt_ids, void *input, void *vals)
Compute tangential stress at boundary.
Definition: cs_function_default.cpp:1438
cs_mesh_location_type_t
Definition: cs_mesh_location.h:60
Definition: cs_function.h:117