7.1
general 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-2021 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 
40 /*----------------------------------------------------------------------------*/
41 
43 
44 /*============================================================================
45  * Macro definitions
46  *============================================================================*/
47 
48 /*============================================================================
49  * Type definitions
50  *============================================================================*/
51 
52 /*----------------------------------------------------------------------------*/
62 /*----------------------------------------------------------------------------*/
63 
64 typedef void
66  const cs_real_t *pot,
67  const cs_hodge_t *hodge,
69  cs_real_t *flx);
70 
71 /*============================================================================
72  * Public function prototypes
73  *============================================================================*/
74 
75 /*----------------------------------------------------------------------------*/
89 /*----------------------------------------------------------------------------*/
90 
91 void
93  const cs_cell_mesh_t *cm,
95  cs_hodge_t *hodge,
97  cs_cell_sys_t *csys);
98 
99 /*----------------------------------------------------------------------------*/
114 /*----------------------------------------------------------------------------*/
115 
116 void
118  const cs_cell_mesh_t *cm,
120  cs_hodge_t *hodge,
121  cs_cell_builder_t *cb,
122  cs_cell_sys_t *csys);
123 
124 /*----------------------------------------------------------------------------*/
147 /*----------------------------------------------------------------------------*/
148 
149 void
151  const cs_cell_mesh_t *cm,
153  cs_hodge_t *hodge,
154  cs_cell_builder_t *cb,
155  cs_cell_sys_t *csys);
156 
157 /*----------------------------------------------------------------------------*/
181 /*----------------------------------------------------------------------------*/
182 
183 void
185  const cs_cell_mesh_t *cm,
187  cs_hodge_t *hodge,
188  cs_cell_builder_t *cb,
189  cs_cell_sys_t *csys);
190 
191 /*----------------------------------------------------------------------------*/
206 /*----------------------------------------------------------------------------*/
207 
208 void
210  const cs_cell_mesh_t *cm,
212  cs_hodge_t *hodge,
213  cs_cell_builder_t *cb,
214  cs_cell_sys_t *csys);
215 
216 /*----------------------------------------------------------------------------*/
233 /*----------------------------------------------------------------------------*/
234 
235 void
237  const cs_cell_mesh_t *cm,
239  cs_hodge_t *hodge,
240  cs_cell_builder_t *cb,
241  cs_cell_sys_t *csys);
242 
243 /*----------------------------------------------------------------------------*/
258 /*----------------------------------------------------------------------------*/
259 
260 void
262  const cs_cell_mesh_t *cm,
264  cs_hodge_t *hodge,
265  cs_cell_builder_t *cb,
266  cs_cell_sys_t *csys);
267 
268 /*----------------------------------------------------------------------------*/
285 /*----------------------------------------------------------------------------*/
286 
287 void
289  const cs_cell_mesh_t *cm,
291  cs_hodge_t *hodge,
292  cs_cell_builder_t *cb,
293  cs_cell_sys_t *csys);
294 
295 /*----------------------------------------------------------------------------*/
310 /*----------------------------------------------------------------------------*/
311 
312 void
314  const cs_cell_mesh_t *cm,
316  cs_hodge_t *hodge,
317  cs_cell_builder_t *cb,
318  cs_cell_sys_t *csys);
319 
320 /*----------------------------------------------------------------------------*/
334 /*----------------------------------------------------------------------------*/
335 
336 void
338  const cs_cell_mesh_t *cm,
340  cs_hodge_t *hodge,
341  cs_cell_builder_t *cb,
342  cs_cell_sys_t *csys);
343 
344 /*----------------------------------------------------------------------------*/
358 /*----------------------------------------------------------------------------*/
359 
360 void
362  const cs_cell_mesh_t *cm,
364  cs_hodge_t *hodge,
365  cs_cell_builder_t *cb,
366  cs_cell_sys_t *csys);
367 
368 /*----------------------------------------------------------------------------*/
384 /*----------------------------------------------------------------------------*/
385 
386 void
388  const cs_cell_mesh_t *cm,
390  cs_hodge_t *hodge,
391  cs_cell_builder_t *cb,
392  cs_cell_sys_t *csys);
393 
394 /*----------------------------------------------------------------------------*/
409 /*----------------------------------------------------------------------------*/
410 
411 void
413  const cs_cell_mesh_t *cm,
415  cs_hodge_t *hodge,
416  cs_cell_builder_t *cb,
417  cs_cell_sys_t *csys);
418 
419 /*----------------------------------------------------------------------------*/
435 /*----------------------------------------------------------------------------*/
436 
437 void
439  const cs_cell_mesh_t *cm,
441  cs_hodge_t *hodge,
442  cs_cell_builder_t *cb,
443  cs_cell_sys_t *csys);
444 
445 /*----------------------------------------------------------------------------*/
460 /*----------------------------------------------------------------------------*/
461 
462 void
464  const cs_cell_mesh_t *cm,
466  cs_hodge_t *hodge,
467  cs_cell_builder_t *cb,
468  cs_cell_sys_t *csys);
469 
470 /*----------------------------------------------------------------------------*/
486 /*----------------------------------------------------------------------------*/
487 
488 void
490  const cs_cell_mesh_t *cm,
492  cs_hodge_t *hodge,
493  cs_cell_builder_t *cb,
494  cs_cell_sys_t *csys);
495 
496 /*----------------------------------------------------------------------------*/
510 /*----------------------------------------------------------------------------*/
511 
512 void
514  const cs_cell_mesh_t *cm,
516  cs_hodge_t *hodge,
517  cs_cell_builder_t *cb,
518  cs_cell_sys_t *csys);
519 
520 /*----------------------------------------------------------------------------*/
534 /*----------------------------------------------------------------------------*/
535 
536 void
538  const cs_cell_mesh_t *cm,
540  cs_hodge_t *hodge,
541  cs_cell_builder_t *cb,
542  cs_cell_sys_t *csys);
543 
544 /*----------------------------------------------------------------------------*/
559 /*----------------------------------------------------------------------------*/
560 
561 void
563  const cs_cell_mesh_t *cm,
565  cs_hodge_t *hodge,
566  cs_cell_builder_t *cb,
567  cs_cell_sys_t *csys);
568 
569 /*----------------------------------------------------------------------------*/
583 /*----------------------------------------------------------------------------*/
584 
585 void
587  const cs_cell_mesh_t *cm,
589  cs_hodge_t *hodge,
590  cs_cell_builder_t *cb,
591  cs_cell_sys_t *csys);
592 
593 /*----------------------------------------------------------------------------*/
608 /*----------------------------------------------------------------------------*/
609 
610 void
612  const cs_cell_mesh_t *cm,
614  cs_hodge_t *hodge,
615  cs_cell_builder_t *cb,
616  cs_cell_sys_t *csys);
617 
618 /*----------------------------------------------------------------------------*/
634 /*----------------------------------------------------------------------------*/
635 
636 void
638  const double *pot,
639  const cs_hodge_t *hodge,
640  cs_cell_builder_t *cb,
641  double *flx);
642 
643 /*----------------------------------------------------------------------------*/
659 /*----------------------------------------------------------------------------*/
660 
661 void
663  const double *pot,
664  const cs_hodge_t *hodge,
665  cs_cell_builder_t *cb,
666  double *flx);
667 
668 /*----------------------------------------------------------------------------*/
684 /*----------------------------------------------------------------------------*/
685 
686 void
688  const cs_cell_mesh_t *cm,
689  const cs_real_t *pot,
690  const cs_hodge_t *hodge,
691  cs_cell_builder_t *cb,
692  cs_real_t *flux);
693 
694 /*----------------------------------------------------------------------------*/
709 /*----------------------------------------------------------------------------*/
710 
711 void
713  const cs_real_t *pot,
714  const cs_hodge_t *hodge,
715  cs_cell_builder_t *cb,
716  cs_real_t *flx);
717 
718 /*----------------------------------------------------------------------------*/
733 /*----------------------------------------------------------------------------*/
734 
735 void
737  const cs_real_t *pot,
738  const cs_hodge_t *hodge,
739  cs_cell_builder_t *cb,
740  cs_real_t *flx);
741 
742 /*----------------------------------------------------------------------------*/
756 /*----------------------------------------------------------------------------*/
757 
758 void
760  const cs_cell_mesh_t *cm,
761  const cs_real_t *pot,
762  const cs_hodge_t *hodge,
763  cs_cell_builder_t *cb,
764  cs_real_t *flux);
765 
766 /*----------------------------------------------------------------------------*/
780 /*----------------------------------------------------------------------------*/
781 
782 double
784  const cs_real_t pty_tens[3][3],
785  const double *p_v,
786  const double p_f,
787  const double p_c,
788  cs_cell_builder_t *cb);
789 
790 /*----------------------------------------------------------------------------*/
804 /*----------------------------------------------------------------------------*/
805 
806 void
808  const cs_cell_mesh_t *cm,
809  const cs_real_t *pot,
810  const cs_hodge_t *hodge,
811  cs_cell_builder_t *cb,
812  cs_real_t *flux);
813 
814 /*----------------------------------------------------------------------------*/
828 /*----------------------------------------------------------------------------*/
829 
830 void
831 cs_cdovb_diffusion_p0_face_flux(const short int f,
832  const cs_cell_mesh_t *cm,
833  const cs_real_t diff_tensor[3][3],
834  const cs_real_t *pot_values,
835  cs_real_t *fluxes);
836 
837 /*----------------------------------------------------------------------------*/
838 
840 
841 #endif /* __CS_CDO_DIFFUSION_H__ */
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_hodge_t *hodge, 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. Predefined prototype to match the function pointer cs_cdo_enforce_bc_t.
Definition: cs_cdo_diffusion.c:2458
void cs_cdovb_diffusion_p0_face_flux(const short int f, const cs_cell_mesh_t *cm, const cs_real_t diff_tensor[3][3], 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:3487
void cs_cdo_diffusion_svb_get_dfbyc_flux(const cs_cell_mesh_t *cm, const double *pot, const cs_hodge_t *hodge, cs_cell_builder_t *cb, double *flx)
Compute the diffusive flux across dual faces for a given cell. Use the same consistent approximation ...
Definition: cs_cdo_diffusion.c:2908
void cs_cdo_diffusion_sfb_cost_robin(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, cs_hodge_t *hodge, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
Take into account Robin BCs. Case of scalar-valued CDO-Fb schemes with a CO+ST algorithm. Predefined prototype to match the function pointer cs_cdo_enforce_bc_t.
Definition: cs_cdo_diffusion.c:1761
Set of parameters to handle an unsteady convection-diffusion-reaction equation with term sources...
Definition: cs_equation_param.h:177
void cs_cdo_diffusion_wbs_get_cell_flux(const cs_cell_mesh_t *cm, const cs_real_t *pot, const cs_hodge_t *hodge, 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:3206
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_hodge_t *hodge, 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:2561
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:3339
#define BEGIN_C_DECLS
Definition: cs_defs.h:510
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_hodge_t *hodge, 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:2735
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_hodge_t *hodge, 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:1388
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_hodge_t *hodge, 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:1058
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_hodge_t *hodge, 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:1915
Set of local quantities and connectivities related to a mesh cell.
Definition: cs_cdo_local.h:202
void cs_cdo_diffusion_vvb_ocs_sliding(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, cs_hodge_t *hodge, 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 OCS algorithm. Orthogonal splitting between Consistency/Stabilization parts. Predefined prototype to match the function pointer cs_cdo_enforce_bc_t.
Definition: cs_cdo_diffusion.c:2243
Structure associated to a discrete Hodge operator *.
Definition: cs_hodge.h:186
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_hodge_t *hodge, 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:1498
void cs_cdo_diffusion_svb_ocs_weak_dirichlet(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, cs_hodge_t *hodge, 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:2048
void cs_cdo_diffusion_alge_dirichlet(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, cs_hodge_t *hodge, 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:977
double cs_real_t
Floating-point value.
Definition: cs_defs.h:322
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_hodge_t *hodge, 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:1635
void cs_cdo_diffusion_wbs_get_dfbyc_flux(const cs_cell_mesh_t *cm, const cs_real_t *pot, const cs_hodge_t *hodge, 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:3108
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:146
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_hodge_t *hodge, 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:1277
Definition: cs_field_pointer.h:128
void cs_cdo_diffusion_pena_dirichlet(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, cs_hodge_t *hodge, 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 P...
Definition: cs_cdo_diffusion.c:850
void cs_cdo_diffusion_vvb_ocs_weak_dirichlet(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, cs_hodge_t *hodge, 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:2131
void() cs_cdo_diffusion_cw_flux_t(const cs_cell_mesh_t *cm, const cs_real_t *pot, const cs_hodge_t *hodge, cs_cell_builder_t *cb, cs_real_t *flx)
Cellwise computation of the diffusive flux.
Definition: cs_cdo_diffusion.h:65
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_hodge_t *hodge, 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:2816
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_hodge_t *hodge, 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:901
Set of local and temporary buffers.
Definition: cs_cdo_local.h:60
void cs_cdo_diffusion_svb_vbyf_flux(short int f, const cs_cell_mesh_t *cm, const cs_real_t *pot, const cs_hodge_t *hodge, 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:3011
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_hodge_t *hodge, 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. Predefined prototype to match the function pointer cs_cdo_enforce_bc_t.
Definition: cs_cdo_diffusion.c:1829
#define END_C_DECLS
Definition: cs_defs.h:511
void cs_cdo_diffusion_wbs_vbyf_flux(short int f, const cs_cell_mesh_t *cm, const cs_real_t *pot, const cs_hodge_t *hodge, 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:3246
Set of local quantities and connectivities related to a mesh face Structure used to get a better memo...
Definition: cs_cdo_local.h:270
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_hodge_t *hodge, 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:2642
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_hodge_t *hodge, 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:1171
void cs_cdo_diffusion_svb_ocs_wsym_dirichlet(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, cs_hodge_t *hodge, 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:2369
void cs_cdo_diffusion_svb_get_cell_flux(const cs_cell_mesh_t *cm, const double *pot, const cs_hodge_t *hodge, cs_cell_builder_t *cb, double *flx)
Compute the constant approximation of the diffusive flux inside a (primal) cell. Use the same consist...
Definition: cs_cdo_diffusion.c:2954
void cs_cdo_diffusion_sfb_cost_flux(short int f, const cs_cell_mesh_t *cm, const cs_real_t *pot, const cs_hodge_t *hodge, 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:3412