TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Ch_front_var_instationnaire_dep.cpp
1/****************************************************************************
2* Copyright (c) 2022, 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 <Ch_front_var_instationnaire_dep.h>
17#include <Champ_Inc_base.h>
18#include <Frontiere_dis_base.h>
19#include <Domaine_dis_base.h>
20#include <Domaine_VF.h>
21#include <TRUSTTab_parts.h>
22
23Implemente_instanciable(Ch_front_var_instationnaire_dep,"Ch_front_var_instationnaire_dep",Champ_front_var_instationnaire);
24
26{
27 return s << que_suis_je() << " " << le_nom();
28}
29
31{
32 int dim;
33 s >> dim;
34 fixer_nb_comp(dim);
35
36 return s;
37}
38
40{
41
43 return 0;
44
45 // Initialisation par defaut a la valeur de l'inconnue au bord
46 // Ca veut dire prendre la trace de son propre bord
47 // Attention, ne pas passer par les raccords !
48 DoubleTab& tab=les_valeurs->valeurs();
49 assert(temps==inco.temps());
50 if(nb_comp()!=inco.nb_comp())
51 {
52 // Used by ICoCo see U_in_var_impl test case
53 // Different field so we initialize to 0:
54 tab = 0;
55 }
56 else
57 {
58 const Frontiere& MaFrontiere = frontiere_dis().frontiere();
59 ConstDoubleTab_parts parts(inco.valeurs());
60 if (parts[0].dimension(0)==inco.domaine_dis_base().nb_elem())
61 MaFrontiere.Frontiere::trace_elem_local(inco.valeurs(),tab);
62 else if (parts[0].dimension(0)==ref_cast(Domaine_VF,inco.domaine_dis_base()).nb_faces())
63 MaFrontiere.Frontiere::trace_face_local(inco.valeurs(),tab);
64 else
65 {
66 Cerr << "Warning: Field " << inco.que_suis_je() << " is not supported yet in Ch_front_var_instationnaire_dep::initialiser" << finl;
67 //Process::exit();
68 }
69 }
71
72 return 1;
73}
74
classe Ch_front_var_instationnaire_dep Cette classe abstraite represente un champ sur une frontiere,
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.
const Domaine_dis_base & domaine_dis_base() const override
DoubleTab & valeurs() override
Renvoie le tableau des valeurs du champ au temps courant.
double temps() const
Renvoie le temps du champ.
virtual const Frontiere_dis_base & frontiere_dis() const
Renvoie la frontiere discretisee associee au champ.
classe Champ_front_var_instationnaire Classe derivee de Champ_front_var qui represente les champs aux
int initialiser(double temps, const Champ_Inc_base &inco) override
Initialise le temps courant et Gpoint.
class Domaine_VF
Definition Domaine_VF.h:44
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
virtual void fixer_nb_comp(int i)
Fixe le nombre de composantes du champ.
const Nom & le_nom() const override
Renvoie le nom du champ.
virtual int nb_comp() const
Definition Field_base.h:56
const Frontiere & frontiere() const
Renvoie la frontiere geometrique associee.
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
Classe de base des flux de sortie.
Definition Sortie.h:52
virtual void echange_espace_virtuel(IsExchangeBlocking exchange_type=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")