16#include <Champ_Fonc_Tabule_Morceaux.h>
19#include <Domaine_VF.h>
20#include <TRUSTTab_parts.h>
39 mon_domaine->creer_tableau_elements(
i_mor);
47 mon_domaine->creer_tableau_elements(
valeurs_);
53 for (is >> nom; nom !=
"}"; is >> nom)
57 OBS_PTR(Sous_Domaine) refssz = les_sous_domaines.add(mon_domaine->ss_domaine(nom));
58 Sous_Domaine& ssz = refssz.valeur();
61 is >> nom,
m_pb_ch.push_back({});
64 Cerr <<
"Errror reading old syntax: " <<
que_suis_je() <<
" " << domaine()->le_nom() <<
" " << nbcomp <<
" { " << ssz.
le_nom() <<
" " << nom <<
" 1 { ... } ... }" << finl;
65 Cerr <<
"New syntax is like : " <<
que_suis_je() <<
" " << domaine()->le_nom() <<
" " << nbcomp <<
" { " << ssz.
le_nom() <<
" { problem_name " << nom <<
" } { ... } ... }" << finl;
66 Cerr <<
"Check the doc or release notes." << finl;
69 else for (is >> nom; nom !=
"}"; is >> nom)
74 std::array<std::string, 3> pb_ch = { nom.getString(), nom_ch.getString(), nat.getString() };
78 const int nb_param = (int)
m_pb_ch.back().size();
86 for (
int n = 0; n < nb_param; n++)
89 DoubleVect param(nb_val);
90 for (
int i = 0; i < nb_val; i++) is >> param[i];
97 for (
int n = 0; n < nb_param; n++) size *= params[n].
size();
100 DoubleVect tab_valeurs(size);
101 for (
int i = 0; i < size; i++) is >> tab_valeurs[i];
102 ch_lu.la_table.remplir(params, tab_valeurs);
110 if (mp_min_vect(
i_mor) == -1)
119 std::vector<std::array<std::string, 3>> v_pb_ch(
s_pb_ch.begin(),
s_pb_ch.end());
120 for (
auto &&pb_ch : v_pb_ch)
122 const Nom pb_nom =
Nom(pb_ch[0]);
127 for (
int i = 0; i < (int)
m_pb_ch.size(); i++)
128 for (
auto && pb_ch :
m_pb_ch[i])
129 morceaux[i].i_ch.push_back((
int)(std::lower_bound(v_pb_ch.begin(), v_pb_ch.end(), pb_ch) - v_pb_ch.begin()));
140 DoubleTab& tab =
valeurs(), vide;
141 std::vector<const DoubleTab* > pval;
142 std::vector<DoubleTrav> tval;
143 std::vector<bool> is_multi;
147 ConstDoubleTab_parts part(pch->valeurs());
149 pval.push_back(&pch->valeurs());
154 tval.push_back(DoubleTab(tab.
dimension_tot(0), pch->nb_comp()));
155 pch->valeur_aux_elems(pch->a_un_domaine_dis_base() ? ref_cast(
Domaine_VF, pch->domaine_dis_base()).xp() : vide, polys, tval.back());
156 pval.push_back(&tval.back());
158 is_multi.push_back(pval.back()->dimension(1) > 1);
160 std::vector<double> vals(
ch_param.size());
161 for (
int e = 0; e < mon_domaine->nb_elem(); e++)
165 if (N == 1 && M == 1)
167 else for (
int n = 0, m; n < N; n++)
169 for (vals.clear(), m = 0; m < M; m++) vals.push_back((*pval[mor.
i_ch[m]])(e, n * is_multi[mor.
i_ch[m]]));
DoubleTab & valeurs() override
Overrides Champ_base::valeurs() Returns the array of values.
class Champ_Fonc_Tabule_Morceaux
std::set< ArrStr > s_pb_ch
int initialiser(const double temps) override
DOES NOTHING.
void mettre_a_jour(double temps) override
Time update.
std::vector< const Champ_base * > ch_param
std::vector< std::vector< ArrStr > > m_pb_ch
std::vector< CHTAB > morceaux
virtual const Champ_base & get_champ(OWN_PTR(Champ_base) &espace_stockage) const =0
int lire_dimension(Entree &, const Nom &)
Verification of the field dimension Returns the dimension of the field.
Champ_base()
Default constructor of a Champ_base.
Class defining operators and methods for all reading operation in an input flow (file,...
virtual void fixer_nb_comp(int i)
Sets the number of components of the field.
static Objet_U & objet(const Nom &)
See Interprete_bloc::objet_global(). BM: the Interprete class is not the best place for this.
class Nom: a character string for naming TRUST objects.
const Nom & que_suis_je() const
Returns the string identifying the class.
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
class Probleme_base It is a Probleme_U that is not a coupling.
bool has_champ(const Motcle &nom, OBS_PTR(Champ_base) &ref_champ) const override
const Champ_base & get_champ(const Motcle &nom) const override
virtual const Champ_Generique_base & get_champ_post(const Motcle &nom) const
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Base class for output streams.
const Nom & le_nom() const override
Returns the name of the Objet_U. Virtual method to override: returns "neant" in this implementation.
int_t nb_elem_tot() const
void interprete_get_domaine(const Nom &nom)
const OBS_PTR(Domaine) &domaine() const
int initialiser(const double temps) override
DOES NOTHING.
_SIZE_ dimension_tot(int) const override
_SIZE_ dimension(int d) const
virtual const MD_Vector & get_md_vector() const
virtual void echange_espace_virtuel(IsExchangeBlocking exchange_type=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")
value_type & add()=delete
double val_simple(double vals_param) const
double val(const double val_param, int ncomp=0) const