TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Op_Diff_PolyMAC_MPFA_base.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 Op_Diff_PolyMAC_MPFA_base_included
17#define Op_Diff_PolyMAC_MPFA_base_included
18
19#include <Op_Diff_PolyMAC_CDO_Gen_base.h>
20
21/*! @brief class Op_Diff_PolyMAC_MPFA_base
22 *
23 * Classe de base des operateurs de diffusion PolyMAC_MPFA
24 *
25 */
27{
28 Declare_base(Op_Diff_PolyMAC_MPFA_base);
29public:
30 void completer() override;
31
32 void mettre_a_jour(double t) override;
33
34 /* flux aux faces (hors Echange_contact): cf. Domaine_PolyMAC_MPFA::fgrad */
35 void update_phif(int full_stencil = 0) const;
36
37 inline IntTab& tab_som_ext() { return som_ext; }
38 inline const IntTab& tab_som_ext() const { return som_ext; }
39
40 inline IntTab& tab_phif_d() { return phif_d; }
41 inline const IntTab& tab_phif_d() const { return phif_d; }
42
43 inline IntTab& tab_phif_e() { return phif_e; }
44 inline const IntTab& tab_phif_e() const { return phif_e; }
45
46 inline DoubleTab& tab_phif_c() { return phif_c; }
47 inline const DoubleTab& tab_phif_c() const { return phif_c; }
48
49protected:
50 mutable IntTab pe_ext; // tableau aux faces de bord : (indice dans op_ext, indice d'element) pour les faces de type Echange_contact
51 //indices : elems locaux dans phif_e([phif_d(f), phif_d(f + 1)[)
52 mutable IntTab phif_d, phif_e; //stencils
53 mutable DoubleTab phif_c; //coefficients
54 double t_last_maj_ = -1e10; //pour detecter quand on doit recalculer nu, xh, wh et fgrad
55
56 /* diffusivite aux elems */
57 void update_nu() const override; //mise a jour
58
59 /* liste de sommets traites directement par l'operateur et non par Domaine_PolyMAC_MPFA::fgrad() (cf. Op_Diff_PolyMAC_MPFA_Elem) */
60 mutable IntTab som_ext;
61
62 mutable int s_dist_init_ = 0, som_ext_init_ = 0, phif_a_jour_ = 0;
63};
64
65#endif /* Op_Diff_PolyMAC_MPFA_base_included */
class Op_Diff_PolyMAC_CDO_Gen_base
class Op_Diff_PolyMAC_MPFA_base
void completer() override
Associe l'operateur au domaine_dis, le domaine_Cl_dis, et a l'inconnue de son equation.
const DoubleTab & tab_phif_c() const
void update_phif(int full_stencil=0) const
void mettre_a_jour(double t) override
DOES NOTHING - to override in derived classes.