TrioCFD 1.9.9_beta
TrioCFD documentation
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 Prints the object to an output stream.
26 *
27 * @param is an output stream
28 * @return the modified output stream
29 */
31{
32 return is;
33}
34
35
36/*! @brief Reads the object from an input stream.
37 *
38 * @param is an input stream
39 * @return the modified input stream
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 // For stats
65 is >> temps_deb; // start time for temporal stats computation
66 is >> temps_fin; // end time for temporal stats computation
67 // initialisation for temporal stats computation
68 oui_stat=1; // =1 : computing temporal stats
69 Cerr << "Reading time statitics parameters..." << finl;
70 Cerr << "Initial time : " << temps_deb << " End time : " << temps_fin << finl;
71 // Check whether values specific to spatial stats computations have been provided
72 break;
73 }
74 default :
75 {
76 Cerr << "Default case..." << finl;
77 Cerr << "Possible keywords are "<< les_mots <<" { and }" << finl;
78 Cerr << "You read:" << 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 : not designed for calculations other than 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 << " no file : chmoy_face_perio - resuming calculations not possible" << 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
This class implements the operators and virtual methods of the EFichier class as follows: there are a...
A character string (Nom) in uppercase.
Definition Motcle.h:26
An array of Motcle objects.
Definition Motcle.h:63
int search(const Motcle &t) const
Definition Motcle.cpp:319
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
friend class Entree
Definition Objet_U.h:71
static int dimension
Definition Objet_U.h:94
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
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Definition Process.cpp:466
Base class for output streams.
Definition Sortie.h:52
Traitement_particulier_NS_base Derives from Support_Champ_Masse_Volumique: use of rho.
Traitement_particulier_chmoy_faceperio This class performs specific post-processing treatments.
virtual void calcul_chmoy_faceperio(double, double, double)=0