16#include <init_forcage_THI.h>
17#include <IJK_Field_vector.h>
26#include <Random_process.h>
34init_forcage_THI::init_forcage_THI()
51 os <<
" minimal_forced_mode " <<
mode_min <<
"\n"
52 <<
" maximal_forced_mode " <<
mode_max <<
"\n";
55 os <<
" temps_grande_echelle " <<
tL <<
"\n";
58 os <<
" random_process " <<
random_ <<
"\n";
77 param.ajouter(
"minimal_forced_mode",&
mode_min);
78 param.ajouter(
"maximal_forced_mode",&
mode_max);
81 param.ajouter(
"temps_grande_echelle",&
tL);
85 {param.ajouter(
"random_process",&
random_);}
86 param.lire_avec_accolades(is);
92 int my_ni,
int my_nj,
int my_nk,
101 const double Ox = my_geom.
get_origin(DIRECTION_I) ;
102 const double Oy = my_geom.
get_origin(DIRECTION_J) ;
103 const double Oz = my_geom.
get_origin(DIRECTION_K) ;
110 int ni(my_ni), nj(my_nj), nk(my_nk);
114 double kmin(2.*M_PI*mmin/Lx), kmax(2.*M_PI*mmax/Lx);
115 int nl(mmax), nm(mmax), nn(mmax);
117 std::string nom_fichier_random(
"./random_gen.out");
118 std::string nom_fichier_spectral(
"./spectral.out");
119 std::string nom_fichier_physique(
"./physique.out");
121 f_sp_THI.initialise(nl,nm,nn, mmin,mmax,kmin,kmax,
amplitude, nom_fichier_spectral);
123 f_ph_THI.initialise(my_nproc_tot,ni,nj,nk,nl,nm,nn,Lx,Ly,Lz,Ox,Oy,Oz,mmin,mmax,kmin,kmax, nom_fichier_physique, splitting_,
i_offset,
j_offset,
k_offset);
134 const double current_time,
152 if (type_forcage_active==0)
154 Cout <<
"Normalement on ne rentre pas ici. Que si on a force de la thi, puisqu'on arrete.";
158 if (type_forcage_active==100)
160 Cout <<
"On force un dirac en spectral, uniX : cos(kx) ex" << finl;
161 f_sp_THI.compute_dirac_point_uniX_alongX();
163 if (type_forcage_active==200)
165 Cout <<
"On force un dirac en spectral, uniX : cos(kx) ey" << finl;
166 f_sp_THI.compute_dirac_point_uniX_alongY();
168 if (type_forcage_active==010)
170 Cout <<
"On force un dirac en spectral, uniY : cos(k(x-z)) ey" << finl;
171 Cout <<
"f_sp = 1/sq(2) (d(k-k_0)+d(k+k_0)) . [0;1;0]" << finl;
172 Cout <<
"f_ph = sq(2) cos(nk_0(x-z)) . [0;1;0]" << finl;
173 f_sp_THI.compute_dirac_point_uniY();
175 if (type_forcage_active==001 || type_forcage_active==1)
177 Cout <<
"On force un dirac en spectral, uniZ" << finl;
178 f_sp_THI.compute_dirac_point_uniZ();
180 if (type_forcage_active==101)
182 Cout <<
"On force un dirac en spectral, uniXZ" << finl;
183 Cout <<
"f_sp = 1/sq(2) (d(k-k_0)+d(k+k_0)) . [1;0;-1]" << finl;
184 Cout <<
"f_ph = sq(2) cos(nk_0(x-z)) . [1;0;-1]" << finl;
186 f_sp_THI.compute_dirac_point_div_nulle();
188 if (type_forcage_active==2)
190 Cout <<
"On force une porte en spectral, soit un cube" << finl;
193 if (type_forcage_active==66)
195 Cout <<
"On force des diracs de sorte a avoir : cos^2(ky) ex" << finl;
196 f_sp_THI.compute_diracs_for_cos_squarred();
198 if (type_forcage_active==166)
200 Cout <<
"On force des diracs de sorte a avoir : t*cos^2(ky) ex" << finl;
201 f_sp_THI.compute_diracs_for_t_times_cos_squarred(current_time);
203 if (type_forcage_active==3)
208 random_.next_step2(tstep, time_iteration);
211 if (type_forcage_active==20)
216 if (type_forcage_active!=20 && type_forcage_active!=0)
252 return f_ph_THI.get_force_attribute();
258 return f_ph_THI.get_force_attribute2();
275 for (
int dir=0; dir<3; dir++)
283 Cout <<
"update_advection_length : dt " << dt << finl;
285 Cout <<
"update_advection_length : time_to_be_del_ " <<
time_to_be_del_ << finl;
286 for (
int dir=0; dir<3; dir++)
288 Cout <<
"update_advection_length : advection_length_["<<dir<<
"] : " <<
advection_length_[dir] << finl;
290 Cout <<
"update_advection_length : advection_length_["<<dir<<
"] : " <<
advection_length_[dir] << finl;
This class encapsulates all the information related to the eulerian mesh for TrioIJK.
int get_offset_local(int direction) const
Returns the local offset in requested direction.
double get_domain_length(int direction) const
Returns the length of the entire domain in requested direction.
double get_origin(int direction) const
Returns the coordinate of the first node (global) of the mesh in the requested direction.
Class defining operators and methods for all reading operation in an input flow (file,...
class Nom Une chaine de caractere pour nommer les objets de TRUST
classe Objet_U Cette classe est la classe de base des Objets de TRUST
const Nom & que_suis_je() const
renvoie la chaine identifiant la classe.
virtual Entree & readOn(Entree &)
Lecture d'un Objet_U sur un flot d'entree Methode a surcharger.
virtual Sortie & printOn(Sortie &) const
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
Classe de base des flux de sortie.
ArrOfDouble advection_length_
int get_facteur_forcage()
void update_advection_length(double dt)
int get_forced_advection()
void compute_initial_chouippe(int nproc_tot, const Domaine_IJK &my_geom, int my_ni, int my_nj, int my_nk, const Domaine_IJK &my_splitting, Nom nom_sauvegarde)
ArrOfDouble advection_velocity_
void update_advection_velocity(ArrOfDouble &value)
void compute_THI_force(const int time_iteration, const double tstep, const double current_time, const Domaine_IJK &my_splitting)
IJK_Field_vector3_double & get_force_ph2()
int activate_forcage(const int current_time_step, const double current_time)
IJK_Field_vector3_double get_force_ph()