programmer's documentation
cs_cdo_diffusion.h
Go to the documentation of this file.
1 #ifndef __CS_CDO_DIFFUSION_H__
2 #define __CS_CDO_DIFFUSION_H__
3 
4 /*============================================================================
5  * Build discrete stiffness matrices and handled boundary conditions for the
6  * diffusion term in CDO vertex-based and vertex+cell schemes
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  * Local headers
31  *----------------------------------------------------------------------------*/
32 
33 #include "cs_cdo.h"
34 #include "cs_cdo_bc.h"
35 #include "cs_cdo_connect.h"
36 #include "cs_cdo_local.h"
37 #include "cs_cdo_quantities.h"
38 #include "cs_hodge.h"
39 #include "cs_param.h"
40 
41 /*----------------------------------------------------------------------------*/
42 
44 
45 /*============================================================================
46  * Macro definitions
47  *============================================================================*/
48 
49 /*============================================================================
50  * Type definitions
51  *============================================================================*/
52 
53 /*----------------------------------------------------------------------------*/
67 /*----------------------------------------------------------------------------*/
68 
69 typedef void
71  const cs_cell_mesh_t *cm,
72  const cs_real_3_t mnu,
73  double beta,
75  cs_sdm_t *ntrgrd);
76 
77 /*----------------------------------------------------------------------------*/
86 /*----------------------------------------------------------------------------*/
87 
88 typedef void
90  const cs_real_t *pot,
92  cs_real_t *flx);
93 
94 /*----------------------------------------------------------------------------*/
107 /*----------------------------------------------------------------------------*/
108 
109 typedef void
111  const cs_cell_bc_t *cbc,
112  const cs_cell_mesh_t *cm,
115  cs_cell_builder_t *cb,
116  cs_cell_sys_t *csys);
117 
118 /*============================================================================
119  * Public function prototypes
120  *============================================================================*/
121 
122 /*----------------------------------------------------------------------------*/
136 /*----------------------------------------------------------------------------*/
137 
138 void
140  const cs_cell_mesh_t *cm,
141  const cs_real_3_t pty_nuf,
142  double beta,
143  cs_cell_builder_t *cb,
144  cs_sdm_t *ntrgrd);
145 
146 /*----------------------------------------------------------------------------*/
159 /*----------------------------------------------------------------------------*/
160 
161 void
163  const cs_cell_mesh_t *cm,
164  const cs_real_3_t pty_nuf,
165  double beta,
166  cs_cell_builder_t *cb,
167  cs_sdm_t *ntrgrd);
168 
169 /*----------------------------------------------------------------------------*/
182 /*----------------------------------------------------------------------------*/
183 
184 void
186  const cs_cell_mesh_t *cm,
187  const cs_real_3_t mnu,
188  double beta,
189  cs_cell_builder_t *cb,
190  cs_sdm_t *ntrgrd);
191 
192 /*----------------------------------------------------------------------------*/
205 /*----------------------------------------------------------------------------*/
206 
207 void
209  const cs_cell_bc_t *cbc,
210  const cs_cell_mesh_t *cm,
212  cs_face_mesh_t *fm,
213  cs_cell_builder_t *cb,
214  cs_cell_sys_t *csys);
215 
216 /*----------------------------------------------------------------------------*/
229 /*----------------------------------------------------------------------------*/
230 
231 void
233  const cs_cell_bc_t *cbc,
234  const cs_cell_mesh_t *cm,
236  cs_face_mesh_t *fm,
237  cs_cell_builder_t *cb,
238  cs_cell_sys_t *csys);
239 
240 /*----------------------------------------------------------------------------*/
253 /*----------------------------------------------------------------------------*/
254 
255 void
257  const cs_cell_bc_t *cbc,
258  const cs_cell_mesh_t *cm,
260  cs_face_mesh_t *fm,
261  cs_cell_builder_t *cb,
262  cs_cell_sys_t *csys);
263 
264 /*----------------------------------------------------------------------------*/
276 /*----------------------------------------------------------------------------*/
277 
278 void
280  const double *pot,
281  cs_cell_builder_t *cb,
282  double *flx);
283 
284 /*----------------------------------------------------------------------------*/
296 /*----------------------------------------------------------------------------*/
297 
298 void
300  const double *pot,
301  cs_cell_builder_t *cb,
302  double *flx);
303 
304 /*----------------------------------------------------------------------------*/
316 /*----------------------------------------------------------------------------*/
317 
318 void
320  const cs_real_t *pot,
321  cs_cell_builder_t *cb,
322  cs_real_t *flx);
323 
324 /*----------------------------------------------------------------------------*/
336 /*----------------------------------------------------------------------------*/
337 
338 void
340  const cs_real_t *pot,
341  cs_cell_builder_t *cb,
342  cs_real_t *flx);
343 
344 /*----------------------------------------------------------------------------*/
358 /*----------------------------------------------------------------------------*/
359 
360 double
362  const cs_real_t pty_tens[3][3],
363  const double *p_v,
364  const double p_f,
365  const double p_c,
366  cs_cell_builder_t *cb);
367 
368 /*----------------------------------------------------------------------------*/
369 
371 
372 #endif /* __CS_CDO_DIFFUSION_H__ */
double cs_cdo_diffusion_face_flux(const cs_face_mesh_t *fm, const cs_real_t pty_tens[3][3], const double *p_v, const double p_f, const double p_c, cs_cell_builder_t *cb)
Compute the diffusive flux across a face (based on a subdivision into tetrahedra of the volume p_{f...
Definition: cs_cdo_diffusion.c:963
void() cs_cdo_diffusion_enforce_dir_t(const cs_param_hodge_t h_info, const cs_cell_bc_t *cbc, const cs_cell_mesh_t *cm, cs_cdo_diffusion_flux_trace_t *flux_op, cs_face_mesh_t *fm, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
Take into account Dirichlet BCs by a weak enforcement using Nitsche technique (symmetrized or not) or...
Definition: cs_cdo_diffusion.h:110
void cs_cdo_diffusion_vcost_get_dfbyc_flux(const cs_cell_mesh_t *cm, const double *pot, cs_cell_builder_t *cb, double *flx)
Compute the diffusive flux across dual faces for a given cell Use the COST algo. for computing the di...
Definition: cs_cdo_diffusion.c:744
void cs_cdo_diffusion_pena_dirichlet(const cs_param_hodge_t h_info, const cs_cell_bc_t *cbc, const cs_cell_mesh_t *cm, cs_cdo_diffusion_flux_trace_t *flux_op, cs_face_mesh_t *fm, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
Take into account Dirichlet BCs by a weak enforcement using Nitsche technique (symmetrized or not) or...
Definition: cs_cdo_diffusion.c:688
#define BEGIN_C_DECLS
Definition: cs_defs.h:453
Definition: cs_cdo_local.h:138
void cs_cdo_diffusion_wbs_get_pc_flux(const cs_cell_mesh_t *cm, const cs_real_t *pot, cs_cell_builder_t *cb, cs_real_t *flx)
Compute the diffusive flux inside a given primal cell Use the WBS algo. for approximating the gradien...
Definition: cs_cdo_diffusion.c:927
double precision, dimension(ncharm), save beta
Definition: cpincl.f90:99
void cs_cdo_diffusion_wbs_get_dfbyc_flux(const cs_cell_mesh_t *cm, const cs_real_t *pot, cs_cell_builder_t *cb, cs_real_t *flx)
Compute the diffusive flux across dual faces for a given cell Use the WBS algo. for approximating the...
Definition: cs_cdo_diffusion.c:825
void cs_cdovb_diffusion_wsym_dirichlet(const cs_param_hodge_t h_info, const cs_cell_bc_t *cbc, const cs_cell_mesh_t *cm, cs_cdo_diffusion_flux_trace_t *flux_op, cs_face_mesh_t *fm, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
Take into account Dirichlet BCs by a weak enforcement using Nitsche technique plus a symmetric treatm...
Definition: cs_cdo_diffusion.c:615
double cs_real_t
Floating-point value.
Definition: cs_defs.h:297
Definition: cs_cdo_local.h:94
void cs_cdovb_diffusion_wbs_flux_op(const cs_face_mesh_t *fm, const cs_cell_mesh_t *cm, const cs_real_3_t pty_nuf, double beta, cs_cell_builder_t *cb, cs_sdm_t *ntrgrd)
Compute the normal trace operator for a given border face when a WBS algo. is used for reconstructing...
Definition: cs_cdo_diffusion.c:334
void cs_cdovb_diffusion_weak_dirichlet(const cs_param_hodge_t h_info, const cs_cell_bc_t *cbc, const cs_cell_mesh_t *cm, cs_cdo_diffusion_flux_trace_t *flux_op, cs_face_mesh_t *fm, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
Take into account Dirichlet BCs by a weak enforcement using Nitsche technique.
Definition: cs_cdo_diffusion.c:550
Definition: cs_field_pointer.h:123
void cs_cdo_diffusion_vcost_get_pc_flux(const cs_cell_mesh_t *cm, const double *pot, cs_cell_builder_t *cb, double *flx)
Compute the diffusive flux inside a (primal) cell Use the COST algo. for computing the discrete Hodge...
Definition: cs_cdo_diffusion.c:782
void() cs_cdo_cellwise_diffusion_flux_t(const cs_cell_mesh_t *cm, const cs_real_t *pot, cs_cell_builder_t *cb, cs_real_t *flx)
Cellwise computation of the diffusive flux.
Definition: cs_cdo_diffusion.h:89
void cs_cdovcb_diffusion_flux_op(const cs_face_mesh_t *fm, const cs_cell_mesh_t *cm, const cs_real_3_t pty_nuf, double beta, cs_cell_builder_t *cb, cs_sdm_t *ntrgrd)
Compute the normal trace operator for a given border face when a WBS algo. is used for reconstructing...
Definition: cs_cdo_diffusion.c:225
Definition: cs_cdo_local.h:108
Definition: cs_cdo_local.h:71
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:309
void cs_cdovb_diffusion_cost_flux_op(const cs_face_mesh_t *fm, const cs_cell_mesh_t *cm, const cs_real_3_t mnu, double beta, cs_cell_builder_t *cb, cs_sdm_t *ntrgrd)
Compute the normal trace operator for a given border face when a COST algo. is used for reconstructin...
Definition: cs_cdo_diffusion.c:458
#define END_C_DECLS
Definition: cs_defs.h:454
void() cs_cdo_diffusion_flux_trace_t(const cs_face_mesh_t *fm, const cs_cell_mesh_t *cm, const cs_real_3_t mnu, double beta, cs_cell_builder_t *cb, cs_sdm_t *ntrgrd)
Compute the diffusion flux operator which corresponds to the normal trace operator for a given border...
Definition: cs_cdo_diffusion.h:70
Definition: cs_cdo_local.h:196
Definition: cs_param.h:76