TrioCFD 1.9.9_beta
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 Reads a list of probes from an input stream. Format: { [READ A PROBE AS MANY TIMES AS NEEDED] }
24 *
25 * @param s an input stream
26 * @return the modified input stream
27 * @throws opening brace expected
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 Performs post-processing on each probe in the list.
66 *
67 * @param temps the current time
68 */
69void Sondes_Int::postraiter(double temps)
70{
71 for (auto& itr : *this) itr.postraiter(temps);
72}
73
74/*! @brief Updates each probe in the list in time.
75 *
76 * @param temps the update time
77 * @param tinit the initial time of the probes
78 */
79void Sondes_Int::mettre_a_jour(double temps, double tinit)
80{
81 for (auto& itr : *this) itr.mettre_a_jour(temps,tinit);
82}
83
84/*! @brief Associates a post-processing object with the probe list.
85 *
86 */
88{
89 mon_post = post;
90}
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
class Postraitement. The class holds -a list of generic fields champs_post_complet_ containing
class Sonde_Int
Definition Sonde_Int.h:37
class Sondes_Int
Definition Sondes_Int.h:29
void mettre_a_jour(double temps, double tinit)
Updates each probe in the list in time.
void associer_post(const Postraitement &)
Associates a post-processing object with the probe list.
void postraiter(double)
Performs post-processing on each probe in the list.
Base class for output streams.
Definition Sortie.h:52