TrioCFD 1.9.8
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
Renvoie le tableau des valeurs du champ au temps courant.
class Domaine_VEF
Definition Domaine_VEF.h:54
int nb_faces() const
renvoie le nombre global de faces.
Definition Domaine_VF.h:471
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