TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Op_Diff_PolyMAC_HFV_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_HFV_base_included
17#define Op_Diff_PolyMAC_HFV_base_included
18
19#include <Op_Diff_PolyMAC_CDO_Gen_base.h>
20
21/*! @brief class Op_Diff_PolyMAC_HFV_base
22 *
23 * Base class for PolyMAC_HFV diffusion operators.
24 *
25 *
26 */
28{
29 Declare_base(Op_Diff_PolyMAC_HFV_base);
30public:
31 void completer() override;
32
33 void mettre_a_jour(double t) override;
34
35 /* extended versions of dimensionner/ajouter_blocs allowing treatment of auxiliary variables only */
36 virtual void dimensionner_blocs_ext(int aux_only, matrices_t matrices, const tabs_t& semi_impl = { }) const = 0;
37 virtual void ajouter_blocs_ext(int aux_only, matrices_t matrices, DoubleTab& secmem, const tabs_t& semi_impl = { }) const = 0;
38
39 /* implementations of dimensionner/ajouter_blocs from these methods */
40 int has_interface_blocs() const override { return 1; }
41
42 void dimensionner_blocs(matrices_t matrices, const tabs_t& semi_impl = { }) const override
43 {
44 dimensionner_blocs_ext(0, matrices, semi_impl);
45 }
46
47 void ajouter_blocs(matrices_t matrices, DoubleTab& secmem, const tabs_t& semi_impl = { }) const override
48 {
49 ajouter_blocs_ext(0, matrices, secmem, semi_impl);
50 }
51
52 void update_nu() const override; //update
53
54protected:
55 double t_last_nu_ = -1e10; //to detect when nu and auxiliary variables need to be recomputed
56
57 /* management of auxiliary variables in semi-implicit mode */
58 void update_aux(double t) const;
59 mutable double t_last_aux_ = -1e10; /* last time at which they were computed */
60 mutable int use_aux_ = 0; /* whether auxiliary variables are stored in var_aux */
61 mutable Matrice_Bloc mat_aux; /* system to solve: mat.var_aux = secmem */
62 mutable DoubleTab var_aux;
63 mutable SolveurSys solv_aux; //solver
64};
65
66#endif /* Op_Diff_PolyMAC_HFV_base_included */
class Op_Diff_PolyMAC_CDO_Gen_base
class Op_Diff_PolyMAC_HFV_base
virtual void ajouter_blocs_ext(int aux_only, matrices_t matrices, DoubleTab &secmem, const tabs_t &semi_impl={ }) const =0
int has_interface_blocs() const override
void dimensionner_blocs(matrices_t matrices, const tabs_t &semi_impl={ }) const override
void completer() override
Associates the operator with the domaine_dis, the domaine_Cl_dis, and the unknown of its equation.
void ajouter_blocs(matrices_t matrices, DoubleTab &secmem, const tabs_t &semi_impl={ }) const override
void mettre_a_jour(double t) override
DOES NOTHING - to override in derived classes.
virtual void dimensionner_blocs_ext(int aux_only, matrices_t matrices, const tabs_t &semi_impl={ }) const =0
class SolveurSys A SolveurSys represents any class
Definition SolveurSys.h:32