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-2018 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 
41 /*----------------------------------------------------------------------------*/
42 
44 
45 /*============================================================================
46  * Macro definitions
47  *============================================================================*/
48 
55 /*
56  * Zone type
57  */
58 
60 #define CS_VOLUME_ZONE_INITIALIZATION (1 << 0)
61 
63 #define CS_VOLUME_ZONE_POROSITY (1 << 1)
64 
66 #define CS_VOLUME_ZONE_HEAD_LOSS (1 << 2)
67 
69 #define CS_VOLUME_ZONE_SOURCE_TERM (1 << 3)
70 
72 #define CS_VOLUME_ZONE_MASS_SOURCE_TERM (1 << 4)
73 
75 #define CS_VOLUME_ZONE_GWF_SOIL (1 << 5)
76 
79 /*============================================================================
80  * Type definitions
81  *============================================================================*/
82 
85 typedef struct {
86 
87  const char *name;
89  int id;
90  int type;
98  bool time_varying;
103 
104 /*=============================================================================
105  * Global variables
106  *============================================================================*/
107 
108 /*============================================================================
109  * Public function prototypes
110  *============================================================================*/
111 
112 /*----------------------------------------------------------------------------*/
120 /*----------------------------------------------------------------------------*/
121 
122 void
124 
125 /*----------------------------------------------------------------------------*/
129 /*----------------------------------------------------------------------------*/
130 
131 void
133 
134 /*----------------------------------------------------------------------------*/
138 /*----------------------------------------------------------------------------*/
139 
140 int
142 
143 /*----------------------------------------------------------------------------*/
149 /*----------------------------------------------------------------------------*/
150 
151 int
153 
154 /*----------------------------------------------------------------------------*/
162 /*----------------------------------------------------------------------------*/
163 
164 void
165 cs_volume_zone_build_all(bool mesh_modified);
166 
167 /*----------------------------------------------------------------------------*/
177 /*----------------------------------------------------------------------------*/
178 
179 int
180 cs_volume_zone_define(const char *name,
181  const char *criteria,
182  int type_flag);
183 
184 /*----------------------------------------------------------------------------*/
202 /*----------------------------------------------------------------------------*/
203 
204 int
205 cs_volume_zone_define_by_func(const char *name,
207  void *input,
208  int type_flag);
209 
210 /*----------------------------------------------------------------------------*/
220 /*----------------------------------------------------------------------------*/
221 
222 const cs_volume_zone_t *
223 cs_volume_zone_by_id(int id);
224 
225 /*----------------------------------------------------------------------------*/
235 /*----------------------------------------------------------------------------*/
236 
237 const cs_volume_zone_t *
238 cs_volume_zone_by_name(const char *name);
239 
240 /*----------------------------------------------------------------------------*/
250 /*----------------------------------------------------------------------------*/
251 
252 const cs_volume_zone_t *
253 cs_volume_zone_by_name_try(const char *name);
254 
255 /*----------------------------------------------------------------------------*/
262 /*----------------------------------------------------------------------------*/
263 
264 void
266  int type_flag);
267 
268 /*----------------------------------------------------------------------------*/
275 /*----------------------------------------------------------------------------*/
276 
277 void
279  bool time_varying);
280 
281 /*----------------------------------------------------------------------------*/
288 /*----------------------------------------------------------------------------*/
289 
290 void
292  bool allow_overlay)
293 ;
294 /*----------------------------------------------------------------------------*/
301 /*----------------------------------------------------------------------------*/
302 
303 const int *
305 
306 /*----------------------------------------------------------------------------*/
312 /*----------------------------------------------------------------------------*/
313 
314 void
316 
317 /*----------------------------------------------------------------------------*/
321 /*----------------------------------------------------------------------------*/
322 
323 void
325 
326 /*----------------------------------------------------------------------------*/
335 /*----------------------------------------------------------------------------*/
336 
337 cs_lnum_t
338 cs_volume_zone_n_type_zones(int type_flag);
339 
340 /*----------------------------------------------------------------------------*/
352 /*----------------------------------------------------------------------------*/
353 
354 cs_lnum_t
355 cs_volume_zone_n_type_cells(int type_flag);
356 
357 /*----------------------------------------------------------------------------*/
368 /*----------------------------------------------------------------------------*/
369 
370 void
372  cs_lnum_t cell_ids[]);
373 
374 /*----------------------------------------------------------------------------*/
375 
377 
378 #endif /* __CS_VOLUME_ZONE_H__ */
bool allow_overlay
Definition: cs_volume_zone.h:100
void cs_volume_zone_log_info(const cs_volume_zone_t *z)
Print info relative to a given volume zone to log file.
Definition: cs_volume_zone.c:729
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:555
const cs_lnum_t * cell_ids
Definition: cs_volume_zone.h:95
void cs_volume_zone_log_setup(void)
Log setup information relative to defined volume zones.
Definition: cs_volume_zone.c:776
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:94
#define BEGIN_C_DECLS
Definition: cs_defs.h:453
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:855
const cs_volume_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:590
const int * cs_volume_zone_cell_zone_id(void)
Return pointer to zone id associated with each cell.
Definition: cs_volume_zone.c:715
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:511
void cs_volume_zone_set_overlay(int id, bool allow_overlay)
Set overlay behavior for a given volume zone.
Definition: cs_volume_zone.c:697
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:829
void cs_volume_zone_finalize(void)
Free all volume zone structures.
Definition: cs_volume_zone.c:347
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:802
cs_lnum_t n_cells
Definition: cs_volume_zone.h:94
const char * name
Definition: cs_volume_zone.h:87
const cs_volume_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:614
void cs_volume_zone_set_type(int id, int type_flag)
Set type flag for a given volume zone.
Definition: cs_volume_zone.c:661
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:293
int id
Definition: cs_volume_zone.h:89
void cs_volume_zone_initialize(void)
Initialize volume zone structures.
Definition: cs_volume_zone.c:321
#define END_C_DECLS
Definition: cs_defs.h:454
bool time_varying
Definition: cs_volume_zone.h:98
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:679
int type
Definition: cs_volume_zone.h:90
int cs_volume_zone_n_zones(void)
Return number of volume zones defined.
Definition: cs_volume_zone.c:371
Definition: cs_volume_zone.h:85
const cs_volume_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:640
int location_id
Definition: cs_volume_zone.h:92
int cs_volume_zone_n_zones_time_varying(void)
Return number of volume zones which may vary in time.
Definition: cs_volume_zone.c:385
void cs_volume_zone_build_all(bool mesh_modified)
Update association of volume zones with a mesh.
Definition: cs_volume_zone.c:408