TrioCFD 1.9.8
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 NE FAIT RIEN
34 *
35 * @param (Sortie& os) un flot de sortie
36 * @return (Sortie&) le flot de sortie modifie
37 */
39{
40 return os;
41}
42
43/*! @brief Lecture du Champ a partir d'un flot d'entree, (On ne sait traiter que les champs scalaires.
44 *
45 * )
46 * exemple:
47 * Champ_Front_Fonction
48 * 1 (nombre de composantes)
49 * temperature (ch est fonction de la temperature)
50 * val*6 (expression du parser)
51 *
52 *
53 * @param (Entree& is) un flot d'entree
54 * @return (Entree&) le flot d'entree modifie
55 */
57{
58
59
60 int nbcomp;
61 nbcomp=lire_dimension(is,que_suis_je());
62 fixer_nb_comp(nbcomp);
64
65 Cerr<<"The analytical fonction is read... "<<finl;
66 la_table.lire_fxyzt(is, nbcomp);
67 return is;
68}
70{
71 const Champ_base& ch=ref_pb->get_champ(nom_champ_parametre_);
72 const Front_VF& fvf = ref_cast(Front_VF, frontiere_dis());
73 const Domaine_VF& zvf = ref_cast(Domaine_VF, frontiere_dis().domaine_dis());
74 DoubleTab& tab=valeurs_au_temps(temps);
75 DoubleTab tab_ch(tab), pos(tab.dimension_tot(0), dimension);
76 ch.trace(frontiere_dis(),tab_ch,temps,0);
77 assert(tab.dimension(0)==tab_ch.dimension(0));
78 for (int i = 0, j; i < fvf.nb_faces_tot(); i++)
79 for (j = 0; j < dimension; j++) pos(i, j) = zvf.xv(fvf.num_face(i), j);
80 la_table.valeurs(tab_ch, pos, temps, tab);
81}
82
84{
86 return 0;
87 ref_pb=inco.equation().probleme();
88 mettre_a_jour(temps);
89 return 1;
90}
92{
93 Cerr<<__FILE__<<(int)__LINE__<<" not coded" <<finl;
94 exit();
95 return (*this);
96}
97
98
99
classe Ch_front_var_instationnaire_dep Cette classe abstraite represente un champ sur une frontiere,
Classe Champ_Front_Fonction Classe derivee de Champ_front_var_instationnaire_dep qui represente les.
void mettre_a_jour(double temps) override
NE FAIT RIEN, a surcharger.
Champ_front_base & affecter_(const Champ_front_base &ch) override
int initialiser(double temps, const Champ_Inc_base &inco) override
Initialisation en debut de calcul.
Classe Champ_Inc_base.
int lire_dimension(Entree &, const Nom &)
Verification de la dimension du champ Renvoie la dimension du champ.
classe Champ_base Cette classe est la base de la hierarchie des champs.
Definition Champ_base.h:43
virtual DoubleTab & trace(const Frontiere_dis_base &, DoubleTab &, double, int distant) const
Calcule la trace d'un champ sur une frontiere au temps tps.
classe Champ_front_base Classe de base pour la hierarchie des champs aux frontieres.
virtual const Frontiere_dis_base & frontiere_dis() const
Renvoie la frontiere discretisee associee au champ.
virtual const Domaine_dis_base & domaine_dis() const
int initialiser(double temps, const Champ_Inc_base &inco) override
Initialise le temps courant et Gpoint.
DoubleTab & valeurs_au_temps(double temps) override
Renvoie les valeurs au temps desire.
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()
Renvoie le probleme associe a l'equation.
virtual void fixer_nb_comp(int i)
Fixe le nombre de composantes du champ.
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
Renvoie la reference sur l'equation pointe par MorEqn::mon_equation.
Definition MorEqn.h:62
static int dimension
Definition Objet_U.h:99
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
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
_SIZE_ dimension_tot(int) const override
Definition TRUSTTab.tpp:160
_SIZE_ dimension(int d) const
Definition TRUSTTab.tpp:133