My Project
programmer's documentation
cs_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-2019 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 /*----------------------------------------------------------------------------*/
97 /*----------------------------------------------------------------------------*/
98 
99 void
101  short int f,
102  const cs_nvec3_t ax,
103  const cs_nvec3_t ay,
104  const cs_real_t center[3],
105  cs_real_t cov[3]);
106 
107 /*----------------------------------------------------------------------------*/
117 /*----------------------------------------------------------------------------*/
118 
119 void
121  const cs_real_t center[3],
122  cs_real_t inertia[3][3]);
123 
124 /*----------------------------------------------------------------------------*/
138 /*----------------------------------------------------------------------------*/
139 
140 void
141 cs_compute_grd_ve(const short int v1,
142  const short int v2,
143  const cs_nvec3_t deq,
144  const cs_real_3_t uvc[],
145  const cs_real_t lvc[],
146  cs_real_t *grd_v1,
147  cs_real_t *grd_v2);
148 
149 /*----------------------------------------------------------------------------*/
164 /*----------------------------------------------------------------------------*/
165 
166 double
167 cs_compute_fwbs_q1(short int f,
168  const cs_cell_mesh_t *cm,
169  cs_real_t *wvf,
170  cs_real_t *pefc_vol);
171 
172 /*----------------------------------------------------------------------------*/
186 /*----------------------------------------------------------------------------*/
187 
188 void
189 cs_compute_fwbs_q2(short int f,
190  const cs_cell_mesh_t *cm,
191  cs_real_3_t grd_c,
192  cs_real_t *wvf,
193  cs_real_t *pefc_vol);
194 
195 /*----------------------------------------------------------------------------*/
211 /*----------------------------------------------------------------------------*/
212 
213 double
214 cs_compute_fwbs_q3(short int f,
215  const cs_cell_mesh_t *cm,
216  cs_real_3_t grd_c,
217  cs_real_t *wvf,
218  cs_real_t *pefc_vol);
219 
220 /*----------------------------------------------------------------------------*/
221 
223 
224 #endif /* __CS_CDO_SCHEME_GEOMETRY_H__ */
cs_compute_fwbs_q2
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_scheme_geometry.c:587
cs_real_3_t
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:315
END_C_DECLS
#define END_C_DECLS
Definition: cs_defs.h:468
cs_compute_fwbs_q3
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_scheme_geometry.c:630
cs_real_t
double cs_real_t
Floating-point value.
Definition: cs_defs.h:302
BEGIN_C_DECLS
#define BEGIN_C_DECLS
Definition: cs_defs.h:467
cs_math.h
cs_compute_face_covariance_tensor
void cs_compute_face_covariance_tensor(const cs_cell_mesh_t *cm, short int f, const cs_nvec3_t ax, const cs_nvec3_t ay, const cs_real_t center[3], cs_real_t cov[3])
Compute the inertial matrix of a cell with respect to the point called "center". This computation is ...
Definition: cs_scheme_geometry.c:324
cs_nvec3_t::unitv
double unitv[3]
Definition: cs_defs.h:346
cs_quant_t::unitv
double unitv[3]
Definition: cs_cdo_quantities.h:89
cs_compute_grd_ve
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,...
Definition: cs_scheme_geometry.c:500
cs_compute_fwbs_q1
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_scheme_geometry.c:550
cs_math_3_dot_product
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:326
cs_quant_t
Definition: cs_cdo_quantities.h:86
cs_compute_grdfc
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_scheme_geometry.h:69
cs_nvec3_t::meas
double meas
Definition: cs_defs.h:345
cs_nvec3_t
Definition: cs_defs.h:343
cs_cell_mesh_t
Set of local quantities and connectivities related to a mesh cell This is a key structure for all cel...
Definition: cs_cdo_local.h:146
k
Definition: cs_field_pointer.h:70
cs_cdo_local.h
cs_compute_inertia_tensor
void cs_compute_inertia_tensor(const cs_cell_mesh_t *cm, const cs_real_t center[3], cs_real_t inertia[3][3])
Compute the inertial matrix of a cell with respect to the point called "center". This computation is ...
Definition: cs_scheme_geometry.c:396