TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Champ_Fonc_Fonction_txyz_Morceaux.cpp
1/****************************************************************************
2* Copyright (c) 2026, 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#include <Champ_Fonc_Fonction_txyz_Morceaux.h>
17#include <Champ_Fonc_Tabule.h>
18
19Implemente_instanciable(Champ_Fonc_Fonction_txyz_Morceaux,"Champ_Fonc_Fonction_txyz_Morceaux",TRUSTChamp_Morceaux_generique<Champ_Morceaux_Type::FONC_TXYZ>);
20// XD champ_fonc_fonction_txyz_morceaux champ_don_base champ_fonc_fonction_txyz_morceaux NO_BRACE Field defined by
21// XD_CONT analytical functions in each sub-domaine. On each zone, the value is defined as a function of x,y,z,t and of
22// XD_CONT scalar value taken from a parameter field. This values is associated to the variable 'val' in the expression.
23// XD attr problem_name ref_Pb_base problem_name REQ Name of the problem.
24// XD attr inco chaine inco REQ Name of the field (for example: temperature).
25// XD attr nb_comp entier nb_comp REQ Number of field components.
26// XD attr data bloc_lecture data REQ { Defaut val_def sous_domaine_1 val_1 ... sous_domaine_i val_i } By default, the
27// XD_CONT value val_def is assigned to the field. It takes the sous_domaine_i identifier Sous_Domaine (sub_area) type
28// XD_CONT object function, val_i. Sous_Domaine (sub_area) type objects must have been previously defined if the
29// XD_CONT operator wishes to use a champ_fonc_fonction_txyz_morceaux type object.
30
32
33/*! @brief Lit les valeurs du champ uniforme par morceaux a partir d'un flot d'entree.
34 *
35 * On lit le nom du domaine (nom_domaine) le nombre de composantes du champ (nb_comp) la valeur par defaut
36 * du champ ainsi que les valeurs sur les sous domaines.
37 * Format:
38 * Champ_Fonc_Fonction_txyz_Morceaux pb champ nb_comp { Defaut val_def sous_domaine_1 val_1 ... sous_domaine_i val_i }
39 *
40 */
42{
43 int dim;
44 Nom nom;
45 is >> nom;
47
50 if (isNum)
51 {
52 Cerr << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << finl;
53 Cerr << "Error in call to " << que_suis_je() << ":" << finl;
54 Cerr << "The syntax has changed in version 1.8.2." << finl;
55 Cerr << "You should now pass the dimension/number of components AFTER the field/parameter name." << finl;
56 Cerr << "Please update your dataset or contact TRUST support team." << finl;
58 }
59 is >> dim;
60
61 creer_tabs(dim);
62 is >> nom;
63
64 return complete_readOn(dim,que_suis_je(),is,nom);
65}
DoubleTab & valeurs() override
Surcharge Champ_base::valeurs() Renvoie le tableau des valeurs.
classe Champ_Fonc_Fonction_txyz_Morceaux Cette classe represente un champ prenant par morceaux des va...
static bool Check_if_int(const Nom &val)
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
const Nom & que_suis_je() const
renvoie la chaine identifiant la classe.
Definition Objet_U.cpp:104
virtual Entree & readOn(Entree &)
Lecture d'un Objet_U sur un flot d'entree Methode a surcharger.
Definition Objet_U.cpp:293
virtual Sortie & printOn(Sortie &) const
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
Definition Objet_U.cpp:282
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Definition Process.cpp:455
Classe de base des flux de sortie.
Definition Sortie.h:52
Entree & complete_readOn(const int dim, const Nom &qsj, Entree &is, Nom &nom)