TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Traitement_particulier_NS_chmoy_faceperio.cpp
1/****************************************************************************
2* Copyright (c) 2026, 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 <Traitement_particulier_NS_chmoy_faceperio.h>
17#include <LecFicDistribue.h>
18#include <Navier_Stokes_std.h>
19#include <Schema_Temps_base.h>
20
21Implemente_base_sans_constructeur_ni_destructeur(Traitement_particulier_NS_chmoy_faceperio,"Traitement_particulier_NS_chmoy_faceperio",Traitement_particulier_NS_base);
22// XD chmoy_faceperio traitement_particulier_base chmoy_faceperio NO_BRACE non documente
23// XD attr bloc bloc_lecture bloc REQ not_set
24
25/*! @brief
26 *
27 * @param (Sortie& is) un flot de sortie
28 * @return (Sortie&) le flot de sortie modifie
29 */
31{
32 return is;
33}
34
35
36/*! @brief
37 *
38 * @param (Entree& is) un flot d'entree
39 * @return (Entree&) le flot d'entree modifie
40 */
42{
43 return is;
44}
45
47{
48 Motcle accouverte = "{" , accfermee = "}" ;
49 Motcle motbidon, motlu;
50 is >> motbidon ;
51 if (motbidon == accouverte)
52 {
53 Motcles les_mots(1);
54 les_mots[0] = "stats";
55
56 is >> motlu;
57 while(motlu != accfermee)
58 {
59 int rang=les_mots.search(motlu);
60 switch(rang)
61 {
62 case 0 :
63 {
64 // Pour stats
65 is >> temps_deb; // temps de debut de calcul des stats temp.
66 is >> temps_fin; // temps de fin de calcul des stats temp.
67 // initialisation pour le calcul des stats temp.
68 oui_stat=1; // =1 : on calcul des stats temp.
69 Cerr << "Reading time statitics parameters..." << finl;
70 Cerr << "Initial time : " << temps_deb << " End time : " << temps_fin << finl;
71 // Verif ensuite pour voir si on a rentrer les valeurs specifiques aux calculs des stats spat.
72 break;
73 }
74 default :
75 {
76 Cerr << "Default case..." << finl;
77 Cerr << "Les mots cles possibles sont "<< les_mots <<" { et }" << finl;
78 Cerr << "Vous avez lu :" << motlu << finl;
79 break;
80 }
81 }
82 is >> motlu;
83 }
84 is >> motlu;
85 if (motlu != accfermee)
86 {
87 Cerr << "Error while reading in Traitement_particulier_NS_canal" << finl;;
88 Cerr << "We were expecting a }" << finl;
89 exit();
90 }
91 }
92 else
93 {
94 Cerr << "Error while reading in Traitement_particulier_NS_canal" << finl;
95 Cerr << "We were expecting a {" << finl;
96 exit();
97 }
98
99 return is;
100}
101
102
104{
105
106 if(Objet_U::dimension!=3)
107 {
108 Cerr << " Traitement_particulier_NS_chmoy_faceperio : non prevu pour des calculs autres que 3D " << finl;
109 exit();
110 }
111
112 if (oui_stat != 0)
114
115 double temps = mon_equation->inconnue().temps();
116 int Nbfaces,num_face;
117
118 if (temps>temps_deb)
119 {
120 Nom fichier = "chmoy_face_perio";
121 ifstream fic(fichier);
122 if (!fic)
123 {
124 Cerr << " pas de fichier : chmoy_face_perio - reprise des calculs impossible" << finl;
125 exit();
126 }
127 else
128 {
129 LecFicDistribue fic2(fichier);
130 fic2 >> Nbfaces;
131
132 for (int i=0; i<Nbfaces; i++)
133 fic2 >> num_face >> chmoy_faceperio(num_face,0) >> chmoy_faceperio(num_face,1) >> chmoy_faceperio(num_face,2);
134 }
135 }
136}
137
139{
140 double temps = mon_equation->inconnue().temps();
141 double dt = mon_equation->schema_temps().pas_de_temps();
142 if (temps>temps_deb && temps<temps_fin)
144}
145
146
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
Cette classe implemente les operateurs et les methodes virtuelles de la classe EFichier de la facon s...
Une chaine de caractere (Nom) en majuscules.
Definition Motcle.h:26
Un tableau d'objets de la classe Motcle.
Definition Motcle.h:63
int search(const Motcle &t) const
Definition Motcle.cpp:321
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
friend class Entree
Definition Objet_U.h:76
static int dimension
Definition Objet_U.h:99
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
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455
Classe de base des flux de sortie.
Definition Sortie.h:52
classe Traitement_particulier_NS_base Derive de Support_Champ_Masse_Volumique: utilisation de rho
classe Traitement_particulier_chmoy_faceperio Cette classe permet de faire les traitements particulie...
virtual void calcul_chmoy_faceperio(double, double, double)=0