92 const Vector& shift_comp_temp,
double om) {
94 Vector shift_auto(shift_auto_temp) ;
96 Vector shift_comp(shift_comp_temp) ;
98 Vector shift_old (shift_auto) ;
101 assert ((orientation==0) || (orientation == M_PI)) ;
103 assert ((orientation_autre==0) || (orientation_autre == M_PI)) ;
105 int alignes = (orientation == orientation_autre) ? 1 : -1 ;
113 shift_tot.
set(1).
import(alignes*shift_comp(1)) ;
114 shift_tot.set(2).import(alignes*shift_comp(2)) ;
115 shift_tot.set(3).import(shift_comp(3)) ;
117 shift_tot = shift_tot + shift_auto ;
119 double indic = (orientation == 0) ? 1 : -1 ;
123 for (
int i=1 ; i<=3 ; i++) {
135 Vector derive_r (shift_auto.get_mp(), CON, *shift_auto.get_triad()) ;
136 for (
int i=1 ; i<=3 ; i++)
137 derive_r.
set(i) = tbi(i).dsdr() ;
142 Valeur val_hor (shift_auto.get_mp().get_mg()) ;
143 Valeur fonction_radiale (shift_auto.get_mp().get_mg()) ;
144 Scalar enleve (shift_auto.get_mp()) ;
147 for (
int comp=1 ; comp<=3 ; comp++) {
149 for (
int k=0 ; k<np ; k++)
150 for (
int j=0 ; j<nt ; j++)
151 for (
int i=0 ; i<nr ; i++)
152 val_hor.set(1, k, j, i) = derive_r(comp).
153 val_grid_point(1, k, j, 0) ;
155 double r_0 = shift_auto.get_mp().val_r (1, -1, 0, 0) ;
156 double r_1 = shift_auto.get_mp().val_r (1, 1, 0, 0) ;
158 fonction_radiale =
pow(r_1-shift_auto.get_mp().r, 3.)*
159 (shift_auto.get_mp().r-r_0)/
pow(r_1-r_0, 3.) ;
160 fonction_radiale.
annule(0) ;
161 fonction_radiale.annule(2,
nz-1) ;
163 enleve = fonction_radiale * val_hor ;
164 enleve.set_spectral_va().set_base (shift_auto(comp).
165 get_spectral_va().get_base()) ;
167 if (
norme(enleve)(1) != 0)
168 shift_auto.set(comp) = shift_auto(comp) - enleve ;
169 if (
norme(shift_auto(comp))(1) > 1e-5) {
171 if (erreur < diff(1))
176 shift_auto.change_triad(shift_auto.get_mp().get_bvect_spher()) ;
194 for (
int i=1 ; i<=3 ; i++) {
199 for (
int i=1 ; i<=3 ; i++)
200 shift(i).get_spectral_va().coef_i() ;
203 tbi.
set(2) = *shift(2).get_spectral_va().c +
omega*
mp.
x ;
204 if (shift(3).get_etat() != ETATZERO)
205 tbi.
set(3) = *shift(3).get_spectral_va().c -
boost_z ;
216 for (
int i=1 ; i<=3 ; i++)
217 derive_r.set(i) = tbi(i).dsdr() ;
228 double r_0 =
mp.
val_r(1, -1, 0, 0) ;
229 double r_1 =
mp.
val_r(1, 1, 0, 0) ;
231 for (
int comp=1 ; comp<=3 ; comp++) {
232 val_hor.annule_hard() ;
233 for (
int k=0 ; k<np ; k++)
234 for (
int j=0 ; j<nt ; j++)
235 for (
int i=0 ; i<nr ; i++)
236 val_hor.set(1, k, j, i) = derive_r(comp).val_grid_point(1, k, j, 0) ;
238 fonction_radiale =
pow(r_1-
mp.
r, 3.)* (
mp.
r-r_0)/
pow(r_1-r_0, 3.) ;
239 fonction_radiale.
annule(0) ;
240 fonction_radiale.annule(2,
nz-1) ;
242 enleve = fonction_radiale*val_hor ;
243 enleve.set_spectral_va().base = shift(comp).get_spectral_va().base ;
245 Scalar copie (shift(comp)) ;
246 shift.
set(comp) = shift(comp)-enleve ;
249 assert (shift(comp).check_dzpuis(0)) ;
253 if (norm(1) > 1e-5) {
virtual const Vector & beta() const
shift vector at the current time step (jtime )
void annule_domain(int l)
Sets the Tensor to zero in a given domain.
virtual void set_etat_qcq()
Sets the logical state of all components to ETATQCQ (ordinary state).
double omega
Angular velocity in LORENE's units.
Evolution_std< Vector > beta_auto_evol
Values at successive time steps of the shift function .
int get_np(int l) const
Returns the number of points in the azimuthal direction ( ) in domain no. l.
void annule(int l)
Sets the Cmp to zero in a given domain.
const Base_vect_spher & get_bvect_spher() const
Returns the orthonormal vectorial basis associated with the coordinates of the mapping.
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
Tensor field of valence 0 (or component of a tensorial field).
void coef_i() const
Computes the physical value of *this.
virtual double val_r(int l, double xi, double theta, double pphi) const
Returns the value of the radial coordinate r for a given in a given domain.
int jtime
Time step index of the latest slice.
Values and coefficients of a (real-value) function.
virtual void change_triad(const Base_vect &)
Sets a new vectorial basis (triad) of decomposition and modifies the components accordingly.
double get_rot_phi() const
Returns the angle between the x –axis and X –axis.
Tensor field of valence 1.
double regularisation(const Vector &shift_auto, const Vector &shift_comp, double ang_vel)
Corrects shift_auto in such a way that the total is equal to zero in the horizon, which should ensure the regularity of .
virtual void std_spectral_base()
Sets the standard spectal bases of decomposition for each component.
void annule_hard()
Sets the Scalar to zero in a hard way.
Map_af & mp
Affine mapping.
Tbl norme(const Cmp &)
Sums of the absolute values of all the values of the Cmp in each domain.
const Base_vect * get_triad() const
Returns the vectorial basis (triad) on which the components are defined.
double boost_x
Boost velocity in x-direction.
Mtbl * c
Values of the function at the points of the multi-grid.
int get_nzone() const
Returns the number of domains.
Cmp pow(const Cmp &, int)
Power .
Evolution_std< double > the_time
Time label of each slice.
void import(const Scalar &ci)
Assignment to another Scalar defined on a different mapping.
int get_nr(int l) const
Returns the number of points in the radial direction ( ) in domain no. l.
const Base_vect_cart & get_bvect_cart() const
Returns the Cartesian basis associated with the coordinates (x,y,z) of the mapping, i.e.
Coord y
y coordinate centered on the grid
Coord x
x coordinate centered on the grid
void set_etat_c_qcq()
Sets the logical state to ETATQCQ (ordinary state) for values in the configuration space (Mtbl c )...
int get_nt(int l) const
Returns the number of points in the co-latitude direction ( ) in domain no. l.
Valeur & set_spectral_va()
Returns va (read/write version)
Scalar & set(int)
Read/write access to a component.
Evolution_std< Vector > beta_evol
Values at successive time steps of the shift vector .
double regularise_one()
Corrects the shift in the innermost shell, so that it remains and that equals zero on the horizon...
const Map & get_mp() const
Returns the mapping.
double boost_z
Boost velocity in z-direction.
Tbl diffrelmax(const Cmp &a, const Cmp &b)
Relative difference between two Cmp (max version).
const Valeur & get_spectral_va() const
Returns va (read only version)
Coord r
r coordinate centered on the grid