23static void evaluer_f_et_df_dt_et_df2_dt2(
const Noms& expressions,
const double t,
const double dt,
Vecteur3& f,
Vecteur3& df_dt,
Vecteur3& df2_dt2)
25 for (
int dir = 0; dir < 3; dir++)
29 parser.
setString(std::string(expressions[dir]));
36 f[dir] = parser.
eval();
40 parser.
setVar((
int)0, t + delta_t);
41 double f2 = parser.
eval();
42 df_dt[dir] = (f2 - f[dir]) / delta_t;
45 parser.
setVar((
int)0, t + delta_t);
46 double x_p1 = parser.
eval();
47 parser.
setVar((
int)0, t - delta_t);
48 double x_m1 = parser.
eval();
49 df2_dt2[dir] = (x_p1 - 2 * f[dir] + x_m1) / ( delta_t * delta_t);
75 os <<
" nom " <<
nom_;
81 os <<
" rayon " <<
rayon_ ;
84 os <<
" # pos=[ " <<
pos_[0] <<
" " <<
pos_[1] <<
" " <<
pos_[2] ;
85 os <<
" ] v=[ " <<
v_[0] <<
" " <<
v_[1] <<
" " <<
v_[2] ;
99 param.ajouter(
"nom", &
nom_);
100 param.ajouter(
"omega", &
omega_);
101 param.lire_avec_accolades(is);
122 os <<
" nom " <<
nom_;
124 os <<
" omega " <<
omega_;
125 os <<
" pos_x " <<
pos_[0] ;
126 os <<
" pos_y " <<
pos_[1] ;
127 os <<
" pos_z " <<
pos_[2] ;
128 os <<
" v_x " <<
v_[0] ; ;
129 os <<
" v_y " <<
v_[1] ;
130 os <<
" v_z " <<
v_[2] ;
137 if (
blocage_[DIRECTION_I]) os <<
" blocage_i";
138 if (
blocage_[DIRECTION_J]) os <<
" blocage_j";
139 if (
blocage_[DIRECTION_K]) os <<
" blocage_k";
143 os <<
" rayon " <<
rayon_;
151 pos_ = Vecteur3(1e38, 1e38, 1e38);
153 v_ = Vecteur3(0,0,0);
159 param.ajouter(
"pos_x", &
pos_[0]);
160 param.ajouter(
"pos_y", &
pos_[1]);
161 param.ajouter(
"pos_z", &
pos_[2]);
163 param.ajouter(
"v_x", &
v_[0]);
164 param.ajouter(
"v_y", &
v_[1]);
165 param.ajouter(
"v_z", &
v_[2]);
176 param.ajouter_flag(
"blocage_i", &
blocage_[DIRECTION_I]);
177 param.ajouter_flag(
"blocage_j", &
blocage_[DIRECTION_J]);
178 param.ajouter_flag(
"blocage_k", &
blocage_[DIRECTION_K]);
185 param.ajouter(
"nom", &
nom_);
187 param.lire_avec_accolades(is);
190 for (
int i = 0; i < 3; i++)
200 const double beta = 0.25;
201 const double gamma = 0.5;
202 const double timestep = dt;
204 a[0] = 1/( beta * timestep * timestep);
205 a[1] = gamma /( beta * timestep);
206 a[2] = 1 /( beta * timestep);
207 a[3] = 1/(2 *beta)-1;
208 a[4] = gamma/ beta -1;
209 a[5] = 0.5* timestep * (gamma/ beta -2);
210 a[6] = timestep * (1- gamma);
211 a[7] = gamma * timestep;
212 Cout <<
"Coefficients newmark: " << a;
217 ArrOfDouble noeuds_y;
219 const int n_element_y = noeuds_y.
size_array()-1;
221 const double hauteur_cylindre = n_element_y * delta_y;
223 double volume_cylindre = surface * hauteur_cylindre;
224 Cout <<
"Volume du tube: " << volume_cylindre << finl;;
235 double K_gauche = a[0] * m_s + a[1] * c + k;
237 for (
int dir = 0; dir < 3; dir++)
251 K_droite[dir] = m_s * (a[0] * pos_newmark[dir] + a[2] *
v_[dir] + a[3] *
acceleration_[dir]) + c * (a[1] * pos_newmark[dir] + a[4] *
v_[dir] + a[5] *
acceleration_[dir]);
252 F_droite[dir] = force_appliquee[dir] + K_droite[dir];
253 double tmp_pos = pos_newmark[dir];
255 pos_newmark[dir] = F_droite[dir] / K_gauche;
276 return VECT(OWN_PTR(
Tube_base))::readOn(is);
281 return VECT(OWN_PTR(Tube_base))::printOn(is);
This class encapsulates all the information related to the eulerian mesh for TrioIJK.
double get_constant_delta(int direction) const
Returns the size of cells in a direction.
const ArrOfDouble & get_node_coordinates(int direction) const
Returns an array with the coordinates of all nodes in the mesh in requested direction.
Class defining operators and methods for all reading operation in an input flow (file,...
Un tableau de chaine de caracteres (VECT(Nom)).
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.
Representation des donnees de la classe Parser.
void addVar(const char *)
virtual void setNbVar(int nvar)
void setVar(const char *sv, double val)
void setString(const std::string &s)
virtual void parseString()
Classe de base des flux de sortie.
_SIZE_ size_array() const
void initialize(const Domaine_IJK &)
void update_vitesse_position(double current_time, double dt, const Vecteur3 &force_appliquee) override
Noms expressions_position_
Vecteur3 position_equilibre_
void update_vitesse_position(double current_time, double dt, const Vecteur3 &force_appliquee) override