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-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  * Local headers
32  *----------------------------------------------------------------------------*/
33 
34 #include "cs_defs.h"
35 
36 /*----------------------------------------------------------------------------*/
37 
39 
40 /*============================================================================
41  * Macro definitions
42  *============================================================================*/
43 
49 #define CS_FLAG_BOUNDARY (1 << 0)
58 #define CS_FLAG_SYS_MASS_MATRIX (1 << 0)
59 #define CS_FLAG_SYS_SYM (1 << 1)
60 #define CS_FLAG_SYS_TIME_DIAG (1 << 2)
61 #define CS_FLAG_SYS_SOURCES_HLOC (1 << 3)
62 #define CS_FLAG_SYS_VECTOR (1 << 4)
63 #define CS_FLAG_SYS_DEBUG (1 << 5)
72 #define CS_FLAG_STATE_UNIFORM (1 << 0)
73 #define CS_FLAG_STATE_CELLWISE (1 << 1)
74 #define CS_FLAG_STATE_FACEWISE (1 << 2)
75 #define CS_FLAG_STATE_STEADY (1 << 3)
76 #define CS_FLAG_STATE_POTENTIAL (1 << 4)
77 #define CS_FLAG_STATE_CIRCULATION (1 << 5)
78 #define CS_FLAG_STATE_FLUX (1 << 6)
79 #define CS_FLAG_STATE_DENSITY (1 << 7)
80 #define CS_FLAG_STATE_OWNER (1 << 8)
89 #define CS_FLAG_FULL_LOC (1 << 0)
90 #define CS_FLAG_SCALAR (1 << 1)
91 #define CS_FLAG_VECTOR (1 << 2)
92 #define CS_FLAG_TENSOR (1 << 3)
93 #define CS_FLAG_VERTEX (1 << 4)
94 #define CS_FLAG_EDGE (1 << 5)
95 #define CS_FLAG_FACE (1 << 6)
96 #define CS_FLAG_CELL (1 << 7)
97 #define CS_FLAG_PRIMAL (1 << 8)
98 #define CS_FLAG_DUAL (1 << 9)
99 #define CS_FLAG_BORDER (1 << 10)
100 #define CS_FLAG_BY_CELL (1 << 11)
101 #define CS_FLAG_BY_FACE (1 << 12)
113 #define CS_FLAG_SCHEME_SCALAR (1 << 0)
114 #define CS_FLAG_SCHEME_VECTOR (1 << 1)
115 #define CS_FLAG_SCHEME_NAVSTO (1 << 2)
116 #define CS_FLAG_SCHEME_POLY0 (1 << 3)
117 #define CS_FLAG_SCHEME_POLY1 (1 << 4)
118 #define CS_FLAG_SCHEME_POLY2 (1 << 5)
124 /*============================================================================
125  * Type definitions
126  *============================================================================*/
127 
128 typedef unsigned char cs_mask_t; /* Elementary flag */
130 /*============================================================================
131  * Global variables
132  *============================================================================*/
133 
134 /* Default locations */
135 extern const cs_flag_t cs_flag_primal_vtx;
136 extern const cs_flag_t cs_flag_primal_face;
137 extern const cs_flag_t cs_flag_primal_cell;
138 extern const cs_flag_t cs_flag_dual_vtx;
139 extern const cs_flag_t cs_flag_dual_face;
140 extern const cs_flag_t cs_flag_dual_cell;
141 extern const cs_flag_t cs_flag_dual_face_byc;
142 
143 /* Part of dual cell closure belonging to a boundary primal face */
145 
146 /*============================================================================
147  * Public function prototypes
148  *============================================================================*/
149 
150 /*----------------------------------------------------------------------------*/
161 /*----------------------------------------------------------------------------*/
162 
163 static inline bool
164 cs_flag_test(cs_flag_t flag_to_check,
165  cs_flag_t reference)
166 {
167  if ((flag_to_check & reference) == reference)
168  return true;
169  else
170  return false;
171 }
172 
173 /*----------------------------------------------------------------------------*/
179 /*----------------------------------------------------------------------------*/
180 
181 const char *
183 
184 /*----------------------------------------------------------------------------*/
185 
187 
188 #endif /* __CS_FLAG_H__ */
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:165
unsigned char cs_mask_t
Definition: cs_flag.h:129
const char * cs_flag_str_location(cs_flag_t loc)
Retrieve the label associated to a location flag.
Definition: cs_flag.c:81
#define BEGIN_C_DECLS
Definition: cs_defs.h:462
const cs_flag_t cs_flag_dual_cell
Definition: cs_flag.c:58
const cs_flag_t cs_flag_primal_cell
Definition: cs_flag.c:55
const cs_flag_t cs_flag_dual_face_byc
Definition: cs_flag.c:59
const cs_flag_t cs_flag_dual_face
Definition: cs_flag.c:57
const cs_flag_t cs_flag_primal_face
Definition: cs_flag.c:54
const cs_flag_t cs_flag_dual_closure_byf
Definition: cs_flag.c:61
const cs_flag_t cs_flag_primal_vtx
Definition: cs_flag.c:53
#define END_C_DECLS
Definition: cs_defs.h:463
unsigned short int cs_flag_t
Definition: cs_defs.h:299
const cs_flag_t cs_flag_dual_vtx
Definition: cs_flag.c:56