TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Sondes_Int.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 <Postraitement.h>
17#include <Sondes_Int.h>
18
19Implemente_instanciable(Sondes_Int, "Sondes_Int", LIST(Sonde_Int));
20
21Sortie& Sondes_Int::printOn(Sortie& s ) const { return s ; }
22
23/*! @brief Lit une liste de sondes a partir d'un flot d'entree Format: { [LIRE UNE SONDE AUTANT DE FOIS QUE NECESSAIRE] }
24 *
25 * @param (Entree& s) un flot d'entree
26 * @return (Entree&) le flot d'entree modifie
27 * @throws accolade ouvrante attendue
28 */
29Entree& Sondes_Int::readOn(Entree& s )
30{
31 assert(mon_post);
32
33 Motcle motlu;
34 Motcle accolade_ouverte("{");
35 Motcle accolade_fermee("}");
36
37 s >> motlu;
38
39 if (motlu != accolade_ouverte)
40 {
41 Cerr << "Error while reading the probes in the postprocessing" << finl;
42 Cerr << "We expected { to start to read the probes" << finl;
43 exit();
44 }
45 s >> motlu;
46
47 if (motlu == accolade_fermee)
48 {
49 Cerr << "Error while reading the probes in the postprocessing" << finl;
50 Cerr << "You have not defined any probe" << finl;
51 exit();
52 }
53 while (motlu != accolade_fermee)
54 {
55 Sonde_Int une_sonde(motlu);
56 une_sonde.associer_post(mon_post.valeur());
57 s >> une_sonde;
58 add(une_sonde);
59 s >> motlu;
60 }
61 Cerr << "End of reading probes " << finl;
62 return s;
63}
64
65/*! @brief Effectue le postraitement sur chacune des sondes de la liste.
66 *
67 */
68void Sondes_Int::postraiter(double temps)
69{
70 for (auto& itr : *this) itr.postraiter(temps);
71}
72
73/*! @brief Effectue une mise a jour en temps de chacune des sondes de la liste.
74 *
75 * @param (double temps) le temps de mise a jour
76 * @param (double tinit) le temps initial des sondes
77 */
78void Sondes_Int::mettre_a_jour(double temps, double tinit)
79{
80 for (auto& itr : *this) itr.mettre_a_jour(temps,tinit);
81}
82
83/*! @brief Associe un postraitement a la liste des sondes.
84 *
85 */
87{
88 mon_post = post;
89}
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
classe Postraitement La classe est dotee -d une liste de champs generiques champs_post_complet_ qui c...
classe Sonde_Int Cette classe permet d'effectuer l'evolution d'un champ au cours du temps.
Definition Sonde_Int.h:36
classe Sondes_Int Cette classe represente une liste d'objets de type Sonde_Int.
Definition Sondes_Int.h:28
void mettre_a_jour(double temps, double tinit)
Effectue une mise a jour en temps de chacune des sondes de la liste.
void associer_post(const Postraitement &)
Associe un postraitement a la liste des sondes.
void postraiter(double)
Effectue le postraitement sur chacune des sondes de la liste.
Classe de base des flux de sortie.
Definition Sortie.h:52