TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Champ_Fonc_Q1_EF.cpp
1/****************************************************************************
2* Copyright (c) 2023, 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_Fonc_Q1_EF.h>
17#include <Domaine_EF.h>
18#include <Domaine.h>
19
20Implemente_instanciable(Champ_Fonc_Q1_EF, "Champ_Fonc_Q1_EF", Champ_Fonc_Q1_base);
21
22Sortie& Champ_Fonc_Q1_EF::printOn(Sortie& s) const { return s << que_suis_je() << " " << le_nom(); }
23
24Entree& Champ_Fonc_Q1_EF::readOn(Entree& s) { return s; }
25
27{
28 return ref_cast(Domaine_EF, le_dom_VF.valeur());
29}
30
35
36int Champ_Fonc_Q1_EF::imprime(Sortie& os, int ncomp) const
37{
38 const Domaine_dis_base& domaine_dis = domaine_dis_base();
39 const Domaine& domaine = domaine_dis.domaine();
40 const DoubleTab& coord = domaine.coord_sommets();
41 const int nb_som = domaine.nb_som();
42 const DoubleTab& val = valeurs();
43 int som;
44 os << nb_som << finl;
45 for (som = 0; som < nb_som; som++)
46 {
47 if (dimension == 3)
48 os << coord(som, 0) << " " << coord(som, 1) << " " << coord(som, 2) << " ";
49 if (dimension == 2)
50 os << coord(som, 0) << " " << coord(som, 1) << " ";
51 if (nb_compo_ == 1)
52 os << val(som) << finl;
53 else
54 os << val(som, ncomp) << finl;
55 }
56 os << finl;
57 Cout << "Champ_Fonc_Q1_EF::imprime FIN >>>>>>>>>> " << finl;
58 return 1;
59}
DoubleTab & valeurs() override
Surcharge Champ_base::valeurs() Renvoie le tableau des valeurs.
void mettre_a_jour(double) override
Mise a jour en temps du champ.
int imprime(Sortie &, int) const override
NE FAIT RIEN.
const Domaine_EF & domaine_EF() const
: class Champ_Fonc_Q1_base
virtual const Domaine & domaine() const
void mettre_a_jour(double temps) override
Mise a jour en temps du champ.
const Domaine_dis_base & domaine_dis_base() const override
class Domaine_EF
Definition Domaine_EF.h:59
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