29char binary_dirac_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Binary/binary_dirac.C,v 1.3 2014/10/13 08:52:44 j_novak Exp $" ;
54#include "utilitaires.h"
78 for(
int i=1; i<=3; i++)
79 for(
int j=i; j<=3; j++) {
85 for(
int i=1; i<=3; i++)
86 for(
int j=i; j<=3; j++)
98 for(
int i=1; i<=3; i++)
99 for(
int j=i; j<=3; j++) {
105 for(
int i=1; i<=3; i++)
106 for(
int j=i; j<=3; j++)
113 cout <<
"Function Binary::dirac_gauge()" << endl ;
119 double precis = 1e-5 ;
120 double precis_poisson = 1e-14 ;
121 double relax_poisson = 1.5 ;
122 int mer_poisson = 4 ;
136 Scalar ssjm1_xi11 (xi1(1)) ;
137 Scalar ssjm1_xi12 (xi1(2)) ;
138 Scalar ssjm1_xi13 (xi1(3)) ;
141 for(
int mer=0; mer<mermax; mer++){
149 double sigma = 3.*r0_1 ;
152 ff1 =
exp( -(rr1 - r0_1)*(rr1 - r0_1)/sigma/sigma ) ;
153 for (
int ii=0; ii<nz-1; ii++)
166 source_xi1 += source_reg1 ;
170 Cmp ssjm1xi11 (ssjm1_xi11) ;
171 Cmp ssjm1xi12 (ssjm1_xi12) ;
172 Cmp ssjm1xi13 (ssjm1_xi13) ;
179 par_xi11.
add_int(mer_poisson, 0) ;
186 par_xi12.
add_int(mer_poisson, 0) ;
193 par_xi13.
add_int(mer_poisson, 0) ;
203 ssjm1_xi11 = ssjm1xi11 ;
204 ssjm1_xi12 = ssjm1xi12 ;
205 ssjm1_xi13 = ssjm1xi13 ;
213 Tbl tdiff_xi1_x =
diffrel(lap_xi1(1), source_xi1(1)) ;
214 Tbl tdiff_xi1_y =
diffrel(lap_xi1(2), source_xi1(2)) ;
215 Tbl tdiff_xi1_z =
diffrel(lap_xi1(3), source_xi1(3)) ;
218 "Relative error in the resolution of the equation for xi1 : "
220 cout <<
"x component : " ;
221 for (
int l=0; l<nz; l++) {
222 cout << tdiff_xi1_x(l) <<
" " ;
225 cout <<
"y component : " ;
226 for (
int l=0; l<nz; l++) {
227 cout << tdiff_xi1_y(l) <<
" " ;
230 cout <<
"z component : " ;
231 for (
int l=0; l<nz; l++) {
232 cout << tdiff_xi1_z(l) <<
" " ;
239 for (
int i=1 ; i<nz ; i++)
240 if (diff(i) > erreur)
243 cout <<
"Step : " << mer <<
" Difference : " << erreur << endl ;
244 cout <<
"-------------------------------------" << endl ;
260 Scalar ssjm1_xi21 (xi2(1)) ;
261 Scalar ssjm1_xi22 (xi2(2)) ;
262 Scalar ssjm1_xi23 (xi2(3)) ;
265 for(
int mer=0; mer<mermax; mer++){
273 double sigma = 3.*r0_2 ;
276 ff2 =
exp( -(rr2 - r0_2)*(rr2 - r0_2)/sigma/sigma ) ;
277 for (
int ii=0; ii<nz-1; ii++)
290 source_xi2 += source_reg2 ;
294 Cmp ssjm1xi21 (ssjm1_xi21) ;
295 Cmp ssjm1xi22 (ssjm1_xi22) ;
296 Cmp ssjm1xi23 (ssjm1_xi23) ;
303 par_xi21.
add_int(mer_poisson, 0) ;
310 par_xi22.
add_int(mer_poisson, 0) ;
317 par_xi23.
add_int(mer_poisson, 0) ;
327 ssjm1_xi21 = ssjm1xi21 ;
328 ssjm1_xi22 = ssjm1xi22 ;
329 ssjm1_xi23 = ssjm1xi23 ;
337 Tbl tdiff_xi2_x =
diffrel(lap_xi2(1), source_xi2(1)) ;
338 Tbl tdiff_xi2_y =
diffrel(lap_xi2(2), source_xi2(2)) ;
339 Tbl tdiff_xi2_z =
diffrel(lap_xi2(3), source_xi2(3)) ;
342 "Relative error in the resolution of the equation for xi2 : "
344 cout <<
"x component : " ;
345 for (
int l=0; l<nz; l++) {
346 cout << tdiff_xi2_x(l) <<
" " ;
349 cout <<
"y component : " ;
350 for (
int l=0; l<nz; l++) {
351 cout << tdiff_xi2_y(l) <<
" " ;
354 cout <<
"z component : " ;
355 for (
int l=0; l<nz; l++) {
356 cout << tdiff_xi2_z(l) <<
" " ;
363 for (
int i=1 ; i<nz ; i++)
364 if (diff(i) > erreur)
367 cout <<
"Step : " << mer <<
" Difference : " << erreur << endl ;
368 cout <<
"-------------------------------------" << endl ;
392 for(
int i=1; i<=3; i++)
393 for(
int j=i; j<=3; j++)
401 cout <<
"norme de h_uu avant :" << endl ;
402 for (
int i=1; i<=3; i++)
403 for (
int j=1; j<=i; j++) {
404 cout <<
" Comp. " << i <<
" " << j <<
" : " ;
405 for (
int l=0; l<nz; l++){
412 cout <<
"norme de h_uu en jauge de dirac :" << endl ;
413 for (
int i=1; i<=3; i++)
414 for (
int j=1; j<=i; j++) {
415 cout <<
" Comp. " << i <<
" " << j <<
" : " ;
416 for (
int l=0; l<nz; l++){
417 cout <<
norme(hij_dirac1(i,j)/(nr*nt*np))(l) <<
" " ;
428 cout <<
"For comparaison H^i before computation = " << endl
429 <<
norme(hh_dirac(1))/(nr*nt*np)
431 <<
norme(hh_dirac(2))/(nr*nt*np)
433 <<
norme(hh_dirac(3))/(nr*nt*np)
437 cout <<
"Vector H^i after the computation" << endl ;
438 for (
int i=1; i<=3; i++){
439 cout <<
" Comp. " << i <<
" : " <<
norme(hh_dirac_new(i)
440 /(nr*nt*np)) << endl ;
464 for(
int i=1; i<=3; i++)
465 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).
const Base_vect_cart & get_bvect_cart() const
Returns the Cartesian basis associated with the coordinates (x,y,z) of the mapping,...
Coord r
r coordinate centered on the grid
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.
const Mg3d * get_mg() const
Gives the Mg3d on which the mapping is defined.
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.
int get_np(int l) const
Returns the number of points in the azimuthal direction ( ) in domain no. l.
int get_nt(int l) const
Returns the number of points in the co-latitude direction ( ) in domain no. l.
int get_nzone() const
Returns the number of domains.
int get_nr(int l) const
Returns the number of points in the radial direction ( ) in domain no. l.
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.