diff options
Diffstat (limited to 'src/TmunuBase_CalcTmunu.inc')
-rw-r--r-- | src/TmunuBase_CalcTmunu.inc | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/src/TmunuBase_CalcTmunu.inc b/src/TmunuBase_CalcTmunu.inc new file mode 100644 index 0000000..8cc9571 --- /dev/null +++ b/src/TmunuBase_CalcTmunu.inc @@ -0,0 +1,60 @@ +/* Add the contributions to T_munu that we gathered via the AddToTmunu + mechanism, using the CalcTmunu.inc mechanism. */ + + + +/* Only add if we are not included from this thorn; otherwise we would + be adding to ourselves. */ +#ifndef TMUNUBASE_SETTMUNU + +#ifdef CCODE + + if (* stress_energy_2_state) + { + +#ifndef NDEBUG + if ((ijk) < 0 || (ijk) >= cctk_lsh[0] * cctk_lsh[1] * cctk_lsh[2]) + { + CCTK_WARN (0, "Illegal array index"); + } +#endif + + Ttt += eT2tt[ijk]; + + Ttx += eT2tx[ijk]; + Tty += eT2ty[ijk]; + Ttz += eT2tz[ijk]; + + Txx += eT2xx[ijk]; + Txy += eT2xy[ijk]; + Txz += eT2xz[ijk]; + Tyy += eT2yy[ijk]; + Tyz += eT2yz[ijk]; + Tzz += eT2zz[ijk]; + + } + +#endif + +#ifdef FCODE + + if (stress_energy_2_state .ne. 0) then + + Ttt = Ttt + eT2tt(i,j,k) + + Ttx = Ttx + eT2tx(i,j,k) + Tty = Tty + eT2ty(i,j,k) + Ttz = Ttz + eT2tz(i,j,k) + + Txx = Txx + eT2xx(i,j,k) + Txy = Txy + eT2xy(i,j,k) + Txz = Txz + eT2xz(i,j,k) + Tyy = Tyy + eT2yy(i,j,k) + Tyz = Tyz + eT2yz(i,j,k) + Tzz = Tzz + eT2zz(i,j,k) + + end if + +#endif + +#endif /* ifndef TMUNUBASE_SETTMUNU */ |