16#include <Terme_Source_Solide_SWIFT_VDF.h>
18#include <Champ_Uniforme.h>
19#include <Domaine_VDF.h>
20#include <Conduction.h>
21#include <Interprete.h>
22#include <Probleme_base.h>
23#include <Milieu_base.h>
36 Cerr <<
" ######### Warning ! #########" << finl;
37 Cerr <<
" For the moment, this forcing term is only available" << finl;
38 Cerr <<
" for recovering identical solid meshes." << finl;
39 Cerr <<
" If otherwise, it will produce a beautiful core-dump..." << finl;
51 Cerr <<
"TAU can not be equal to 0." << finl;
54 Cerr <<
"Characteristic time TAU is : " <<
tau << finl;
56 else if(motlu ==
"pb_swift")
62 Cerr <<
"pb_swift is: " << pb_swift->le_nom() << finl;
64 else if(motlu ==
"pb_corse")
70 Cerr <<
"pb_coarse is: " << pb_corse->le_nom() << finl;
74 Cerr <<
"An argument of Terme_Source_Solide_SWIFT_VDF is not correct !" << finl;
80 Cerr <<
"The forcing term for the mean solid temperature field with the SWIFT method needs 3 arguments" << finl;
81 Cerr <<
"Syntax : " << finl;
82 Cerr <<
"Solide_SWIFT SWIFT pb_sol_SWIFT COARSE pb_sol_coarse TAU tau " << finl;
89 for(i=0; i<pb_swift->nombre_d_equations(); i++)
91 if(sub_type(Conduction,pb_swift->equation(i)))
93 eq_swift = ref_cast(Conduction,pb_swift->equation(i));
99 Cerr <<
"Error : The Conduction equation was not found...!" << finl;
100 Cerr <<
"for the SWIFT solid forcing term (in pb_swift)." << finl;
105 for(i=0; i<pb_corse->nombre_d_equations(); i++)
107 if(sub_type(Conduction,pb_corse->equation(i)))
109 eq_corse = ref_cast(Conduction,pb_corse->equation(i));
115 Cerr <<
"Error : The Conduction equation was not found...!" << finl;
116 Cerr <<
"for the SWIFT solid forcing term (in pb_coarse)." << finl;
141 int num_elem, j, indic, trouve;
146 const DoubleTab& xp = domaine_VDF.
xp();
152 int Nx = nb_elems / (nb_faces_x - nb_elems);
153 int Nz = nb_elems / (nb_faces_z - nb_elems);
154 int Ny = nb_elems / Nx / Nz;
166 for (num_elem = 0; num_elem < nb_elems; num_elem++)
170 for (j = 0; j < indic + 1; j++)
172 if (std::fabs(y - Y[j]) <= 1e-8)
174 corresp[num_elem] = j;
183 corresp[num_elem] = indic;
197 for (
int j = 0; j < t_S; j++)
200 for (
int i = 0; i < t_C; i++)
210 Cerr <<
"## ACHTUNG !!! The equivalence between" << finl;
211 Cerr <<
"## the two domains at the Y level was not found!" << finl;
226 int Nx = nb_elems / (nb_faces_x - nb_elems);
227 int Nz = nb_elems / (nb_faces_z - nb_elems);
228 int Ny = nb_elems / Nx / Nz;
234 for (j = 0; j < nb_elems; j++)
235 T_moy[corresp[j]] += Temp[j];
236 for (j = 0; j < Ny; j++)
237 T_moy[j] /= compt[j];
245 int nb_elems = domaine_VDF.
nb_elem();
246 const DoubleVect& volume = domaine_VDF.
volumes();
248 DoubleVect Tmoy_swift;
249 DoubleVect Tmoy_corse;
255 for (
int num_elem = 0; num_elem < nb_elems; num_elem++)
const Domaine_dis_base & domaine_dis_base() const override
DoubleTab & valeurs() override
Returns the array of field values at the current time.
Class Conduction: represents the temperature evolution equation.
const Champ_Inc_base & inconnue() const override
Returns the unknown field of the equation, i.e. the temperature (const version).
class Domaine_Cl_dis_base Domaine_Cl_dis_base objects represent discretized boundary conditions
double volumes(int i) const
double xp(int num_elem, int k) const
class Domaine_dis_base This class is the base of the hierarchy of discretized domains.
const Domaine & domaine() const
Class defining operators and methods for all reading operation in an input flow (file,...
static Objet_U & objet(const Nom &)
See Interprete_bloc::objet_global(). BM: the Interprete class is not the best place for this.
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.
class Probleme_base It is a Probleme_U that is not a coupling.
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Base class for output streams.
Source_base A Source_base object is a term appearing on the right-hand side of an.
virtual DoubleTab & ajouter(DoubleTab &) const
void resize(_SIZE_, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
void calcul_moyenne(const Conduction &my_eqn, DoubleVect &T_moy, const IntVect &corresp, const IntVect &compt) const
DoubleTab & calculer(DoubleTab &) const override
void init_calcul_moyenne(const Conduction &my_eqn, DoubleVect &Y, IntVect &corresp, IntVect &compt)
void correspondance_SWIFT_coarse()
void ajouter_blocs(matrices_t matrices, DoubleTab &secmem, const tabs_t &semi_impl) const override
void associer_domaines(const Domaine_dis_base &, const Domaine_Cl_dis_base &) override
void associer_pb(const Probleme_base &) override