92 for (
int ll=1; ll<=2; ll++) {
97 const Mg3d* mg = mp.get_mg() ;
158 double lambda_dirac = 0. ;
161 const Vector hdirac_auto = lambda_dirac *
175 double r0 = mp.val_r(nz-2, 1, 0, 0) ;
176 double sigma = 1.*r0 ;
183 ff =
exp( -(rr - r0)*(rr - r0)/sigma/sigma ) ;
184 for (
int ii=0; ii<nz-1; ii++)
185 ff.set_domain(ii) = 1. ;
186 ff.set_outer_boundary(nz-1, 0) ;
187 ff.std_spectral_base() ;
193 Vector omdsdp (mp, CON, mp.get_bvect_cart()) ;
201 if (fabs(mp.get_rot_phi()) < 1e-10){
202 omdsdp.
set(1) = - om * yya * ff ;
203 omdsdp.
set(2) = om * xxa * ff ;
207 omdsdp.
set(1) = om * yya * ff ;
208 omdsdp.
set(2) = - om * xxa * ff ;
224 for (
int i=1; i<=3; i++)
225 for (
int j=1; j<=i; j++) {
226 tkij_a.
set(i, j) = dbeta(i, j) + dbeta(j, i) -
227 double(2) /double(3) * div_beta * (gtilde.
con())(i,j) ;
231 tkij_a = 0.5 * tkij_a / nn ;
235 Scalar a2_auto =
contract(tkij_auto_cov, 0, 1, tkij_a, 0, 1,
true) ;
242 for (
int i=1; i<=3; i++)
243 for (
int j=i; j<=3; j++) {
244 tkij_c.
set(i, j) = dbeta_comp(i, j) + dbeta_comp(j, i) -
245 double(2) /double(3) * divbeta_comp * (gtilde.
con())(i,j) ;
249 tkij_c = 0.5 * tkij_c / nn ;
251 Scalar a2_comp =
contract(tkij_auto_cov, 0, 1, tkij_c, 0, 1,
true) ;
269 source2 = star_i.
psi4 % (a2_auto + a2_comp) ;
273 0, dcov_logn_auto, 0,
true) ;
275 source4 = -
contract(star_i.
hij, 0, 1, dcovdcov_logn_auto +
278 source_tot = source1 + source2 + source3 + source4 ;
295 Scalar source_tot_hij(mp) ;
296 Tensor source_Sij(mp, 2, CON, mp.get_bvect_cart()) ;
297 Tensor source_Rij(mp, 2, CON, mp.get_bvect_cart()) ;
298 Tensor tens_temp(mp, 2, CON, mp.get_bvect_cart()) ;
300 Tensor source_1 (mp, 2, CON, mp.get_bvect_cart()) ;
301 Tensor source_2 (mp, 2, CON, mp.get_bvect_cart()) ;
302 Tensor source_3a (mp, 2, CON, mp.get_bvect_cart()) ;
303 Tensor source_3b (mp, 2, CON, mp.get_bvect_cart()) ;
304 Tensor source_4 (mp, 2, CON, mp.get_bvect_cart()) ;
305 Tensor source_5 (mp, 2, CON, mp.get_bvect_cart()) ;
306 Tensor source_6 (mp, 2, CON, mp.get_bvect_cart()) ;
309 source_1 =
contract(dcon_hij, 1, dcov_lnq_auto, 0) ;
311 source_2 = -
contract(dcon_hij, 2, dcov_lnq_auto, 0)
312 - 2./3. *
contract(hdirac, 0, dcov_lnq_auto, 0) * flat.
con() ;
318 (star_i.
logn - 2.e-8) ;
328 Tensor dcov_omdsdphi (mp, 2, type, mp.get_bvect_cart()) ;
329 dcov_omdsdphi.
set(1,1) = 0. ;
330 dcov_omdsdphi.
set(2,1) = om * ff ;
331 dcov_omdsdphi.
set(3,1) = 0. ;
332 dcov_omdsdphi.
set(2,2) = 0. ;
333 dcov_omdsdphi.
set(3,2) = 0. ;
334 dcov_omdsdphi.
set(3,3) = 0. ;
335 dcov_omdsdphi.
set(1,2) = -om *ff ;
336 dcov_omdsdphi.
set(1,3) = 0. ;
337 dcov_omdsdphi.
set(2,3) = 0. ;
340 source_3a =
contract(tkij_a, 0, dcov_omdsdphi, 1) ;
356 source_5 = dcon_hdirac_auto ;
358 source_6 = - 2./3. * hdirac_auto.
divergence(flat) * flat.
con() ;
364 source_Sij = 8. * nn / psi4 * phi_auto.
derive_con(gtilde) *
367 source_Sij += 4. / psi4 * phi_auto.
derive_con(gtilde) *
372 source_Sij += - nn / (3.*psi4) * gtilde_con *
374 dcov_gtilde, 0, 1), 0, 1)
376 dcov_gtilde, 0, 2), 0, 1)) ;
378 source_Sij += - 8.*nn / (3.*psi4) * gtilde_con *
384 source_Sij += tens_temp ;
386 source_Sij += - 8./(3.*psi4) *
contract(dcov_phi_auto, 0,
389 source_Sij += 2.*nn*
contract(gtilde_cov, 0, 1, tkij_a *
390 (tkij_a+tkij_c), 1, 3) ;
392 source_Sij += - 2. * qpig * nn * ( psi4 * star_i.
stress_euler
393 - 0.33333333333333333 * star_i.
s_euler * gtilde_con ) ;
395 source_Sij += - 1./(psi4*psi2) *
contract(gtilde_con, 1,
396 contract(gtilde_con, 1, qq*dcovdcov_lnq_auto +
397 qq*dcov_lnq_auto*dcov_lnq, 0), 1) ;
400 dcov_hij_auto, 2), 1, dcov_qq, 0) -
402 star_i.
hij, 1), 1, dcov_qq, 0) ;
405 dcov_hij_auto, 2), 0, dcov_qq, 0) ;
407 source_Sij += 1./(3.*psi4*psi2)*
contract(gtilde_con, 0, 1,
408 qq*dcovdcov_lnq_auto + qq*dcov_lnq_auto*dcov_lnq, 0, 1)
411 source_Sij += 1./(3.*psi4*psi2) *
contract(hdirac, 0,
425 source_Rij +=
contract(hdirac, 0, dcov_hij_auto, 2) ;
431 gtilde_con, 0, dcov_hij_auto, 2), 0, dcov_hij, 2), 1, 3) ;
434 dcov_hij_auto, 1), 2, gtilde_con, 1), 0, dcov_hij, 1), 0, 3) +
436 dcov_hij_auto, 1), 0, dcov_hij, 1), 0, 3), 0, gtilde_con, 1) ;
438 source_Rij += 0.5 *
contract(gtilde_con*gtilde_con, 1, 3,
439 contract(dcov_hij_auto, 0, 1, dcov_gtilde, 0, 1), 0, 1) ;
441 source_Rij = source_Rij * 0.5 ;
443 for(
int i=1; i<=3; i++)
444 for(
int j=1; j<=i; j++) {
446 source_tot_hij = source_1(i,j) + source_1(j,i)
447 + source_2(i,j) + 2.*psi4/nn * (
448 source_4(i,j) - source_Sij(i,j))
449 - 2.* source_Rij(i,j) +
450 source_5(i,j) + source_5(j,i) + source_6(i,j) ;
453 source3 = 2.*psi4/nn * (source_3a(i,j) + source_3a(j,i)
456 source_tot_hij = source_tot_hij + source3 ;
463 lie_aij_1.
set(1,1) = nn / (2.*psi4) *
464 (lapl-source_tot_hij) ;
469 lie_aij_1.
set(2,1) = nn / (2.*psi4) *
470 (lapl-source_tot_hij) ;
475 lie_aij_1.
set(3,1) = nn / (2.*psi4) *
476 (lapl-source_tot_hij) ;
481 lie_aij_1.
set(2,2) = nn / (2.*psi4) *
482 (lapl-source_tot_hij) ;
487 lie_aij_1.
set(3,2) = nn / (2.*psi4) *
488 (lapl-source_tot_hij) ;
493 lie_aij_1.
set(3,3) = nn / (2.*psi4) *
494 (lapl-source_tot_hij) ;
502 lie_aij_2.
set(1,1) = nn / (2.*psi4) *
503 (lapl-source_tot_hij) ;
508 lie_aij_2.
set(2,1) = nn / (2.*psi4) *
509 (lapl-source_tot_hij) ;
514 lie_aij_2.
set(3,1) = nn / (2.*psi4) *
515 (lapl-source_tot_hij) ;
520 lie_aij_2.
set(2,2) = nn / (2.*psi4) *
521 (lapl-source_tot_hij) ;
526 lie_aij_2.
set(3,2) = nn / (2.*psi4) *
527 (lapl-source_tot_hij) ;
532 lie_aij_2.
set(3,3) = nn / (2.*psi4) *
533 (lapl-source_tot_hij) ;
542 int nz =
star1.mp.get_mg()->get_nzone() ;
545 double* bornes =
new double [6] ;
546 bornes[nz] = __infinity ;
547 bornes[4] = M_PI /
omega ;
548 bornes[3] = M_PI /
omega * 0.5 ;
549 bornes[2] = M_PI /
omega * 0.2 ;
550 bornes[1] = M_PI /
omega * 0.1 ;
560 Sym_tensor lie_aij_tot (mapping, CON, mapping.get_bvect_cart()) ;
570 lie_K2_1.
import(lie_K_2) ;
571 lie_K_tot_1 = lie_K_1 + lie_K2_1 ;
575 for(
int i=1; i<=3; i++)
576 for(
int j=1; j<=i; j++) {
577 lie_aij2_1.
set(i,j).
import(lie_aij_2(i,j)) ;
579 get_spectral_va().get_base()) ;
582 lie_aij_tot_1 = lie_aij_1 + lie_aij2_1 ;
587 lie_kij_tot = lie_aij_tot_1/
star1.psi4 + 1./3.*
star1.gamma.con()*
591 cout <<
" IN THE CENTER OF STAR 1 " << endl
592 <<
" ----------------------- " << endl ;
616 cout <<
"L2 norm of L_k K^{ab} " << endl ;
625 for (
int mm=0; mm<nz; mm++)
626 for (
int pp=0; pp<=mm; pp++)
627 integral.
set(mm) += integ(pp) ;
633 cout <<
"omega = " <<
omega << endl ;
634 cout <<
"mass_adm = " <<
mass_adm() << endl ;
639 cout <<
"Position du centre de l'etoile x/lambda = "
640 << -
star1.get_mp().get_ori_x() *
omega / M_PI <<
" in Lorene units"