TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Masse_PolyMAC_CDO_base.cpp
1/****************************************************************************
2* Copyright (c) 2024, 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#include <Schema_Euler_Implicite.h>
17#include <Op_Diff_negligeable.h>
18#include <Masse_PolyMAC_CDO_base.h>
19#include <Domaine_Cl_PolyMAC_family.h>
20#include <Domaine_PolyMAC_CDO.h>
21#include <TRUSTTab_parts.h>
22#include <Equation_base.h>
23#include <Operateur.h>
24
25Implemente_base(Masse_PolyMAC_CDO_base, "Masse_PolyMAC_CDO_base", Solveur_Masse_base);
26Sortie& Masse_PolyMAC_CDO_base::printOn(Sortie& s) const { return s << que_suis_je() << " " << le_nom(); }
28
29Implemente_base(Masse_PolyMAC_HFV_base, "Masse_PolyMAC_HFV_base", Masse_PolyMAC_CDO_base);
30Sortie& Masse_PolyMAC_HFV_base::printOn(Sortie& s) const { return s << que_suis_je() << " " << le_nom(); }
32
34{
35 le_dom_PolyMAC_CDO = ref_cast(Domaine_PolyMAC_CDO, le_dom_dis_base);
36}
37
39{
40 le_dom_Cl_PolyMAC_CDO = ref_cast(Domaine_Cl_PolyMAC_family, le_dom_Cl_dis_base);
41}
42
44{
45 if (!sub_type(Schema_Implicite_base, equation().schema_temps()))
46 {
47 Cerr << "===================================================================================" << finl;
48 Cerr << "Error when using " << equation().schema_temps().que_suis_je() << " scheme:" << finl;
49 Cerr << "You can only use implicit schemes with the PolyMAC_CDO discretization (for mass solver)." << finl;
51 }
52 no_diff_ = true;
53
54 for (int i = 0; i < equation().nombre_d_operateurs(); i++)
55 if (sub_type(Operateur_Diff_base, equation().operateur(i).l_op_base()))
56 if (!sub_type(Op_Diff_negligeable, equation().operateur(i).l_op_base()))
57 no_diff_ = false;
58}
59
60void Masse_PolyMAC_CDO_base::appliquer_coef(DoubleVect& coef) const
61{
63 {
64 OBS_PTR(Champ_base) ref_coeff;
66
67 DoubleTab values;
68 if (sub_type(Champ_Inc_base,ref_coeff.valeur()))
69 {
70 const Champ_Inc_base& coeff = ref_cast(Champ_Inc_base,ref_coeff.valeur());
71 ConstDoubleTab_parts val_parts(coeff.valeurs());
72 values.ref(val_parts[0]);
73
74 }
75 else if (sub_type(Champ_Fonc_base,ref_coeff.valeur()))
76 {
77 const Champ_Fonc_base& coeff = ref_cast(Champ_Fonc_base,ref_coeff.valeur());
78 values.ref(coeff.valeurs());
79
80 }
81 else if (sub_type(Champ_Don_base,ref_coeff.valeur()))
82 {
83 DoubleTab nodes;
85 ref_coeff->valeur_aux(nodes,values);
86 }
87 tab_multiply_any_shape(coef, values, VECT_REAL_ITEMS);
88 }
89}
classe Champ_Don_base classe de base des Champs donnes (non calcules)
classe Champ_Fonc_base Classe de base des champs qui sont fonction d'une grandeur calculee
Classe Champ_Inc_base.
virtual DoubleTab & remplir_coord_noeuds(DoubleTab &) const =0
classe Champ_base Cette classe est la base de la hierarchie des champs.
Definition Champ_base.h:43
classe Domaine_Cl_dis_base Les objets Domaine_Cl_dis_base representent les conditions aux limites
classe Domaine_dis_base Cette classe est la base de la hierarchie des domaines discretisees.
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
virtual const Champ_Inc_base & inconnue() const =0
const Champ_base & get_champ(const Motcle &nom) const override
virtual int nombre_d_operateurs() const =0
Schema_Temps_base & schema_temps()
Renvoie le schema en temps associe a l'equation.
OBS_PTR(Domaine_PolyMAC_CDO) le_dom_PolyMAC_CDO
void appliquer_coef(DoubleVect &coef) const
void associer_domaine_cl_dis_base(const Domaine_Cl_dis_base &) override
void associer_domaine_dis_base(const Domaine_dis_base &) override
const Equation_base & equation() const
Renvoie la reference sur l'equation pointe par MorEqn::mon_equation.
Definition MorEqn.h:62
const Nom & que_suis_je() const
renvoie la chaine identifiant la classe.
Definition Objet_U.cpp:104
virtual Entree & readOn(Entree &)
Lecture d'un Objet_U sur un flot d'entree Methode a surcharger.
Definition Objet_U.cpp:293
virtual const Nom & le_nom() const
Donne le nom de l'Objet_U Methode a surcharger : renvoie "neant" dans cette implementation.
Definition Objet_U.cpp:319
virtual Sortie & printOn(Sortie &) const
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
Definition Objet_U.cpp:282
Classe Op_Diff_negligeable Cette classe represente un operateur de diffusion negligeable.
classe Operateur_Diff_base Cette classe est la base de la hierarchie des operateurs representant
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455
class Schema_Implicite_base Classe de base pour tous les schemas en temps implicite
classe Solveur_Masse_base Represente la matrice de masse d'une equation.
Classe de base des flux de sortie.
Definition Sortie.h:52
virtual void ref(const TRUSTTab &)
Definition TRUSTTab.tpp:308