59 #include "et_rot_mag.h" 62 #include "graphique.h" 66 const Itbl& icontrol,
const Tbl& control,
Tbl& diff,
74 const double relax_mag) {
94 int mer_max = icontrol(0) ;
99 int mermax_poisson = icontrol(5) ;
106 double precis = control(0) ;
110 double relax_poisson = control(3) ;
120 double& diff_A_phi = diff.
set(0) ;
136 double precis_poisson = 1.e-16 ;
138 Param par_poisson_At ;
141 par_poisson_At.
add_int(mermax_poisson, 0) ;
143 par_poisson_At.
add_double(precis_poisson, 1) ;
147 Param par_poisson_Avect ;
152 par_poisson_Avect.
add_int(mermax_poisson, 0) ;
153 par_poisson_Avect.
add_double(relax_poisson, 0) ;
154 par_poisson_Avect.
add_double(precis_poisson, 1) ;
178 ofstream fichmulti(
"multipoles.d") ;
181 ofstream fichconv(
"convergence.d") ;
182 fichconv <<
"# diff_A_phi GRV2 " << endl ;
184 ofstream fichfreq(
"frequency.d") ;
185 fichfreq <<
"# f [Hz]" << endl ;
187 ofstream fichevol(
"evolution.d") ;
189 "# |dH/dr_eq/dH/dr_pole| r_pole/r_eq ent_c" 214 for(
int mer=0 ; (diff_A_phi > precis) && (mer<mer_max) ; mer++ ) {
216 cout <<
"-----------------------------------------------" << endl ;
217 cout <<
"step: " << mer << endl ;
232 an_j, f_j, bn_j, g_j, N_j, par_poisson_At, par_poisson_Avect) ;
237 A_t = relax_mag*A_t_new + (1.-relax_mag)*A_t_old ;
238 A_phi = relax_mag*A_phi_new + (1. - relax_mag)*A_phi_old ;
241 double diff_A_phi_n =
max(
abs((A_phi_new - A_phi_old))).
set(0);
243 double diff_j_phi_n =
max(
abs((j_phi_new - j_phi_old))).
set(0);
252 diff_A_phi = diff_A_phi_n / max_Aphi ;
255 cout << mer <<
" "<< diff_j_phi_n <<
" " << max_jphi << endl;
258 fichmulti << diff_A_phi<<
" " 259 <<maphi.
set(0,0) <<
" " <<maphi.
set(0,1) <<
" " 260 <<maphi.
set(0,2) <<
" " <<maphi.
set(0,3) <<
" " 261 <<maphi.
set(0,4) << endl;
void add_tenseur_mod(Tenseur &ti, int position=0)
Adds the address of a new modifiable Tenseur to the list.
Cmp ssjm1_khi
Effective source at the previous step for the resolution of the Poisson equation for the scalar by m...
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
void add_int(const int &n, int position=0)
Adds the address of a new int to the list.
virtual void magnet_comput_plus(const int adapt_flag, const int initial_j, const Tbl an_j, Cmp(*f_j)(const Cmp &x, const Tbl), const Tbl bn_j, Cmp(*g_j)(const Cmp &x, const Tbl), Cmp(*N_j)(const Cmp &x, const Tbl), Param &par_poisson_At, Param &par_poisson_Avect)
Computes the electromagnetic quantities solving the Maxwell equations (6) and (7) of [Bocquet...
Tenseur ssjm1_wshift
Effective source at the previous step for the resolution of the vector Poisson equation for ...
double & set(int i)
Read/write of a particular element (index i) (1D case)
Basic integer array class.
Tbl min(const Cmp &)
Minimum values of a Cmp in each domain.
Cmp A_phi
-component of the electromagnetic potential 1-form divided by .
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
void update_metric()
Computes metric coefficients from known potentials.
void set_etat_zero()
Sets the logical state to ETATZERO (zero).
double a_j
Amplitude of the curent/charge function.
void equilibrium_mag_plus(const Itbl &icontrol, const Tbl &control, Tbl &diff, const int initial_j, const Tbl an_j, Cmp(*f_j)(const Cmp &x, const Tbl), Cmp(*M_j)(const Cmp &x, const Tbl), const Tbl bn_j, Cmp(*g_j)(const Cmp &x, const Tbl), Cmp(*N_j)(const Cmp &x, const Tbl), const double relax_mag)
Computes an equilibrium configuration.
Tbl multipole_spectrum()
Gives the spectrum in terms of multipolar modes l .
Map & mp
Mapping associated with the star.
virtual void equation_of_state()
Computes the proper baryon and energy density, as well as pressure from the enthalpy.
Tbl max(const Cmp &)
Maximum values of a Cmp in each domain.
virtual void hydro_euler()
Computes the hydrodynamical quantities relative to the Eulerian observer from those in the fluid fram...
Cmp j_phi
-component of the current 4-vector
void std_base_scal()
Sets the spectral bases of the Valeur va to the standard ones for a scalar.
Cmp abs(const Cmp &)
Absolute value.
void add_double(const double &x, int position=0)
Adds the the address of a new double to the list.
Cmp A_t
t-component of the elecctromagnetic potential 1-form, divided by .
virtual void MHD_comput()
Computes the electromagnetic part of the stress-energy tensor.
void add_cmp_mod(Cmp &ti, int position=0)
Adds the address of a new modifiable Cmp to the list.
Standard electro-magnetic units.
Tensor handling *** DEPRECATED : use class Tensor instead ***.
void add_int_mod(int &n, int position=0)
Adds the address of a new modifiable int to the list.