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_HLOC_CONF (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_PRIMAL (1 << 0)
90 #define CS_FLAG_DUAL (1 << 1)
91 #define CS_FLAG_VERTEX (1 << 2)
92 #define CS_FLAG_EDGE (1 << 3)
93 #define CS_FLAG_FACE (1 << 4)
94 #define CS_FLAG_CELL (1 << 5)
95 #define CS_FLAG_BORDER (1 << 6)
96 #define CS_FLAG_SCALAR (1 << 7)
97 #define CS_FLAG_VECTOR (1 << 8)
98 #define CS_FLAG_TENSOR (1 << 9)
99 #define CS_FLAG_BY_CELL (1 << 10)
100 #define CS_FLAG_FULL_LOC (1 << 11)
112 #define CS_FLAG_SCHEME_SCALAR (1 << 0)
113 #define CS_FLAG_SCHEME_VECTOR (1 << 1)
114 #define CS_FLAG_SCHEME_NAVSTO (1 << 2)
115 #define CS_FLAG_SCHEME_POLY0 (1 << 3)
116 #define CS_FLAG_SCHEME_POLY1 (1 << 4)
117 #define CS_FLAG_SCHEME_POLY2 (1 << 5)
123 /*============================================================================
124  * Type definitions
125  *============================================================================*/
126 
127 typedef unsigned char cs_mask_t; /* Elementary flag */
129 /*============================================================================
130  * Global variables
131  *============================================================================*/
132 
133 /* Default locations */
134 extern const cs_flag_t cs_flag_primal_vtx;
135 extern const cs_flag_t cs_flag_primal_face;
136 extern const cs_flag_t cs_flag_primal_cell;
137 extern const cs_flag_t cs_flag_dual_vtx;
138 extern const cs_flag_t cs_flag_dual_face;
139 extern const cs_flag_t cs_flag_dual_cell;
140 extern const cs_flag_t cs_flag_dual_face_byc;
141 
142 /*============================================================================
143  * Public function prototypes
144  *============================================================================*/
145 
146 /*----------------------------------------------------------------------------*/
157 /*----------------------------------------------------------------------------*/
158 
159 static inline bool
160 cs_flag_test(cs_flag_t flag_to_check,
161  cs_flag_t reference)
162 {
163  if ((flag_to_check & reference) == reference)
164  return true;
165  else
166  return false;
167 }
168 
169 /*----------------------------------------------------------------------------*/
170 
172 
173 #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:161
unsigned char cs_mask_t
Definition: cs_flag.h:128
#define BEGIN_C_DECLS
Definition: cs_defs.h:461
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_primal_vtx
Definition: cs_flag.c:53
#define END_C_DECLS
Definition: cs_defs.h:462
unsigned short int cs_flag_t
Definition: cs_defs.h:299
const cs_flag_t cs_flag_dual_vtx
Definition: cs_flag.c:56