TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Table.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 Table_included
17#define Table_included
18
19#include <TRUSTTabs_forward.h>
20#include <Parser_Eval.h>
21#include <TRUSTVects.h>
22#include <Parser_U.h>
23#include <vector>
24
25/*! @brief
26 *
27 */
28class Table : public Objet_U, public Parser_Eval
29{
30 Declare_instanciable_sans_constructeur_ni_destructeur(Table);
31
32public :
33
34 Table();
35 inline Table(const DoubleVect& param,const DoubleVect& aval);
36 void remplir(const DoubleVect& param,const DoubleTab& val);
37 void remplir(const DoubleVects& params, const DoubleVect& aval);
38 double val_simple(double vals_param) const;
39 double val(const double val_param, int ncomp=0) const;
40 double val(const std::vector<double>& vals_param, int ncomp) const;
41 double val(const DoubleVect& val_param) const;
42 DoubleTab& valeurs(const DoubleTab& val_param,const DoubleTab& pos,const double tps,DoubleTab& val) const;
43 DoubleVect& valeurs(DoubleVect&, const double val_param) const;
44 DoubleVect& valeurs(DoubleVect&, const DoubleVect& val_param) const;
45 Entree& lire_f(Entree& is, const int nb_comp);
46 Entree& lire_fxyzt(Entree& is,const int dim);
47 inline const int& isfonction() const;
48 Table(const Table&);
49 Table& operator=(const Table& t) = default; // exige par gcc 9 car sinon error: implicitly-declared 'Table& Table::operator=(const Table&)' is deprecated [-Werror=deprecated-copy]
50 bool instationnaire() const;
51
52private:
53
54 DoubleTab les_valeurs;
55 DoubleVects les_parametres;
56 mutable bool instationnaire_ = false;
57 int isf = 0;
58};
59
60
61
62/*! @brief Construit un table avec les valeurs val, et les parametres param
63 *
64 * @param (const DoubleVect& param) parametres
65 * @param (const DoubleVect& val) valeurs
66 */
67inline Table::Table(const DoubleVect& param,const DoubleVect& aval)
68 : les_parametres(1)
69{
70 les_valeurs=aval;
71 les_parametres[0] = param;
72}
73
74inline const int& Table::isfonction() const
75{
76 return isf;
77}
78
79#endif // TABLE_H
friend class Entree
Definition Objet_U.h:76
Objet_U()
Constructeur par defaut : attribue un numero d'identifiant unique a l'objet (object_id_),...
Definition Objet_U.cpp:55
Classe Parser_Eval Cette classe a pour fonction d evaleur les valeurs prises par une fonction analyti...
Definition Parser_Eval.h:29
Table()
Constructeur par defaut.
Definition Table.cpp:27
void remplir(const DoubleVect &param, const DoubleTab &val)
Affecte les parametres et les valeurs de la table.
Definition Table.cpp:304
double val_simple(double vals_param) const
Definition Table.cpp:130
double val(const double val_param, int ncomp=0) const
Definition Table.cpp:145
const int & isfonction() const
Definition Table.h:74
DoubleTab & valeurs(const DoubleTab &val_param, const DoubleTab &pos, const double tps, DoubleTab &val) const
Definition Table.cpp:292
Entree & lire_f(Entree &is, const int nb_comp)
Definition Table.cpp:36
Entree & lire_fxyzt(Entree &is, const int dim)
Definition Table.cpp:60
Table & operator=(const Table &t)=default
bool instationnaire() const
Definition Table.cpp:334