TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Champs_compris.h
1/****************************************************************************
2* Copyright (c) 2025, 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 Champs_compris_included
17#define Champs_compris_included
18
19#include <TRUST_List.h>
20#include <TRUST_Ref.h>
21#include <Noms.h>
22#include <IJK_Field_forward.h>
23#include <unordered_map>
24
25class Champ_base;
26
27/*! @brief classe Champs_compris Represente un champ compris par un objet de type Equation, Milieu,
28 *
29 * Operateur, Source, Traitement_particulier.
30 *
31 * Parametrized by the type of field: typically Champ_base or IJK_Field_double
32 */
33template<typename FIELD_TYPE>
35{
36public :
37 // Return the field if found, otherwise raises.
38 const FIELD_TYPE& get_champ(const Motcle& nom) const;
39 // Same thing, but without raising:
40 bool has_champ(const Motcle& nom, OBS_PTR(FIELD_TYPE)& ref_champ) const;
41 bool has_champ(const Motcle& nom) const;
42 void ajoute_champ(const FIELD_TYPE& champ);
43 const Noms liste_noms_compris() const;
45
46protected :
47 std::unordered_map<std::string, OBS_PTR(FIELD_TYPE)> liste_champs_;
48};
49
50using Champs_compris = Champs_compris_T<Champ_base>;
51using Champs_compris_IJK_base = Champs_compris_T<IJK_Field_double>;
52
53#endif /* Champs_compris_included */
classe Champ_base Cette classe est la base de la hierarchie des champs.
Definition Champ_base.h:43
classe Champs_compris Represente un champ compris par un objet de type Equation, Milieu,
const Noms liste_noms_compris() const
std::unordered_map< std::string, OBS_PTR(Champ_base)> liste_champs_
const FIELD_TYPE & get_champ(const Motcle &nom) const
void ajoute_champ(const FIELD_TYPE &champ)
bool has_champ(const Motcle &nom) const
void clear_champs_compris()
bool has_champ(const Motcle &nom, OBS_PTR(FIELD_TYPE)&ref_champ) const
Une chaine de caractere (Nom) en majuscules.
Definition Motcle.h:26
Un tableau de chaine de caracteres (VECT(Nom)).
Definition Noms.h:26