16#include <Champ_input_P0.h>
17#include <Probleme_base.h>
18#include <Schema_Temps_base.h>
19#include <Interprete.h>
21#include <Sous_Domaine.h>
22#include <ICoCoExceptions.h>
24#include <Convert_ICoCoTrioField.h>
25#include <Domaine_VF.h>
31using ICoCo::WrongArgument;
44 mon_pb->domaine().creer_tableau_elements(
valeurs_);
46 mon_pb->addInputField(*
this);
51 int nb_elem_tot=
valeurs_.dimension_tot(0);
52 for (
int ele=0; ele< nb_elem_tot; ele++)
59 const Sous_Domaine& ssz=mon_sous_domaine.valeur();
62 nb_elems_reels_sous_domaine_ += (ssz[i] < nb_elems_reels_loc_);
97 afield.setName(
le_nom().getChar());
99 afield._time1=mon_pb->presentTime();
100 afield._time2=mon_pb->futureTime();
102 afield._nb_field_components=
nb_comp();
105 const DoubleTab& sommets=mon_pb->domaine().les_sommets();
107 afield._mesh_dim = afield._space_dim = sommets.
dimension(1);
108 affecte_double_avec_doubletab(&afield._coords,sommets);
112 afield._nb_elems = mon_sous_domaine ? nb_elems_reels_sous_domaine_ : zvf.
nb_elem();
114 if (type_elem !=
"POLYEDRE")
118 afield._nodes_per_elem = std::max(conn.
dimension(1), type_elem ==
"POLYGONE" ? (
int) 5 : 0);
119 afield._connectivity =
new int[afield._nb_elems * afield._nodes_per_elem];
120 for (
int i = 0; i < afield._nb_elems; i++)
121 for (
int j = 0; j < afield._nodes_per_elem; j++)
123 const int e = mon_sous_domaine ? mon_sous_domaine.valeur()[i] : i;
124 afield._connectivity[afield._nodes_per_elem * i + j] = j < conn.
dimension(1) ? conn(e, j) : -1;
130 int *p = afield._connectivity =
new int[afield._nb_elems * afield._nodes_per_elem];
131 for (
int i = 0, j, k, e, f, s; i < (mon_sous_domaine ? mon_sous_domaine->nb_elem_tot() : zvf.
nb_elem()); i++)
133 if (mon_sous_domaine && mon_sous_domaine.valeur()[i] >= zvf.
nb_elem())
continue;
134 e = mon_sous_domaine ? mon_sous_domaine.valeur()[i] : i;
135 int *pf = p + afield._nodes_per_elem;
140 for ( ; p < pf; p++) *p = -1;
150 if (mon_sous_domaine)
152 const Sous_Domaine& ssz=mon_sous_domaine.valeur();
153 if (afield._nb_elems != nb_elems_reels_sous_domaine_)
154 throw WrongArgument(mon_pb->le_nom().getChar(),
"setInputField",
"afield",
"should have the same _nb_elems as returned by getInputFieldTemplate");
156 if (afield._nb_field_components!=
valeurs_.dimension(1))
157 throw WrongArgument(mon_pb->le_nom().getChar(),
"setInputField",
"afield",
"should have the same _nb_field_components as returned by getInputFieldTemplate");
159 if (ssz[i] < nb_elems_reels_loc_)
void associer_domaine_dis_base(const Domaine_dis_base &) override
virtual const Domaine_VF & domaine_vf() const
int face_sommets(int i, int j) const
Returns the index of the i-th vertex of face num_face.
int elem_faces(int i, int j) const
Returns the index of the i-th face of element num_elem; the face numbering convention is.
const Domaine & domaine() const
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.
const Nom & le_nom() const override
Returns the name of the field.
void nommer(const Nom &) override
Gives a name to the field.
virtual int nb_comp() const
A character string (Nom) in uppercase.
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.
Base class for output streams.
int_t nb_elem_tot() const
_SIZE_ dimension(int d) const