TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Solveur_Masse_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 Solveur_Masse_base_included
17#define Solveur_Masse_base_included
18
19#include <TRUSTTabs_forward.h>
20#include <Interface_blocs.h>
21
22#include <TRUST_Deriv.h>
23#include <MorEqn.h>
24
27class Matrice_Morse;
28class Matrice_Base;
29
30/*! @brief Solveur_Masse_base Represents the mass matrix of an equation.
31 *
32 * An equation
33 * contains a reference to a mass matrix.
34 * This class is the base of the mass matrix hierarchy.
35 *
36 * @sa SolveurMasse Equation_base, Abstract class., Abstract methods:, DoubleTab& appliquer(DoubleTab&) const, void associer_domaine_dis_base(const Domaine_dis_base& ), void associer_domaine_cl_dis_base(const Domaine_Cl_dis_base& )
37 */
38
39class Solveur_Masse_base : public Objet_U, public MorEqn
40{
41 Declare_base(Solveur_Masse_base);
42
43public :
44
45 virtual DoubleTab& appliquer(DoubleTab&) const;
46
47 virtual void mettre_a_jour(double temps);
48 virtual void resetTime(double temps);
51 virtual void assembler();
52
53 virtual Matrice_Base& ajouter_masse(double dt, Matrice_Base& matrice, int penalisation=1) const;
54 virtual DoubleTab& ajouter_masse(double dt, DoubleTab& x, const DoubleTab& y, int penalisation=1, bool use_old_volumes=false) const;
55 virtual Matrice_Base& ajouter_masse_dt_local(DoubleVect& dt_locaux, Matrice_Base& matrice, int penalisation=1) const;
56 virtual DoubleTab& ajouter_masse_dt_local(DoubleVect& dt_locaux, DoubleTab& x, const DoubleTab& y, int penalisation=1) const;
57 virtual void get_masse_dt_local(DoubleVect& m_dt_locaux, DoubleVect& dt_locaux, int penalisation=1);
58 virtual void get_masse_divide_by_local_dt(DoubleVect& m_dt_locaux, DoubleVect& dt_locaux, int penalisation=1);
59
60 virtual DoubleTab& corriger_solution(DoubleTab& x, const DoubleTab& y, int incr = 0) const;
63 {
65 }
70
71 // this method replaces the appliquer method from versions before 154
72 virtual DoubleTab& appliquer_impl(DoubleTab& x) const =0;
73
74 // adding a dimensionner() method
75 // that dimensions the matrix for the case where all operators are negligible
76 virtual void dimensionner(Matrice_Morse& matrix) const;
77
78 /* interface {dimensionner,ajouter}_blocs -> cf Equation_base.h */
79 virtual int has_interface_blocs() const
80 {
81 return 0;
82 };
83 virtual void dimensionner_blocs(matrices_t matrices, const tabs_t& semi_impl = {}) const;
84 virtual void ajouter_blocs(matrices_t matrices, DoubleTab& secmem, double dt, const tabs_t& semi_impl, int resoudre_en_increments) const;
85
86 // adding a completer() method
87 // called by the completer() method of equations.
88 // Default implementation does nothing.
89 virtual void completer();
90
91 // adding a preparer_calcul() method
92 // called by the preparer_calcul method of equations
93 // Default implementation does nothing
94 virtual void preparer_calcul();
95
96 inline void set_penalisation_flag(int pen) { penalisation_flag_ = pen; }
97
98
99protected :
100 Nom name_of_coefficient_temporel_; // name of the temporal coefficient
103private:
104 mutable double penalisation_;
105};
106
107#endif /* Solveur_Masse_base_included */
class Domaine_Cl_dis_base Domaine_Cl_dis_base objects represent discretized boundary conditions
class Domaine_dis_base This class is the base of the hierarchy of discretized domains.
Matrice_Base class - Base class of the matrix hierarchy.
Matrice_Morse class - Represents a (sparse) matrix M, not necessarily square,.
class MorEqn Class that groups the functionalities of linking with an
Definition MorEqn.h:35
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
Objet_U()
Default constructor: assigns a unique identifier to the object (object_id_) and registers the object ...
Definition Objet_U.cpp:54
Solveur_Masse_base Represents the mass matrix of an equation.
void set_penalisation_flag(int pen)
virtual void dimensionner(Matrice_Morse &matrix) const
virtual void assembler()
DOES NOTHING.
const Nom & get_name_of_coefficient_temporel() const
int has_coefficient_temporel() const
virtual Matrice_Base & ajouter_masse_dt_local(DoubleVect &dt_locaux, Matrice_Base &matrice, int penalisation=1) const
virtual void dimensionner_blocs(matrices_t matrices, const tabs_t &semi_impl={}) const
virtual void get_masse_divide_by_local_dt(DoubleVect &m_dt_locaux, DoubleVect &dt_locaux, int penalisation=1)
virtual void get_masse_dt_local(DoubleVect &m_dt_locaux, DoubleVect &dt_locaux, int penalisation=1)
virtual Matrice_Base & ajouter_masse(double dt, Matrice_Base &matrice, int penalisation=1) const
virtual DoubleTab & appliquer_impl(DoubleTab &x) const =0
virtual DoubleTab & corriger_solution(DoubleTab &x, const DoubleTab &y, int incr=0) const
virtual void preparer_calcul()
virtual void associer_domaine_dis_base(const Domaine_dis_base &)=0
virtual void resetTime(double temps)
DOES NOTHING - to override in derived classes.
virtual DoubleTab & appliquer(DoubleTab &) const
Returns appliquer_impl(x/temporal_coefficient) if a temporal coefficient is set, otherwise returns ap...
void set_name_of_coefficient_temporel(const Nom &)
Allows choosing the name of the temporal coefficient to use for apply.
virtual void associer_domaine_cl_dis_base(const Domaine_Cl_dis_base &)=0
virtual int has_interface_blocs() const
virtual void mettre_a_jour(double temps)
DOES NOTHING - to override in derived classes.
virtual void ajouter_blocs(matrices_t matrices, DoubleTab &secmem, double dt, const tabs_t &semi_impl, int resoudre_en_increments) const