TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Source_Generique_base.cpp
1/****************************************************************************
2* Copyright (c) 2026, 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
17#include <Source_Generique_base.h>
18#include <Equation_base.h>
19#include <Postraitement.h>
20
21Implemente_base(Source_Generique_base,"Source_Generique_base",Source_base);
22// XD source_generique source_base source_generique NO_BRACE to define a source term depending on some discrete fields
23// XD_CONT of the problem and (or) analytic expression. It is expressed by the way of a generic field usually used for
24// XD_CONT post-processing.
25// XD attr champ champ_generique_base champ REQ the source field
26
27/*! @brief DOES NOTHING - to override in derived classes.
28 *
29 * Imprime la source sur un flot de sortie.
30 *
31 * @param (Sortie& os) le flot de sortie
32 * @return (Sortie&) le flot de sortie modifie
33 */
35{
36 return os;
37}
38
39/*! @brief DOES NOTHING - to override in derived classes.
40 *
41 * Lecture d'un terme source sur un flot d'entree.
42 *
43 * @param (Entree& is) le flot d'entree
44 * @return (Entree&) le flot d'entree modifie
45 */
47{
48 is >> ch_source_;
49 return is;
50}
51
56
57DoubleTab& Source_Generique_base::calculer(DoubleTab& resu) const
58{
59 resu=0;
60 return ajouter(resu);
61}
62
64{
66
67 Postraitement post_bidon;
68 post_bidon.associer_nom_et_pb_base("", equation().probleme());
69 ch_source_->completer(post_bidon);
70 Entity loc = ch_source_->get_localisation();
71 if (((loc == Entity::ELEMENT) && (localisation_source() != "elem"))
72 || ((loc == Entity::FACE) && (localisation_source() != "faces")))
73 {
74 Nom nom_loc;
75 if (loc == Entity::ELEMENT)
76 nom_loc = "elem";
77 else if (loc == Entity::FACE)
78 nom_loc = "faces";
79 Cerr << "----------------------------------------------------------------" << finl;
80 Cerr << "Error during TRUST calculation :" << finl;
81 Cerr << "----------------------------------------------------------------" << finl;
82 Cerr << "The generic source field associated to the " << que_suis_je() << " source term " << finl;
83 Cerr << "of the equation " << equation().que_suis_je() << " will be evaluated at localisation " << nom_loc
84 << finl;
85 Cerr << "while the source term itself must be computed at location " << localisation_source() << finl;
86 Cerr << "Please contact TRUST support." << finl;
87 exit();
88 }
89}
90
92{
93
94}
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
const Equation_base & equation() const
Renvoie la reference sur l'equation pointe par MorEqn::mon_equation.
Definition MorEqn.h:62
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
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 Sortie & printOn(Sortie &) const
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
Definition Objet_U.cpp:282
classe Postraitement La classe est dotee -d une liste de champs generiques champs_post_complet_ qui c...
void associer_nom_et_pb_base(const Nom &, const Probleme_base &) override
classe Probleme_base C'est un Probleme_U qui n'est pas un couplage.
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455
Classe de base des flux de sortie.
Definition Sortie.h:52
classe Source_Generique_base Cette classe est la base de la hierarchie des sources portant
void mettre_a_jour(double temps) override
DOES NOTHING - to override in derived classes.
virtual Nom localisation_source()=0
void completer() override
Met a jour les references internes a l'objet Source_base.
DoubleTab & calculer(DoubleTab &) const override
void associer_pb(const Probleme_base &) override
classe Source_base Un objet Source_base est un terme apparaissant au second membre d'une
Definition Source_base.h:42
virtual void completer()
Met a jour les references internes a l'objet Source_base.
virtual DoubleTab & ajouter(DoubleTab &) const