TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Champ_Front_Fonction.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 <Champ_Front_Fonction.h>
17#include <EChaine.h>
18#include <Champ_Inc_base.h>
19#include <Equation_base.h>
20#include <Probleme_base.h>
21#include <Domaine_VF.h>
22#include <Front_VF.h>
23
24Implemente_instanciable(Champ_Front_Fonction,"Champ_Front_Fonction",Ch_front_var_instationnaire_dep);
25// XD champ_front_fonction front_field_base champ_front_fonction NO_BRACE boundary field that is function of another
26// XD_CONT field
27// XD attr dim entier dim REQ Number of field components.
28// XD attr inco chaine inco REQ Name of the field (for example: temperature).
29// XD attr expression chaine expression REQ keyword to use a analytical expression like 10.*EXP(-0.1*val) where val be
30// XD_CONT the keyword for the field.
31
32
33/*! @brief DOES NOTHING
34 *
35 * @param (Sortie& os) an output stream
36 * @return (Sortie&) the modified output stream
37 */
39{
40 return os;
41}
42
43/*! @brief Read the field from an input stream. (Only scalar fields are handled.)
44 *
45 * example:
46 * Champ_Front_Fonction
47 * 1 (number of components)
48 * temperature (ch is a function of temperature)
49 * val*6 (parser expression)
50 *
51 *
52 * @param (Entree& is) an input stream
53 * @return (Entree&) the modified input stream
54 */
56{
57
58
59 int nbcomp;
60 nbcomp=lire_dimension(is,que_suis_je());
61 fixer_nb_comp(nbcomp);
63
64 Cerr<<"The analytical fonction is read... "<<finl;
65 la_table.lire_fxyzt(is, nbcomp);
66 return is;
67}
69{
70 const Champ_base& ch=ref_pb->get_champ(nom_champ_parametre_);
71 const Front_VF& fvf = ref_cast(Front_VF, frontiere_dis());
72 const Domaine_VF& zvf = ref_cast(Domaine_VF, frontiere_dis().domaine_dis());
73 DoubleTab& tab=valeurs_au_temps(temps);
74 DoubleTab tab_ch(tab), pos(tab.dimension_tot(0), dimension);
75 ch.trace(frontiere_dis(),tab_ch,temps,0);
76 assert(tab.dimension(0)==tab_ch.dimension(0));
77 for (int i = 0, j; i < fvf.nb_faces_tot(); i++)
78 for (j = 0; j < dimension; j++) pos(i, j) = zvf.xv(fvf.num_face(i), j);
79 la_table.valeurs(tab_ch, pos, temps, tab);
80}
81
83{
85 return 0;
86 ref_pb=inco.equation().probleme();
87 mettre_a_jour(temps);
88 return 1;
89}
91{
92 Cerr<<__FILE__<<(int)__LINE__<<" not coded" <<finl;
93 exit();
94 return (*this);
95}
96
97
98
class Ch_front_var_instationnaire_dep This abstract class represents a field on a boundary,
Class Champ_Front_Fonction Derived class of Champ_front_var_instationnaire_dep representing.
void mettre_a_jour(double temps) override
DOES NOTHING, to override.
Champ_front_base & affecter_(const Champ_front_base &ch) override
int initialiser(double temps, const Champ_Inc_base &inco) override
Initialization at the beginning of calculation.
Class Champ_Inc_base.
int lire_dimension(Entree &, const Nom &)
Verification of the field dimension Returns the dimension of the field.
class Champ_base This class is the base of the fields hierarchy.
Definition Champ_base.h:43
virtual DoubleTab & trace(const Frontiere_dis_base &, DoubleTab &, double, int distant) const
Computes the trace of a field on a boundary at time tps.
class Champ_front_base Base class for the hierarchy of boundary fields.
virtual const Frontiere_dis_base & frontiere_dis() const
Returns the discretized boundary associated with the field.
virtual const Domaine_dis_base & domaine_dis() const
int initialiser(double temps, const Champ_Inc_base &inco) override
Initializes the current time and Gpoint.
DoubleTab & valeurs_au_temps(double temps) override
Returns the values at the desired time.
class Domaine_VF
Definition Domaine_VF.h:44
double xv(int num_face, int k) const
Definition Domaine_VF.h:76
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
Probleme_base & probleme()
Returns the problem associated with the equation.
virtual void fixer_nb_comp(int i)
Sets the number of components of the field.
class Front_VF
Definition Front_VF.h:36
int nb_faces_tot() const
Definition Front_VF.h:58
int num_face(const int) const
Definition Front_VF.h:68
const Equation_base & equation() const
Returns the reference to the equation pointed to by MorEqn::mon_equation.
Definition MorEqn.h:62
static int dimension
Definition Objet_U.h:94
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
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
_SIZE_ dimension_tot(int) const override
Definition TRUSTTab.tpp:160
_SIZE_ dimension(int d) const
Definition TRUSTTab.tpp:133