8.0
general documentation
cs_param_cdo.h
Go to the documentation of this file.
1 #ifndef __CS_PARAM_CDO_H__
2 #define __CS_PARAM_CDO_H__
3 
4 /*============================================================================
5  * High-level metadata related to CDO/HHO schemes
6  *============================================================================*/
7 
8 /*
9  This file is part of code_saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2023 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 
44 /* Specifications for OpenMP loops */
45 
46 #define CS_CDO_OMP_CHUNK_SIZE 128
47 #define CS_CDO_OMP_SCHEDULE schedule(static, CS_CDO_OMP_CHUNK_SIZE)
48 #define CS_CDO_OMP_SYNC_SECTIONS 0 /* > 0 --> critical sections
49  otherwise atomic sections */
50 
51 /* Avoid issues with assert in some OpenMp contructs using gcc 9 */
52 
53 #if defined(HAVE_OPENMP) && defined(__GNUC__)
54  #if __GNUC__ == 9
55  #define CS_CDO_OMP_ASSERT(e)
56  #else
57  #define CS_CDO_OMP_ASSERT(e) assert(e)
58  #endif
59 #else
60  #define CS_CDO_OMP_ASSERT(e) assert(e)
61 #endif
62 
63 /* Size of the buffer used to collect global ids for rows and columns
64  when assembling the values in the global matrix from the local cellwise
65  matrices */
66 
67 #define CS_CDO_ASSEMBLE_BUF_SIZE 200
68 
69 /* The following limitation only results from an optimization in the size of
70  the bit mask (can be changed if needed by changing the definition of
71  the type cs_mask_t)
72  Here is the max. number of reaction terms allowed in an equation */
73 
74 #define CS_CDO_N_MAX_REACTIONS 8
75 
76 #define CS_ALL_FACES 0 /* All faces: interior + border */
77 #define CS_BND_FACES 1 /* Boundary faces */
78 #define CS_INT_FACES 2 /* Interior faces */
79 
80 /* HHO specific part:
81  *
82  * Number of DoFs on faces and cells according to the polynomial space
83  */
84 
85 #define CS_N_DOFS_FACE_0TH 1
86 #define CS_N_DOFS_FACE_1ST 3
87 #define CS_N_DOFS_FACE_2ND 6
88 
89 #define CS_N_DOFS_CELL_0TH 1
90 #define CS_N_DOFS_CELL_1ST 4
91 #define CS_N_DOFS_CELL_2ND 10
92 
93 /*============================================================================
94  * Type definitions
95  *============================================================================*/
96 
97 typedef enum {
98 
99  CS_PARAM_CDO_MODE_OFF = -1, /* CDO schemes are not used */
100  CS_PARAM_CDO_MODE_WITH_FV = 1, /* CDO and legacy FV schemes are used */
101  CS_PARAM_CDO_MODE_ONLY = 2 /* Only CDO schemes are used */
102 
104 
105 /* OpenMP STRATEGY FOR THE ASSEMBLY STEP */
106 /* ===================================== */
107 
108 typedef enum {
109 
113 
115 
116 /*============================================================================
117  * Global variables
118  *============================================================================*/
119 
121 
122 /*============================================================================
123  * Public function prototypes
124  *============================================================================*/
125 
126 /*----------------------------------------------------------------------------*/
131 /*----------------------------------------------------------------------------*/
132 
133 void
135 
136 /*----------------------------------------------------------------------------*/
142 /*----------------------------------------------------------------------------*/
143 
146 
147 /*----------------------------------------------------------------------------*/
151 /*----------------------------------------------------------------------------*/
152 
153 void
154 cs_param_cdo_log(void);
155 
156 /*----------------------------------------------------------------------------*/
157 
159 
160 #endif /* __CS_PARAM_CDO_H__ */
#define BEGIN_C_DECLS
Definition: cs_defs.h:509
#define END_C_DECLS
Definition: cs_defs.h:510
void cs_param_cdo_log(void)
Print a welcome message indicating what is the current CDO status.
Definition: cs_param_cdo.c:130
cs_param_assemble_omp_strategy_t
Definition: cs_param_cdo.h:107
@ CS_PARAM_ASSEMBLE_OMP_ATOMIC
Definition: cs_param_cdo.h:109
@ CS_PARAM_ASSEMBLE_OMP_CRITICAL
Definition: cs_param_cdo.h:110
@ CS_PARAM_ASSEMBLE_OMP_N_STRATEGIES
Definition: cs_param_cdo.h:111
cs_param_cdo_mode_t
Definition: cs_param_cdo.h:96
@ CS_PARAM_CDO_MODE_ONLY
Definition: cs_param_cdo.h:100
@ CS_PARAM_CDO_MODE_OFF
Definition: cs_param_cdo.h:98
@ CS_PARAM_CDO_MODE_WITH_FV
Definition: cs_param_cdo.h:99
cs_param_cdo_mode_t cs_glob_param_cdo_mode
cs_param_cdo_mode_t cs_param_cdo_mode_get(void)
Get the mode of activation for the CDO/HHO schemes.
Definition: cs_param_cdo.c:118
void cs_param_cdo_mode_set(cs_param_cdo_mode_t mode)
Set the global variable storing the mode of activation to apply to CDO/HHO schemes....
Definition: cs_param_cdo.c:103