57#include "utilitaires.h"
64 int nz =
star1.
mp.get_mg()->get_nzone() ;
65 int nr =
star1.
mp.get_mg()->get_nr(0);
66 int nt =
star1.
mp.get_mg()->get_nt(0);
67 int np =
star1.
mp.get_mg()->get_np(0);
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++){
151 double r0_1 =
star1.
mp.val_r(nz-2, 1, 0, 0) ;
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) ;
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++){
275 double r0_2 =
star2.
mp.val_r(nz-2, 1, 0, 0) ;
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) ;
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 ;
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 ;
467 for(
int i=1; i<=3; i++)
468 for(
int j=i; j<=3; j++)
void dirac_gauge()
Function used to impose Dirac gauge during an iteration.
Star_bin star2
Second star of the system.
Star_bin star1
First star of the system.
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
virtual const Sym_tensor & con() const
Read-only access to the contravariant representation.
virtual const Sym_tensor & con() const
Read-only access to the contravariant representation.
virtual const Scalar & determinant() const
Returns the determinant.
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_int(const int &n, int position=0)
Adds the address of a new int to the list.
Tensor field of valence 0 (or component of a tensorial field).
virtual void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
virtual void std_spectral_base()
Sets the spectral bases of the Valeur va to the standard ones for a scalar field.
Tbl & set_domain(int l)
Read/write of the value in a given domain.
void set_outer_boundary(int l, double x)
Sets the value of the Scalar at the outer boundary of a given domain.
const Vector & derive_con(const Metric &gam) const
Returns the "contravariant" derivative of *this with respect to some metric , by raising the index of...
void import(const Scalar &ci)
Assignment to another Scalar defined on a different mapping.
Scalar decouple
Function used to construct the part generated by the star from the total .
Sym_tensor hij_comp
Deviation of the inverse conformal metric from the inverse flat metric generated principally by the ...
Sym_tensor hij
Total deviation of the inverse conformal metric from the inverse flat metric.
Sym_tensor hij_auto
Deviation of the inverse conformal metric from the inverse flat metric generated principally by the ...
Scalar psi4
Conformal factor .
Metric_flat flat
Flat metric defined on the mapping (Spherical components with respect to the mapping of the star) .
Metric gtilde
Conformal metric .
Map & mp
Mapping associated with the star.
Class intended to describe valence-2 symmetric tensors.
Sym_tensor derive_lie(const Vector &v) const
Computes the Lie derivative of this with respect to some vector field v.
const Vector & divergence(const Metric &) const
Returns the divergence of this with respect to a Metric .
Tensor field of valence 1.
Vector poisson(double lambda, int method=6) const
Solves the vector Poisson equation with *this as a source.
virtual void std_spectral_base()
Sets the standard spectal bases of decomposition for each component.
const Scalar & divergence(const Metric &) const
The divergence of this with respect to a Metric .
Scalar & set(int)
Read/write access to a component.
Cmp exp(const Cmp &)
Exponential.
Tbl diffrel(const Cmp &a, const Cmp &b)
Relative difference between two Cmp (norme version).
Tbl norme(const Cmp &)
Sums of the absolute values of all the values of the Cmp in each domain.
Cmp pow(const Cmp &, int)
Power .
Tbl diffrelmax(const Cmp &a, const Cmp &b)
Relative difference between two Cmp (max 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...
void set_triad(const Base_vect &new_triad)
Assigns a new vectorial basis (triad) of decomposition.
const Tensor & derive_con(const Metric &gam) const
Returns the "contravariant" derivative of this with respect to some metric , by raising the last inde...
virtual void change_triad(const Base_vect &new_triad)
Sets a new vectorial basis (triad) of decomposition and modifies the components accordingly.
virtual void inc_dzpuis(int inc=1)
Increases by inc units the value of dzpuis and changes accordingly the values in the compactified ext...
const Base_vect * get_triad() const
Returns the vectorial basis (triad) on which the components are defined.
Scalar & set(const Itbl &ind)
Returns the value of a component (read/write version).
virtual void std_spectral_base()
Sets the standard spectal bases of decomposition for each component.