TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Champ_Som_PolyMAC_CDO.cpp
1/****************************************************************************
2* Copyright (c) 2026, 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_Som_PolyMAC_CDO.h>
17#include <Domaine_PolyMAC_CDO.h>
18#include <Synonyme_info.h>
19#include <Domaine.h>
20
21Implemente_instanciable(Champ_Som_PolyMAC_CDO,"Champ_Som_PolyMAC_CDO",Champ_Inc_P1_base);
22Add_synonym(Champ_Som_PolyMAC_CDO, "Champ_Som_PolyMAC_HFV");
23
25{
26 return s << que_suis_je() << " " << le_nom();
27}
28
30{
31 lire_donnees(s) ;
32 return s ;
33}
34
35int Champ_Som_PolyMAC_CDO::imprime(Sortie& os, int ncomp) const
36{
37 const Domaine_dis_base& domaine_dis = domaine_dis_base();
38 const Domaine& domaine = domaine_dis.domaine();
39 const DoubleTab& coord=domaine.coord_sommets();
40 const int nb_som = domaine.nb_som();
41 const DoubleTab& val = valeurs();
42 int som;
43 os << nb_som << finl;
44 for (som=0; som<nb_som; som++)
45 {
46 if (dimension==3)
47 os << coord(som,0) << " " << coord(som,1) << " " << coord(som,2) << " " ;
48 if (dimension==2)
49 os << coord(som,0) << " " << coord(som,1) << " " ;
50 if (nb_compo_ == 1)
51 os << val(som) << finl;
52 else
53 os << val(som,ncomp) << finl;
54 }
55 os << finl;
56 Cout << "Champ_Som_PolyMAC_CDO::imprime FIN >>>>>>>>>> " << finl;
57 return 1;
58}
const Domaine & domaine() const
int lire_donnees(Entree &)
Lit les valeurs du champs a partir d'un flot d'entree.
const Domaine_dis_base & domaine_dis_base() const override
DoubleTab & valeurs() override
Renvoie le tableau des valeurs du champ au temps courant.
int imprime(Sortie &, int) const override
classe Domaine_dis_base Cette classe est la base de la hierarchie des domaines discretisees.
const Domaine & domaine() const
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
const Nom & le_nom() const override
Renvoie le nom du champ.
int nb_compo_
Definition Field_base.h:95
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