programmer's documentation
cs_boundary_conditions.h
Go to the documentation of this file.
1 #ifndef __CS_BOUNDARY_CONDITIONS_H__
2 #define __CS_BOUNDARY_CONDITIONS_H__
3 
4 /*============================================================================
5  * Post-processing management
6  *============================================================================*/
7 
8 /*
9  This file is part of Code_Saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2016 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  * Standard C library headers
32  *----------------------------------------------------------------------------*/
33 
34 /*----------------------------------------------------------------------------
35  * Local headers
36  *----------------------------------------------------------------------------*/
37 
38 #include "fvm_nodal.h"
39 #include "fvm_writer.h"
40 
41 #include "cs_base.h"
42 #include "cs_field.h"
43 #include "cs_mesh_location.h"
44 
45 /*----------------------------------------------------------------------------*/
46 
48 
49 /*============================================================================
50  * Macro definitions
51  *============================================================================*/
52 
53 /*============================================================================
54  * Local type definitions
55  *============================================================================*/
56 
57 /*=============================================================================
58  * Global variables
59  *============================================================================*/
60 
61 /*============================================================================
62  * Public Fortran function prototypes
63  *============================================================================*/
64 
65 /*----------------------------------------------------------------------------
66  * Handling of boundary condition definition errors and associated output.
67  *
68  * For each boundary face, itypfb defines the boundary condition type.
69  * As a convention here, zero values correspond to undefined types,
70  * positive values to defined types (with no error), and negative values
71  * to defined types with inconsistent or incompatible values, the
72  * aboslute value indicationg the original boundary condition type.
73  *
74  * Fortran Interface:
75  *
76  * SUBROUTINE BCDERR (ITYPFB)
77  * *****************
78  *
79  * INTEGER ITYPFB : <-> : Array of BC type ids
80  *----------------------------------------------------------------------------*/
81 
82 void CS_PROCF (bcderr, BCDERR)
83 (
85 );
86 
87 /*============================================================================
88  * Public function prototypes
89  *============================================================================*/
90 
91 /*----------------------------------------------------------------------------
92  * Handling of boundary condition definition errors and associated output.
93  *
94  * For each boundary face, bc_type defines the boundary condition type.
95  * As a convention here, zero values correspond to undefined types,
96  * positive values to defined types (with no error), and negative values
97  * to defined types with inconsistent or incompatible values, the
98  * absolute value indicating the original boundary condition type.
99  *
100  * parameters:
101  * bc_type <-- array of BC type ids
102  *----------------------------------------------------------------------------*/
103 
104 void
105 cs_boundary_conditions_error(const cs_int_t bc_type[]);
106 
107 /*----------------------------------------------------------------------------
108  * Locate shifted boundary face coordinates on possibly filtered
109  * cells or boundary faces for later interpolation.
110  *
111  * parameters:
112  * location_type <-- matching values location (CS_MESH_LOCATION_CELLS
113  * or CS_MESH_LOCATION_BOUNDARY_FACES)
114  * n_location_elts <-- number of selected location elements
115  * n_faces <-- number of selected boundary faces
116  * location_elts <-- list of selected location elements (0 to n-1),
117  * or NULL if no indirection is needed
118  * faces <-- list of selected boundary faces (0 to n-1),
119  * or NULL if no indirection is needed
120  * coord_shift <-- array of coordinates shift relative to selected
121  * boundary faces
122  * coord_stride <-- access stride in coord_shift: 0 for uniform
123  * shift, 1 for "per face" shift.
124  * tolerance <-- relative tolerance for point location.
125  *
126  * returns:
127  * associated locator structure
128  *----------------------------------------------------------------------------*/
129 
130 ple_locator_t *
132  cs_lnum_t n_location_elts,
133  cs_lnum_t n_faces,
134  const cs_lnum_t *location_elts,
135  const cs_lnum_t *faces,
136  cs_real_3_t *coord_shift,
137  int coord_stride,
138  double tolerance);
139 
140 /*----------------------------------------------------------------------------
141  * Set mapped boundary conditions for a given field and mapping locator.
142  *
143  * parameters:
144  * field <-- field whose boundary conditions are set
145  * locator <-- associated mapping locator, as returned
146  * by cs_boundary_conditions_map().
147  * location_type <-- matching values location (CS_MESH_LOCATION_CELLS or
148  * CS_MESH_LOCATION_BOUNDARY_FACES)
149  * normalize <-- normalization option:
150  * 0: values are simply mapped
151  * 1: values are mapped, then multiplied
152  * by a constant factor so that their
153  * surface integral on selected faces
154  * is preserved (relative to the
155  * input values)
156  * 2: as 1, but with a boundary-defined
157  * weight, defined by balance_w
158  * 3: as 1, but with a cell-defined
159  * weight, defined by balance_w
160  * interpolate <-- interpolation option:
161  * 0: values are simply based on matching
162  * cell or face center values
163  * 1: values are based on matching cell
164  * or face center values, corrected
165  * by gradient interpolation
166  * n_faces <-- number of selected boundary faces
167  * faces <-- list of selected boundary faces (0 to n-1),
168  * or NULL if no indirection is needed
169  * balance_w <-- optional balance weight, or NULL
170  * nvarcl <-- number of variables requiring BC's
171  * rcodcl <-> boundary condition values
172  *----------------------------------------------------------------------------*/
173 
174 void
176  ple_locator_t *locator,
177  cs_mesh_location_type_t location_type,
178  int normalize,
179  int interpolate,
180  cs_lnum_t n_faces,
181  const cs_lnum_t *faces,
182  cs_real_t *balance_w,
183  int nvarcl,
184  cs_real_t rcodcl[]);
185 
186 /*----------------------------------------------------------------------------*/
187 
189 
190 #endif /* __CS_BOUNDARY_CONDITIONS_H__ */
Field descriptor.
Definition: cs_field.h:99
cs_mesh_location_type_t
Definition: cs_mesh_location.h:60
#define BEGIN_C_DECLS
Definition: cs_defs.h:419
void cs_boundary_conditions_error(const cs_int_t bc_type[])
Definition: cs_boundary_conditions.c:471
int cs_int_t
Fortran-compatible integer.
Definition: cs_defs.h:295
void cs_boundary_conditions_mapped_set(cs_field_t *f, ple_locator_t *locator, cs_mesh_location_type_t location_type, int normalize, int interpolate, cs_lnum_t n_faces, const cs_lnum_t *faces, cs_real_t *balance_w, int nvarcl, cs_real_t rcodcl[])
Set mapped boundary conditions for a given field and mapping locator.
Definition: cs_boundary_conditions.c:830
void bcderr(cs_int_t *itypfb)
Definition: cs_boundary_conditions.c:445
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:307
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:292
integer, dimension(:), allocatable itypfb
Definition: pointe.f90:127
integer(c_int), pointer, save nvarcl
number of variable plus number of turbulent fluxes (used by the boundary conditions) ...
Definition: optcal.f90:651
#define END_C_DECLS
Definition: cs_defs.h:420
double cs_real_t
Definition: cs_defs.h:296
#define CS_PROCF(x, y)
Definition: cs_defs.h:433
ple_locator_t * cs_boundary_conditions_map(cs_mesh_location_type_t location_type, cs_lnum_t n_location_elts, cs_lnum_t n_faces, const cs_lnum_t *location_elts, const cs_lnum_t *faces, cs_real_3_t *coord_shift, int coord_stride, double tolerance)
Locate shifted boundary face coordinates on possibly filtered cells or boundary faces for later inter...
Definition: cs_boundary_conditions.c:670