16#include <Op_Diff_PolyMAC_HFV_Face.h>
17#include <Champ_Face_PolyMAC_HFV.h>
18#include <Domaine_Cl_PolyMAC_family.h>
19#include <Champ_Don_Fonc_xyz.h>
20#include <Champ_Uniforme.h>
21#include <Pb_Multiphase.h>
22#include <Simpler_Base.h>
23#include <Milieu_base.h>
54 else if (N_nu == N * D)
56 else if (N_nu == N * D * D)
57 nu_.resize(0, N, D, D);
59 Process::exit(
Nom(
"Op_Diff_PolyMAC_HFV_base : diffusivity component count ") +
Nom(N_nu) +
"not among (" +
Nom(N) +
", " +
Nom(N * D) +
", " +
Nom(N * D * D) +
")!");
61 le_dom_poly_->domaine().creer_tableau_elements(
nu_);
68 int e, i, m, n, N =
equation().
inconnue().
valeurs().
line_size(), N_nu =
nu_.line_size(), N_nu_src = nu_src.
line_size(), mult = N_nu / N, c_nu = nu_src.
dimension_tot(0) == 1, d, db, D =
dimension;
69 assert(N_nu % N == 0);
73 for (e = 0; e < domaine.nb_elem_tot(); e++)
74 for (n = 0; n < N_nu; n++)
75 nu_.addr()[N_nu * e + n] = nu_src(!c_nu * e, n);
76 else if (N_nu == N * D && N_nu_src == N)
77 for (e = 0; e < domaine.nb_elem_tot(); e++)
78 for (n = 0; n < N; n++)
79 for (d = 0; d < D; d++)
80 nu_(e, n, d) = nu_src(!c_nu * e, n);
81 else if (N_nu == N * D * D && (N_nu_src == N || N_nu_src == N * D))
82 for (e = 0; e < domaine.nb_elem_tot(); e++)
83 for (n = 0; n < N; n++)
84 for (d = 0; d < D; d++)
85 for (db = 0; db < D; db++)
86 nu_(e, n, d, db) = (d == db) * nu_src(!c_nu * e, N_nu_src == N ? n : D * n + d);
92 for (e = 0; e < domaine.nb_elem_tot(); e++)
93 for (n = 0, i = 0; n < N; n++)
94 for (m = 0; m < mult; m++, i++)
106 const std::string& nom_inco = (le_champ_inco ? le_champ_inco.valeur() :
equation().inconnue()).le_nom().getString();
107 int i, j, n_ext = (int)
op_ext.size(), first_run =
mat_aux.nb_lignes() == 0;
109 for (
mat_aux.dimensionner(n_ext, n_ext), i = 0; i < n_ext; i++)
110 for (j = 0; j < n_ext; j++)
111 mat_aux.get_bloc(i, j).typer(
"Matrice_Morse");
112 std::vector<const Op_Diff_PolyMAC_HFV_base*> opp_ext(n_ext);
113 for (i = 0; i < n_ext; i++)
115 std::vector<matrices_t> lines(n_ext);
116 for (i = 0; i < n_ext; i++)
117 for (j = 0; j < n_ext; j++)
120 for (i = 0; i < n_ext; i++)
124 std::deque<ConstDoubleTab_parts> v_part;
125 for (i = 0; i < n_ext; i++)
126 v_part.emplace_back(
op_ext[i]->has_champ_inco() ?
op_ext[i]->mon_inconnue().valeurs() :
op_ext[i]->equation().inconnue().valeurs());
128 for (i = 0; i < n_ext; i++)
129 mdc.
add_part(v_part[i][1].get_md_vector(), v_part[i][1].line_size());
132 DoubleTrav inco, secmem;
134 DoubleTab_parts p_inc(inco), p_sec(secmem);
135 for (i = 0; i < n_ext; i++)
136 p_inc[i] = v_part[i][1];
140 for (i = 0; i < n_ext; i++)
141 for (j = 0; j < n_ext; j++)
143 for (i = 0; i < n_ext; i++)
146 mat_aux.ajouter_multvect(inco, secmem);
150 if (
equation().parametre_equation())
154 EChaine chl(
"petsc cholesky { }");
163 for (i = 0; i < n_ext; i++)
DoubleTab & valeurs() override
Returns the array of field values at the current time.
virtual DoubleTab & valeurs()=0
An input stream whose source is a character string.
Class defining operators and methods for all reading operation in an input flow (file,...
class Equation_base The role of an equation is the calculation of one or more fields....
virtual const Milieu_base & milieu() const =0
virtual const Champ_Inc_base & inconnue() const =0
Metadata for a distributed composite vector.
void add_part(const MD_Vector &part, int shape=0, Nom name="")
Append the "part" descriptor to the composite vector.
: This class is an OWN_PTR but the pointed object is shared among multiple
void copy(const MD_Vector_base &)
Constructs an MD_Vector object by copying an existing object.
Matrice_Morse class - Represents a (sparse) matrix M, not necessarily square,.
DoubleVect & porosite_elem()
const Equation_base & equation() const
Returns the reference to the equation pointed to by MorEqn::mon_equation.
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 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.
class Op_Diff_PolyMAC_CDO_Gen_base
virtual int dimension_min_nu() const
virtual void modifier_mu(DoubleTab &) const
const Champ_base & diffusivite() const override
class Op_Diff_PolyMAC_HFV_base
virtual void ajouter_blocs_ext(int aux_only, matrices_t matrices, DoubleTab &secmem, const tabs_t &semi_impl={ }) const =0
void completer() override
Associates the operator with the domaine_dis, the domaine_Cl_dis, and the unknown of its equation.
void update_aux(double t) const
void update_nu() const override
void mettre_a_jour(double t) override
DOES NOTHING - to override in derived classes.
virtual void dimensionner_blocs_ext(int aux_only, matrices_t matrices, const tabs_t &semi_impl={ }) const =0
std::vector< const Operateur_Diff_base * > op_ext
virtual void mettre_a_jour(double temps)
DOES NOTHING - to override in derived classes.
virtual void completer()
Associates the operator with the domaine_dis, the domaine_Cl_dis, and the unknown of its equation.
class Parametre_implicite A Parametre_implicite object groups together the various
Multiphase thermohydraulics problem of type "3*N equations":
static void abort()
Abort routine for TRUST on a fatal error.
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Base class for output streams.
_SIZE_ dimension_tot(int) const override