16#include <Masse_PolyMAC_CDO_Elem.h>
17#include <Domaine_Cl_PolyMAC_family.h>
18#include <Champ_Elem_PolyMAC_CDO.h>
19#include <Domaine_PolyMAC_CDO.h>
20#include <TRUSTTab_parts.h>
21#include <Equation_base.h>
22#include <Neumann_paroi.h>
23#include <Matrix_tools.h>
24#include <Array_tools.h>
25#include <Milieu_base.h>
38 const DoubleVect& volumes = domaine_PolyMAC_CDO.
volumes();
41 const int nb_elem = domaine_PolyMAC_CDO.
nb_elem(), nb_dim = sm.
nb_dim();
51 for (
int num_elem = 0; num_elem < nb_elem; num_elem++)
52 for (
int k = 0; k < nb_comp; k++)
53 sm(num_elem, k) /= (volumes(num_elem) * porosite_elem(num_elem));
58 for (
int num_elem = 0; num_elem < nb_elem; num_elem++)
59 for (
int k = 0; k < d1; k++)
60 for (
int d = 0; d < d2; d++)
61 sm(num_elem, k, d) /= (volumes(num_elem) * porosite_elem(num_elem));
65 Cerr <<
"Masse_PolyMAC_CDO_Elem::appliquer cannot be applied to a DoubleTab with " << sm.
nb_dim() <<
" dimensions" << finl;
77 int e, f, ne_tot = domaine.nb_elem_tot(), nf_tot = domaine.nb_faces_tot(), n, N = ch.
valeurs().
line_size();
78 const bool only_ne = (matrix.
nb_lignes() == ne_tot);
80 domaine.init_m2(), ch.
fcl();
84 for (e = 0; e < domaine.nb_elem(); e++)
85 for (n = 0; n < N; n++)
88 for (f = 0; !only_ne && f < domaine.nb_faces(); f++)
90 for (n = 0; n < N; n++)
91 indice.
append_line(N * (ne_tot + f) + n, N * (ne_tot + f) + n);
93 tableau_trier_retirer_doublons(indice);
101 Cerr <<
"Masse_PolyMAC_CDO_Elem::ajouter_masse : use_old_volumes is not supported." << finl;
106 const Conds_lim& cls = le_dom_Cl_PolyMAC_CDO->les_conditions_limites();
108 int e, f, ne_tot = domaine.nb_elem_tot(), n, N = inco.
line_size();
109 DoubleVect coef(
equation().milieu().porosite_elem());
115 for (e = 0; e < domaine.nb_elem(); e++)
116 for (n = 0; n < N; n++)
117 secmem(e, n) += coef(e) * pe(e) * ve(e) * inco(e, n) / dt;
120 for (f = 0; secmem.
dimension_tot(0) > ne_tot && f < domaine.nb_faces(); f++)
121 if (ch.
fcl()(f, 0) == 4)
122 for (n = 0; n < N; n++)
123 secmem(N * (ne_tot + f) + n) += fs(f) * ref_cast(
Neumann_paroi, cls[ch.
fcl()(f, 1)].valeur()).flux_impose(ch.
fcl()(f, 2), n);
124 else if (ch.
fcl()(f, 0) == 6)
125 for (n = 0; n < N; n++)
126 secmem(N * (ne_tot + f) + n) += ref_cast(
Dirichlet, cls[ch.
fcl()(f, 1)].valeur()).val_imp(ch.
fcl()(f, 2), n);
138 DoubleVect coef(
equation().milieu().porosite_elem());
142 domaine.init_m2(), ch.
fcl();
144 for (e = 0; e < domaine.nb_elem(); e++)
145 for (n = 0; n < N; n++)
146 mat(N * e + n, N * e + n) += coef(e) * pe(e) * ve(e) / dt;
149 for (f = 0; mat.
nb_lignes() > N * ne_tot && f < domaine.nb_faces(); f++)
151 for (n = 0; n < N; n++)
152 mat(N * (ne_tot + f) + n, N * (ne_tot + f) + n) += 1;
const IntTab & fcl() const
DoubleTab & valeurs() override
Returns the array of field values at the current time.
class Conds_lim This class represents a vector of boundary conditions.
Dirichlet This class is the base class of the hierarchy of Dirichlet-type boundary conditions.
double volumes(int i) const
Class defining operators and methods for all reading operation in an input flow (file,...
virtual const Milieu_base & milieu() const =0
DoubleTab & ajouter_masse(double dt, DoubleTab &x, const DoubleTab &y, int penalisation=1, bool use_old_volumes=false) const override
void dimensionner(Matrice_Morse &matrix) const override
DoubleTab & appliquer_impl(DoubleTab &) const override
void appliquer_coef(DoubleVect &coef) const
Matrice_Base class - Base class of the matrix hierarchy.
Matrice_Morse class - Represents a (sparse) matrix M, not necessarily square,.
int nb_lignes() const override
Return local number of lines (=size on the current proc).
DoubleVect & porosite_elem()
const Equation_base & equation() const
Returns the reference to the equation pointed to by MorEqn::mon_equation.
Classe Neumann_paroi This boundary condition corresponds to an imposed flux for the.
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 const Nom & le_nom() const
Returns the name of the Objet_U. Virtual method to override: returns "neant" in this implementation.
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.
int has_coefficient_temporel_
Base class for output streams.
_SIZE_ dimension_tot(int) const override
_SIZE_ dimension(int d) const
virtual void echange_espace_virtuel(IsExchangeBlocking exchange_type=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")