TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
List_Equations_Scalaires_Passifs_Especes.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 <List_Equations_Scalaires_Passifs_Especes.h>
17#include <Domaine_Cl_dis_base.h>
18#include <Probleme_base.h>
19
20Implemente_instanciable(List_Equations_Scalaires_Passifs_Especes,"Equations_Scalaires_Passifs|Equations_Especes",Equation_base);
21
23
25{
26 // Here is a big hack
27 Motcle motlu;
28
29 is >> motlu;
30 if (motlu != "{")
31 {
32 Cerr << "Big problem in List_Equations_Scalaires_Passifs_Especes::readOn , we expected : { and not " << motlu << " !!!" << finl;
34 }
35 is >> motlu;
36 while (motlu != "}")
37 {
38 Nom nume(list_eq.size());
39 OWN_PTR(Equation_base) &Eqn_nvelle = list_eq.add(OWN_PTR(Equation_base)());
40 Eqn_nvelle.typer(motlu);
41 Equation_base& Eqn = ref_cast(Equation_base, Eqn_nvelle.valeur());
42
43 // now we associate the problem
45 Eqn.associer_milieu_base(mil.valeur());
47
48 // we discretize it (not done by discretiser)
50 Eqn.discretiser();
51
52 // we change the name of the unknown and the equation
53 Nom nom;
54 nom = Eqn.inconnue().le_nom();
55 Nom nom_eq;
56 nom_eq = Eqn.le_nom();
57 nom += nume;
58 Cerr << "The unknown name is modified : new name " << nom << finl;
59 Eqn.inconnue().nommer(nom);
61
62 nom_eq += nume;
63 Cerr << "The equation name is modified : new name " << nom_eq << finl;
64 Eqn.nommer(nom_eq);
65 // finally we read
66 is >> Eqn;
67 is >> motlu;
68 }
69 complet = 1;
70 return is;
71}
72
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
class Equation_base The role of an equation is the calculation of one or more fields....
const Nom & le_nom() const override
Returns the name of the equation.
virtual void associer_milieu_equation()
virtual void associer_milieu_base(const Milieu_base &)=0
virtual void associer_domaine_dis(const Domaine_dis_base &)
Associates the discretized domain with the equation.
void nommer(const Nom &nom) override
Method called when the object instance is created in the data file (Interprete::ajouter).
virtual void associer_pb_base(const Probleme_base &)
Associates with the Problem passed as parameter.
OWN_PTR(Parametre_equation_base) &parametre_equation()
virtual const Champ_Inc_base & inconnue() const =0
void add_champs_compris(const Champ_base &ch)
Probleme_base & probleme()
Returns the problem associated with the equation.
virtual void associer_sch_tps_base(const Schema_Temps_base &)
Associates the time scheme with the equation.
Schema_Temps_base & schema_temps()
Returns the time scheme associated with the equation.
virtual void discretiser()
Discretizes the equation.
Domaine_dis_base & domaine_dis()
Returns the discretized domain associated with the equation.
const Nom & le_nom() const override
Returns the name of the field.
void nommer(const Nom &) override
Gives a name to the field.
List_Equations_Scalaires_Passifs_Especes Represents a list of passive scalar or species equations.
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
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