TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Sondes.h
1/****************************************************************************
2* Copyright (c) 2024, 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#ifndef Sondes_included
17#define Sondes_included
18
19#include <Champ_Generique_base.h>
20#include <Champs_compris.h>
21#include <TRUST_List.h>
22
23#include <Sonde.h>
24#include <Noms.h>
25
26/*! @brief class Sondes
27 * @brief Represents a list of probes.
28 *
29 * @sa Sonde Postraitement
30 */
31class Sondes : public LIST(OWN_PTR(Sonde))
32{
33 Declare_instanciable(Sondes);
34public:
35 inline void ouvrir_fichiers();
36 inline void fermer_fichiers();
37 void completer();
38 inline void init_bords();
39 void associer_post(const Postraitement&);
40 void postraiter();
41 void mettre_a_jour(double temps, double tinit);
42 OBS_PTR(Champ_base) get_from_cache(OBS_PTR(Champ_Generique_base)& mon_champ, const Nom& nom_champ_lu_);
43 void clear_cache();
45 const Motcles& get_noms_champs_postraitables() const { return noms_champs_postraitables_; }
46 bool update_positions=false;
49 void resetTime(double time) { for (auto &itr : *this) itr->resetTime(time); };
50
51private:
52 // Cache mechanism for probes:
53 LIST(OBS_PTR(Champ_base)) sourceList;
54 LIST(OWN_PTR(Champ_base)) espaceStockageList;
55 Noms sourceNoms;
56 OBS_PTR(Postraitement) mon_post;
57 Motcles noms_champs_postraitables_;
58};
59
60inline void Sondes::init_bords()
61{
62 for (auto& itr : *this) itr->init_bords();
63}
64
65/*! @brief Opens all files associated with each probe in the list.
66 *
67 */
69{
70 for (auto &itr : *this) itr->ouvrir_fichier();
71}
72
73/*! @brief Closes all files associated with the probes in the list.
74 *
75 */
77{
78 for (auto &itr : *this) itr->fermer_fichier();
79}
80
81#endif /* Sondes_included */
class Champ_Generique_base
class Champ_base This class is the base of the fields hierarchy.
Definition Champ_base.h:43
An array of Motcle objects.
Definition Motcle.h:63
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
An array of character strings (VECT(Nom)).
Definition Noms.h:26
class Postraitement. The class holds -a list of generic fields champs_post_complet_ containing
class Sondes
Definition Sondes.h:32
OBS_PTR(Champ_base) get_from_cache(OBS_PTR(Champ_Generique_base) &mon_champ
void set_update_positions(bool update_positions)
Modifies the update-positions setting for mobile probes.
Definition Sondes.cpp:164
void fermer_fichiers()
Closes all files associated with the probes in the list.
Definition Sondes.h:76
void mettre_a_jour(double temps, double tinit)
Updates each probe in the list in time.
Definition Sondes.cpp:146
void postraiter()
Performs post-processing on each probe in the list.
Definition Sondes.cpp:107
const Motcles & get_noms_champs_postraitables() const
Definition Sondes.h:45
void ouvrir_fichiers()
Opens all files associated with each probe in the list.
Definition Sondes.h:68
void clear_cache()
Definition Sondes.cpp:114
void set_noms_champs_postraitables()
Definition Sondes.cpp:85
void completer()
Definition Sondes.cpp:98
void init_bords()
Definition Sondes.h:60
void resetTime(double time)
Definition Sondes.h:49
void associer_post(const Postraitement &)
Associates a post-processing object with the probe list.
Definition Sondes.cpp:156
const Nom & nom_champ_lu_
Definition Sondes.h:42
bool get_update_positions()
Returns the update-positions setting for mobile probes.
Definition Sondes.cpp:173
bool update_positions
Definition Sondes.h:46