TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
TRUSTChamp_Morceaux_generique.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 TRUSTChamp_Morceaux_generique_included
17#define TRUSTChamp_Morceaux_generique_included
18
19#include <Champ_Uniforme.h>
20#include <Champ_Don_base.h>
21#include <Probleme_base.h>
22#include <TRUST_Vector.h>
23#include <TRUST_List.h>
24#include <TRUST_Ref.h>
25#include <Parser_U.h>
26#include <Domaine_forward.h>
27
28enum class Champ_Morceaux_Type { FONC , FONC_TXYZ , FONC_TABULE , UNIFORME };
29
30template <Champ_Morceaux_Type _TYPE_>
32{
33public:
34
35 Champ_base& affecter_(const Champ_base& ch) override;
36
37 DoubleVect& valeur_a(const DoubleVect& position, DoubleVect& valeurs) const override;
38
39 DoubleVect& valeur_a_elem(const DoubleVect& position, DoubleVect& valeurs, int le_poly) const override;
40
41 double valeur_a_elem_compo(const DoubleVect& position, int le_poly, int ncomp) const override;
42
43 DoubleTab& valeur_aux(const DoubleTab& positions, DoubleTab& valeurs) const override;
44
45 DoubleVect& valeur_aux_compo(const DoubleTab& positions, DoubleVect& valeurs, int ncomp) const override;
46
47 DoubleTab& valeur_aux_elems(const DoubleTab& positions, const IntVect& les_polys, DoubleTab& valeurs) const override;
48
49 DoubleVect& valeur_aux_elems_compo(const DoubleTab& positions, const IntVect& les_polys, DoubleVect& valeurs, int ncomp) const override;
50
51 void mettre_a_jour(double temps) override;
52
53 int initialiser(const double temps) override;
54
55 const OBS_PTR(Domaine)& domaine() const { return mon_domaine; }
56 OBS_PTR(Domaine)& domaine() { return mon_domaine; }
57 const LIST(OBS_PTR(Sous_Domaine))& sous_domaines() const { return les_sous_domaines; }
58 LIST(OBS_PTR(Sous_Domaine))& sous_domaines() { return les_sous_domaines; }
59
60protected:
61 LIST(OBS_PTR(Sous_Domaine)) les_sous_domaines;
62 OBS_PTR(Domaine) mon_domaine;
64 VECT(Parser_U) parser; /* vector of all parsers */
65 Nom nom_champ_parametre_; /* name of the field whose functions have parameters */
66 IntTab parser_idx_; /* parser_idx(i, j): parser to call to calculate component j of the field in cell i */
68 void interprete_get_domaine(const Nom& nom);
69
70 void creer_tabs(const int);
71 Entree& complete_readOn(const int dim, const Nom& qsj, Entree& is, Nom& nom);
72
73};
74
75#include <TRUSTChamp_Morceaux_generique.tpp>
76
77#endif /* TRUSTChamp_Morceaux_generique_included */
class Champ_Don_base base class of Given Fields (not calculated)
DoubleTab & valeurs() override
Overrides Champ_base::valeurs() Returns the array of values.
Champ_base()
Default constructor of a Champ_base.
double temps() const
Returns the time of the field.
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
class Parser_U Version of the Parser class, deriving from Objet_U.
Definition Parser_U.h:32
class Probleme_base It is a Probleme_U that is not a coupling.
Entree & complete_readOn(const int dim, const Nom &qsj, Entree &is, Nom &nom)
DoubleVect & valeur_aux_elems_compo(const DoubleTab &positions, const IntVect &les_polys, DoubleVect &valeurs, int ncomp) const override
Returns the values of one component of the field at the points specified by their coordinates,...
DoubleVect & valeur_a_elem(const DoubleVect &position, DoubleVect &valeurs, int le_poly) const override
Returns the value of the field at the point specified by its coordinates, indicating that this point ...
DoubleTab & valeur_aux(const DoubleTab &positions, DoubleTab &valeurs) const override
Returns the values of the field at the points specified by their coordinates.
const OBS_PTR(Domaine) &domaine() const
OBS_PTR(Domaine) mon_domaine
LIST(OBS_PTR(Sous_Domaine)) les_sous_domaines
const LIST(OBS_PTR(Sous_Domaine)) &sous_domaines() const
void mettre_a_jour(double temps) override
Time update.
OBS_PTR(Probleme_base) ref_pb
DoubleTab & valeur_aux_elems(const DoubleTab &positions, const IntVect &les_polys, DoubleTab &valeurs) const override
Returns the values of the field at the points specified by their coordinates, indicating that the com...
Champ_base & affecter_(const Champ_base &ch) override
Causes an error! To be overridden by derived classes! Not a pure virtual for development convenience!
DoubleVect & valeur_aux_compo(const DoubleTab &positions, DoubleVect &valeurs, int ncomp) const override
Returns the values of one component of the field at the points specified by their coordinates.
int initialiser(const double temps) override
DOES NOTHING.
LIST(OBS_PTR(Sous_Domaine)) &sous_domaines()
DoubleVect & valeur_a(const DoubleVect &position, DoubleVect &valeurs) const override
Returns the value of the field at the point specified by its coordinates.
double valeur_a_elem_compo(const DoubleVect &position, int le_poly, int ncomp) const override
Returns the value of one component of the field at the point specified by its coordinates,...