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 #include "cs_time_step.h"
35 
36 #include "cs_param.h"
37 #include "cs_cdo_quantities.h"
38 
39 /*----------------------------------------------------------------------------*/
40 
42 
43 /*============================================================================
44  * Macro definitions
45  *============================================================================*/
46 
47 /*============================================================================
48  * Type definitions
49  *============================================================================*/
50 
51 /* List of entities attached to a type of BC (for instance Dirichlet or Neumann)
52  Two categories are considered
53  First, the entities attached to a non-homogeneous BC, then those attached
54  to a homogeneous BC.
55  Only entities with a non-homogeneous used stride and values items
56 */
57 
58 typedef struct {
59 
61  cs_lnum_t n_nhmg_elts; /* number of non-homogeneous elements */
62 
63  cs_lnum_t *elt_ids; /* size = n_elts */
64  short int *def_ids; /* size = n_nhmg_elts */
65 
67 
68 /* Translation of the user-defined BCs setup into a computable-oriented
69  structure */
70 
71 typedef struct {
72 
74 
75  // Selection of faces
79 
80 } cs_cdo_bc_t;
81 
82 
83 /*============================================================================
84  * Public function prototypes
85  *============================================================================*/
86 
87 /*============================================================================
88  * Public function prototypes
89  *============================================================================*/
90 
91 /*----------------------------------------------------------------------------*/
100 /*----------------------------------------------------------------------------*/
101 
104  cs_lnum_t n_nhmg_elts);
105 
106 /*----------------------------------------------------------------------------*/
114 /*----------------------------------------------------------------------------*/
115 
118 
119 /*----------------------------------------------------------------------------*/
131 /*----------------------------------------------------------------------------*/
132 
133 cs_cdo_bc_t *
134 cs_cdo_bc_init(const cs_param_bc_t *param_bc,
135  cs_lnum_t n_b_faces);
136 
137 /*----------------------------------------------------------------------------*/
145 /*----------------------------------------------------------------------------*/
146 
147 cs_cdo_bc_t *
148 cs_cdo_bc_free(cs_cdo_bc_t *face_bc);
149 
150 /*----------------------------------------------------------------------------*/
162 /*----------------------------------------------------------------------------*/
163 
166  const cs_cdo_bc_t *face_bc);
167 
168 /*----------------------------------------------------------------------------*/
179 /*----------------------------------------------------------------------------*/
180 
181 void
183  const cs_time_step_t *time_step,
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__ */
time step descriptor
Definition: cs_time_step.h:51
Definition: cs_cdo_bc.h:58
cs_cdo_bc_list_t * rob
Definition: cs_cdo_bc.h:78
void cs_cdo_bc_dirichlet_set(cs_flag_t dof_flag, const cs_time_step_t *time_step, 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:502
#define BEGIN_C_DECLS
Definition: cs_defs.h:429
cs_lnum_t n_b_faces
Definition: cs_cdo_bc.h:73
cs_cdo_bc_list_t * dir
Definition: cs_cdo_bc.h:76
Definition: cs_cdo_bc.h:71
cs_cdo_bc_list_t * neu
Definition: cs_cdo_bc.h:77
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:61
short int * def_ids
Definition: cs_cdo_bc.h:64
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:430
cs_lnum_t * elt_ids
Definition: cs_cdo_bc.h:63
Definition: cs_param.h:294
unsigned short int cs_flag_t
Definition: cs_cdo.h:50
cs_lnum_t n_elts
Definition: cs_cdo_bc.h:60