My Project
programmer's documentation
cs_field_pointer.h
Go to the documentation of this file.
1 #ifndef __CS_FIELD_POINTER_H__
2 #define __CS_FIELD_POINTER_H__
3 
4 /*============================================================================
5  * Field pointers and ids for standard and model fields
6  *============================================================================*/
7 
8 /*
9  This file is part of Code_Saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2019 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_field.h"
36 
37 /*----------------------------------------------------------------------------*/
38 
40 
41 /*=============================================================================
42  * Macro definitions
43  *============================================================================*/
44 
45 /* Macro used for scoping of field pointer enums */
46 
47 #define CS_ENUMF_(e) CS_FIELD_POINTER_ ## e
48 
49 /* Macro used to return a field pointer by its enumerated value */
50 
51 #define CS_F_(e) cs_glob_field_pointers[CS_FIELD_POINTER_ ## e].f
52 
53 #define CS_FI_(e, i) cs_glob_field_pointers[CS_FIELD_POINTER_ ## e].a->p[i]
54 
55 /*============================================================================
56  * Type definitions
57  *============================================================================*/
58 
61 typedef enum {
62 
63  /* Base variables and properties */
64 
119  /* Specific physics variables and properties */
120 
200  /* Cooling tower fields */
210  /* NCFD fields */
242  /* Added variables (scalars) */
245  /* User-defined arrays */
247 
248  /* End of attributes */
249 
251 
253 
257  int n;
259 };
260 
266 };
267 
268 /*============================================================================
269  * Global variables
270  *============================================================================*/
271 
272 /* Pointers */
273 
275 
276 /*=============================================================================
277  * Public function prototypes
278  *============================================================================*/
279 
280 /*----------------------------------------------------------------------------
281  * Free all field pointer data.
282  *----------------------------------------------------------------------------*/
283 
284 void
286 
287 /*----------------------------------------------------------------------------
288  * Map a simple field to an enumerated pointer.
289  *
290  * The associated field pointer may then be retreived using \ref CS_F_(e).
291  *
292  * parameters:
293  * e <-- field enumerator value
294  * f <-- pointer to field structure
295  *----------------------------------------------------------------------------*/
296 
297 void
299  cs_field_t *f);
300 
301 /*----------------------------------------------------------------------------
302  * Map a field to an (enumerated pointer, index) couple.
303  *
304  * This sort of mapping may be used for sets of fields whose size
305  * is not known in advance.
306  *
307  * The associated field pointer may then be retreived using \ref CS_F_(e, i).
308  *
309  * parameters:
310  * e <-- field enumerator value
311  * index <-- field enumerator index
312  * f <-- pointer to field structure
313  *----------------------------------------------------------------------------*/
314 
315 void
317  int index,
318  cs_field_t *f);
319 
320 /*----------------------------------------------------------------------------
321  * Map base fields to enumerated pointers.
322  *----------------------------------------------------------------------------*/
323 
324 void
326 
327 /*----------------------------------------------------------------------------
328  * Map some boundary fields to enumerated pointers.
329  *----------------------------------------------------------------------------*/
330 
331 void
333 
334 /*----------------------------------------------------------------------------
335  * Map base fields to enumerated pointers for atmospheric models
336  *
337  * parameters:
338  * n_chem_species <-- number of chemical species
339  * species_f_if <-- field id for each chemical species
340  *----------------------------------------------------------------------------*/
341 
342 void
343 cs_field_pointer_map_atmospheric(int n_chem_species,
344  const int species_f_id[]);
345 
346 /*----------------------------------------------------------------------------
347  * Map base fields to enumerated pointers for atmospheric models
348  *
349  * parameters:
350  * n_coals <-- number of coals
351  * n_classes <-- number of coal classes
352  *----------------------------------------------------------------------------*/
353 
354 void
356  int n_classes);
357 
358 /*----------------------------------------------------------------------------*
359  * Map base fields to enumerated pointers for compressible model
360  *----------------------------------------------------------------------------*/
361 
362 void
364 
365 /*----------------------------------------------------------------------------*
366  * Map base fields to enumerated pointers for gas mix model
367  *----------------------------------------------------------------------------*/
368 
369 void
371 
372 /*----------------------------------------------------------------------------
373  * Map base fields to enumerated pointers for gas combustion.
374  *----------------------------------------------------------------------------*/
375 
376 void
378 
379 /*----------------------------------------------------------------------------*/
380 /*
381  * Map base fields to enumerated pointers for groundwater flows
382  *----------------------------------------------------------------------------*/
383 
384 void
386 
387 /*----------------------------------------------------------------------------*/
388 
390 
391 #endif /* __CS_FIELD_POINTER_H__ */
cs_field_pointer_val_t
Definition: cs_field_pointer.h:263
qfpyy
Definition: cs_field_pointer.h:218
coyfp
Definition: cs_field_pointer.h:143
e_tot
Definition: cs_field_pointer.h:100
ntdrp
Definition: cs_field_pointer.h:131
emissivity
Definition: cs_field_pointer.h:191
vel
Definition: cs_field_pointer.h:68
cs_defs.h
xlam
Definition: cs_field_pointer.h:189
t_b
Definition: cs_field_pointer.h:99
radsc
Definition: cs_field_pointer.h:170
f9m
Definition: cs_field_pointer.h:157
curim
Definition: cs_field_pointer.h:173
poti
Definition: cs_field_pointer.h:166
vel_mean
Definition: cs_field_pointer.h:238
cs_field_pointer_map_indexed
void cs_field_pointer_map_indexed(cs_field_pointer_id_t e, int index, cs_field_t *f)
Map a field to an (enumerated pointer, index) couple.
Definition: cs_field_pointer.c:225
rad_abs
Definition: cs_field_pointer.h:183
vel_rel
Definition: cs_field_pointer.h:239
rad_emi
Definition: cs_field_pointer.h:184
add_var
Definition: cs_field_pointer.h:243
th_diff
Definition: cs_field_pointer.h:113
lambda
Definition: cs_field_pointer.h:112
yhcn
Definition: cs_field_pointer.h:160
t_poro
Definition: cs_field_pointer.h:117
fm
Definition: cs_field_pointer.h:134
t_kelvin
Definition: cs_field_pointer.h:121
rho
Definition: cs_field_pointer.h:103
f4m
Definition: cs_field_pointer.h:152
disp_t
Definition: cs_field_pointer.h:235
drho_dp
Definition: cs_field_pointer.h:231
phi
Definition: cs_field_pointer.h:81
npm
Definition: cs_field_pointer.h:138
rho_b
Definition: cs_field_pointer.h:104
drag
Definition: cs_field_pointer.h:227
void_f
Definition: cs_field_pointer.h:94
f6m
Definition: cs_field_pointer.h:154
yf_ncond
Definition: cs_field_pointer.h:211
rad_cak
Definition: cs_field_pointer.h:185
qinsp
Definition: cs_field_pointer.h:188
f7m
Definition: cs_field_pointer.h:155
h_l
Definition: cs_field_pointer.h:204
ym_w
Definition: cs_field_pointer.h:202
r22
Definition: cs_field_pointer.h:74
magfl
Definition: cs_field_pointer.h:175
cs_field_pointer_map_coal_combustion
void cs_field_pointer_map_coal_combustion(int n_coals, int n_classes)
Map base fields to enumerated pointers for coal combustion.
Definition: cs_field_pointer.c:410
END_C_DECLS
#define END_C_DECLS
Definition: cs_defs.h:468
cs_glob_field_pointers
union cs_field_pointer_val_t * cs_glob_field_pointers
Definition: cs_field_pointer.c:130
elech
Definition: cs_field_pointer.h:171
head
Definition: cs_field_pointer.h:198
mass_f
Definition: cs_field_pointer.h:126
elefl
Definition: cs_field_pointer.h:176
rij
Definition: cs_field_pointer.h:79
fsm
Definition: cs_field_pointer.h:137
pack_zone_id
Definition: cs_field_pointer.h:208
omg
Definition: cs_field_pointer.h:86
thermal_diff_l
Definition: cs_field_pointer.h:207
cs_field_pointer_map_atmospheric
void cs_field_pointer_map_atmospheric(int n_chem_species, const int species_f_id[])
Map base fields to enumerated pointers for atmospheric models.
Definition: cs_field_pointer.c:383
drift_vel
Definition: cs_field_pointer.h:236
potr
Definition: cs_field_pointer.h:165
energy_f
Definition: cs_field_pointer.h:127
yfm
Definition: cs_field_pointer.h:141
qfpzz
Definition: cs_field_pointer.h:222
volume_f
Definition: cs_field_pointer.h:125
fconv
Definition: cs_field_pointer.h:193
BEGIN_C_DECLS
#define BEGIN_C_DECLS
Definition: cs_defs.h:467
vism
Definition: cs_field_pointer.h:123
cs_field_pointer_destroy_all
void cs_field_pointer_destroy_all(void)
Free all field pointer data.
Definition: cs_field_pointer.c:172
fp2m
Definition: cs_field_pointer.h:135
hybrid_blend
Definition: cs_field_pointer.h:90
lift
Definition: cs_field_pointer.h:234
epa
Definition: cs_field_pointer.h:190
r23
Definition: cs_field_pointer.h:77
mol_mass
Definition: cs_field_pointer.h:196
qfpxy
Definition: cs_field_pointer.h:215
yno
Definition: cs_field_pointer.h:161
xck
Definition: cs_field_pointer.h:147
h2
Definition: cs_field_pointer.h:149
x2
Definition: cs_field_pointer.h:225
qfpyx
Definition: cs_field_pointer.h:217
mu_t
Definition: cs_field_pointer.h:110
xch
Definition: cs_field_pointer.h:146
CS_FIELD_N_POINTERS
Definition: cs_field_pointer.h:250
cs_field_pointer_map_gas_combustion
void cs_field_pointer_map_gas_combustion(void)
Map base fields to enumerated pointers for gas combustion.
Definition: cs_field_pointer.c:527
ygfm
Definition: cs_field_pointer.h:139
tau12_t
Definition: cs_field_pointer.h:233
laplf
Definition: cs_field_pointer.h:174
cs_field_pointer_array_t::n
int n
Definition: cs_field_pointer.h:257
hconv
Definition: cs_field_pointer.h:194
eps
Definition: cs_field_pointer.h:71
xwt
Definition: cs_field_pointer.h:148
thermal_diff_h
Definition: cs_field_pointer.h:206
f2m
Definition: cs_field_pointer.h:151
cs_field_pointer_map_boundary
void cs_field_pointer_map_boundary(void)
Map some boundary fields to enumerated pointers.
Definition: cs_field_pointer.c:364
cs_field_pointer_map_compressible
void cs_field_pointer_map_compressible(void)
Map base fields to enumerated pointers for compressible model.
Definition: cs_field_pointer.c:477
cs_field.h
r13
Definition: cs_field_pointer.h:78
alp_bl
Definition: cs_field_pointer.h:83
np
Definition: cs_field_pointer.h:145
cs_field_pointer_val_t::a
struct cs_field_pointer_array_t * a
Definition: cs_field_pointer.h:265
r33
Definition: cs_field_pointer.h:75
d32
Definition: cs_field_pointer.h:226
qfp
Definition: cs_field_pointer.h:213
potva
Definition: cs_field_pointer.h:167
cs_field_pointer_map_base
void cs_field_pointer_map_base(void)
Map base fields to enumerated pointers.
Definition: cs_field_pointer.c:289
curre
Definition: cs_field_pointer.h:172
ynh3
Definition: cs_field_pointer.h:162
qfpzy
Definition: cs_field_pointer.h:221
user
Definition: cs_field_pointer.h:246
qfpxz
Definition: cs_field_pointer.h:216
rad_q
Definition: cs_field_pointer.h:179
dt_dp
Definition: cs_field_pointer.h:240
r12
Definition: cs_field_pointer.h:76
cs_field_pointer_id_t
cs_field_pointer_id_t
Definition: cs_field_pointer.h:61
f8m
Definition: cs_field_pointer.h:156
fnet
Definition: cs_field_pointer.h:192
qp
Definition: cs_field_pointer.h:212
chemistry
Definition: cs_field_pointer.h:132
humid
Definition: cs_field_pointer.h:201
f_bar
Definition: cs_field_pointer.h:82
joulp
Definition: cs_field_pointer.h:169
hox
Definition: cs_field_pointer.h:163
fvp2m
Definition: cs_field_pointer.h:158
t
Definition: cs_field_pointer.h:98
qinci
Definition: cs_field_pointer.h:187
if_poro
Definition: cs_field_pointer.h:116
cs_field_pointer_val_t::f
cs_field_t * f
Definition: cs_field_pointer.h:264
t_l
Definition: cs_field_pointer.h:203
cs_field_pointer_map
void cs_field_pointer_map(cs_field_pointer_id_t e, cs_field_t *f)
Map a simple field to an enumerated pointer.
Definition: cs_field_pointer.c:196
cp
Definition: cs_field_pointer.h:106
th_diff_t
Definition: cs_field_pointer.h:230
poro
Definition: cs_field_pointer.h:115
f1m
Definition: cs_field_pointer.h:150
yco2
Definition: cs_field_pointer.h:159
yfp2m
Definition: cs_field_pointer.h:142
pot_t
Definition: cs_field_pointer.h:129
dt
Definition: cs_field_pointer.h:65
qfpyz
Definition: cs_field_pointer.h:219
r11
Definition: cs_field_pointer.h:73
f5m
Definition: cs_field_pointer.h:153
drho_dh
Definition: cs_field_pointer.h:232
cs_field_pointer_array_t::p
cs_field_t * p[]
Definition: cs_field_pointer.h:258
mesh_u
Definition: cs_field_pointer.h:92
qfpzx
Definition: cs_field_pointer.h:220
cs_field_pointer_map_groundwater
void cs_field_pointer_map_groundwater(void)
Map base fields to enumerated pointers for groundwater flows.
Definition: cs_field_pointer.c:561
cs_field_pointer_array_t
Definition: cs_field_pointer.h:256
rad_lumin
Definition: cs_field_pointer.h:178
rad_ist
Definition: cs_field_pointer.h:182
ia
Definition: cs_field_pointer.h:224
y_l_pack
Definition: cs_field_pointer.h:205
qfpxx
Definition: cs_field_pointer.h:214
nusa
Definition: cs_field_pointer.h:87
h
Definition: cs_field_pointer.h:97
ycoel
Definition: cs_field_pointer.h:168
cs_field_t
Field descriptor.
Definition: cs_field.h:124
cs_field_pointer_map_gas_mix
void cs_field_pointer_map_gas_mix(void)
Map base fields to enumerated pointers for gas mix model.
Definition: cs_field_pointer.c:514
h_tot
Definition: cs_field_pointer.h:101
cv
Definition: cs_field_pointer.h:107
vol_f
Definition: cs_field_pointer.h:95
wlubr
Definition: cs_field_pointer.h:229
gamma
Definition: cs_field_pointer.h:223
rad_est
Definition: cs_field_pointer.h:181
CS_ENUMF_
#define CS_ENUMF_(e)
Macro used for scoping of field pointer enums.
Definition: cs_field_pointer.h:47
mu
Definition: cs_field_pointer.h:109
ad_mass
Definition: cs_field_pointer.h:228
yplus
Definition: cs_field_pointer.h:237
totwt
Definition: cs_field_pointer.h:130
k
Definition: cs_field_pointer.h:70
p
Definition: cs_field_pointer.h:67