TrioCFD 1.9.9_beta
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 * Base class for PolyMAC_MPFA diffusion operators.
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 /* face fluxes (excluding 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; // array at boundary faces: (index in op_ext, element index) for faces of type Echange_contact
51 //indices : local elements in 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; //to detect when nu, xh, wh and fgrad need to be recomputed
55
56 /* diffusivity at elements */
57 void update_nu() const override; //update
58
59 /* list of vertices handled directly by the operator and not by 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
Associates the operator with the domaine_dis, the domaine_Cl_dis, and the unknown of its 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.