My Project
programmer's documentation
Loading...
Searching...
No Matches
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/* Specifications for OpenMP loops */
45#define CS_CDO_OMP_CHUNK_SIZE 128
46#define CS_CDO_OMP_SCHEDULE schedule(static, CS_CDO_OMP_CHUNK_SIZE)
47#define CS_CDO_OMP_SYNC_SECTIONS 0 /* > 0 --> critical sections
48 otherwise atomic sections */
49
50/* Avoid issues with assert in some OpenMp contructs using gcc 9 */
51#if defined(HAVE_OPENMP) && defined(__GNUC__)
52 #if __GNUC__ == 9
53 #define CS_CDO_OMP_ASSERT(e)
54 #else
55 #define CS_CDO_OMP_ASSERT(e) assert(e)
56 #endif
57#else
58 #define CS_CDO_OMP_ASSERT(e) assert(e)
59#endif
60
61/* Size of the buffer used to collect global ids for rows and columns
62 when assembling the values in the global matrix from the local cellwise
63 matrices */
64#define CS_CDO_ASSEMBLE_BUF_SIZE 99
65
66/* The following limitation only results from an optimization in the size of
67 the bit mask (can be changed if needed by changing the definition of
68 the type cs_mask_t) */
69#define CS_CDO_N_MAX_REACTIONS 8 // Max number of reaction terms in an equation
71#define CS_ALL_FACES 0 /* All faces: interior + border */
72#define CS_BND_FACES 1 /* Boundary faces */
73#define CS_INT_FACES 2 /* Interior faces */
74
75/* Number of DoFs on faces and cells according to the polynomial space */
76#define CS_N_FACE_DOFS_0TH 1
77#define CS_N_FACE_DOFS_1ST 3
78#define CS_N_FACE_DOFS_2ND 6
80#define CS_N_CELL_DOFS_0TH 1
81#define CS_N_CELL_DOFS_1ST 4
82#define CS_N_CELL_DOFS_2ND 10
83
84/*============================================================================
85 * Type definitions
86 *============================================================================*/
87
88/* OpenMP STRATEGY FOR THE ASSEMBLY STEP */
89/* ===================================== */
98
99/* DISCRETE HODGE OPERATORS */
100/* ======================== */
102typedef enum {
103
104 /* Hodge operator between dual spaces */
105 CS_PARAM_HODGE_TYPE_VPCD, /* from primal vertices to dual cells */
106 CS_PARAM_HODGE_TYPE_EPFD, /* from primal edges to dual faces */
107 CS_PARAM_HODGE_TYPE_FPED, /* from primal faces to dual edges */
108 CS_PARAM_HODGE_TYPE_EDFP, /* from dual edges to primal faces */
109 CS_PARAM_HODGE_TYPE_CPVD, /* from primal cells to dual vertices */
110
111 /* Hodge operator for hybrid spaces */
112 CS_PARAM_HODGE_TYPE_FB, /* primal face + primal cells */
113 CS_PARAM_HODGE_TYPE_VC, /* primal vertices + primal cells */
118typedef enum {
120 CS_PARAM_HODGE_ALGO_VORONOI, // Under othogonality condition gives a diag. op.
121 CS_PARAM_HODGE_ALGO_WBS, // WBS: Whitney Barycentric Subdivision
122 CS_PARAM_HODGE_ALGO_COST, // COST: COnsistency & STabilization splitting
123 CS_PARAM_HODGE_ALGO_AUTO, /* Switch between the previous algo. according to
124 the type of cell and its property */
129typedef struct {
131 bool is_unity; /* No associated property. Property is equalt to the unity */
132 bool is_iso; /* Associated property is isotroopic ? */
133 bool inv_pty; /* Definition based on the property or its inverse */
135 cs_param_hodge_type_t type; /* type of discrete Hodge operator */
136 cs_param_hodge_algo_t algo; /* type of algorithm used to build this op. */
137 double coef; /* Value of the stabilization parameter
138 if the COST algo. is used, otherwise 0. */
139
141
142/*============================================================================
143 * Global variables
144 *============================================================================*/
145
146/* Separation lines: header1, header2 (compatible with markdown), other */
147extern const char h1_sep[80];
148extern const char h2_sep[80];
149extern const char sepline[80];
150extern const char msepline[50];
151
152/* Activation of the CDO/HHO module */
153extern int cs_param_cdo_mode;
154
155/*============================================================================
156 * Public function prototypes
157 *============================================================================*/
158
159/*----------------------------------------------------------------------------*/
167/*----------------------------------------------------------------------------*/
168
169const char *
171
172/*----------------------------------------------------------------------------*/
180/*----------------------------------------------------------------------------*/
181
182const char *
184
185/*----------------------------------------------------------------------------*/
192/*----------------------------------------------------------------------------*/
193
194void
195cs_param_hodge_log(const char *prefix,
196 const cs_param_hodge_t hp);
197
198/*----------------------------------------------------------------------------*/
199
201
202#endif /* __CS_PARAM_CDO_H__ */
#define BEGIN_C_DECLS
Definition cs_defs.h:467
#define END_C_DECLS
Definition cs_defs.h:468
const char h2_sep[80]
Definition cs_param_cdo.c:68
const char h1_sep[80]
Definition cs_param_cdo.c:66
cs_param_hodge_type_t
Definition cs_param_cdo.h:101
@ CS_PARAM_HODGE_TYPE_FPED
Definition cs_param_cdo.h:106
@ CS_PARAM_HODGE_TYPE_EDFP
Definition cs_param_cdo.h:107
@ CS_PARAM_HODGE_TYPE_EPFD
Definition cs_param_cdo.h:105
@ CS_PARAM_HODGE_TYPE_VC
Definition cs_param_cdo.h:112
@ CS_PARAM_HODGE_TYPE_FB
Definition cs_param_cdo.h:111
@ CS_PARAM_HODGE_TYPE_VPCD
Definition cs_param_cdo.h:104
@ CS_PARAM_HODGE_TYPE_CPVD
Definition cs_param_cdo.h:108
@ CS_PARAM_N_HODGE_TYPES
Definition cs_param_cdo.h:113
cs_param_assemble_omp_strategy_t
Definition cs_param_cdo.h:90
@ CS_PARAM_ASSEMBLE_OMP_ATOMIC
Definition cs_param_cdo.h:92
@ CS_PARAM_ASSEMBLE_OMP_CRITICAL
Definition cs_param_cdo.h:93
@ CS_PARAM_ASSEMBLE_OMP_N_STRATEGIES
Definition cs_param_cdo.h:94
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:113
cs_param_hodge_algo_t
Definition cs_param_cdo.h:117
@ CS_PARAM_HODGE_ALGO_VORONOI
Definition cs_param_cdo.h:119
@ CS_PARAM_N_HODGE_ALGOS
Definition cs_param_cdo.h:124
@ CS_PARAM_HODGE_ALGO_WBS
Definition cs_param_cdo.h:120
@ CS_PARAM_HODGE_ALGO_COST
Definition cs_param_cdo.h:121
@ CS_PARAM_HODGE_ALGO_AUTO
Definition cs_param_cdo.h:122
void cs_param_hodge_log(const char *prefix, const cs_param_hodge_t hp)
Output the settings related to a cs_param_hodge_t structure.
Definition cs_param_cdo.c:144
const char sepline[80]
Definition cs_param_cdo.c:70
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:129
const char msepline[50]
Definition cs_param_cdo.c:72
int cs_param_cdo_mode
Definition cs_param_cdo.h:128