56 #include "graphique.h" 57 #include "utilitaires.h" 81 for(
int i=1; i<=3; i++)
82 for(
int j=i; j<=3; j++) {
88 for(
int i=1; i<=3; i++)
89 for(
int j=i; j<=3; j++)
101 for(
int i=1; i<=3; i++)
102 for(
int j=i; j<=3; j++) {
108 for(
int i=1; i<=3; i++)
109 for(
int j=i; j<=3; j++)
116 cout <<
"Function Binary::dirac_gauge()" << endl ;
122 double precis = 1e-5 ;
123 double precis_poisson = 1e-14 ;
124 double relax_poisson = 1.5 ;
125 int mer_poisson = 4 ;
139 Scalar ssjm1_xi11 (xi1(1)) ;
140 Scalar ssjm1_xi12 (xi1(2)) ;
141 Scalar ssjm1_xi13 (xi1(3)) ;
144 for(
int mer=0; mer<mermax; mer++){
152 double sigma = 3.*r0_1 ;
155 ff1 =
exp( -(rr1 - r0_1)*(rr1 - r0_1)/sigma/sigma ) ;
156 for (
int ii=0; ii<nz-1; ii++)
169 source_xi1 += source_reg1 ;
173 Cmp ssjm1xi11 (ssjm1_xi11) ;
174 Cmp ssjm1xi12 (ssjm1_xi12) ;
175 Cmp ssjm1xi13 (ssjm1_xi13) ;
182 par_xi11.
add_int(mer_poisson, 0) ;
189 par_xi12.
add_int(mer_poisson, 0) ;
196 par_xi13.
add_int(mer_poisson, 0) ;
202 source_xi1(1).poisson(par_xi11, xi1.set(1)) ;
203 source_xi1(2).poisson(par_xi12, xi1.set(2)) ;
204 source_xi1(3).poisson(par_xi13, xi1.set(3)) ;
206 ssjm1_xi11 = ssjm1xi11 ;
207 ssjm1_xi12 = ssjm1xi12 ;
208 ssjm1_xi13 = ssjm1xi13 ;
216 Tbl tdiff_xi1_x =
diffrel(lap_xi1(1), source_xi1(1)) ;
217 Tbl tdiff_xi1_y =
diffrel(lap_xi1(2), source_xi1(2)) ;
218 Tbl tdiff_xi1_z =
diffrel(lap_xi1(3), source_xi1(3)) ;
221 "Relative error in the resolution of the equation for xi1 : " 223 cout <<
"x component : " ;
224 for (
int l=0; l<nz; l++) {
225 cout << tdiff_xi1_x(l) <<
" " ;
228 cout <<
"y component : " ;
229 for (
int l=0; l<nz; l++) {
230 cout << tdiff_xi1_y(l) <<
" " ;
233 cout <<
"z component : " ;
234 for (
int l=0; l<nz; l++) {
235 cout << tdiff_xi1_z(l) <<
" " ;
242 for (
int i=1 ; i<nz ; i++)
243 if (diff(i) > erreur)
246 cout <<
"Step : " << mer <<
" Difference : " << erreur << endl ;
247 cout <<
"-------------------------------------" << endl ;
263 Scalar ssjm1_xi21 (xi2(1)) ;
264 Scalar ssjm1_xi22 (xi2(2)) ;
265 Scalar ssjm1_xi23 (xi2(3)) ;
268 for(
int mer=0; mer<mermax; mer++){
276 double sigma = 3.*r0_2 ;
279 ff2 =
exp( -(rr2 - r0_2)*(rr2 - r0_2)/sigma/sigma ) ;
280 for (
int ii=0; ii<nz-1; ii++)
293 source_xi2 += source_reg2 ;
297 Cmp ssjm1xi21 (ssjm1_xi21) ;
298 Cmp ssjm1xi22 (ssjm1_xi22) ;
299 Cmp ssjm1xi23 (ssjm1_xi23) ;
306 par_xi21.
add_int(mer_poisson, 0) ;
313 par_xi22.
add_int(mer_poisson, 0) ;
320 par_xi23.
add_int(mer_poisson, 0) ;
326 source_xi2(1).poisson(par_xi21, xi2.set(1)) ;
327 source_xi2(2).poisson(par_xi22, xi2.set(2)) ;
328 source_xi2(3).poisson(par_xi23, xi2.set(3)) ;
330 ssjm1_xi21 = ssjm1xi21 ;
331 ssjm1_xi22 = ssjm1xi22 ;
332 ssjm1_xi23 = ssjm1xi23 ;
340 Tbl tdiff_xi2_x =
diffrel(lap_xi2(1), source_xi2(1)) ;
341 Tbl tdiff_xi2_y =
diffrel(lap_xi2(2), source_xi2(2)) ;
342 Tbl tdiff_xi2_z =
diffrel(lap_xi2(3), source_xi2(3)) ;
345 "Relative error in the resolution of the equation for xi2 : " 347 cout <<
"x component : " ;
348 for (
int l=0; l<nz; l++) {
349 cout << tdiff_xi2_x(l) <<
" " ;
352 cout <<
"y component : " ;
353 for (
int l=0; l<nz; l++) {
354 cout << tdiff_xi2_y(l) <<
" " ;
357 cout <<
"z component : " ;
358 for (
int l=0; l<nz; l++) {
359 cout << tdiff_xi2_z(l) <<
" " ;
366 for (
int i=1 ; i<nz ; i++)
367 if (diff(i) > erreur)
370 cout <<
"Step : " << mer <<
" Difference : " << erreur << endl ;
371 cout <<
"-------------------------------------" << endl ;
394 gtilde_con1.std_spectral_base() ;
395 for(
int i=1; i<=3; i++)
396 for(
int j=i; j<=3; j++)
404 cout <<
"norme de h_uu avant :" << endl ;
405 for (
int i=1; i<=3; i++)
406 for (
int j=1; j<=i; j++) {
407 cout <<
" Comp. " << i <<
" " << j <<
" : " ;
408 for (
int l=0; l<nz; l++){
415 cout <<
"norme de h_uu en jauge de dirac :" << endl ;
416 for (
int i=1; i<=3; i++)
417 for (
int j=1; j<=i; j++) {
418 cout <<
" Comp. " << i <<
" " << j <<
" : " ;
419 for (
int l=0; l<nz; l++){
420 cout <<
norme(hij_dirac1(i,j)/(nr*nt*np))(l) <<
" " ;
431 cout <<
"For comparaison H^i before computation = " << endl
432 <<
norme(hh_dirac(1))/(nr*nt*np)
434 <<
norme(hh_dirac(2))/(nr*nt*np)
436 <<
norme(hh_dirac(3))/(nr*nt*np)
440 cout <<
"Vector H^i after the computation" << endl ;
441 for (
int i=1; i<=3; i++){
442 cout <<
" Comp. " << i <<
" : " <<
norme(hh_dirac_new(i)
443 /(nr*nt*np)) << endl ;
466 gtilde_con2.std_spectral_base() ;
467 for(
int i=1; i<=3; i++)
468 for(
int j=i; j<=3; j++)
Sym_tensor hij_comp
Deviation of the inverse conformal metric from the inverse flat metric generated principally by the ...
virtual const Sym_tensor & con() const
Read-only access to the contravariant representation.
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
Cmp exp(const Cmp &)
Exponential.
void add_int(const int &n, int position=0)
Adds the address of a new int to the list.
Map & mp
Mapping associated with the star.
Sym_tensor hij_auto
Deviation of the inverse conformal metric from the inverse flat metric generated principally by the ...
int get_np(int l) const
Returns the number of points in the azimuthal direction ( ) in domain no. l.
Star_bin star1
First star of the system.
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).
virtual void std_spectral_base()
Sets the spectral bases of the Valeur va to the standard ones for a scalar field. ...
void dirac_gauge()
Function used to impose Dirac gauge during an iteration.
virtual void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
const Vector & derive_con(const Metric &gam) const
Returns the "contravariant" derivative of *this with respect to some metric , by raising the index of...
Tensor field of valence 1.
Tbl & set_domain(int l)
Read/write of the value in a given domain.
Tbl diffrel(const Cmp &a, const Cmp &b)
Relative difference between two Cmp (norme version).
virtual void dec_dzpuis(int dec=1)
Decreases by dec units the value of dzpuis and changes accordingly the values in the compactified ext...
virtual const Sym_tensor & con() const
Read-only access to the contravariant representation.
virtual double val_r(int l, double xi, double theta, double pphi) const =0
Returns the value of the radial coordinate r for a given in a given domain.
Scalar decouple
Function used to construct the part generated by the star from the total .
const Vector & divergence(const Metric &) const
Returns the divergence of this with respect to a Metric .
Tbl norme(const Cmp &)
Sums of the absolute values of all the values of the Cmp in each domain.
Sym_tensor hij
Total deviation of the inverse conformal metric from the inverse flat metric.
const Base_vect * get_triad() const
Returns the vectorial basis (triad) on which the components are defined.
Metric_flat flat
Flat metric defined on the mapping (Spherical components with respect to the mapping of the star) ...
void set_outer_boundary(int l, double x)
Sets the value of the Scalar at the outer boundary of a given domain.
int get_nzone() const
Returns the number of domains.
const Scalar & divergence(const Metric &) const
The divergence of this with respect to a Metric .
Cmp pow(const Cmp &, int)
Power .
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
virtual const Scalar & determinant() const
Returns the determinant.
Metric gtilde
Conformal metric .
virtual void inc_dzpuis(int inc=1)
Increases by inc units the value of dzpuis and changes accordingly the values in the compactified ext...
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.
Tbl & set(int l)
Read/write of the value in a given domain.
const Base_vect_cart & get_bvect_cart() const
Returns the Cartesian basis associated with the coordinates (x,y,z) of the mapping, i.e.
Scalar & set(const Itbl &ind)
Returns the value of a component (read/write version).
void add_double(const double &x, int position=0)
Adds the the address of a new double to the list.
virtual void change_triad(const Base_vect &new_triad)
Sets a new vectorial basis (triad) of decomposition and modifies the components accordingly.
void set_triad(const Base_vect &new_triad)
Assigns a new vectorial basis (triad) of decomposition.
int get_nt(int l) const
Returns the number of points in the co-latitude direction ( ) in domain no. l.
Scalar & set(int)
Read/write access to a component.
void add_cmp_mod(Cmp &ti, int position=0)
Adds the address of a new modifiable Cmp to the list.
Star_bin star2
Second star of the system.
virtual void std_spectral_base()
Sets the standard spectal bases of decomposition for each component.
Sym_tensor derive_lie(const Vector &v) const
Computes the Lie derivative of this with respect to some vector field v.
Scalar psi4
Conformal factor .
Class intended to describe valence-2 symmetric tensors.
void add_int_mod(int &n, int position=0)
Adds the address of a new modifiable int to the list.
Tbl diffrelmax(const Cmp &a, const Cmp &b)
Relative difference between two Cmp (max version).
Coord r
r coordinate centered on the grid