programmer's documentation
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
cs_boundary_zone.h
Go to the documentation of this file.
1 #ifndef __CS_BOUNDARY_ZONE_H__
2 #define __CS_BOUNDARY_ZONE_H__
3 
4 /*============================================================================
5  * Boundary 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_BOUNDARY_ZONE_WALL (1 << 0)
61 
63 #define CS_BOUNDARY_ZONE_CDO_DOMAIN (1 << 1)
64 
67 /*============================================================================
68  * Type definitions
69  *============================================================================*/
70 
73 typedef struct {
74 
75  const char *name;
77  int id;
78  int type;
86  bool time_varying;
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_boundary_zone_build_all(bool mesh_modified);
155 
156 /*----------------------------------------------------------------------------*/
166 /*----------------------------------------------------------------------------*/
167 
168 int
169 cs_boundary_zone_define(const char *name,
170  const char *criteria,
171  int type_flag);
172 
173 /*----------------------------------------------------------------------------*/
191 /*----------------------------------------------------------------------------*/
192 
193 int
194 cs_boundary_zone_define_by_func(const char *name,
196  void *input,
197  int type_flag);
198 
199 /*----------------------------------------------------------------------------*/
209 /*----------------------------------------------------------------------------*/
210 
211 const cs_boundary_zone_t *
212 cs_boundary_zone_by_id(int id);
213 
214 /*----------------------------------------------------------------------------*/
224 /*----------------------------------------------------------------------------*/
225 
226 const cs_boundary_zone_t *
227 cs_boundary_zone_by_name(const char *name);
228 
229 /*----------------------------------------------------------------------------*/
239 /*----------------------------------------------------------------------------*/
240 
241 const cs_boundary_zone_t *
242 cs_boundary_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 cs_lnum_t
327 cs_boundary_zone_n_type_zones(int type_flag);
328 
329 /*----------------------------------------------------------------------------*/
351 /*----------------------------------------------------------------------------*/
352 
353 int *
355 
356 /*----------------------------------------------------------------------------*/
365 /*----------------------------------------------------------------------------*/
366 
367 const int *
369 
370 /*----------------------------------------------------------------------------*/
376 /*----------------------------------------------------------------------------*/
377 
378 void
380 
381 /*----------------------------------------------------------------------------*/
387 /*----------------------------------------------------------------------------*/
388 
389 int
391 
392 /*----------------------------------------------------------------------------*/
393 
395 
396 #endif /* __CS_BOUNDARY_ZONE_H__ */
int type
Definition: cs_boundary_zone.h:78
void cs_boundary_zone_set_time_varying(int id, bool time_varying)
Set time varying behavior for a given boundary zone.
Definition: cs_boundary_zone.c:673
void cs_boundary_zone_finalize(void)
Free all boundary zone structures.
Definition: cs_boundary_zone.c:337
void cs_boundary_zone_update_face_class_id(void)
Update boundary face output class ids if present.
Definition: cs_boundary_zone.c:853
const cs_boundary_zone_t * cs_boundary_zone_by_name(const char *name)
Return a pointer to a boundary zone based on its name if present.
Definition: cs_boundary_zone.c:608
void cs_boundary_zone_log_setup(void)
Log setup information relative to defined boundary zones.
Definition: cs_boundary_zone.c:771
int location_id
Definition: cs_boundary_zone.h:80
void cs_boundary_zone_log_info(const cs_boundary_zone_t *z)
Print info relative to a given boundary zone to log file.
Definition: cs_boundary_zone.c:723
void cs_boundary_zone_build_all(bool mesh_modified)
Update association of boundary zones with a mesh.
Definition: cs_boundary_zone.c:399
int * cs_boundary_zone_face_class_id(void)
Get pointer to optional boundary face class ids.
Definition: cs_boundary_zone.c:834
#define BEGIN_C_DECLS
Definition: cs_defs.h:453
int cs_boundary_zone_n_zones(void)
Return number of boundary zones defined.
Definition: cs_boundary_zone.c:362
const int * cs_boundary_zone_face_zone_id(void)
Return pointer to zone id associated with each boundary face.
Definition: cs_boundary_zone.c:709
void cs_boundary_zone_set_overlay(int id, bool allow_overlay)
Set overlay behavior for a given boundary zone.
Definition: cs_boundary_zone.c:691
cs_lnum_t cs_boundary_zone_n_type_zones(int type_flag)
Return number of boundary zones associated with a given zone flag.
Definition: cs_boundary_zone.c:797
const char * name
Definition: cs_boundary_zone.h:75
int cs_boundary_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_boundary_zone.c:549
cs_lnum_t n_faces
Definition: cs_boundary_zone.h:82
const cs_boundary_zone_t * cs_boundary_zone_by_id(int id)
Return a pointer to a boundary zone based on its id.
Definition: cs_boundary_zone.c:584
int cs_boundary_zone_n_zones_time_varying(void)
Return number of boundary zones which may vary in time.
Definition: cs_boundary_zone.c:376
int cs_boundary_zone_define(const char *name, const char *criteria, int type_flag)
Define a new boundary zone using a selection criteria string.
Definition: cs_boundary_zone.c:505
bool time_varying
Definition: cs_boundary_zone.h:86
int id
Definition: cs_boundary_zone.h:77
const cs_boundary_zone_t * cs_boundary_zone_by_name_try(const char *name)
Return a pointer to a boundary zone based on its name if present.
Definition: cs_boundary_zone.c:634
int cs_boundary_zone_max_class_or_zone_id(void)
Return the maximum defined face class or zone id.
Definition: cs_boundary_zone.c:910
void cs_boundary_zone_set_type(int id, int type_flag)
Set type flag for a given boundary zone.
Definition: cs_boundary_zone.c:655
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:293
#define END_C_DECLS
Definition: cs_defs.h:454
void cs_boundary_zone_initialize(void)
Initialize boundary zone structures.
Definition: cs_boundary_zone.c:311
const int * cs_boundary_zone_face_class_or_zone_id(void)
Get read pointer to optional boundary face class or zone ids.
Definition: cs_boundary_zone.c:890
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
Definition: cs_boundary_zone.h:73
const cs_lnum_t * face_ids
Definition: cs_boundary_zone.h:83
bool allow_overlay
Definition: cs_boundary_zone.h:88