programmer's 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  * 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 
44 /* Avoid issues with assert in some OpenMp contructs using gcc 9 */
45 #if defined(HAVE_OPENMP) && defined(__GNUC__)
46  #if __GNUC__ == 9
47  #define CS_CDO_OMP_ASSERT(e)
48  #else
49  #define CS_CDO_OMP_ASSERT(e) assert(e)
50  #endif
51 #else
52  #define CS_CDO_OMP_ASSERT(e) assert(e)
53 #endif
54 
55 /* Size of the buffer used to collect global ids for rows and columns
56  when assembling the values in the global matrix from the local cellwise
57  matrices */
58 #define CS_CDO_ASSEMBLE_BUF_SIZE 99
59 
60 /* The following limitation only results from an optimization in the size of
61  the bit mask (can be changed if needed by changing the definition of
62  the type cs_mask_t) */
63 #define CS_CDO_N_MAX_REACTIONS 8 // Max number of reaction terms in an equation
64 
65 /* Specifications for open mp loops */
66 #define CS_CDO_OMP_CHUNK_SIZE 128
67 #define CS_CDO_OMP_SCHEDULE schedule(static, CS_CDO_OMP_CHUNK_SIZE)
68 
69 #define CS_ALL_FACES 0 /* All faces: interior + border */
70 #define CS_BND_FACES 1 /* Boundary faces */
71 #define CS_INT_FACES 2 /* Interior faces */
72 
73 /* Number of DoFs on faces and cells according to the polynomial space */
74 #define CS_N_FACE_DOFS_0TH 1
75 #define CS_N_FACE_DOFS_1ST 3
76 #define CS_N_FACE_DOFS_2ND 6
77 
78 #define CS_N_CELL_DOFS_0TH 1
79 #define CS_N_CELL_DOFS_1ST 4
80 #define CS_N_CELL_DOFS_2ND 10
81 
82 /*============================================================================
83  * Type definitions
84  *============================================================================*/
85 
86 /* DISCRETE HODGE OPERATORS */
87 /* ======================== */
88 
89 typedef enum {
90 
91  /* Hodge operator between dual spaces */
92  CS_PARAM_HODGE_TYPE_VPCD, /* from primal vertices to dual cells */
93  CS_PARAM_HODGE_TYPE_EPFD, /* from primal edges to dual faces */
94  CS_PARAM_HODGE_TYPE_FPED, /* from primal faces to dual edges */
95  CS_PARAM_HODGE_TYPE_EDFP, /* from dual edges to primal faces */
96  CS_PARAM_HODGE_TYPE_CPVD, /* from primal cells to dual vertices */
97 
98  /* Hodge operator for hybrid spaces */
99  CS_PARAM_HODGE_TYPE_FB, /* primal face + primal cells */
100  CS_PARAM_HODGE_TYPE_VC, /* primal vertices + primal cells */
102 
104 
105 typedef enum {
106 
107  CS_PARAM_HODGE_ALGO_VORONOI, // Under othogonality condition gives a diag. op.
108  CS_PARAM_HODGE_ALGO_WBS, // WBS: Whitney Barycentric Subdivision
109  CS_PARAM_HODGE_ALGO_COST, // COST: COnsistency & STabilization splitting
110  CS_PARAM_HODGE_ALGO_AUTO, /* Switch between the previous algo. according to
111  the type of cell and its property */
113 
115 
116 typedef struct {
117 
118  bool is_unity; /* No associated property. Property is equalt to the unity */
119  bool is_iso; /* Associated property is isotroopic ? */
120  bool inv_pty; /* Definition based on the property or its inverse */
121 
122  cs_param_hodge_type_t type; /* type of discrete Hodge operator */
123  cs_param_hodge_algo_t algo; /* type of algorithm used to build this op. */
124  double coef; /* Value of the stabilization parameter
125  if the COST algo. is used, otherwise 0. */
126 
128 
129 /*============================================================================
130  * Global variables
131  *============================================================================*/
132 
133 /* Separation lines: long, medium, short */
134 extern const char lsepline[80];
135 extern const char msepline[60];
136 extern const char ssepline[40];
137 
138 /* Activation of the CDO/HHO module */
139 extern int cs_param_cdo_mode;
140 
141 /*============================================================================
142  * Public function prototypes
143  *============================================================================*/
144 
145 /*----------------------------------------------------------------------------*/
153 /*----------------------------------------------------------------------------*/
154 
155 const char *
157 
158 /*----------------------------------------------------------------------------*/
166 /*----------------------------------------------------------------------------*/
167 
168 const char *
170 
171 /*----------------------------------------------------------------------------*/
172 
174 
175 #endif /* __CS_PARAM_CDO_H__ */
cs_param_hodge_algo_t algo
Definition: cs_param_cdo.h:123
Definition: cs_param_cdo.h:107
bool inv_pty
Definition: cs_param_cdo.h:120
Definition: cs_param_cdo.h:99
#define BEGIN_C_DECLS
Definition: cs_defs.h:462
Definition: cs_param_cdo.h:101
Definition: cs_param_cdo.h:100
const char ssepline[40]
Definition: cs_param_cdo.c:70
bool is_unity
Definition: cs_param_cdo.h:118
int cs_param_cdo_mode
bool is_iso
Definition: cs_param_cdo.h:119
const char lsepline[80]
Definition: cs_param_cdo.c:66
const char * cs_param_hodge_get_algo_name(const cs_param_hodge_t h_info)
Get the name of algorithm related to a discrete Hdoge operator.
Definition: cs_param_cdo.c:111
cs_param_hodge_type_t type
Definition: cs_param_cdo.h:122
Definition: cs_param_cdo.h:109
cs_param_hodge_type_t
Definition: cs_param_cdo.h:89
const char msepline[60]
Definition: cs_param_cdo.c:68
Definition: cs_param_cdo.h:96
Definition: cs_param_cdo.h:95
Definition: cs_param_cdo.h:92
#define END_C_DECLS
Definition: cs_defs.h:463
Definition: cs_param_cdo.h:110
Definition: cs_param_cdo.h:93
cs_param_hodge_algo_t
Definition: cs_param_cdo.h:105
double coef
Definition: cs_param_cdo.h:124
Definition: cs_param_cdo.h:112
Definition: cs_param_cdo.h:116
Definition: cs_param_cdo.h:108
Definition: cs_param_cdo.h:94
const char * cs_param_hodge_get_type_name(const cs_param_hodge_t h_info)
Get the type of discrete Hodge operator.
Definition: cs_param_cdo.c:127