TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Parser_Eval.h
1/****************************************************************************
2* Copyright (c) 2023, 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 Parser_Eval_included
17#define Parser_Eval_included
18
19#include <TRUSTTabs_forward.h>
20#include <TRUSTTabs.h>
21#include <Parser_U.h>
22
23/*! @brief Classe Parser_Eval Cette classe a pour fonction d evaleur les valeurs prises par une fonction analytique.
24 *
25 * La fonction peut dependre de l espace (x, y, z), du temps (t) et d'un champ parametre (val).
26 *
27 */
29{
30public :
31 inline VECT(Parser_U)& fonction() { return fonction_; }
32 Parser_U& parser(int i) { return fonction_[i]; }
33 Parser_U& parser(int i) const { return fonction_[i]; }
34
35 // multiple points evaluation - x, y, z
36 void eval_fct(const DoubleTab& positions, DoubleTab& val) const { eval_fct_(positions, nullptr, nullptr, val); }
37 // multiple points evaluation - x, y, z, t
38 void eval_fct(const DoubleTab& positions, const double t, DoubleTab& val) const { eval_fct_(positions, &t, nullptr, val); }
39 // multiple points evaluation - x, y, z, t, field
40 void eval_fct(const DoubleTab& positions, const double t, const DoubleTab& val_param, DoubleTab& val) const { eval_fct_(positions, &t, &val_param, val); }
41 // multiple points evaluation, single component - x, y, z
42 void eval_fct(const DoubleTab& positions, DoubleVect& val, const int ncomp) const { eval_fct_single_compo(positions, nullptr, val, ncomp); }
43 // multiple points evaluation, single component - x, y, z, t
44 void eval_fct(const DoubleTab& positions, const double t, DoubleVect& val, const int ncomp) const { eval_fct_single_compo(positions, &t, val, ncomp); }
45 // single point evaluation - x, y, z
46 void eval_fct(const DoubleVect& position, DoubleVect& val) const { eval_fct_single_position(position, nullptr, nullptr, val); }
47 // single point evaluation - x, y, z, t
48 void eval_fct(const DoubleVect& position, const double t, DoubleVect& val) const { eval_fct_single_position(position, &t, nullptr, val); }
49
50 // Fonction generale qui depend de plusieurs champs inconnus
51 void eval_fct(const DoubleTabs& variables, DoubleTab& val) const;
52
53protected:
54 mutable VECT(Parser_U) fonction_;
55
56private:
57 double eval_fct_single_position_single_compo(const DoubleVect& position, const double* t, const double* val_param, const int ncomp) const;
58 void eval_fct_single_position(const DoubleVect& position, const double* t, const double* val_param, DoubleVect& val) const;
59 void eval_fct_single_compo(const DoubleTab& positions, const double* t, DoubleVect& val, const int ncomp) const;
60 void eval_fct_(const DoubleTab& positions, const double* t, const DoubleTab *val_param, DoubleTab& val) const;
61};
62
63#endif /* Parser_Eval_included */
Classe Parser_Eval Cette classe a pour fonction d evaleur les valeurs prises par une fonction analyti...
Definition Parser_Eval.h:29
void eval_fct(const DoubleTab &positions, const double t, DoubleVect &val, const int ncomp) const
Definition Parser_Eval.h:44
void eval_fct(const DoubleVect &position, const double t, DoubleVect &val) const
Definition Parser_Eval.h:48
Parser_U & parser(int i) const
Definition Parser_Eval.h:33
VECT(Parser_U) &fonction()
Definition Parser_Eval.h:31
void eval_fct(const DoubleTab &positions, const double t, DoubleTab &val) const
Definition Parser_Eval.h:38
void eval_fct(const DoubleTab &positions, DoubleVect &val, const int ncomp) const
Definition Parser_Eval.h:42
Parser_U & parser(int i)
Definition Parser_Eval.h:32
void eval_fct(const DoubleTab &positions, DoubleTab &val) const
Definition Parser_Eval.h:36
void eval_fct(const DoubleVect &position, DoubleVect &val) const
Definition Parser_Eval.h:46
void eval_fct(const DoubleTab &positions, const double t, const DoubleTab &val_param, DoubleTab &val) const
Definition Parser_Eval.h:40
VECT(Parser_U) fonction_
classe Parser_U Version de la classe Parser, derivant de Objet_U.
Definition Parser_U.h:32