16#include <Check_espace_virtuel.h>
17#include <Domaine_Cl_PolyMAC_family.h>
18#include <Navier_Stokes_std.h>
19#include <Schema_Temps_base.h>
20#include <Op_Div_PolyMAC_CDO.h>
21#include <Probleme_base.h>
22#include <EcrFicPartage.h>
23#include <Matrice_Morse.h>
24#include <Matrix_tools.h>
25#include <Array_tools.h>
47 const DoubleVect& surface = domaine_PolyMAC_CDO.
face_surfaces();
48 const IntTab& face_voisins = domaine_PolyMAC_CDO.
face_voisins();
53 declare_espace_virtuel_invalide(div);
61 const int nb_faces = domaine_PolyMAC_CDO.
nb_faces();
63 for (
int face = 0; face < premiere_face_int; face++)
65 const double flux = porosite_surf[face] * vit[face] * surface[face];
66 tab_flux_bords(face, 0) += flux;
68 const int elem1 = face_voisins(face, 0);
72 const int elem2 = face_voisins(face, 1);
77 for (
int face = premiere_face_int; face < nb_faces; face++)
79 const double flux = porosite_surf[face] * vit[face] * surface[face];
81 const int elem1 = face_voisins(face, 0);
85 const int elem2 = face_voisins(face, 1);
101 const DoubleVect& surface = domaine_PolyMAC_CDO.
face_surfaces();
102 const IntTab& face_voisins = domaine_PolyMAC_CDO.
face_voisins();
105 const int nb_faces = domaine_PolyMAC_CDO.
nb_faces();
107 for (
int face = 0; face < nb_faces; face++)
110 const double flux = -porosite_surf[face] * surface[face];
112 const int elem1 = face_voisins(face, 0);
114 matrice(elem1, face) += flux;
116 const int elem2 = face_voisins(face, 1);
118 matrice(elem2, face) -= flux;
131 int nb_faces = domaine_PolyMAC_CDO.
nb_faces();
133 int nb_elem_tot = domaine_PolyMAC_CDO.
nb_elem_tot();
134 Stencil stencyl(0, 2);
136 const IntTab& face_voisins = domaine_PolyMAC_CDO.
face_voisins();
139 for (
int face = 0; face < nb_faces; face++)
141 for (
int dir = 0; dir < 2; dir++)
143 const int elem = face_voisins(face, dir);
146 stencyl.
resize(nb_coef + 1, 2);
147 stencyl(nb_coef, 0) = elem;
148 stencyl(nb_coef, 1) = face;
153 tableau_trier_retirer_doublons(stencyl);
165 const int impr_bord = (le_dom_PolyMAC_CDO->domaine().bords_a_imprimer().est_vide() ? 0 : 1);
177 DoubleVect flux_bord(nb_compo);
178 DoubleVect bilan(nb_compo);
181 for (
int num_cl = 0; num_cl < le_dom_PolyMAC_CDO->nb_front_Cl(); num_cl++)
184 const Cond_lim& la_cl = le_dcl_PolyMAC_CDO->les_conditions_limites(num_cl);
187 const int nfin = ndeb + frontiere_dis.
nb_faces();
188 for (
int face = ndeb; face < nfin; face++)
189 for (
int k = 0; k < nb_compo; k++)
192 for (
int k = 0; k < nb_compo; k++)
197 for (
int k = 0; k < nb_compo; k++)
201 bilan(k) += flux_bord(k);
208 for (
int k = 0; k < nb_compo; k++)
214 for (
int num_cl = 0; num_cl < le_dom_PolyMAC_CDO->nb_front_Cl(); num_cl++)
216 const Frontiere_dis_base& la_fr = le_dcl_PolyMAC_CDO->les_conditions_limites(num_cl)->frontiere_dis();
217 const Cond_lim& la_cl = le_dcl_PolyMAC_CDO->les_conditions_limites(num_cl);
220 int nfin = ndeb + frontiere_dis.
nb_faces();
221 if (le_dom_PolyMAC_CDO->domaine().bords_a_imprimer().contient(la_fr.
le_nom()))
223 Flux_face <<
"# Flux par face sur " << la_fr.
le_nom() <<
" au temps " << temps <<
" : " << finl;
224 for (
int face = ndeb; face < nfin; face++)
227 Flux_face <<
"# Face a x= " << le_dom_PolyMAC_CDO->xv(face, 0) <<
" y= " << le_dom_PolyMAC_CDO->xv(face, 1) <<
" flux=";
229 Flux_face <<
"# Face a x= " << le_dom_PolyMAC_CDO->xv(face, 0) <<
" y= " << le_dom_PolyMAC_CDO->xv(face, 1) <<
" z= " << le_dom_PolyMAC_CDO->xv(face, 2) <<
" flux=";
230 for (
int k = 0; k < nb_compo; k++)
244 const DoubleVect& vol = domaine_PolyMAC_CDO.
volumes();
247 for (
int num_elem = 0; num_elem < nb_elem; num_elem++)
248 div(num_elem) /= vol(num_elem);
class Cond_lim Generic class used to represent any class
static void verifier(const char *const msg, double)
int_t nb_elem_tot() const
class Domaine_Cl_dis_base Domaine_Cl_dis_base objects represent discretized boundary conditions
virtual const DoubleVect & face_surfaces() const
int nb_faces() const
Returns the total number of faces.
int nb_faces_tot() const
Returns the total number of faces.
double volumes(int i) const
int oriente_normale(int f, int e) const
int premiere_face_int() const
A face is internal if and only if it separates two elements.
int face_voisins(int num_face, int i) const
Returns the neighbouring element of num_face in direction i.
int nb_faces_bord() const
Returns the number of faces on which boundary conditions are applied:
class Domaine_dis_base This class is the base of the hierarchy of discretized domains.
const Domaine & domaine() const
Sortie & syncfile() override
Triggers writing to disk of the data accumulated on the different processors since the last call to s...
Class defining operators and methods for all reading operation in an input flow (file,...
virtual const Milieu_base & milieu() const =0
Probleme_base & probleme()
Returns the problem associated with the equation.
int num_premiere_face() const
class Frontiere_dis_base Class representing a discretized boundary.
const Nom & le_nom() const override
Returns the name of the geometric boundary.
Matrice_Morse class - Represents a (sparse) matrix M, not necessarily square,.
DoubleVect & porosite_face()
const Equation_base & equation() const
Returns the reference to the equation pointed to by MorEqn::mon_equation.
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.
DoubleTab & calculer(const DoubleTab &, DoubleTab &) const override
int impr(Sortie &os) const override
DOES NOTHING - to override in derived classes.
DoubleTab & ajouter(const DoubleTab &, DoubleTab &) const override
void volumique(DoubleTab &) const override
void contribuer_a_avec(const DoubleTab &, Matrice_Morse &matrice) const override
DOES NOTHING - to override in derived classes.
void dimensionner(Matrice_Morse &matrice) const override
DOES NOTHING - to override in derived classes.
void associer(const Domaine_dis_base &, const Domaine_Cl_dis_base &, const Champ_Inc_base &) override
Classe Operateur_Div_base This class is the base of the hierarchy of operators representing.
DoubleTab & ajouter(const DoubleTab &vit, DoubleTab &div) const override
virtual void contribuer_a_avec(const DoubleTab &, Matrice_Morse &) const
DOES NOTHING - to override in derived classes.
virtual int has_interface_blocs() const
void ouvrir_fichier_partage(EcrFicPartage &, const Nom &, const int flag=1) const
Opening/creation of a shared file for printing an operator. To override in derived classes.
virtual void dimensionner(Matrice_Morse &) const
DOES NOTHING - to override in derived classes.
void ouvrir_fichier(SFichier &os, const Nom &, const int flag=1) const
Opening/creation of a file for printing an operator. To override in derived classes.
const Schema_Temps_base & schema_temps() const
Returns the time scheme associated with the problem.
static double mp_sum(double)
Computes the sum of x over all processors in the current group.
static int je_suis_maitre()
Returns 1 if on the master processor of the current group (i.e. me() == 0), 0 otherwise.
double temps_courant() const
Returns the current time.
Base class for output streams.
void resize(_SIZE_ n, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
virtual void echange_espace_virtuel(IsExchangeBlocking exchange_type=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")