My Project
programmer's documentation
cs_flag.h
Go to the documentation of this file.
1 #ifndef __CS_FLAG_H__
2 #define __CS_FLAG_H__
3 
4 /*============================================================================
5  * Manage the definition/setting of a computation
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  * Local headers
32  *----------------------------------------------------------------------------*/
33 
34 #include "cs_defs.h"
35 
36 /*----------------------------------------------------------------------------*/
37 
39 
40 /*============================================================================
41  * Macro definitions
42  *============================================================================*/
43 
49 #define CS_FLAG_BOUNDARY_CELL_BY_FACE (1 << 0)
51 #define CS_FLAG_BOUNDARY_CELL_BY_VERTEX (1 << 1)
60 #define CS_FLAG_SYS_MASS_MATRIX (1 << 0)
61 #define CS_FLAG_SYS_SYM (1 << 1)
62 #define CS_FLAG_SYS_TIME_DIAG (1 << 2)
63 #define CS_FLAG_SYS_REAC_DIAG (1 << 3)
64 #define CS_FLAG_SYS_SOURCES_HLOC (1 << 4)
65 #define CS_FLAG_SYS_VECTOR (1 << 5)
74 #define CS_FLAG_STATE_UNIFORM (1 << 0)
75 #define CS_FLAG_STATE_CELLWISE (1 << 1)
76 #define CS_FLAG_STATE_FACEWISE (1 << 2)
77 #define CS_FLAG_STATE_STEADY (1 << 3)
78 #define CS_FLAG_STATE_POTENTIAL (1 << 4)
79 #define CS_FLAG_STATE_CIRCULATION (1 << 5)
80 #define CS_FLAG_STATE_FLUX (1 << 6)
81 #define CS_FLAG_STATE_DENSITY (1 << 7)
82 #define CS_FLAG_STATE_OWNER (1 << 8)
91 #define CS_FLAG_FULL_LOC (1 << 0)
92 #define CS_FLAG_SCALAR (1 << 1)
93 #define CS_FLAG_VECTOR (1 << 2)
94 #define CS_FLAG_TENSOR (1 << 3)
95 #define CS_FLAG_VERTEX (1 << 4)
96 #define CS_FLAG_EDGE (1 << 5)
97 #define CS_FLAG_FACE (1 << 6)
98 #define CS_FLAG_CELL (1 << 7)
99 #define CS_FLAG_PRIMAL (1 << 8)
100 #define CS_FLAG_DUAL (1 << 9)
101 #define CS_FLAG_BORDER (1 << 10)
102 #define CS_FLAG_BY_CELL (1 << 11)
103 #define CS_FLAG_BY_FACE (1 << 12)
115 #define CS_FLAG_SCHEME_SCALAR (1 << 0)
116 #define CS_FLAG_SCHEME_VECTOR (1 << 1)
117 #define CS_FLAG_SCHEME_NAVSTO (1 << 2)
118 #define CS_FLAG_SCHEME_POLY0 (1 << 3)
119 #define CS_FLAG_SCHEME_POLY1 (1 << 4)
120 #define CS_FLAG_SCHEME_POLY2 (1 << 5)
126 /* According to the flag which are set, different quantities or connectivities
127  are built on-the-fly and stored in a local cache structure (cell/base) */
128 
129 #define CS_FLAG_COMP_PV (1 << 0) /* 1: local info. for vertices */
130 #define CS_FLAG_COMP_PVQ (1 << 1) /* 2: local quant. on vertices */
131 #define CS_FLAG_COMP_PE (1 << 2) /* 4: local info. for edges */
132 #define CS_FLAG_COMP_PEQ (1 << 3) /* 8: local quant. on edges */
133 #define CS_FLAG_COMP_DFQ (1 << 4) /* 16: local quant. on dual faces */
134 #define CS_FLAG_COMP_PF (1 << 5) /* 32: local info. for faces */
135 #define CS_FLAG_COMP_PFQ (1 << 6) /* 64: local quant. on faces */
136 #define CS_FLAG_COMP_DEQ (1 << 7) /* 128: local quant. on dual edges */
137 #define CS_FLAG_COMP_EV (1 << 8) /* 256: local e2v connectivity */
138 #define CS_FLAG_COMP_FE (1 << 9) /* 512: local f2e connectivity */
139 #define CS_FLAG_COMP_FEQ (1 << 10) /* 1024: local f2e quantities */
140 #define CS_FLAG_COMP_FV (1 << 11) /* 2048: local f2v connectivity */
141 #define CS_FLAG_COMP_EF (1 << 12) /* 4096: local e2f connectivity */
142 #define CS_FLAG_COMP_EFQ (1 << 13) /* 8192: local e2f quantities */
143 #define CS_FLAG_COMP_HFQ (1 << 14) /* 16384: local quant. on face pyramids */
144 #define CS_FLAG_COMP_DIAM (1 << 15) /* 32768: local diameters on faces/cell */
145 
146 /*============================================================================
147  * Type definitions
148  *============================================================================*/
149 
150 typedef unsigned char cs_mask_t; /* Elementary flag */
151 
152 /*============================================================================
153  * Global variables
154  *============================================================================*/
155 
156 /* Default locations */
157 extern const cs_flag_t cs_flag_primal_vtx;
158 extern const cs_flag_t cs_flag_primal_face;
159 extern const cs_flag_t cs_flag_primal_cell;
160 extern const cs_flag_t cs_flag_dual_vtx;
161 extern const cs_flag_t cs_flag_dual_face;
162 extern const cs_flag_t cs_flag_dual_cell;
163 extern const cs_flag_t cs_flag_dual_face_byc;
164 
165 /* Part of dual cell closure belonging to a boundary primal face */
167 
168 /*============================================================================
169  * Public function prototypes
170  *============================================================================*/
171 
172 /*----------------------------------------------------------------------------*/
183 /*----------------------------------------------------------------------------*/
184 
185 static inline bool
186 cs_flag_test(cs_flag_t flag_to_check,
187  cs_flag_t reference)
188 {
189  if ((flag_to_check & reference) == reference)
190  return true;
191  else
192  return false;
193 }
194 
195 /*----------------------------------------------------------------------------*/
201 /*----------------------------------------------------------------------------*/
202 
203 const char *
205 
206 /*----------------------------------------------------------------------------*/
207 
209 
210 #endif /* __CS_FLAG_H__ */
cs_defs.h
cs_flag_primal_face
const cs_flag_t cs_flag_primal_face
Definition: cs_flag.c:54
cs_flag_dual_vtx
const cs_flag_t cs_flag_dual_vtx
Definition: cs_flag.c:56
END_C_DECLS
#define END_C_DECLS
Definition: cs_defs.h:468
BEGIN_C_DECLS
#define BEGIN_C_DECLS
Definition: cs_defs.h:467
cs_flag_dual_closure_byf
const cs_flag_t cs_flag_dual_closure_byf
Definition: cs_flag.c:61
cs_flag_dual_cell
const cs_flag_t cs_flag_dual_cell
Definition: cs_flag.c:58
cs_flag_str_location
const char * cs_flag_str_location(cs_flag_t loc)
Retrieve the label associated to a location flag.
Definition: cs_flag.c:81
cs_mask_t
unsigned char cs_mask_t
Definition: cs_flag.h:152
cs_flag_primal_cell
const cs_flag_t cs_flag_primal_cell
Definition: cs_flag.c:55
cs_flag_dual_face_byc
const cs_flag_t cs_flag_dual_face_byc
Definition: cs_flag.c:59
cs_flag_test
static bool cs_flag_test(cs_flag_t flag_to_check, cs_flag_t reference)
Check if a two flag share the same pattern Return true if the flag to check has at least the pattern ...
Definition: cs_flag.h:188
cs_flag_t
unsigned short int cs_flag_t
Definition: cs_defs.h:304
cs_flag_primal_vtx
const cs_flag_t cs_flag_primal_vtx
Definition: cs_flag.c:53
cs_flag_dual_face
const cs_flag_t cs_flag_dual_face
Definition: cs_flag.c:57