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-2021 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 
39 BEGIN_C_DECLS
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 
72 int
73 cs_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 
92 int
93 cs_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), NULL is returned.
108  *
109  * \param[in, out]  f  pointer to associated field
110  *
111  * \return  pointer to field's equation parameters, or NULL
112  */
113 /*----------------------------------------------------------------------------*/
114 
115 cs_equation_param_t *
116 cs_field_get_equation_param(cs_field_t  *f);
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), NULL is returned.
128  *
129  * \param[in]  f  pointer to associated field
130  *
131  * \return  const-qualified pointer to field's equation parameters, or NULL
132  */
133 /*----------------------------------------------------------------------------*/
134 
135 const cs_equation_param_t *
136 cs_field_get_equation_param_const(const cs_field_t  *f);
137 
138 /*----------------------------------------------------------------------------*/
139 
140 END_C_DECLS
141 
142 #endif /* __CS_FIELD_DEFAULT_H__ */
143