9.2
general documentation
cs_field_default.h
Go to the documentation of this file.
1#ifndef CS_FIELD_DEFAULT_H
2#define CS_FIELD_DEFAULT_H
3
4/*============================================================================
5 * Field utility functions.
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"
36
37/*=============================================================================
38 * Macro definitions
39 *============================================================================*/
40
41/*============================================================================
42 * Type definitions
43 *============================================================================*/
44
45/*============================================================================
46 * Global variables
47 *============================================================================*/
48
49/*=============================================================================
50 * Public function prototypes
51 *============================================================================*/
52
53/*----------------------------------------------------------------------------*/
54/*
55 * \brief Add a field shared between CDO and legacy schemes. This field is
56 * related to a general solved variable, with default options.
57 *
58 * \param[in] name field name
59 * \param[in] label field default label, or empty
60 * \param[in] location_id id of associated location
61 * \param[in] dim field dimension
62 * \param[in] has_previous no if lower than 1
63 *
64 * \return newly defined field id
65 */
66/*----------------------------------------------------------------------------*/
67
68int
69cs_variable_cdo_field_create(const char *name,
70 const char *label,
71 int location_id,
72 int dim,
73 int has_previous);
74
75/*----------------------------------------------------------------------------*/
76/*
77 * \brief Add field defining a general solved variable, with default options.
78 *
79 * \param[in] name field name
80 * \param[in] label field default label, or empty
81 * \param[in] location_id id of associated location
82 * \param[in] dim field dimension
83 *
84 * \return newly defined field id
85 */
86/*----------------------------------------------------------------------------*/
87
88int
89cs_variable_field_create(const char *name,
90 const char *label,
91 int location_id,
92 int dim);
93
94/*----------------------------------------------------------------------------*/
95/*
96 * \brief Access a field's equation parameters.
97 *
98 * If the equation parameters were never initialized, they will be initialized
99 * based on the current defaults.
100 *
101 * If the field does not have associated equation paremeters (i.e. is not
102 * a variable field or is a CDO field (which is referenced by but does not
103 * directly reference equations), nullptr is returned.
104 *
105 * \param[in, out] f pointer to associated field
106 *
107 * \return pointer to field's equation parameters, or nullptr
108 */
109/*----------------------------------------------------------------------------*/
110
113
114/*----------------------------------------------------------------------------*/
115/*
116 * \brief Access a field's equation parameters for read only.
117 *
118 * If the equation parameters were never initialized, the current default
119 * parameters will be returned instead.
120 *
121 * If the field does not have associated equation parameters (i.e. is not
122 * a variable field or is a CDO field (which is referenced by but does not
123 * directly reference equations), nullptr is returned.
124 *
125 * \param[in] f pointer to associated field
126 *
127 * \return const-qualified pointer to field's equation parameters, or nullptr
128 */
129/*----------------------------------------------------------------------------*/
130
133
134/*----------------------------------------------------------------------------*/
135/*
136 * \brief For a given field, returns field defined as its variance, if present.
137 *
138 * \param[in] f field
139 *
140 * \return pointer to matching variance (variable) field, or nullptr.
141 */
142/*----------------------------------------------------------------------------*/
143
146
147/*----------------------------------------------------------------------------*/
148/*
149 * \brief Initialize all field BC coefficients.
150 */
151/*----------------------------------------------------------------------------*/
152
153void
155
156/*----------------------------------------------------------------------------*/
157/*
158 * \brief Return the number of defined scalar fields.
159 *
160 * \return number of legacy FV scalar variavble fields.
161 */
162/*----------------------------------------------------------------------------*/
163
164int
166
167/*----------------------------------------------------------------------------*/
168
169#endif /* CS_FIELD_DEFAULT_H */
Field descriptor.
Definition: cs_field.h:275
const cs_equation_param_t * cs_field_get_equation_param_const(const cs_field_t *f)
Access a field's equation parameters for read only.
Definition: cs_field_default.cpp:296
void cs_field_map_and_init_bcs(void)
Initialize all field BC coefficients.
Definition: cs_field_default.cpp:353
int cs_variable_field_create(const char *name, const char *label, int location_id, int dim)
Add field defining a general solved variable, with default options.
Definition: cs_field_default.cpp:200
int cs_variable_cdo_field_create(const char *name, const char *label, int location_id, int dim, int has_previous)
Add a field shared between CDO and legacy schemes. This field is related to a general solved variable...
Definition: cs_field_default.cpp:146
cs_field_t * cs_field_get_variance(const cs_field_t *f)
For a given field, returns field defined as its variance, if present.
Definition: cs_field_default.cpp:323
int cs_field_n_scalar_fields(void)
Return the number of defined scalar fields.
Definition: cs_field_default.cpp:481
cs_equation_param_t * cs_field_get_equation_param(cs_field_t *f)
Access a field's equation parameters.
Definition: cs_field_default.cpp:262
char * label
Definition: keywords.h:58
Set of parameters to handle an unsteady convection-diffusion-reaction equation with term sources.
Definition: cs_equation_param.h:190