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_bc.h"
34 #include "cs_cdo_connect.h"
35 #include "cs_cdo_local.h"
36 #include "cs_cdo_quantities.h"
37 #include "cs_hodge.h"
38 #include "cs_param.h"
39 
40 /*----------------------------------------------------------------------------*/
41 
43 
44 /*============================================================================
45  * Macro definitions
46  *============================================================================*/
47 
48 /*============================================================================
49  * Type definitions
50  *============================================================================*/
51 
52 /*----------------------------------------------------------------------------*/
66 /*----------------------------------------------------------------------------*/
67 
68 typedef void
70  const cs_cell_mesh_t *cm,
71  const cs_real_3_t mnu,
72  double beta,
74  cs_sdm_t *ntrgrd);
75 
76 /*----------------------------------------------------------------------------*/
85 /*----------------------------------------------------------------------------*/
86 
87 typedef void
89  const cs_real_t *pot,
91  cs_real_t *flx);
92 
93 /*----------------------------------------------------------------------------*/
105 /*----------------------------------------------------------------------------*/
106 
107 typedef void
109  const cs_cell_mesh_t *cm,
112  cs_cell_builder_t *cb,
113  cs_cell_sys_t *csys);
114 
115 /*============================================================================
116  * Public function prototypes
117  *============================================================================*/
118 
119 /*----------------------------------------------------------------------------*/
133 /*----------------------------------------------------------------------------*/
134 
135 void
137  const cs_cell_mesh_t *cm,
138  const cs_real_3_t pty_nuf,
139  double beta,
140  cs_cell_builder_t *cb,
141  cs_sdm_t *ntrgrd);
142 
143 /*----------------------------------------------------------------------------*/
156 /*----------------------------------------------------------------------------*/
157 
158 void
160  const cs_cell_mesh_t *cm,
161  const cs_real_3_t pty_nuf,
162  double beta,
163  cs_cell_builder_t *cb,
164  cs_sdm_t *ntrgrd);
165 
166 /*----------------------------------------------------------------------------*/
179 /*----------------------------------------------------------------------------*/
180 
181 void
183  const cs_cell_mesh_t *cm,
184  const cs_real_3_t mnu,
185  double beta,
186  cs_cell_builder_t *cb,
187  cs_sdm_t *ntrgrd);
188 
189 /*----------------------------------------------------------------------------*/
201 /*----------------------------------------------------------------------------*/
202 
203 void
205  const cs_cell_mesh_t *cm,
207  cs_face_mesh_t *fm,
208  cs_cell_builder_t *cb,
209  cs_cell_sys_t *csys);
210 
211 /*----------------------------------------------------------------------------*/
224 /*----------------------------------------------------------------------------*/
225 
226 void
228  const cs_cell_mesh_t *cm,
230  cs_face_mesh_t *fm,
231  cs_cell_builder_t *cb,
232  cs_cell_sys_t *csys);
233 
234 /*----------------------------------------------------------------------------*/
246 /*----------------------------------------------------------------------------*/
247 
248 void
250  const cs_cell_mesh_t *cm,
252  cs_face_mesh_t *fm,
253  cs_cell_builder_t *cb,
254  cs_cell_sys_t *csys);
255 
256 /*----------------------------------------------------------------------------*/
268 /*----------------------------------------------------------------------------*/
269 
270 void
272  const cs_cell_mesh_t *cm,
274  cs_face_mesh_t *fm,
275  cs_cell_builder_t *cb,
276  cs_cell_sys_t *csys);
277 
278 /*----------------------------------------------------------------------------*/
290 /*----------------------------------------------------------------------------*/
291 
292 void
294  const double *pot,
295  cs_cell_builder_t *cb,
296  double *flx);
297 
298 /*----------------------------------------------------------------------------*/
310 /*----------------------------------------------------------------------------*/
311 
312 void
314  const double *pot,
315  cs_cell_builder_t *cb,
316  double *flx);
317 
318 /*----------------------------------------------------------------------------*/
330 /*----------------------------------------------------------------------------*/
331 
332 void
334  const cs_real_t *pot,
335  cs_cell_builder_t *cb,
336  cs_real_t *flx);
337 
338 /*----------------------------------------------------------------------------*/
350 /*----------------------------------------------------------------------------*/
351 
352 void
354  const cs_real_t *pot,
355  cs_cell_builder_t *cb,
356  cs_real_t *flx);
357 
358 /*----------------------------------------------------------------------------*/
372 /*----------------------------------------------------------------------------*/
373 
374 double
376  const cs_real_t pty_tens[3][3],
377  const double *p_v,
378  const double p_f,
379  const double p_c,
380  cs_cell_builder_t *cb);
381 
382 /*----------------------------------------------------------------------------*/
383 
385 
386 #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:1011
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:792
#define BEGIN_C_DECLS
Definition: cs_defs.h:461
void cs_cdovb_diffusion_weak_dirichlet(const cs_param_hodge_t h_info, 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:547
Definition: cs_cdo_local.h:133
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:975
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:873
double cs_real_t
Floating-point value.
Definition: cs_defs.h:297
void cs_cdo_diffusion_pena_dirichlet(const cs_param_hodge_t h_info, 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:674
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:332
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:830
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:88
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:223
void cs_cdovb_diffusion_wsym_dirichlet(const cs_param_hodge_t h_info, 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:606
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_cdo_diffusion_pena_block_dirichlet(const cs_param_hodge_t h_info, 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 by a penalization technique with a huge value...
Definition: cs_cdo_diffusion.c:726
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:456
void() cs_cdo_diffusion_enforce_dir_t(const cs_param_hodge_t h_info, 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:108
#define END_C_DECLS
Definition: cs_defs.h:462
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:69
Definition: cs_cdo_local.h:191
Definition: cs_param_cdo.h:97