8.3
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-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_defs.h"
35#include "cs_equation_param.h"
36
37/*----------------------------------------------------------------------------*/
38
40
41/*=============================================================================
42 * Macro definitions
43 *============================================================================*/
44
45/*============================================================================
46 * Type definitions
47 *============================================================================*/
48
49/*============================================================================
50 * Global variables
51 *============================================================================*/
52
53/*=============================================================================
54 * Public function prototypes
55 *============================================================================*/
56
57/*----------------------------------------------------------------------------*/
58/*
59 * \brief Add a field shared between CDO and legacy schemes. This field is
60 * related to a general solved variable, with default options.
61 *
62 * \param[in] name field name
63 * \param[in] label field default label, or empty
64 * \param[in] location_id id of associated location
65 * \param[in] dim field dimension
66 * \param[in] has_previous no if lower than 1
67 *
68 * \return newly defined field id
69 */
70/*----------------------------------------------------------------------------*/
71
72int
73cs_variable_cdo_field_create(const char *name,
74 const char *label,
75 int location_id,
76 int dim,
77 int has_previous);
78
79/*----------------------------------------------------------------------------*/
80/*
81 * \brief Add field defining a general solved variable, with default options.
82 *
83 * \param[in] name field name
84 * \param[in] label field default label, or empty
85 * \param[in] location_id id of associated location
86 * \param[in] dim field dimension
87 *
88 * \return newly defined field id
89 */
90/*----------------------------------------------------------------------------*/
91
92int
93cs_variable_field_create(const char *name,
94 const char *label,
95 int location_id,
96 int dim);
97
98/*----------------------------------------------------------------------------*/
99/*
100 * \brief Access a field's equation parameters.
101 *
102 * If the equation parameters were never initialized, they will be initialized
103 * based on the current defaults.
104 *
105 * If the field does not have associated equation paremeters (i.e. is not
106 * a variable field or is a CDO field (which is referenced by but does not
107 * directly reference equations), nullptr is returned.
108 *
109 * \param[in, out] f pointer to associated field
110 *
111 * \return pointer to field's equation parameters, or nullptr
112 */
113/*----------------------------------------------------------------------------*/
114
117
118/*----------------------------------------------------------------------------*/
119/*
120 * \brief Access a field's equation parameters for read only.
121 *
122 * If the equation parameters were never initialized, the current default
123 * parameters will be returned instead.
124 *
125 * If the field does not have associated equation parameters (i.e. is not
126 * a variable field or is a CDO field (which is referenced by but does not
127 * directly reference equations), nullptr is returned.
128 *
129 * \param[in] f pointer to associated field
130 *
131 * \return const-qualified pointer to field's equation parameters, or nullptr
132 */
133/*----------------------------------------------------------------------------*/
134
137
138/*----------------------------------------------------------------------------*/
139/*
140 * \brief For a given field, returns field defined as its variance, if present.
141 *
142 * \param[in] f field
143 *
144 * \return pointer to matching variance (variable) field, or nullptr.
145 */
146/*----------------------------------------------------------------------------*/
147
150
151/*----------------------------------------------------------------------------*/
152/*
153 * \brief Allocate and map boundary condition coefficients for all
154 * variable fields.
155 */
156/*----------------------------------------------------------------------------*/
157
158void
160
161/*----------------------------------------------------------------------------*/
162/*
163 * \brief Deallocate and unmap boundary condition coefficients for all
164 * variable fields.
165 */
166/*----------------------------------------------------------------------------*/
167
168void
170
171/*----------------------------------------------------------------------------*/
172/*
173 * \brief Initialize all field BC coefficients.
174 */
175/*----------------------------------------------------------------------------*/
176
177void
179
180/*----------------------------------------------------------------------------*/
181/*
182 * \brief Return the number of defined scalar fields.
183 *
184 * \return number of legacy FV scalar variavble fields.
185 */
186/*----------------------------------------------------------------------------*/
187
188int
190
191/*----------------------------------------------------------------------------*/
192
194
195#endif /* __CS_FIELD_DEFAULT_H__ */
#define BEGIN_C_DECLS
Definition: cs_defs.h:542
#define END_C_DECLS
Definition: cs_defs.h:543
void cs_field_free_bc_codes_all(void)
Deallocate and unmap boundary condition coefficients for all variable fields.
Definition: cs_field_default.cpp:477
void cs_field_build_bc_codes_all(void)
Allocate and map boundary condition coefficients for all variable fields.
Definition: cs_field_default.cpp:374
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:316
void cs_field_map_and_init_bcs(void)
Initialize all field BC coefficients.
Definition: cs_field_default.cpp:518
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:228
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:174
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:343
int cs_field_n_scalar_fields(void)
Return the number of defined scalar fields.
Definition: cs_field_default.cpp:621
cs_equation_param_t * cs_field_get_equation_param(cs_field_t *f)
Access a field's equation parameters.
Definition: cs_field_default.cpp:282
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:192
Field descriptor.
Definition: cs_field.h:131