30char et_rot_mag_equil_plus_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Etoile/et_rot_mag_equil_plus.C,v 1.4 2014/10/13 08:52:58 j_novak Exp $" ;
56#include "et_rot_mag.h"
63 const Itbl& icontrol,
const Tbl& control,
Tbl& diff,
71 const double relax_mag) {
91 int mer_max = icontrol(0) ;
96 int mermax_poisson = icontrol(5) ;
103 double precis = control(0) ;
107 double relax_poisson = control(3) ;
117 double& diff_A_phi = diff.
set(0) ;
133 double precis_poisson = 1.e-16 ;
135 Param par_poisson_At ;
138 par_poisson_At.
add_int(mermax_poisson, 0) ;
140 par_poisson_At.
add_double(precis_poisson, 1) ;
144 Param par_poisson_Avect ;
149 par_poisson_Avect.
add_int(mermax_poisson, 0) ;
150 par_poisson_Avect.
add_double(relax_poisson, 0) ;
151 par_poisson_Avect.
add_double(precis_poisson, 1) ;
175 ofstream fichmulti(
"multipoles.d") ;
178 ofstream fichconv(
"convergence.d") ;
179 fichconv <<
"# diff_A_phi GRV2 " << endl ;
181 ofstream fichfreq(
"frequency.d") ;
182 fichfreq <<
"# f [Hz]" << endl ;
184 ofstream fichevol(
"evolution.d") ;
186 "# |dH/dr_eq/dH/dr_pole| r_pole/r_eq ent_c"
211 for(
int mer=0 ; (diff_A_phi > precis) && (mer<mer_max) ; mer++ ) {
213 cout <<
"-----------------------------------------------" << endl ;
214 cout <<
"step: " << mer << endl ;
229 an_j, f_j, bn_j, g_j, N_j, par_poisson_At, par_poisson_Avect) ;
234 A_t = relax_mag*A_t_new + (1.-relax_mag)*A_t_old ;
235 A_phi = relax_mag*A_phi_new + (1. - relax_mag)*A_phi_old ;
238 double diff_A_phi_n =
max(
abs((A_phi_new - A_phi_old))).
set(0);
240 double diff_j_phi_n =
max(
abs((j_phi_new - j_phi_old))).
set(0);
249 diff_A_phi = diff_A_phi_n / max_Aphi ;
252 cout << mer <<
" "<< diff_j_phi_n <<
" " << max_jphi << endl;
255 fichmulti << diff_A_phi<<
" "
256 <<maphi.
set(0,0) <<
" " <<maphi.
set(0,1) <<
" "
257 <<maphi.
set(0,2) <<
" " <<maphi.
set(0,3) <<
" "
258 <<maphi.
set(0,4) << endl;
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
void std_base_scal()
Sets the spectral bases of the Valeur va to the standard ones for a scalar.
void set_etat_zero()
Sets the logical state to ETATZERO (zero).
Tbl multipole_spectrum()
Gives the spectrum in terms of multipolar modes l .
Cmp j_phi
-component of the current 4-vector
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.
virtual void MHD_comput()
Computes the electromagnetic part of the stress-energy tensor.
Cmp A_phi
-component of the electromagnetic potential 1-form divided by .
double a_j
Amplitude of the curent/charge function.
Cmp A_t
t-component of the elecctromagnetic potential 1-form, divided by .
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 .
virtual void hydro_euler()
Computes the hydrodynamical quantities relative to the Eulerian observer from those in the fluid fram...
void update_metric()
Computes metric coefficients from known potentials.
Cmp ssjm1_khi
Effective source at the previous step for the resolution of the Poisson equation for the scalar by m...
virtual void equation_of_state()
Computes the proper baryon and energy density, as well as pressure from the enthalpy.
Map & mp
Mapping associated with the star.
Basic integer array class.
void add_double(const double &x, int position=0)
Adds the the address of a new double to the list.
void add_cmp_mod(Cmp &ti, int position=0)
Adds the address of a new modifiable Cmp to the list.
void add_int_mod(int &n, int position=0)
Adds the address of a new modifiable int to the list.
void add_tenseur_mod(Tenseur &ti, int position=0)
Adds the address of a new modifiable Tenseur to the list.
void add_int(const int &n, int position=0)
Adds the address of a new int to the list.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
double & set(int i)
Read/write of a particular element (index i) (1D case)
Tensor handling *** DEPRECATED : use class Tensor instead ***.
Tbl min(const Cmp &)
Minimum values of a Cmp in each domain.
Tbl max(const Cmp &)
Maximum values of a Cmp in each domain.
Cmp abs(const Cmp &)
Absolute value.
Standard electro-magnetic units.