programmer's documentation
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 
49 /*============================================================================
50  * Type definitions
51  *============================================================================*/
52 
55 typedef struct {
56 
57  const char *name;
59  int id;
60  int type;
68  bool time_varying;
74 
75 /*=============================================================================
76  * Global variables
77  *============================================================================*/
78 
79 /*============================================================================
80  * Public function prototypes
81  *============================================================================*/
82 
83 /*----------------------------------------------------------------------------*/
91 /*----------------------------------------------------------------------------*/
92 
93 void
95 
96 /*----------------------------------------------------------------------------*/
100 /*----------------------------------------------------------------------------*/
101 
102 void
104 
105 /*----------------------------------------------------------------------------*/
109 /*----------------------------------------------------------------------------*/
110 
111 int
113 
114 /*----------------------------------------------------------------------------*/
120 /*----------------------------------------------------------------------------*/
121 
122 int
124 
125 /*----------------------------------------------------------------------------*/
133 /*----------------------------------------------------------------------------*/
134 
135 void
136 cs_boundary_zone_build_all(bool mesh_modified);
137 
138 /*----------------------------------------------------------------------------*/
148 /*----------------------------------------------------------------------------*/
149 
150 int
151 cs_boundary_zone_define(const char *name,
152  const char *criteria,
153  int type_flag);
154 
155 /*----------------------------------------------------------------------------*/
173 /*----------------------------------------------------------------------------*/
174 
175 int
176 cs_boundary_zone_define_by_func(const char *name,
178  void *input,
179  int type_flag);
180 
181 /*----------------------------------------------------------------------------*/
191 /*----------------------------------------------------------------------------*/
192 
193 const cs_boundary_zone_t *
194 cs_boundary_zone_by_id(int id);
195 
196 /*----------------------------------------------------------------------------*/
206 /*----------------------------------------------------------------------------*/
207 
208 const cs_boundary_zone_t *
209 cs_boundary_zone_by_name(const char *name);
210 
211 /*----------------------------------------------------------------------------*/
221 /*----------------------------------------------------------------------------*/
222 
223 const cs_boundary_zone_t *
224 cs_boundary_zone_by_name_try(const char *name);
225 
226 /*----------------------------------------------------------------------------*/
233 /*----------------------------------------------------------------------------*/
234 
235 void
237  bool type_flag);
238 
239 /*----------------------------------------------------------------------------*/
246 /*----------------------------------------------------------------------------*/
247 
248 void
250  bool time_varying);
251 
252 /*----------------------------------------------------------------------------*/
259 /*----------------------------------------------------------------------------*/
260 
261 void
263  bool allow_overlay)
264 ;
265 /*----------------------------------------------------------------------------*/
272 /*----------------------------------------------------------------------------*/
273 
274 const int *
276 
277 /*----------------------------------------------------------------------------*/
283 /*----------------------------------------------------------------------------*/
284 
285 void
287 
288 /*----------------------------------------------------------------------------*/
292 /*----------------------------------------------------------------------------*/
293 
294 void
296 
297 /*----------------------------------------------------------------------------*/
306 /*----------------------------------------------------------------------------*/
307 
308 cs_lnum_t
309 cs_boundary_zone_n_type_zones(int type_flag);
310 
311 /*----------------------------------------------------------------------------*/
333 /*----------------------------------------------------------------------------*/
334 
335 int *
337 
338 /*----------------------------------------------------------------------------*/
347 /*----------------------------------------------------------------------------*/
348 
349 const int *
351 
352 /*----------------------------------------------------------------------------*/
358 /*----------------------------------------------------------------------------*/
359 
360 void
362 
363 /*----------------------------------------------------------------------------*/
369 /*----------------------------------------------------------------------------*/
370 
371 int
373 
374 /*----------------------------------------------------------------------------*/
375 
377 
378 #endif /* __CS_BOUNDARY_ZONE_H__ */
int type
Definition: cs_boundary_zone.h:60
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:62
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
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:451
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:57
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:64
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:68
int id
Definition: cs_boundary_zone.h:59
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
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:293
#define END_C_DECLS
Definition: cs_defs.h:452
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
Definition: cs_boundary_zone.h:55
void cs_boundary_zone_set_type(int id, bool type_flag)
Set type flag for a given boundary zone.
Definition: cs_boundary_zone.c:655
const cs_lnum_t * face_ids
Definition: cs_boundary_zone.h:65
bool allow_overlay
Definition: cs_boundary_zone.h:70