TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Domaine_PolyMAC_MPFA.h
1/****************************************************************************
2* Copyright (c) 2025, CEA
3* All rights reserved.
4*
5* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
9*
10* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
11* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
12* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13*
14*****************************************************************************/
15
16#ifndef Domaine_PolyMAC_MPFA_included
17#define Domaine_PolyMAC_MPFA_included
18
19#include <Domaine_PolyMAC_HFV.h>
20
22{
23 Declare_instanciable(Domaine_PolyMAC_MPFA);
24public :
25 void discretiser() override;
26
27 //stencil of the face gradient fgrad: fsten_eb([fsten_d(f), fsten_d(f + 1)[]) -> elements e, boundary faces ne_tot + f
28 void init_stencils() const;
29 mutable IntTab fsten_d, fsten_eb;
30
31 //for a scalar field T at elements, interpolates [n_f.nu.grad T]_f
32 //while exactly preserving fields satisfying [nu grad T]_e = const.
33 //Inputs : N : number of components
34 // is_p : 1 if treating the pressure field (swap Neumann / Dirichlet)
35 // cls : boundary conditions
36 // fcl(f, 0/1/2) : boundary condition data (type, index, local index) (cf. Champ_{P0,Face}_PolyMAC_MPFA)
37 // nu(e, n, ..) : diffusivity at elements (optional)
38 // som_ext : list of vertices to skip (e.g. direct treatment of Echange_Contact in Op_Diff_PolyMAC_MPFA_Elem)
39 // virt : 1 if also wanting flux at virtual faces
40 // full_stencil : 1 if wanting the full stencil (for dimensionner())
41 //Outputs: phif_d(f, 0/1) : indices in phif_{e,c} / phif_{pe,pc} of the flux at f in [phif_d(f, 0/1), phif_d(f + 1, 0/1)[
42 // phif_e(i), phif_c(i, n, c) : local indices/coefficients (no Echange_contact) and diagonal (independent components)
43 void fgrad(int N, int is_p, const Conds_lim& cls, const IntTab& fcl, const DoubleTab *nu, const IntTab *som_ext,
44 int virt, int full_stencil, IntTab& phif_d, IntTab& phif_e, DoubleTab& phif_c) const;
45
46 //MD_Vectors for Champ_Face_PolyMAC_MPFA (faces + d x elems)
48
49protected:
50 mutable int first_fgrad_ = 1; //to print the "MPFA-O MPFA-O(h) VFSYM" message only once per computation
51};
52
53#endif /* Domaine_PolyMAC_MPFA_included */
class Conds_lim This class represents a vector of boundary conditions.
Definition Conds_lim.h:32
void fgrad(int N, int is_p, const Conds_lim &cls, const IntTab &fcl, const DoubleTab *nu, const IntTab *som_ext, int virt, int full_stencil, IntTab &phif_d, IntTab &phif_e, DoubleTab &phif_c) const
Computes field gradient interpolation at faces while preserving constant fields.
void init_stencils() const
Initializes the face stencils for gradient computation.
: This class is an OWN_PTR but the pointed object is shared among multiple
Definition MD_Vector.h:48