programmer's documentation
cs_cdo_bc.h
Go to the documentation of this file.
1 #ifndef __CS_CDO_BC_H__
2 #define __CS_CDO_BC_H__
3 
4 /*============================================================================
5  * Manage boundary conditions. Produce ready-to-use BC structure from the
6  * user definition.
7  *============================================================================*/
8 
9 /*
10  This file is part of Code_Saturne, a general-purpose CFD tool.
11 
12  Copyright (C) 1998-2015 EDF S.A.
13 
14  This program is free software; you can redistribute it and/or modify it under
15  the terms of the GNU General Public License as published by the Free Software
16  Foundation; either version 2 of the License, or (at your option) any later
17  version.
18 
19  This program is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
21  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
22  details.
23 
24  You should have received a copy of the GNU General Public License along with
25  this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
26  Street, Fifth Floor, Boston, MA 02110-1301, USA.
27 */
28 
29 /*----------------------------------------------------------------------------
30  * Local headers
31  *----------------------------------------------------------------------------*/
32 
33 #include "cs_base.h"
34 
35 #include "cs_param.h"
36 #include "cs_cdo_quantities.h"
37 
38 /*----------------------------------------------------------------------------*/
39 
41 
42 /*============================================================================
43  * Macro definitions
44  *============================================================================*/
45 
46 /*============================================================================
47  * Type definitions
48  *============================================================================*/
49 
50 /* List of entities attached to a type of BC (for instance Dirichlet or Neumann)
51  Two categories are considered
52  First, the entities attached to a non-homogeneous BC, then those attached
53  to a homogeneous BC.
54  Only entities with a non-homogeneous used stride and values items
55 */
56 
57 typedef struct {
58 
60  cs_lnum_t n_nhmg_elts; /* number of non-homogeneous elements */
61 
62  cs_lnum_t *elt_ids; /* size = n_elts */
63  short int *def_ids; /* size = n_nhmg_elts */
64 
66 
67 /* Translation of the user-defined BCs setup into a computable-oriented
68  structure */
69 
70 typedef struct {
71 
73 
74  // Selection of faces
78 
79 } cs_cdo_bc_t;
80 
81 
82 /*============================================================================
83  * Public function prototypes
84  *============================================================================*/
85 
86 /*============================================================================
87  * Public function prototypes
88  *============================================================================*/
89 
90 /*----------------------------------------------------------------------------*/
99 /*----------------------------------------------------------------------------*/
100 
103  cs_lnum_t n_nhmg_elts);
104 
105 /*----------------------------------------------------------------------------*/
113 /*----------------------------------------------------------------------------*/
114 
117 
118 /*----------------------------------------------------------------------------*/
130 /*----------------------------------------------------------------------------*/
131 
132 cs_cdo_bc_t *
133 cs_cdo_bc_init(const cs_param_bc_t *param_bc,
134  cs_lnum_t n_b_faces);
135 
136 /*----------------------------------------------------------------------------*/
144 /*----------------------------------------------------------------------------*/
145 
146 cs_cdo_bc_t *
147 cs_cdo_bc_free(cs_cdo_bc_t *face_bc);
148 
149 /*----------------------------------------------------------------------------*/
161 /*----------------------------------------------------------------------------*/
162 
165  const cs_cdo_bc_t *face_bc);
166 
167 /*----------------------------------------------------------------------------*/
179 /*----------------------------------------------------------------------------*/
180 
181 void
183  double tcur,
184  const void *geom,
185  const cs_param_bc_t *bc,
186  const cs_cdo_bc_list_t *ent_dir,
187  double *dir_val);
188 
189 /*----------------------------------------------------------------------------*/
190 
192 
193 #endif /* __CS_CDO_BC_H__ */
Definition: cs_cdo_bc.h:57
cs_cdo_bc_list_t * rob
Definition: cs_cdo_bc.h:77
#define BEGIN_C_DECLS
Definition: cs_defs.h:419
cs_lnum_t n_b_faces
Definition: cs_cdo_bc.h:72
cs_cdo_bc_list_t * dir
Definition: cs_cdo_bc.h:75
Definition: cs_cdo_bc.h:70
cs_cdo_bc_list_t * neu
Definition: cs_cdo_bc.h:76
cs_cdo_bc_t * cs_cdo_bc_free(cs_cdo_bc_t *face_bc)
Free a cs_cdo_bc_t structure.
Definition: cs_cdo_bc.c:373
Definition: cs_mesh.h:62
cs_cdo_bc_list_t * cs_cdo_bc_list_create(cs_lnum_t n_elts, cs_lnum_t n_nhmg_elts)
Create a cs_cdo_bc_list_t structure.
Definition: cs_cdo_bc.c:98
cs_cdo_bc_list_t * cs_cdo_bc_vtx_dir_create(const cs_mesh_t *m, const cs_cdo_bc_t *face_bc)
Build cs_cdo_bc_list_t structures for Dirichlet BC on primal vertices. When there is a choice between...
Definition: cs_cdo_bc.c:402
cs_cdo_bc_t * cs_cdo_bc_init(const cs_param_bc_t *param_bc, cs_lnum_t n_b_faces)
Prepare the treatment of the boundary conditions. Compile the information detailed in a cs_param_bc_t...
Definition: cs_cdo_bc.c:170
cs_lnum_t n_nhmg_elts
Definition: cs_cdo_bc.h:60
short int * def_ids
Definition: cs_cdo_bc.h:63
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:292
cs_cdo_bc_list_t * cs_cdo_bc_list_free(cs_cdo_bc_list_t *bcl)
Free a cs_cdo_bc_list_t structure.
Definition: cs_cdo_bc.c:141
#define END_C_DECLS
Definition: cs_defs.h:420
void cs_cdo_bc_dirichlet_set(cs_flag_t dof_flag, double tcur, const void *geom, const cs_param_bc_t *bc, const cs_cdo_bc_list_t *ent_dir, double *dir_val)
Set the Dirichlet values to enforce on the corresponding entities.
Definition: cs_cdo_bc.c:503
cs_lnum_t * elt_ids
Definition: cs_cdo_bc.h:62
Definition: cs_param.h:222
unsigned short int cs_flag_t
Definition: cs_cdo.h:50
cs_lnum_t n_elts
Definition: cs_cdo_bc.h:59