TrioCFD 1.9.8
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
Renvoie le tableau des valeurs du champ au temps courant.
class Domaine_VDF
Definition Domaine_VDF.h:64
int nb_faces_tot() const
renvoie le nombre total de 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
classe Equation_base Le role d'une equation est le calcul d'un ou plusieurs champs....
virtual const Champ_Inc_base & inconnue() const =0
Domaine_dis_base & domaine_dis()
Renvoie le domaine discretise associe a l'equation.
Entree & interpreter(Entree &) override
Classe de base des objets "interprete".
Definition Interprete.h:38
static Objet_U & objet(const Nom &)
Voir Interprete_bloc::objet_global() BM: la classe Interprete n'est pas le meilleur endroit pour cett...
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
friend class Entree
Definition Objet_U.h:76
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 Probleme_base C'est un Probleme_U qui n'est pas un couplage.
virtual const Equation_base & equation(int) const =0
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455
Cette classe est a la classe C++ ofstream ce que la classe Sortie est a la classe C++ ostream Elle re...
Definition SFichier.h:27
Classe de base des flux de sortie.
Definition Sortie.h:52