122 assert(radius > 1.e-15) ;
123 assert(map.get_mg()->get_nzone() == 1) ;
124 assert(map.get_mg()->get_nr(0) == 1) ;
125 assert(map.get_mg()->get_type_r(0) == FIN) ;
129 jac2d.set_index_type(0) = CON ;
130 proj.set_index_type(0) = CON ;
132 jac2d.set_etat_zero() ;
137 ephi.set_etat_zero();
138 proj.set_etat_zero();
140 for (
int i=1; i<=3; i++)
141 hh.set(i,i) = 2./radius ;
142 trk.set_etat_zero() ;
147 zeta.set_etat_zero();
161 ricci(h_in.get_mp()),
175 const Mg3d& gri2d = *map.get_mg() ;
178 assert(mp_rad != 0x0) ;
180 const Mg3d& gri3d = *map3.get_mg();
181 assert(&gri2d == Kij.
get_mp().get_mg()->get_angu_1dom()) ;
183 int np = gri2d.
get_np(0) ;
184 int nt = gri2d.
get_nt(0) ;
186 int nr3 = gri3d.
get_nr(0) ;
187 int nt3 = gri3d.
get_nt(0) ;
188 int np3 = gri3d.
get_np(0) ;
190 assert( nt == nt3 ) ;
191 assert ( np == np3 );
203 proj.set_index_type(0) = CON;
204 jac2d.set_index_type(0) = CON;
211 for (
int f= 0; f<nz; f++)
212 for (
int k=0; k<np3; k++)
213 for (
int j=0; j<nt3; j++) {
214 for (
int l=0; l<nr3; l++) {
242 jac2d.allocate_all() ;
243 jac2d.std_spectral_base();
244 for (
int l=1; l<4; l++)
245 for (
int m=1; m<4; m++)
246 for (
int k=0; k<np; k++)
247 for (
int j=0; j<nt; j++) {
249 j, k, pipo, lz, xi) ;
250 jac2d.set(l,m).set_grid_point(0, k, j, 0) =
251 jac(l,m).get_spectral_va().val_point_jk(lz, xi, j, k) ;
256 jac_inv.
set(1,2) = - jac_inv(1,2);
257 jac_inv.
set(1,3) = - jac_inv(1,3) ;
267 ss3d = ss3d /
sqrt (ssnorm) ;
268 ss3dcon = ss3dcon /
sqrt (ssnorm) ;
283 for (
int ii=1; ii <=3; ii++){
287 for (
int ii=1; ii <=3; ii++)
288 for (
int jjy = 1; jjy <=3; jjy ++){
289 jac_inv.
set(ii, jjy).
dec_dzpuis(jac_inv(ii, jjy).get_dzpuis());
298 ss3 =
contract(jac_inv, 0, ss3d, 0);
300 ss.std_spectral_base();
302 for (
int l=1; l<4; l++)
303 for (
int k=0; k<np; k++)
304 for (
int j=0; j<nt; j++) {
305 mp_rad->
val_lx_jk(
h_surf.val_grid_point(0, k, j, 0)*1.0000000000001, j, k, pipo,
307 ss.set(l).set_grid_point(0, k, j, 0) =
308 ss3(l).get_spectral_va().val_point_jk(lz, xi, j, k) ;
318 ephi3.
set(3) = ephi33;
321 ephi.allocate_all() ;
322 ephi.std_spectral_base();
324 for (
int l=1; l<4; l++)
325 for (
int k=0; k<np; k++)
326 for (
int j=0; j<nt; j++) {
328 j, k, pipo, lz, xi) ;
329 ephi.set(l).set_grid_point(0, k, j, 0) =
330 ephi3(l).get_spectral_va().val_point_jk(lz, xi, j, k) ;
335 Tensor proj_prov = gamij.
con().
down(1, gamij) - ss3dcon*ss3d;
337 proj.std_spectral_base();
342 for (
int l=1; l<4; l++)
343 for (
int m=1; m<4; m++)
344 for (
int k=0; k<np; k++)
345 for (
int j=0; j<nt; j++) {
347 j, k, pipo, lz, xi) ;
348 proj.set(l,m).set_grid_point(0, k, j, 0) =
349 proj3d(l,m).get_spectral_va().val_point_jk(lz, xi, j, k) ;
363 + 2* gamij.
cov()(1,2)* (h_surf3.
srdsdt()) + gamij.
cov()(2,2);
375 for (
int l=1; l<4; l++)
376 for (
int m=1; m<4; m++)
377 for (
int k=0; k<np; k++)
378 for (
int j=0; j<nt; j++) {
380 j, k, pipo, lz, xi) ;
382 qq3d(l,m).get_spectral_va().val_point_jk(lz, xi, j, k) ;
388 - ss3d * ss3d) , 0), 1) ;
390 qq.std_spectral_base();
391 for (
int l=1; l<4; l++)
392 for (
int m=1; m<4; m++)
393 for (
int k=0; k<np; k++)
394 for (
int j=0; j<nt; j++) {
396 j, k, pipo, lz, xi) ;
397 qq.set(l,m).set_grid_point(0, k, j, 0) =
398 qqq(l,m).get_spectral_va().val_point_jk(lz, xi, j, k) ;
404 for (
int k=0; k<np; k++)
405 for (
int j=0; j<nt; j++) {
407 j, k, pipo, lz, xi) ;
408 trk.set_grid_point(0, k, j, 0) =
417 for (
int k=0; k<np; k++)
418 for (
int j=0; j<nt; j++) {
419 mp_rad->
val_lx_jk(
h_surf.val_grid_point(0, k, j, 0)*1.000000000000001, j, k, pipo,
421 fff.set_grid_point(0, k, j, 0) =
430 for (
int k=0; k<np; k++)
431 for (
int j=0; j<nt; j++) {
432 mp_rad->
val_lx_jk(
h_surf.val_grid_point(0, k, j, 0)*1.00000000000001, j, k, pipo,
434 ggg.set_grid_point(0, k, j, 0) =
440 double rayon =
sqrt(
area()/(4.*M_PI));
441 ftilde = -ftilde/(rayon*rayon);
449 double *a_tilde =
new double[nombre];
453 for (
int k=0; k<np+1; k++)
454 for (
int j=0; j<nt; j++) {
455 int l_q, m_q, base_r ;
457 if (nullite_plm(j, nt, k, np, base) == 1) {
458 donne_lm(1, lz, j, k, base, m_q, l_q,base_r) ;
460 a_tilde[l_q] = (*coefftilde)(0, k, j, 0);
470 for (
int k=0; k<np+1; k++)
471 for (
int j=0; j<nt; j++) {
472 int l_q2, m_q2, base_r2 ;
474 if (nullite_plm(j, nt, k, np, base2) == 1) {
475 donne_lm(1, lz, j, k, base2, m_q2, l_q2,base_r2) ;
478 (*dzeta).set(0,k,j,0) = a_tilde[0] + (a_tilde[1]/3.)*
sqrt(2.*1. + 1.);
481 (*dzeta).set(0,k,j,0) =
482 (a_tilde[l_q2 +1]/(2.*l_q2 + 3.))*
sqrt((2.*(l_q2 +1.)+1.)/(2.*l_q2 + 1.))
483 - (a_tilde[l_q2 -1]/(2.*l_q2 - 1.))
484 *
sqrt((2.*(l_q2 - 1.)+1.)/(2.*l_q2 + 1.));
500 ll.std_spectral_base();
501 for (
int l=1; l<4; l++)
502 for (
int k=0; k<np; k++)
503 for (
int j=0; j<nt; j++) {
504 mp_rad->
val_lx_jk(
h_surf.val_grid_point(0, k, j, 0)*1.000000000001, j, k, pipo,
506 ll.set(l).set_grid_point(0, k, j, 0) =
507 ll3(l).get_spectral_va().val_point_jk(lz, xi, j, k) ;
516 Tensor jj3d = Kij - ss3d*ll3d - ll3d*ss3d
517 -
contract(Kij, 0 , 1, sxss3dcon , 0, 1)* sxss3d ;
520 jj.std_spectral_base();
521 for (
int l=1; l<4; l++)
522 for (
int m=1; m<4; m++)
523 for (
int k=0; k<np; k++)
524 for (
int j=0; j<nt; j++) {
526 j, k, pipo, lz, xi) ;
527 jj.set(l,m).set_grid_point(0, k, j, 0) =
528 jj3(l,m).get_spectral_va().val_point_jk(lz, xi, j, k) ;
537 hh.std_spectral_base();
538 for (
int l=1; l<4; l++)
539 for (
int m=1; m<4; m++)
540 for (
int k=0; k<np; k++)
541 for (
int j=0; j<nt; j++) {
543 j, k, pipo, lz, xi) ;
544 hh.set(l,m).set_grid_point(0, k, j, 0) =
545 hh3(l,m).get_spectral_va().val_point_jk(lz, xi, j, k) ;
550 Tensor hh3dupdown = hh3d.
up(0, gamij);
556 Tensor hh3dupup = hh3dupdown.
up(1,gamij);
561 Scalar ricci22 = ricciscal3
567 ricci22 += (hh3d.
trace(gamij)*hh3d.
trace(gamij))
573 ricci.allocate_all();
574 ricci.std_spectral_base();
575 for (
int k=0; k<np; k++)
576 for (
int j=0; j<nt; j++) {
577 mp_rad->
val_lx_jk(
h_surf.val_grid_point(0, k, j, 0)*1.000000000000001, j, k, pipo,
579 ricci.set_grid_point(0, k, j, 0) =
660 if (p_epsilon_A_minus_one != 0x0)
delete p_epsilon_A_minus_one ;
665 if (p_delta != 0x0)
delete p_delta ;
676 p_epsilon_A_minus_one = 0x0;
727 Vector phi(mp_ang, CON, mp_ang.get_bvect_spher());
741 double rayon =
sqrt(
area()/(4.*M_PI));
753 double rayon =
sqrt(
area()/(4.*M_PI));
755 double factor =
mass()/(8. * M_PI);
757 {
for (
int compte=0; compte <=order -1; compte++)
758 factor = factor*rayon;
768 for (
int nn=1; nn<order; nn++){
770 Scalar Pnnew = (2.*nn +1.)*Pn;
772 Pnnew = Pnnew - nn*Pnold;
773 Pnnew = Pnnew/(double(nn) + 1.);
808 Vector phi(mp_ang, CON, mp_ang.get_bvect_spher());
810 double rayon =
sqrt(
area()/(4.*M_PI));
812 double factor = 1./(8. * M_PI);
814 {
for (
int compte=0; compte <=order -2; compte++)
815 factor = factor*rayon;
828 for (
int nn=1; nn<order; nn++){
830 Scalar Pnnew = (2.*nn +1.)*Pn;
832 Pnnew = Pnnew - nn*Pnold;
833 Pnnew = Pnnew/(double(nn) + 1.);
842 dPn = Pn* zeta; dPn = dPn - Pnold; dPn = double(order)*dPn;
845 quotient = quotient*zeta*zeta; quotient = quotient -1.;
868 if (p_epsilon_A_minus_one == 0x0) {
873 return *p_epsilon_A_minus_one;
963 int valence1 = valence0 + 1 ;
964 int valence1m1 = valence1 - 1 ;
985 Itbl tipe(valence1) ;
987 for (
int id = 0;
id<valence0;
id++) {
988 tipe.
set(
id) = tipeuu(
id) ;
990 tipe.
set(valence1m1) = COV ;
1007 Itbl ind1(valence1) ;
1008 Itbl ind0(valence0) ;
1009 Itbl ind(valence0) ;
1029 for (
int ic=0; ic<ncomp1; ic++) {
1038 for (
int id = 0;
id < valence0;
id++) {
1039 ind0.
set(
id) = ind1(
id) ;
1043 int k = ind1(valence1m1) ;
1059 cresu = (uu(ind0)).
srdsdt() ;
1062 for (
int id=0;
id<valence0;
id++) {
1064 switch ( ind0(
id) ) {
1096 cerr <<
"Connection_fspher::p_derive_cov : index problem ! "
1113 for (
int id=0;
id<valence0;
id++) {
1115 switch ( ind0(
id) ) {
1162 cerr <<
"Connection_fspher::p_derive_cov : index problem ! \n"
1174 cerr <<
"Connection_fspher::p_derive_cov : index problem ! \n" ;
1191 cout <<
"c'est pas fait!" << endl ;
1208 if (p_delta == 0x0) {
1210 Tensor christoflat(qab.get_mp(), 3, COV, qab.get_mp().get_bvect_spher());
1217 for (
int k=1; k<=3; k++) {
1218 for (
int i=1; i<=3; i++) {
1219 for (
int j=1; j<=i; j++) {
1221 for (
int l=1; l<=3; l++) {
1222 cc += qab.con()(k,l) * (
1223 dgam(l,j,i) + dgam(i,l,j) - dgam(i,j,l) ) ;
1231 p_delta =
new Tensor (christoflat) ;
1248 for (
int y=1;
y<=nbboucle;
y++){
Bases of the spectral expansions.
void give_quant_numbers(int, int, int, int &, int &, int &) const
Computes the various quantum numbers and 1d radial base.
Basic integer array class.
int & set(int i)
Read/write of a particular element (index i ) (1D case).
double integrale_surface(const Cmp &ci, double rayon) const
Performs the surface integration of ci on the sphere of radius rayon .
Base class for pure radial mappings.
virtual void val_lx_jk(double rr, int j, int k, const Param &par, int &l, double &xi) const =0
Computes the domain index l and the value of corresponding to a point of arbitrary r but collocation...
Metric for tensor calculation.
virtual const Sym_tensor & con() const
Read-only access to the contravariant representation.
const Map & get_mp() const
Returns the mapping.
virtual const Sym_tensor & cov() const
Read-only access to the covariant representation.
const Sym_tensor & ricci() const
Returns the Ricci tensor (given by the Connection p_connect ).
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.
Coefficients storage for the multi-domain spectral method.
Tensor field of valence 0 (or component of a tensorial field).
const Scalar & srdsdt() const
Returns of *this .
const Vector & derive_cov(const Metric &gam) const
Returns the gradient (1-form = covariant vector) of *this.
void div_r_dzpuis(int ced_mult_r)
Division by r everywhere but with the output flag dzpuis set to ced_mult_r .
void mult_cost()
Multiplication by .
const Scalar & srstdsdp() const
Returns of *this .
virtual void std_spectral_base()
Sets the spectral bases of the Valeur va to the standard ones for a scalar field.
void div_tant()
Division by .
Valeur & set_spectral_va()
Returns va (read/write version).
const Valeur & get_spectral_va() const
Returns va (read only version).
void annule_hard()
Sets the Scalar to zero in a hard way.
void mult_sint()
Multiplication by .
virtual void allocate_all()
Sets the logical state to ETATQCQ (ordinary state) and performs the memory allocation of all the elem...
const Base_val & get_spectral_base() const
Returns the spectral bases of the Valeur va.
double & set_grid_point(int l, int k, int j, int i)
Setting the value of the field at a given grid point.
const Vector & derive_con(const Metric &gam) const
Returns the "contravariant" derivative of *this with respect to some metric , by raising the index of...
virtual void dec_dzpuis(int dec=1)
Decreases by dec units the value of dzpuis and changes accordingly the values of the Scalar in the co...
void mult_r()
Multiplication by r everywhere; dzpuis is not changed.
Tensor derive_cov2dflat(const Tensor &uu) const
Computes the round covariant derivative on the spheroid.
virtual ~Spheroid()
Destructor.
const Scalar & sqrt_q() const
Computes the normal vector field to the 2-surface.
Tensor proj
The 3-d projector on the 2-surface (contravariant-covariant form).
Sym_tensor qq
The 3-d covariant degenerated 2-metric on the surface.
const Scalar & theta_minus() const
Computes the ingoing null expansion .
virtual void sauve(FILE *) const
Save in a file.
Vector ll
Normal-tangent component of the extrinsic curvature of the 3-slice.
double * p_multipole_angu
Angular momentum multipole for the spheroid.
double * p_mass
Mass defined from angular momentum.
Scalar trk
Trace K of the extrinsic curvature of the 3-slice.
Scalar * p_theta_plus
Classical Penrose parameter, difference wrt one.
Scalar ggg
Normalization function for the ingoing null vector k.
void operator=(const Spheroid &)
Assignment to another Spheroid.
double epsilon_A_minus_one() const
Computation of the refined Penrose parameter for axisymmetric spacetimes, and its difference wrt one.
void set_der_0x0() const
Sets to 0x0 all the pointers on derived quantities.
Spheroid(const Map_af &map, double radius)
The delta tensorial fields linked to Christoffel symbols.
const Tensor & delta() const
Computes the delta coefficients for covariant derivative.
double multipole_angu(const int order) const
Computes the angular multipole of a given order for the spheroid, assumed to be spherical.
bool issphere
Flag to know whether the horizon is geometrically round or distorted.
Tensor jac2d
The jacobian of the adaptation of coordinates (contravariant/covariant representation).
double mass() const
Computes the mass as defined from the calculus of angular momentum, done with respect to a divergence...
Sym_tensor jj
Tangent components of the extrinsic curvature of the 3-slice.
double * p_area
The area of the 2-surface.
Scalar fff
Normalization function for the outgoing null vector l.
double area() const
Computes the area of the 2-surface.
double multipole_mass(const int order) const
Computes the mass multipole of a given order for the spheroid, assumed to be spherical.
Scalar h_surf
The location of the 2-surface as r = h_surf .
Sym_tensor hh
The ricci scalar on the 2-surface.
double * p_epsilon_P_minus_one
Refined Penrose parameter, difference wrt one.
Scalar * p_sqrt_q
Surface element .
Vector ss
The adapted normal vector field to spheroid in the 3-slice.
virtual void del_deriv() const
Deletes all the derived quantities.
const Scalar & get_ricci() const
Returns the 2-ricci scalar .
const Sym_tensor & shear() const
Computes the shear of the 2-surface .
Scalar * p_theta_minus
Null ingoing expansion.
double angu_mom() const
Computes the angular momentum with respect to a divergence-free vector field tangent to the 2-surface...
const Sym_tensor & get_qq() const
returns the 3-d degenerate 2-metric
Vector ephi
The conformal Killing vector field on the 2-surface (set to by default to the axial vector associated...
const Vector & get_ephi() const
Returns the conformal Killing symmetry vector on the 2-surface.
double * p_multipole_mass
Mass multipole for the spheroid.
double * p_angu_mom
The angular momentum.
Tensor derive_cov2d(const Tensor &uu) const
Computes the total covariant derivative on the spheroid.
Scalar ricci
Induced metric on the 2-surface .
Sym_tensor * p_shear
The shear tensor.
double epsilon_P_minus_one() const
Computation of the classical Penrose parameter, and its difference wrt one.
const Scalar & theta_plus() const
Computes the outgoing null expansion .
Class intended to describe valence-2 symmetric tensors.
Symmetric tensors (with respect to two of their arguments).
double val_point_jk(int l, double x, int j, int k) const
Computes the value of the field represented by *this at an arbitrary point in , but collocation point...
void ylm()
Computes the coefficients of *this.
Mtbl_cf * c_cf
Coefficients of the spectral expansion of the function.
void coef() const
Computes the coeffcients of *this.
Tensor field of valence 1.
virtual void std_spectral_base()
Sets the standard spectal bases of decomposition for each component.
Scalar & set(int)
Read/write access to a component.
Cmp sqrt(const Cmp &)
Square root.
Cmp pow(const Cmp &, int)
Power .
const Map & get_mp() const
Returns the mapping.
int sym_index1() const
Number of the first symmetric index (0<= id_sym1 < valence ).
int get_index_type(int i) const
Gives the type (covariant or contravariant) of the index number i .
virtual void allocate_all()
Performs the memory allocation of all the elements, down to the double arrays of the Tbl s.
int sym_index2() const
Number of the second symmetric index (id_sym1 < id_sym2 < valence ).
int get_valence() const
Returns the valence.
virtual Itbl indices(int pos) const
Returns the indices of a component given by its position in the array cmp .
int & set_index_type(int i)
Sets the type of the index number i .
int get_n_comp() const
Returns the number of stored components.
Tensor down(int ind, const Metric &gam) const
Computes a new tensor by lowering an index of *this.
const Base_vect * get_triad() const
Returns the vectorial basis (triad) on which the components are defined.
void annule_domain(int l)
Sets the Tensor to zero in a given domain.
const Tensor & derive_cov(const Metric &gam) const
Returns the covariant derivative of this with respect to some metric .
Tensor up(int ind, const Metric &gam) const
Computes a new tensor by raising an index of *this.
Tensor trace(int ind1, int ind2) const
Trace on two different type indices.
virtual void set_etat_zero()
Sets the logical state of all components to ETATZERO (zero state).
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.
Tenseur contract(const Tenseur &, int id1, int id2)
Self contraction of two indices of a Tenseur .
virtual void srstdsdp(const Cmp &ci, Cmp &resu) const =0
Computes of a Cmp .
const Base_vect_spher & get_bvect_spher() const
Returns the orthonormal vectorial basis associated with the coordinates of the mapping.
Coord y
y coordinate centered on the grid
Map(const Mg3d &)
Constructor from a multi-domain 3D grid.
const Metric_flat & flat_met_spher() const
Returns the flat metric associated with the spherical coordinates and with components expressed in th...
Coord phi
coordinate centered on the grid
virtual void srdsdt(const Cmp &ci, Cmp &resu) const =0
Computes of a Cmp .