TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Imprimer_Fichiers_RANS_VDF.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_VDF.h>
17#include <EFichier.h>
18#include <Probleme_base.h>
19#include <SFichier.h>
20
21Implemente_instanciable(Imprimer_Fichiers_RANS_VDF,"Imprimer_Fichiers_RANS_VDF",Interprete);
22
24{
25 return Interprete::printOn(os);
26}
27
28
30{
31 // Motcle mot_lu;
32 // Motcle temperature("temperature");
33
34 // is >> mot_lu;
35 // if(mot_lu==temperature)
36 // {
37 // temperature = 1;
38 // Cerr << "La temperature va etre sauvegardee" << finl;
39 // }
40
41 return Interprete::readOn(is);
42}
43
44
46{
47
48 Nom nom_pb;
49 is >> nom_pb;
50 if(! sub_type(Probleme_base, objet(nom_pb)))
51 {
52 Cerr << nom_pb << " est du type " << objet(nom_pb).que_suis_je() << finl;
53 Cerr << "On attendait un objet de type Probleme_base" << finl;
55 }
56 Probleme_base& pb=ref_cast(Probleme_base, objet(nom_pb));
57
58 const Domaine_VDF& domaine_VDF = ref_cast(Domaine_VDF,pb.equation(0).domaine_dis());
59 const Equation_base& eqn_hydr = pb.equation(0);
60 const DoubleVect& vit = eqn_hydr.inconnue().valeurs(); //vitesse
61 SFichier fic_vit("vitesse_RANS.dat");
62
63 int ndeb = 0, nfin = domaine_VDF.nb_faces_tot() ;
64
65 for(int num_face = ndeb ; num_face < nfin ; num_face ++)
66 {
67 fic_vit << num_face << " " << vit(num_face) << finl;
68 }
69
70 // if(temperature != 0)
71 // {
72 SFichier fic_temp("temperature_RANS.dat");
73 const Equation_base& eqn_therm = pb.equation(1);
74 const DoubleVect& temp = eqn_therm.inconnue().valeurs(); //temperature
75
76 int ndeb2 = 0, nfin2 = domaine_VDF.nb_elem_tot() ;
77
78 for(int num_elem = ndeb2 ; num_elem < nfin2 ; num_elem++)
79 {
80 fic_temp << num_elem << " " << temp(num_elem) << finl;
81 }
82 // }
83
84 return is;
85}
DoubleTab & valeurs() override
Returns the array of field values at the current time.
class Domaine_VDF
Definition Domaine_VDF.h:61
int nb_faces_tot() const
Returns the total number of faces.
Definition Domaine_VF.h:481
int nb_elem_tot() const
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