16#include <LecFicDiffuse.h>
17#include <Champ_P0_VDF.h>
18#include <Domaine_VDF.h>
33 const DoubleTab& xp = domaine_vdf.
xp();
34 int nb_poly = domaine_vdf.
nb_elem();
41 domaine.calculer_centres_gravite(positions);
56 const DoubleTab& val =
valeurs();
59 DoubleVect moy(nb_compo);
61 double coef, sum_vol = 0;
65 coef = porosite_elem(num_elem) * volumes(num_elem);
66 for (k = 0; k < nb_compo; k++)
67 moy[k] += val(num_elem, k) * coef;
84 const DoubleTab& val =
valeurs();
87 double coef, sum_vol = 0;
91 coef = porosite_elem(num_elem) * volumes(num_elem);
92 moy += val(num_elem, ncomp) * coef;
142 np=(ni-1)*(nj-1)*(nk-1);
144 for(k=0; k<nk-1; k++)
145 for(ii=0; ii<ni-1; ii++)
146 for(jj=0; jj<nj-1; jj++)
148 elem=jj+(nj-1)*(ii+k*(ni-1));
149 Grille(elem,0)=0.5*(xi(ii)+xi(ii+1));
150 Grille(elem,1)=0.5*(yj(jj)+yj(jj+1));
151 Grille(elem,2)=0.5*(zk(k)+zk(k+1));
155 for(k=0; k<nk-1; k++)
158 os <<
"Coupe a K= " << k << finl;
163 n2=std::min(ni-1,n2+cmax);
166 for(
int i=n1; i<n2; i++)
169 for(
int j=nj-2; j>-1; j--)
171 os <<
"J= " << j <<
" ";
172 for(
int i=n1; i<n2; i++)
174 elem=j+(nj-1)*(i+k*(ni-1));
175 os << tab_valeurs(elem,0) <<
" ";
186 for(ii=0; ii<ni-1; ii++)
187 for(jj=0; jj<nj-1; jj++)
190 Grille(elem,0)=0.5*(xi(ii)+xi(ii+1));
191 Grille(elem,1)=0.5*(yj(jj)+yj(jj+1));
199 n2=std::min(ni-1,n2+cmax);
202 for(
int i=n1; i<n2; i++)
205 for(
int j=nj-2; j>-1; j--)
207 os <<
"J= " << j <<
" ";
208 for(
int i=n1; i<n2; i++)
211 os << tab_valeurs(elem,0) <<
" ";
220 Cerr <<
"Champ_P0_VDF::imprime_P0_VDF with nb_compo_>1 not implemented." << finl;
237 const DoubleTab& val =
valeurs();
240 for (elem = 0; elem < nb_elem; elem++)
241 integr += val(elem, ncomp) * volumes(elem);
: class Champ_Inc_P0_base
const Domaine & domaine() const
const Domaine_dis_base & domaine_dis_base() const override
DoubleTab & valeurs() override
Returns the array of field values at the current time.
DoubleTab & valeur_aux(const DoubleTab &positions, DoubleTab &valeurs) const override
Computes the values of the unknown field at the specified positions.
class Champ_P0_VDF Class representing a P0 discrete field per element associated with a discretized d...
DoubleTab & remplir_coord_noeuds(DoubleTab &) const override
int imprime(Sortie &os, int nb_compo_) const override
Writes the field in IJK format.
DoubleVect moyenne(const DoubleVect &porosite_elem) const
Returns the P0-average of the field, i.e. the sum, divided by the total domain volume,...
const Domaine_VDF & domaine_VDF() const
double integrale_espace(int ncomp) const override
Computes the spatial integral of one component of the field over the corresponding domain.
double volumes(int i) const
double xp(int num_elem, int k) const
const Domaine & domaine() const
Class defining operators and methods for all reading operation in an input flow (file,...
const Nom & le_nom() const override
Returns the name of the field.
virtual int nb_comp() const
This class implements the operators and virtual methods of the EFichier class as follows: The file to...
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.
static const Nom & nom_du_cas()
Returns a constant reference to the case name. This method is static.
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Base class for output streams.
virtual void ref(const TRUSTTab &)
void resize(_SIZE_ n, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
_SIZE_ dimension(int d) const