7.0
general 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-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  * 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 
79 #define CS_VOLUME_ZONE_SOLID (1 << 6)
80 
82 #define CS_VOLUME_ZONE_1D (1 << 7)
83 
85 #define CS_VOLUME_ZONE_PHYSICAL_PROPERTIES (1 << 8)
86 
89 /*============================================================================
90  * Type definitions
91  *============================================================================*/
92 
93 /*=============================================================================
94  * Global variables
95  *============================================================================*/
96 
97 /*============================================================================
98  * Public function prototypes
99  *============================================================================*/
100 
101 /*----------------------------------------------------------------------------*/
109 /*----------------------------------------------------------------------------*/
110 
111 void
113 
114 /*----------------------------------------------------------------------------*/
118 /*----------------------------------------------------------------------------*/
119 
120 void
122 
123 /*----------------------------------------------------------------------------*/
127 /*----------------------------------------------------------------------------*/
128 
129 int
131 
132 /*----------------------------------------------------------------------------*/
138 /*----------------------------------------------------------------------------*/
139 
140 int
142 
143 /*----------------------------------------------------------------------------*/
151 /*----------------------------------------------------------------------------*/
152 
153 void
154 cs_volume_zone_build_all(bool mesh_modified);
155 
156 /*----------------------------------------------------------------------------*/
166 /*----------------------------------------------------------------------------*/
167 
168 int
169 cs_volume_zone_define(const char *name,
170  const char *criteria,
171  int type_flag);
172 
173 /*----------------------------------------------------------------------------*/
191 /*----------------------------------------------------------------------------*/
192 
193 int
194 cs_volume_zone_define_by_func(const char *name,
196  void *input,
197  int type_flag);
198 
199 /*----------------------------------------------------------------------------*/
209 /*----------------------------------------------------------------------------*/
210 
211 const cs_zone_t *
212 cs_volume_zone_by_id(int id);
213 
214 /*----------------------------------------------------------------------------*/
224 /*----------------------------------------------------------------------------*/
225 
226 const cs_zone_t *
227 cs_volume_zone_by_name(const char *name);
228 
229 /*----------------------------------------------------------------------------*/
239 /*----------------------------------------------------------------------------*/
240 
241 const cs_zone_t *
242 cs_volume_zone_by_name_try(const char *name);
243 
244 /*----------------------------------------------------------------------------*/
251 /*----------------------------------------------------------------------------*/
252 
253 void
255  int type_flag);
256 
257 /*----------------------------------------------------------------------------*/
264 /*----------------------------------------------------------------------------*/
265 
266 void
268  bool time_varying);
269 
270 /*----------------------------------------------------------------------------*/
277 /*----------------------------------------------------------------------------*/
278 
279 void
281  bool allow_overlay)
282 ;
283 /*----------------------------------------------------------------------------*/
290 /*----------------------------------------------------------------------------*/
291 
292 const int *
294 
295 /*----------------------------------------------------------------------------*/
301 /*----------------------------------------------------------------------------*/
302 
303 void
305 
306 /*----------------------------------------------------------------------------*/
310 /*----------------------------------------------------------------------------*/
311 
312 void
314 
315 /*----------------------------------------------------------------------------*/
324 /*----------------------------------------------------------------------------*/
325 
326 int
327 cs_volume_zone_n_type_zones(int type_flag);
328 
329 /*----------------------------------------------------------------------------*/
341 /*----------------------------------------------------------------------------*/
342 
343 cs_lnum_t
344 cs_volume_zone_n_type_cells(int type_flag);
345 
346 /*----------------------------------------------------------------------------*/
357 /*----------------------------------------------------------------------------*/
358 
359 void
361  cs_lnum_t cell_ids[]);
362 
363 /*----------------------------------------------------------------------------*/
375 /*----------------------------------------------------------------------------*/
376 
377 void
378 cs_volume_zone_tag_cell_type(int zone_type_flag,
379  int tag_value,
380  int tag[]);
381 
382 /*----------------------------------------------------------------------------*/
386 /*----------------------------------------------------------------------------*/
387 
388 void
390 
391 /*----------------------------------------------------------------------------*/
392 
394 
395 #endif /* __CS_VOLUME_ZONE_H__ */
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:636
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:721
void cs_volume_zone_log_setup(void)
Log setup information relative to defined volume zones.
Definition: cs_volume_zone.c:857
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
#define BEGIN_C_DECLS
Definition: cs_defs.h:495
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:936
void cs_volume_zone_tag_cell_type(int zone_type_flag, int tag_value, int tag[])
Tag cells of a given zone type.
Definition: cs_volume_zone.c:977
const int * cs_volume_zone_cell_zone_id(void)
Return pointer to zone id associated with each cell.
Definition: cs_volume_zone.c:796
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:592
void cs_volume_zone_set_overlay(int id, bool allow_overlay)
Set overlay behavior for a given volume zone.
Definition: cs_volume_zone.c:778
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:910
int 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:883
void cs_volume_zone_finalize(void)
Free all volume zone structures.
Definition: cs_volume_zone.c:422
void cs_volume_zone_set_type(int id, int type_flag)
Set type flag for a given volume zone.
Definition: cs_volume_zone.c:742
void cs_volume_zone_print_info(void)
Print volume zones information to listing file.
Definition: cs_volume_zone.c:1007
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:301
void cs_volume_zone_initialize(void)
Initialize volume zone structures.
Definition: cs_volume_zone.c:396
#define END_C_DECLS
Definition: cs_defs.h:496
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:695
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:760
int cs_volume_zone_n_zones(void)
Return number of volume zones defined.
Definition: cs_volume_zone.c:446
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:810
int cs_volume_zone_n_zones_time_varying(void)
Return number of volume zones which may vary in time.
Definition: cs_volume_zone.c:460
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:671
void cs_volume_zone_build_all(bool mesh_modified)
Update association of volume zones with a mesh.
Definition: cs_volume_zone.c:483
Definition: cs_zone.h:55