My Project
programmer's documentation
cs_volume_zone.h
Go to the documentation of this file.
1 #ifndef __CS_VOLUME_ZONE_H__
2 #define __CS_VOLUME_ZONE_H__
3 
4 /*============================================================================
5  * Volume zones handling.
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  * Standard C library headers
32  *----------------------------------------------------------------------------*/
33 
34 /*----------------------------------------------------------------------------
35  * Local headers
36  *----------------------------------------------------------------------------*/
37 
38 #include "cs_base.h"
39 #include "cs_mesh_location.h"
40 #include "cs_zone.h"
41 
42 /*----------------------------------------------------------------------------*/
43 
45 
46 /*============================================================================
47  * Macro definitions
48  *============================================================================*/
49 
56 /*
57  * Zone type
58  */
59 
61 #define CS_VOLUME_ZONE_INITIALIZATION (1 << 0)
62 
64 #define CS_VOLUME_ZONE_POROSITY (1 << 1)
65 
67 #define CS_VOLUME_ZONE_HEAD_LOSS (1 << 2)
68 
70 #define CS_VOLUME_ZONE_SOURCE_TERM (1 << 3)
71 
73 #define CS_VOLUME_ZONE_MASS_SOURCE_TERM (1 << 4)
74 
76 #define CS_VOLUME_ZONE_GWF_SOIL (1 << 5)
77 
80 /*============================================================================
81  * Type definitions
82  *============================================================================*/
83 
84 /*=============================================================================
85  * Global variables
86  *============================================================================*/
87 
88 /*============================================================================
89  * Public function prototypes
90  *============================================================================*/
91 
92 /*----------------------------------------------------------------------------*/
100 /*----------------------------------------------------------------------------*/
101 
102 void
104 
105 /*----------------------------------------------------------------------------*/
109 /*----------------------------------------------------------------------------*/
110 
111 void
113 
114 /*----------------------------------------------------------------------------*/
118 /*----------------------------------------------------------------------------*/
119 
120 int
122 
123 /*----------------------------------------------------------------------------*/
129 /*----------------------------------------------------------------------------*/
130 
131 int
133 
134 /*----------------------------------------------------------------------------*/
142 /*----------------------------------------------------------------------------*/
143 
144 void
145 cs_volume_zone_build_all(bool mesh_modified);
146 
147 /*----------------------------------------------------------------------------*/
157 /*----------------------------------------------------------------------------*/
158 
159 int
160 cs_volume_zone_define(const char *name,
161  const char *criteria,
162  int type_flag);
163 
164 /*----------------------------------------------------------------------------*/
182 /*----------------------------------------------------------------------------*/
183 
184 int
185 cs_volume_zone_define_by_func(const char *name,
187  void *input,
188  int type_flag);
189 
190 /*----------------------------------------------------------------------------*/
200 /*----------------------------------------------------------------------------*/
201 
202 const cs_zone_t *
203 cs_volume_zone_by_id(int id);
204 
205 /*----------------------------------------------------------------------------*/
215 /*----------------------------------------------------------------------------*/
216 
217 const cs_zone_t *
218 cs_volume_zone_by_name(const char *name);
219 
220 /*----------------------------------------------------------------------------*/
230 /*----------------------------------------------------------------------------*/
231 
232 const cs_zone_t *
233 cs_volume_zone_by_name_try(const char *name);
234 
235 /*----------------------------------------------------------------------------*/
242 /*----------------------------------------------------------------------------*/
243 
244 void
246  int type_flag);
247 
248 /*----------------------------------------------------------------------------*/
255 /*----------------------------------------------------------------------------*/
256 
257 void
259  bool time_varying);
260 
261 /*----------------------------------------------------------------------------*/
268 /*----------------------------------------------------------------------------*/
269 
270 void
272  bool allow_overlay)
273 ;
274 /*----------------------------------------------------------------------------*/
281 /*----------------------------------------------------------------------------*/
282 
283 const int *
285 
286 /*----------------------------------------------------------------------------*/
292 /*----------------------------------------------------------------------------*/
293 
294 void
296 
297 /*----------------------------------------------------------------------------*/
301 /*----------------------------------------------------------------------------*/
302 
303 void
305 
306 /*----------------------------------------------------------------------------*/
315 /*----------------------------------------------------------------------------*/
316 
317 cs_lnum_t
318 cs_volume_zone_n_type_zones(int type_flag);
319 
320 /*----------------------------------------------------------------------------*/
332 /*----------------------------------------------------------------------------*/
333 
334 cs_lnum_t
335 cs_volume_zone_n_type_cells(int type_flag);
336 
337 /*----------------------------------------------------------------------------*/
348 /*----------------------------------------------------------------------------*/
349 
350 void
352  cs_lnum_t cell_ids[]);
353 
354 /*----------------------------------------------------------------------------*/
358 /*----------------------------------------------------------------------------*/
359 void
361 
362 /*----------------------------------------------------------------------------*/
363 
365 
366 #endif /* __CS_VOLUME_ZONE_H__ */
input
static int input(void)
cs_zone_t
Definition: cs_zone.h:55
cs_mesh_location_select_t
void() cs_mesh_location_select_t(void *input, const cs_mesh_t *m, int location_id, cs_lnum_t *n_elts, cs_lnum_t **elt_ids)
Definition: cs_mesh_location.h:99
cs_volume_zone_finalize
void cs_volume_zone_finalize(void)
Free all volume zone structures.
Definition: cs_volume_zone.c:403
END_C_DECLS
#define END_C_DECLS
Definition: cs_defs.h:468
cs_volume_zone_n_type_cells
cs_lnum_t cs_volume_zone_n_type_cells(int type_flag)
Return number of volume zone cells associated with a given zone flag.
Definition: cs_volume_zone.c:891
BEGIN_C_DECLS
#define BEGIN_C_DECLS
Definition: cs_defs.h:467
cs_volume_zone_set_overlay
void cs_volume_zone_set_overlay(int id, bool allow_overlay)
Set overlay behavior for a given volume zone.
Definition: cs_volume_zone.c:759
cs_volume_zone_define
int cs_volume_zone_define(const char *name, const char *criteria, int type_flag)
Define a new volume zone using a selection criteria string.
Definition: cs_volume_zone.c:573
cs_volume_zone_set_type
void cs_volume_zone_set_type(int id, int type_flag)
Set type flag for a given volume zone.
Definition: cs_volume_zone.c:723
cs_volume_zone_cell_zone_id
const int * cs_volume_zone_cell_zone_id(void)
Return pointer to zone id associated with each cell.
Definition: cs_volume_zone.c:777
cs_volume_zone_initialize
void cs_volume_zone_initialize(void)
Initialize volume zone structures.
Definition: cs_volume_zone.c:377
cs_volume_zone_n_zones
int cs_volume_zone_n_zones(void)
Return number of volume zones defined.
Definition: cs_volume_zone.c:427
cs_volume_zone_by_id
const cs_zone_t * cs_volume_zone_by_id(int id)
Return a pointer to a volume zone based on its id.
Definition: cs_volume_zone.c:652
cs_volume_zone_log_setup
void cs_volume_zone_log_setup(void)
Log setup information relative to defined volume zones.
Definition: cs_volume_zone.c:838
cs_volume_zone_n_zones_time_varying
int cs_volume_zone_n_zones_time_varying(void)
Return number of volume zones which may vary in time.
Definition: cs_volume_zone.c:441
cs_lnum_t
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:298
cs_zone.h
cs_volume_zone_by_name
const cs_zone_t * cs_volume_zone_by_name(const char *name)
Return a pointer to a volume zone based on its name if present.
Definition: cs_volume_zone.c:676
cs_volume_zone_n_type_zones
cs_lnum_t cs_volume_zone_n_type_zones(int type_flag)
Return number of volume zones associated with a given zone flag.
Definition: cs_volume_zone.c:864
cs_mesh_location.h
cs_volume_zone_log_info
void cs_volume_zone_log_info(const cs_zone_t *z)
Print info relative to a given volume zone to log file.
Definition: cs_volume_zone.c:791
cs_volume_zone_define_by_func
int cs_volume_zone_define_by_func(const char *name, cs_mesh_location_select_t *func, void *input, int type_flag)
Define a new mesh location with an associated selection function.
Definition: cs_volume_zone.c:617
cs_volume_zone_print_info
void cs_volume_zone_print_info(void)
Print volume zones information to listing file.
Definition: cs_volume_zone.c:950
cs_volume_zone_build_all
void cs_volume_zone_build_all(bool mesh_modified)
Update association of volume zones with a mesh.
Definition: cs_volume_zone.c:464
cs_base.h
cs_volume_zone_by_name_try
const cs_zone_t * cs_volume_zone_by_name_try(const char *name)
Return a pointer to a volume zone based on its name if present.
Definition: cs_volume_zone.c:702
cs_volume_zone_set_time_varying
void cs_volume_zone_set_time_varying(int id, bool time_varying)
Set time varying behavior for a given volume zone.
Definition: cs_volume_zone.c:741
cs_volume_zone_select_type_cells
void cs_volume_zone_select_type_cells(int type_flag, cs_lnum_t cell_ids[])
Select cells associated with volume zones of a given type.
Definition: cs_volume_zone.c:917