TrioCFD 1.9.9_beta
TrioCFD documentation
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 * Prints the source term to an output stream.
30 *
31 * @param (Sortie& os) the output stream
32 * @return (Sortie&) the modified output stream
33 */
35{
36 return os;
37}
38
39/*! @brief DOES NOTHING - to override in derived classes.
40 *
41 * Reads a source term from an input stream.
42 *
43 * @param (Entree& is) the input stream
44 * @return (Entree&) the modified input stream
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
Returns the reference to the equation pointed to by MorEqn::mon_equation.
Definition MorEqn.h:62
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
const Nom & que_suis_je() const
Returns the string identifying the class.
Definition Objet_U.cpp:104
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
Definition Objet_U.cpp:289
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Definition Objet_U.cpp:278
class Postraitement. The class holds -a list of generic fields champs_post_complet_ containing
void associer_nom_et_pb_base(const Nom &, const Probleme_base &) override
class Probleme_base It is a Probleme_U that is not a coupling.
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Definition Process.cpp:466
Base class for output streams.
Definition Sortie.h:52
Source_Generique_base This class is the base of the source term hierarchy carrying.
void mettre_a_jour(double temps) override
DOES NOTHING - to override in derived classes.
virtual Nom localisation_source()=0
void completer() override
Updates internal references of the Source_base object.
DoubleTab & calculer(DoubleTab &) const override
void associer_pb(const Probleme_base &) override
Source_base A Source_base object is a term appearing on the right-hand side of an.
Definition Source_base.h:42
virtual void completer()
Updates internal references of the Source_base object.
virtual DoubleTab & ajouter(DoubleTab &) const