TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Champ_front_var.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_var.h>
17#include <Domaine_VF.h>
18
19Implemente_base(Champ_front_var,"Champ_front_var",Champ_front_base);
20
21
22/*! @brief Imprime le nom du champ sur un flot de sortie
23 *
24 * @param (Sortie& s) un flot de sortie
25 * @return (Sortie&) le flot de sortie modifie
26 */
28{
29 return s << que_suis_je() << " " << le_nom();
30}
31
32
33/*! @brief NE FAIT RIEN A surcharger dans les classes derivees
34 *
35 * Doit dans tous les cas fixer nb_comp
36 *
37 * @param (Entree& is)
38 * @return (Entree&) le flot d'entree modifie
39 */
41{
43 return s ;
44}
45
46
47/*! @brief Initialisation en debut de calcul.
48 *
49 * Dimensionne le tableau de valeurs et cree son espace virtuel.
50 * Les classes derivees doivent imperativement appeler cette methode.
51 *
52 * @return (0 en cas d'erreur, 1 sinon.)
53 */
54int Champ_front_var::initialiser(double temps, const Champ_Inc_base& inco)
55{
56 const Frontiere& frontiere = frontiere_dis().frontiere();
57 const int n = les_valeurs->nb_cases();
58 const int nbc = nb_comp();
59 for(int i = 0; i < n; i++)
60 {
61 DoubleTab& tab = les_valeurs[i].valeurs();
62 // B.M. la methode completer dimensionne parfois le tableau.
63 // On a un peut tout et n'importe quoi en entree: parfois tableau vide,
64 // parfois nb_dim==1, etc...
65 // Attention, les valeurs existantes doivent etre conservees s'il y en a !
66 if (tab.nb_dim()!=2 || tab.dimension(1)!=nbc)
67 {
68 tab.resize(tab.dimension(0), nbc);
69 frontiere.creer_tableau_faces(tab);
70 }
72 }
73 return 1;
74}
Classe Champ_Inc_base.
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.
classe Champ_front_var Classe derivee de Champ_front_base qui represente un champ sur
int initialiser(double temps, const Champ_Inc_base &inco) override
Initialisation en debut de calcul.
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
virtual void creer_tableau_faces(Array_base &, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT) const
Cree un tableau ayant une "ligne" par face de cette frontiere Voir MD_Vector_tools::creer_tableau_dis...
const Frontiere & frontiere() const
Renvoie la frontiere geometrique associee.
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
int nb_dim() const
Definition TRUSTTab.h:199
void resize(_SIZE_ n, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
Definition TRUSTTab.tpp:469
_SIZE_ dimension(int d) const
Definition TRUSTTab.tpp:133
virtual void echange_espace_virtuel(IsExchangeBlocking exchange_type=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")