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