9.2
general documentation
cs_enforcement.h
Go to the documentation of this file.
1#ifndef CS_ENFORCEMENT_H
2#define CS_ENFORCEMENT_H
3
4/*============================================================================
5 * Manage the list of solid cells and associated helper functions
6 *============================================================================*/
7
8/*
9 This file is part of code_saturne, a general-purpose CFD tool.
10
11 Copyright (C) 1998-2026 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 * Local headers
30 *----------------------------------------------------------------------------*/
31
32#include "base/cs_defs.h"
33#include "cdo/cs_cdo_connect.h"
34#include "cdo/cs_cdo_local.h"
35
36/*============================================================================
37 * Macro definitions
38 *============================================================================*/
39
40/*=============================================================================
41 * Structure and type definitions
42 *============================================================================*/
43
59typedef enum {
60
67
68
73typedef enum {
74
79
80
85typedef struct {
86
89
92 int stride;
96
97/*============================================================================
98 * Public function prototypes
99 *============================================================================*/
100
101/*----------------------------------------------------------------------------*/
114/*----------------------------------------------------------------------------*/
115
119 int stride,
120 cs_lnum_t n_elts,
121 const cs_lnum_t *elt_ids,
122 const cs_real_t *values);
123
124/*----------------------------------------------------------------------------*/
136/*----------------------------------------------------------------------------*/
137
138void
142 int stride,
143 cs_lnum_t n_elts,
144 const cs_lnum_t *elt_ids,
145 const cs_real_t *values);
146
147/*----------------------------------------------------------------------------*/
155/*----------------------------------------------------------------------------*/
156
159
160/*----------------------------------------------------------------------------*/
166/*----------------------------------------------------------------------------*/
167
168void
170
171/*----------------------------------------------------------------------------*/
178/*----------------------------------------------------------------------------*/
179
180void
181cs_enforcement_param_log(const char *eqname,
182 const cs_enforcement_param_t *efp);
183
184/*----------------------------------------------------------------------------*/
194/*----------------------------------------------------------------------------*/
195
196cs_real_t *
198 int n_params,
199 cs_enforcement_param_t **efp_array);
200
201/*----------------------------------------------------------------------------*/
211/*----------------------------------------------------------------------------*/
212
213cs_real_t *
215 int n_params,
216 cs_enforcement_param_t **efp_array);
217
218/*----------------------------------------------------------------------------*/
228/*----------------------------------------------------------------------------*/
229
230cs_real_t *
232 int n_params,
233 cs_enforcement_param_t **efp_array);
234
235/*----------------------------------------------------------------------------*/
245/*----------------------------------------------------------------------------*/
246
247bool
248cs_enforcement_dofs_cw(const cs_real_t *forced_values,
249 cs_cell_sys_t *csys,
250 cs_real_t *cw_forced_values);
251
252#endif /* CS_ENFORCEMENT_H */
double cs_real_t
Floating-point value.
Definition: cs_defs.h:332
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:325
cs_real_t * cs_enforcement_define_at_faces(const cs_cdo_connect_t *connect, int n_params, cs_enforcement_param_t **efp_array)
Build a cs_enforcement_t structure for face-based scheme.
Definition: cs_enforcement.cpp:494
void cs_enforcement_param_log(const char *eqname, const cs_enforcement_param_t *efp)
Log a cs_enforcement_param_t structure.
Definition: cs_enforcement.cpp:275
cs_enforcement_selection_t
Type of entities used to define the selection where the enforcement takes place.
Definition: cs_enforcement.h:59
@ CS_ENFORCEMENT_SELECTION_VERTICES
Definition: cs_enforcement.h:64
@ CS_ENFORCEMENT_SELECTION_EDGES
Definition: cs_enforcement.h:63
@ CS_ENFORCEMENT_SELECTION_CELLS
Definition: cs_enforcement.h:61
@ CS_ENFORCEMENT_SELECTION_FACES
Definition: cs_enforcement.h:62
cs_real_t * cs_enforcement_define_at_edges(const cs_cdo_connect_t *connect, int n_params, cs_enforcement_param_t **efp_array)
Build a cs_enforcement_t structure for edge-based scheme.
Definition: cs_enforcement.cpp:623
cs_enforcement_param_t * cs_enforcement_param_create(cs_enforcement_selection_t sel_type, cs_enforcement_type_t type, int stride, cs_lnum_t n_elts, const cs_lnum_t *elt_ids, const cs_real_t *values)
Create and define a cs_enforcement_param_t structure.
Definition: cs_enforcement.cpp:105
void cs_enforcement_param_free(cs_enforcement_param_t **p_efp)
Free a cs_enforcement_param_t structure.
Definition: cs_enforcement.cpp:248
void cs_enforcement_param_reset(cs_enforcement_param_t *efp, cs_enforcement_selection_t sel_type, cs_enforcement_type_t type, int stride, cs_lnum_t n_elts, const cs_lnum_t *elt_ids, const cs_real_t *values)
Reset an existing cs_enforcement_param_t structure.
Definition: cs_enforcement.cpp:166
cs_enforcement_param_t * cs_enforcement_param_copy(const cs_enforcement_param_t *ref)
Copy a cs_enforcement_param_t structure.
Definition: cs_enforcement.cpp:222
cs_enforcement_type_t
Describe the way the values to enforce are defined.
Definition: cs_enforcement.h:73
@ CS_ENFORCEMENT_BY_DOF_VALUES
Definition: cs_enforcement.h:76
@ CS_ENFORCEMENT_BY_CONSTANT
Definition: cs_enforcement.h:75
cs_real_t * cs_enforcement_define_at_vertices(const cs_cdo_connect_t *connect, int n_params, cs_enforcement_param_t **efp_array)
Build a cs_enforcement_t structure for vertex-based scheme.
Definition: cs_enforcement.cpp:365
bool cs_enforcement_dofs_cw(const cs_real_t *forced_values, cs_cell_sys_t *csys, cs_real_t *cw_forced_values)
Build the cell-wise value to enforce.
Definition: cs_enforcement.cpp:752
Definition: cs_cdo_connect.h:57
Set of arrays and local (small) dense matrices related to a mesh cell This is a key structure for bui...
Definition: cs_cdo_local.h:163
Set of data defining an enforcement.
Definition: cs_enforcement.h:85
int stride
Definition: cs_enforcement.h:92
cs_enforcement_type_t type
Definition: cs_enforcement.h:88
cs_real_t * values
Definition: cs_enforcement.h:93
cs_lnum_t n_elts
Definition: cs_enforcement.h:90
cs_enforcement_selection_t selection_type
Definition: cs_enforcement.h:87
cs_lnum_t * elt_ids
Definition: cs_enforcement.h:91