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 /* Number of DoFs on faces and cells according to the polynomial space */
59 #define CS_N_FACE_DOFS_0TH 1
60 #define CS_N_FACE_DOFS_1ST 3
61 #define CS_N_FACE_DOFS_2ND 6
62 
63 #define CS_N_CELL_DOFS_0TH 1
64 #define CS_N_CELL_DOFS_1ST 4
65 #define CS_N_CELL_DOFS_2ND 10
66 
67 /*============================================================================
68  * Type definitions
69  *============================================================================*/
70 
71 /* DISCRETE HODGE OPERATORS */
72 /* ======================== */
73 
74 typedef enum {
75 
76  CS_PARAM_HODGE_TYPE_VPCD, // from primal vertices to dual cells
77  CS_PARAM_HODGE_TYPE_EPFD, // from primal edges to dual faces
78  CS_PARAM_HODGE_TYPE_FPED, // from primal faces to dual edges
79  CS_PARAM_HODGE_TYPE_EDFP, // from dual edges to primal faces
80  CS_PARAM_HODGE_TYPE_CPVD, // from primal cells to dual vertices
81  CS_PARAM_HODGE_TYPE_VC, // primal vertices + primal cells
83 
85 
86 typedef enum {
87 
88  CS_PARAM_HODGE_ALGO_VORONOI, // Under othogonality condition gives a diag. op.
89  CS_PARAM_HODGE_ALGO_WBS, // WBS: Whitney Barycentric Subdivision
90  CS_PARAM_HODGE_ALGO_COST, // COST: COnsistency & STabilization splitting
91  CS_PARAM_HODGE_ALGO_AUTO, /* Switch between the previous algo. according to
92  the type of cell and its property */
94 
96 
97 typedef struct {
98 
99  bool is_unity; /* No associated property. Property is equalt to the unity */
100  bool is_iso; /* Associated property is isotroopic ? */
101  bool inv_pty; /* Definition based on the property or its inverse */
102 
103  cs_param_hodge_type_t type; /* type of discrete Hodge operator */
104  cs_param_hodge_algo_t algo; /* type of algorithm used to build this op. */
105  double coef; /* Value of the stabilization parameter
106  if the COST algo. is used, otherwise 0. */
107 
109 
110 /*============================================================================
111  * Global variables
112  *============================================================================*/
113 
114 /* Separation lines: long, medium, short */
115 extern const char lsepline[80];
116 extern const char msepline[60];
117 extern const char ssepline[40];
118 
119 /* Activation of the CDO/HHO module */
120 extern int cs_param_cdo_mode;
121 
122 /*============================================================================
123  * Public function prototypes
124  *============================================================================*/
125 
126 /*----------------------------------------------------------------------------*/
134 /*----------------------------------------------------------------------------*/
135 
136 const char *
138 
139 /*----------------------------------------------------------------------------*/
147 /*----------------------------------------------------------------------------*/
148 
149 const char *
151 
152 /*----------------------------------------------------------------------------*/
153 
155 
156 #endif /* __CS_PARAM_CDO_H__ */
cs_param_hodge_algo_t algo
Definition: cs_param_cdo.h:104
Definition: cs_param_cdo.h:88
bool inv_pty
Definition: cs_param_cdo.h:101
#define BEGIN_C_DECLS
Definition: cs_defs.h:461
Definition: cs_param_cdo.h:82
Definition: cs_param_cdo.h:81
const char ssepline[40]
Definition: cs_param_cdo.c:70
bool is_unity
Definition: cs_param_cdo.h:99
int cs_param_cdo_mode
bool is_iso
Definition: cs_param_cdo.h:100
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:103
Definition: cs_param_cdo.h:90
cs_param_hodge_type_t
Definition: cs_param_cdo.h:74
const char msepline[60]
Definition: cs_param_cdo.c:68
Definition: cs_param_cdo.h:80
Definition: cs_param_cdo.h:79
Definition: cs_param_cdo.h:76
#define END_C_DECLS
Definition: cs_defs.h:462
Definition: cs_param_cdo.h:91
Definition: cs_param_cdo.h:77
cs_param_hodge_algo_t
Definition: cs_param_cdo.h:86
double coef
Definition: cs_param_cdo.h:105
Definition: cs_param_cdo.h:93
Definition: cs_param_cdo.h:97
Definition: cs_param_cdo.h:89
Definition: cs_param_cdo.h:78
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