TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Imprimer_Fichiers_RANS_VEF.cpp
1/****************************************************************************
2* Copyright (c) 2015 - 2016, 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 <Imprimer_Fichiers_RANS_VEF.h>
17#include <SFichier.h>
18#include <EFichier.h>
19#include <Probleme_base.h>
20#include <Domaine.h>
21
22Implemente_instanciable(Imprimer_Fichiers_RANS_VEF,"Imprimer_Fichiers_RANS_VEF",Interprete);
23
25{
26 return Interprete::printOn(os);
27}
28
29
31{
32 // Motcle mot_lu;
33 // Motcle temperature("temperature");
34
35 // is >> mot_lu;
36 // if(mot_lu==temperature)
37 // {
38 // temperature = 1;
39 // Cerr << "La temperature va etre sauvegardee" << finl;
40 // }
41
42 return Interprete::readOn(is);
43}
44
45
47{
48
49 Nom nom_pb;
50 is >> nom_pb;
51 if(! sub_type(Probleme_base, objet(nom_pb)))
52 {
53 Cerr << nom_pb << " est du type " << objet(nom_pb).que_suis_je() << finl;
54 Cerr << "On attendait un objet de type Probleme_base" << finl;
56 }
57 Probleme_base& pb=ref_cast(Probleme_base, objet(nom_pb));
58
59
60 const Domaine_VEF& domaine_VEF = ref_cast(Domaine_VEF,pb.equation(0).domaine_dis());
61 const Equation_base& eqn_hydr = pb.equation(0);
62 const DoubleTab& vit = eqn_hydr.inconnue().valeurs(); //vitesse
63
64 // const Domaine_dis_base& zdisbase=mon_equation->inconnue().domaine_dis_base();
65 // const Domaine_VEF& domaine_VEF=ref_cast(Domaine_VEF, zdisbase);
66 // const DoubleTab& vitesse = mon_equation->inconnue().valeurs();
67 int nb_faces = domaine_VEF.nb_faces();
68
69 SFichier fic("vitesse_RANS.dat");
70
71 for(int num_face=0 ; num_face<nb_faces ; num_face++)
72 {
73 fic << vit(num_face,0) << " " << vit(num_face,1) << " " << vit(num_face,2) << finl;
74 }
75
76
77 return is;
78}
DoubleTab & valeurs() override
Returns the array of field values at the current time.
class Domaine_VEF
Definition Domaine_VEF.h:53
int nb_faces() const
Returns the total number of faces.
Definition Domaine_VF.h:471
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
class Equation_base The role of an equation is the calculation of one or more fields....
virtual const Champ_Inc_base & inconnue() const =0
Domaine_dis_base & domaine_dis()
Returns the discretized domain associated with the equation.
Entree & interpreter(Entree &) override
Base class for "interpreter" objects.
Definition Interprete.h:38
static Objet_U & objet(const Nom &)
See Interprete_bloc::objet_global(). BM: the Interprete class is not the best place for this.
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
friend class Entree
Definition Objet_U.h:71
const Nom & que_suis_je() const
Returns the string identifying the class.
Definition Objet_U.cpp:104
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
Definition Objet_U.cpp:289
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Definition Objet_U.cpp:278
class Probleme_base It is a Probleme_U that is not a coupling.
virtual const Equation_base & equation(int) const =0
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Definition Process.cpp:466
SFichier is to the C++ ofstream class what Sortie is to the C++ ostream class.
Definition SFichier.h:29
Base class for output streams.
Definition Sortie.h:52