My Project
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-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  * 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_equation_param.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 /*----------------------------------------------------------------------------*/
62 /*----------------------------------------------------------------------------*/
63 
64 typedef void
66  const cs_real_t *pot,
68  cs_real_t *flx);
69 
70 /*============================================================================
71  * Public function prototypes
72  *============================================================================*/
73 
74 /*----------------------------------------------------------------------------*/
85 /*----------------------------------------------------------------------------*/
86 
87 void
89  const cs_cell_mesh_t *cm,
92  cs_cell_sys_t *csys);
93 
94 /*----------------------------------------------------------------------------*/
106 /*----------------------------------------------------------------------------*/
107 
108 void
110  const cs_cell_mesh_t *cm,
112  cs_cell_builder_t *cb,
113  cs_cell_sys_t *csys);
114 
115 /*----------------------------------------------------------------------------*/
135 /*----------------------------------------------------------------------------*/
136 
137 void
139  const cs_cell_mesh_t *cm,
141  cs_cell_builder_t *cb,
142  cs_cell_sys_t *csys);
143 
144 /*----------------------------------------------------------------------------*/
165 /*----------------------------------------------------------------------------*/
166 
167 void
169  const cs_cell_mesh_t *cm,
171  cs_cell_builder_t *cb,
172  cs_cell_sys_t *csys);
173 
174 /*----------------------------------------------------------------------------*/
186 /*----------------------------------------------------------------------------*/
187 
188 void
190  const cs_cell_mesh_t *cm,
192  cs_cell_builder_t *cb,
193  cs_cell_sys_t *csys);
194 
195 /*----------------------------------------------------------------------------*/
209 /*----------------------------------------------------------------------------*/
210 
211 void
213  const cs_cell_mesh_t *cm,
215  cs_cell_builder_t *cb,
216  cs_cell_sys_t *csys);
217 
218 /*----------------------------------------------------------------------------*/
230 /*----------------------------------------------------------------------------*/
231 
232 void
234  const cs_cell_mesh_t *cm,
236  cs_cell_builder_t *cb,
237  cs_cell_sys_t *csys);
238 
239 /*----------------------------------------------------------------------------*/
253 /*----------------------------------------------------------------------------*/
254 
255 void
257  const cs_cell_mesh_t *cm,
259  cs_cell_builder_t *cb,
260  cs_cell_sys_t *csys);
261 
262 /*----------------------------------------------------------------------------*/
274 /*----------------------------------------------------------------------------*/
275 
276 void
278  const cs_cell_mesh_t *cm,
280  cs_cell_builder_t *cb,
281  cs_cell_sys_t *csys);
282 
283 /*----------------------------------------------------------------------------*/
294 /*----------------------------------------------------------------------------*/
295 
296 void
298  const cs_cell_mesh_t *cm,
300  cs_cell_builder_t *cb,
301  cs_cell_sys_t *csys);
302 
303 /*----------------------------------------------------------------------------*/
314 /*----------------------------------------------------------------------------*/
315 
316 void
318  const cs_cell_mesh_t *cm,
320  cs_cell_builder_t *cb,
321  cs_cell_sys_t *csys);
322 
323 /*----------------------------------------------------------------------------*/
336 /*----------------------------------------------------------------------------*/
337 
338 void
340  const cs_cell_mesh_t *cm,
342  cs_cell_builder_t *cb,
343  cs_cell_sys_t *csys);
344 
345 /*----------------------------------------------------------------------------*/
356 /*----------------------------------------------------------------------------*/
357 
358 void
360  const cs_cell_mesh_t *cm,
362  cs_cell_builder_t *cb,
363  cs_cell_sys_t *csys);
364 
365 /*----------------------------------------------------------------------------*/
378 /*----------------------------------------------------------------------------*/
379 
380 void
382  const cs_cell_mesh_t *cm,
384  cs_cell_builder_t *cb,
385  cs_cell_sys_t *csys);
386 
387 /*----------------------------------------------------------------------------*/
398 /*----------------------------------------------------------------------------*/
399 
400 void
402  const cs_cell_mesh_t *cm,
404  cs_cell_builder_t *cb,
405  cs_cell_sys_t *csys);
406 
407 /*----------------------------------------------------------------------------*/
419 /*----------------------------------------------------------------------------*/
420 
421 void
423  const cs_cell_mesh_t *cm,
425  cs_cell_builder_t *cb,
426  cs_cell_sys_t *csys);
427 
428 /*----------------------------------------------------------------------------*/
439 /*----------------------------------------------------------------------------*/
440 
441 void
443  const cs_cell_mesh_t *cm,
445  cs_cell_builder_t *cb,
446  cs_cell_sys_t *csys);
447 
448 /*----------------------------------------------------------------------------*/
460 /*----------------------------------------------------------------------------*/
461 
462 void
464  const cs_cell_mesh_t *cm,
466  cs_cell_builder_t *cb,
467  cs_cell_sys_t *csys);
468 
469 /*----------------------------------------------------------------------------*/
480 /*----------------------------------------------------------------------------*/
481 
482 void
484  const cs_cell_mesh_t *cm,
486  cs_cell_builder_t *cb,
487  cs_cell_sys_t *csys);
488 
489 /*----------------------------------------------------------------------------*/
501 /*----------------------------------------------------------------------------*/
502 
503 void
505  const cs_cell_mesh_t *cm,
507  cs_cell_builder_t *cb,
508  cs_cell_sys_t *csys);
509 
510 /*----------------------------------------------------------------------------*/
523 /*----------------------------------------------------------------------------*/
524 
525 void
527  const double *pot,
528  cs_cell_builder_t *cb,
529  double *flx);
530 
531 /*----------------------------------------------------------------------------*/
543 /*----------------------------------------------------------------------------*/
544 
545 void
547  const double *pot,
548  cs_cell_builder_t *cb,
549  double *flx);
550 
551 /*----------------------------------------------------------------------------*/
564 /*----------------------------------------------------------------------------*/
565 
566 void
568  const cs_equation_param_t *eqp,
569  const cs_cell_mesh_t *cm,
570  const cs_real_t *pot,
571  cs_cell_builder_t *cb,
572  cs_real_t *flux);
573 
574 /*----------------------------------------------------------------------------*/
586 /*----------------------------------------------------------------------------*/
587 
588 void
590  const cs_real_t *pot,
591  cs_cell_builder_t *cb,
592  cs_real_t *flx);
593 
594 /*----------------------------------------------------------------------------*/
606 /*----------------------------------------------------------------------------*/
607 
608 void
610  const cs_real_t *pot,
611  cs_cell_builder_t *cb,
612  cs_real_t *flx);
613 
614 /*----------------------------------------------------------------------------*/
628 /*----------------------------------------------------------------------------*/
629 
630 void
632  const cs_equation_param_t *eqp,
633  const cs_cell_mesh_t *cm,
634  const cs_real_t *pot,
635  cs_cell_builder_t *cb,
636  cs_real_t *flux);
637 
638 /*----------------------------------------------------------------------------*/
652 /*----------------------------------------------------------------------------*/
653 
654 double
656  const cs_real_t pty_tens[3][3],
657  const double *p_v,
658  const double p_f,
659  const double p_c,
660  cs_cell_builder_t *cb);
661 
662 /*----------------------------------------------------------------------------*/
676 /*----------------------------------------------------------------------------*/
677 
678 void
680  const cs_equation_param_t *eqp,
681  const cs_cell_mesh_t *cm,
682  const cs_real_t *pot,
683  cs_cell_builder_t *cb,
684  cs_real_t *flux);
685 
686 /*----------------------------------------------------------------------------*/
700 /*----------------------------------------------------------------------------*/
701 
702 void
703 cs_cdovb_diffusion_p0_face_flux(const short int f,
704  const cs_cell_mesh_t *cm,
705  const cs_real_3_t *diff_tensor,
706  const cs_real_t *pot_values,
707  cs_real_t *fluxes);
708 
709 /*----------------------------------------------------------------------------*/
710 
712 
713 #endif /* __CS_CDO_DIFFUSION_H__ */
cs_cdo_diffusion_svb_cost_vbyf_flux
void cs_cdo_diffusion_svb_cost_vbyf_flux(short int f, const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_real_t *pot, cs_cell_builder_t *cb, cs_real_t *flux)
Compute the normal flux for a face assuming only the knowledge of the potential at cell vertices....
Definition: cs_cdo_diffusion.c:2799
cs_cdo_diffusion_alge_block_dirichlet
void cs_cdo_diffusion_alge_block_dirichlet(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
Take into account Dirichlet BCs by keeping the DoFs related to Dirichlet BCs in the algebraic system ...
Definition: cs_cdo_diffusion.c:1041
cs_cdo_diffusion_svb_cost_get_cell_flux
void cs_cdo_diffusion_svb_cost_get_cell_flux(const cs_cell_mesh_t *cm, const double *pot, cs_cell_builder_t *cb, double *flx)
Compute the constant approximation of the diffusive flux inside a (primal) cell. Use the CO+ST algo....
Definition: cs_cdo_diffusion.c:2755
fm
Definition: cs_field_pointer.h:134
cs_real_3_t
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:315
cs_cdo_diffusion_sfb_cost_flux
void cs_cdo_diffusion_sfb_cost_flux(short int f, const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_real_t *pot, cs_cell_builder_t *cb, cs_real_t *flux)
Compute the normal diffusive flux for a face assuming only the knowledge of the potential at faces an...
Definition: cs_cdo_diffusion.c:3201
cs_face_mesh_t
Set of local quantities and connectivities related to a mesh face Structure used to get a better memo...
Definition: cs_cdo_local.h:212
END_C_DECLS
#define END_C_DECLS
Definition: cs_defs.h:468
cs_cdo_diffusion_sfb_weak_dirichlet
void cs_cdo_diffusion_sfb_weak_dirichlet(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, 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. Case of scalar-valued ...
Definition: cs_cdo_diffusion.c:1149
cs_cdo_diffusion_svb_cost_wsym_dirichlet
void cs_cdo_diffusion_svb_cost_wsym_dirichlet(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, 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:2220
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_cdo_diffusion_cw_flux_t
void() cs_cdo_diffusion_cw_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:65
cs_cdo_diffusion_vcb_wsym_dirichlet
void cs_cdo_diffusion_vcb_wsym_dirichlet(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, 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:2630
cs_cdo_bc.h
cs_cdo_diffusion_svb_wbs_weak_dirichlet
void cs_cdo_diffusion_svb_wbs_weak_dirichlet(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, 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. Case of CDO-Vb schemes...
Definition: cs_cdo_diffusion.c:2398
cs_cdo_diffusion_svb_cost_robin
void cs_cdo_diffusion_svb_cost_robin(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
Take into account Robin BCs. Case of scalar-valued CDO-Vb schemes with a CO+ST algorithm.
Definition: cs_cdo_diffusion.c:1710
cs_cdo_quantities.h
cs_cdo_diffusion_pena_block_dirichlet
void cs_cdo_diffusion_pena_block_dirichlet(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, 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:894
cs_cdo_diffusion_vvb_cost_sliding
void cs_cdo_diffusion_vvb_cost_sliding(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
Take into account a sliding BCs. Case of vector-valued CDO-Vb schemes with a CO+ST algorithm.
Definition: cs_cdo_diffusion.c:2102
cs_cdovb_diffusion_p0_face_flux
void cs_cdovb_diffusion_p0_face_flux(const short int f, const cs_cell_mesh_t *cm, const cs_real_3_t *diff_tensor, const cs_real_t *pot_values, cs_real_t *fluxes)
Compute the normal flux for a face assuming only the knowledge of the potential at cell vertices....
Definition: cs_cdo_diffusion.c:3273
cs_cdo_diffusion_svb_wbs_robin
void cs_cdo_diffusion_svb_wbs_robin(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
Take into account Robin BCs. Case of scalar-valued CDO-Vb schemes with a WBS algorithm.
Definition: cs_cdo_diffusion.c:2301
cs_equation_param_t
Set of parameters to handle an unsteady convection-diffusion-reaction equation with term sources.
Definition: cs_equation_param.h:148
cs_cdo_diffusion_vfb_wsym_sliding
void cs_cdo_diffusion_vfb_wsym_sliding(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
Take into account sliding BCs by a weak enforcement using Nitsche technique plus a symmetric treatmen...
Definition: cs_cdo_diffusion.c:1588
cs_cdo_diffusion_wbs_vbyf_flux
void cs_cdo_diffusion_wbs_vbyf_flux(short int f, const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_real_t *pot, cs_cell_builder_t *cb, cs_real_t *flux)
Compute the normal flux for a face assuming only the knowledge of the potential at cell vertices (and...
Definition: cs_cdo_diffusion.c:3028
cs_hodge.h
cs_cdo_diffusion_wbs_face_flux
double cs_cdo_diffusion_wbs_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:3126
cs_cdo_diffusion_wbs_get_cell_flux
void cs_cdo_diffusion_wbs_get_cell_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:2992
cs_cdo_diffusion_sfb_wsym_dirichlet
void cs_cdo_diffusion_sfb_wsym_dirichlet(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, 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:1348
cs_cdo_diffusion_svb_cost_generic
void cs_cdo_diffusion_svb_cost_generic(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
Take into account generic BCs by a weak enforcement using Nitsche technique. According to the setting...
Definition: cs_cdo_diffusion.c:1801
cs_cell_builder_t
Set of local and temporary buffers useful for building the algebraic system with a cellwise process....
Definition: cs_cdo_local.h:56
cs_cdo_connect.h
cs_cdo_diffusion_vfb_wsym_dirichlet
void cs_cdo_diffusion_vfb_wsym_dirichlet(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, 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:1454
cs_cdo_diffusion_vfb_weak_dirichlet
void cs_cdo_diffusion_vfb_weak_dirichlet(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, 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. Case of vector-valued ...
Definition: cs_cdo_diffusion.c:1241
cs_cdo_diffusion_vvb_cost_weak_dirichlet
void cs_cdo_diffusion_vvb_cost_weak_dirichlet(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, 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. A Dirichlet is set for...
Definition: cs_cdo_diffusion.c:2000
cs_cdo_diffusion_alge_dirichlet
void cs_cdo_diffusion_alge_dirichlet(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
Take into account Dirichlet BCs by keeping the DoFs related to Dirichlet BCs in the algebraic system ...
Definition: cs_cdo_diffusion.c:965
cs_cdo_diffusion_svb_wbs_wsym_dirichlet
void cs_cdo_diffusion_svb_wbs_wsym_dirichlet(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, 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:2472
cs_equation_param.h
Structure and routines handling the specific settings related to a cs_equation_t structure.
cs_cdo_diffusion_svb_cost_weak_dirichlet
void cs_cdo_diffusion_svb_cost_weak_dirichlet(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, 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. Case of CDO-Vb schemes...
Definition: cs_cdo_diffusion.c:1924
cs_cell_sys_t
Set of arrays and local (small) dense matrices related to a mesh cell This is a key structure for bui...
Definition: cs_cdo_local.h:93
cs_cdo_diffusion_svb_cost_get_dfbyc_flux
void cs_cdo_diffusion_svb_cost_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 The discrete Hodge operator has been pr...
Definition: cs_cdo_diffusion.c:2716
cs_cdo_diffusion_vcb_weak_dirichlet
void cs_cdo_diffusion_vcb_weak_dirichlet(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, 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. Case of CDO-VCb scheme...
Definition: cs_cdo_diffusion.c:2556
cs_cdo_diffusion_wbs_get_dfbyc_flux
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:2890
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
cs_cdo_diffusion_pena_dirichlet
void cs_cdo_diffusion_pena_dirichlet(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, 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:848
cs_param.h
cs_cdo_local.h