programmer's documentation
cs_cdo_scheme_geometry.h
Go to the documentation of this file.
1 #ifndef __CS_CDO_SCHEME_GEOMETRY_H__
2 #define __CS_CDO_SCHEME_GEOMETRY_H__
3 
4 /*============================================================================
5  * Geometric computations for building discretization operators which is
6  * shared by several files
7  *============================================================================*/
8 
9 /*
10  This file is part of Code_Saturne, a general-purpose CFD tool.
11 
12  Copyright (C) 1998-2018 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  * Standard C library headers
31  *----------------------------------------------------------------------------*/
32 
33 /*----------------------------------------------------------------------------
34  * Local headers
35  *----------------------------------------------------------------------------*/
36 
37 #include "cs_cdo_local.h"
38 #include "cs_math.h"
39 
40 /*----------------------------------------------------------------------------*/
41 
43 
44 /*============================================================================
45  * Macro definitions
46  *============================================================================*/
47 
48 /*============================================================================
49  * Type definitions
50  *============================================================================*/
51 
52 /*=============================================================================
53  * Inline static function prototypes
54  *============================================================================*/
55 
56 /*----------------------------------------------------------------------------*/
66 /*----------------------------------------------------------------------------*/
67 
68 inline static void
69 cs_compute_grdfc(const short int f_sgn,
70  const cs_quant_t pfq,
71  const cs_nvec3_t deq,
72  cs_real_t *grd_c)
73 {
74  const double hfc = cs_math_3_dot_product(pfq.unitv, deq.unitv) * deq.meas;
75  const cs_real_t ohf = -f_sgn/hfc;
76 
77  for (int k = 0; k < 3; k++) grd_c[k] = ohf * pfq.unitv[k];
78 }
79 
80 /*============================================================================
81  * Public function prototypes
82  *============================================================================*/
83 
84 /*----------------------------------------------------------------------------*/
98 /*----------------------------------------------------------------------------*/
99 
100 void
101 cs_compute_grd_ve(const short int v1,
102  const short int v2,
103  const cs_nvec3_t deq,
104  const cs_real_3_t uvc[],
105  const cs_real_t lvc[],
106  cs_real_t *grd_v1,
107  cs_real_t *grd_v2);
108 
109 /*----------------------------------------------------------------------------*/
124 /*----------------------------------------------------------------------------*/
125 
126 double
127 cs_compute_fwbs_q1(short int f,
128  const cs_cell_mesh_t *cm,
129  cs_real_t *wvf,
130  cs_real_t *pefc_vol);
131 
132 /*----------------------------------------------------------------------------*/
146 /*----------------------------------------------------------------------------*/
147 
148 void
149 cs_compute_fwbs_q2(short int f,
150  const cs_cell_mesh_t *cm,
151  cs_real_3_t grd_c,
152  cs_real_t *wvf,
153  cs_real_t *pefc_vol);
154 
155 /*----------------------------------------------------------------------------*/
171 /*----------------------------------------------------------------------------*/
172 
173 double
174 cs_compute_fwbs_q3(short int f,
175  const cs_cell_mesh_t *cm,
176  cs_real_3_t grd_c,
177  cs_real_t *wvf,
178  cs_real_t *pefc_vol);
179 
180 /*----------------------------------------------------------------------------*/
181 
183 
184 #endif /* __CS_CDO_SCHEME_GEOMETRY_H__ */
Definition: cs_field_pointer.h:70
static cs_real_t cs_math_3_dot_product(const cs_real_t u[3], const cs_real_t v[3])
Compute the dot product of two vectors of 3 real values.
Definition: cs_math.h:154
void cs_compute_grd_ve(const short int v1, const short int v2, const cs_nvec3_t deq, const cs_real_3_t uvc[], const cs_real_t lvc[], cs_real_t *grd_v1, cs_real_t *grd_v2)
Compute the gradient of a Lagrange hat function related to primal vertices in a p_{ef,c} subvolume of a cell c where e is an edge belonging to the face f with vertices v1 and v2.
Definition: cs_cdo_scheme_geometry.c:127
double cs_compute_fwbs_q3(short int f, const cs_cell_mesh_t *cm, cs_real_3_t grd_c, cs_real_t *wvf, cs_real_t *pefc_vol)
Compute for a face the weight related to each vertex w_{v,f} This weight is equal to |dc(v) cap f|/|f...
Definition: cs_cdo_scheme_geometry.c:257
#define BEGIN_C_DECLS
Definition: cs_defs.h:451
Definition: cs_cdo_local.h:132
double cs_real_t
Floating-point value.
Definition: cs_defs.h:297
Definition: cs_cdo.h:140
double cs_compute_fwbs_q1(short int f, const cs_cell_mesh_t *cm, cs_real_t *wvf, cs_real_t *pefc_vol)
Compute for a face the weight related to each vertex w_{v,f} This weight is equal to |dc(v) cap f|/|f...
Definition: cs_cdo_scheme_geometry.c:177
double meas
Definition: cs_cdo.h:142
static void cs_compute_grdfc(const short int f_sgn, const cs_quant_t pfq, const cs_nvec3_t deq, cs_real_t *grd_c)
Compute the value of the constant gradient of the Lagrange function attached to xc in p_{f...
Definition: cs_cdo_scheme_geometry.h:69
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:309
double unitv[3]
Definition: cs_cdo.h:143
Definition: cs_cdo_quantities.h:81
double unitv[3]
Definition: cs_cdo_quantities.h:84
void cs_compute_fwbs_q2(short int f, const cs_cell_mesh_t *cm, cs_real_3_t grd_c, cs_real_t *wvf, cs_real_t *pefc_vol)
Compute for a face the weight related to each vertex w_{v,f} This weight is equal to |dc(v) cap f|/|f...
Definition: cs_cdo_scheme_geometry.c:214
#define END_C_DECLS
Definition: cs_defs.h:452