aboutsummaryrefslogtreecommitdiff
path: root/src/CopyTmunu.F90
diff options
context:
space:
mode:
authorschnetter <schnetter@b83b3108-af97-48ba-8c81-9293ccf7f924>2009-09-28 18:13:48 +0000
committerschnetter <schnetter@b83b3108-af97-48ba-8c81-9293ccf7f924>2009-09-28 18:13:48 +0000
commit1198ef6e175f651646fb7989e8cdce06d424d684 (patch)
treea12b5980e3986e7f579db332a0e809c1f602c7a9 /src/CopyTmunu.F90
parentbcf804124910ccb0643e23ee6f7be30a768a1486 (diff)
Move thorn TmunuBase from AEIThorns to CactusEinstein.
Thorn TmunuBase provides grid functions for the stress-energy tensor T_ab. This allows spacetime codes to be independent of hydrodynamics formulations, or other formulations contributing to the stress-energy tensor. TmunuBase is backwards compatible with the old CalcTmunu.inc mechanism. git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinBase/TmunuBase/trunk@2 b83b3108-af97-48ba-8c81-9293ccf7f924
Diffstat (limited to 'src/CopyTmunu.F90')
-rw-r--r--src/CopyTmunu.F9044
1 files changed, 44 insertions, 0 deletions
diff --git a/src/CopyTmunu.F90 b/src/CopyTmunu.F90
new file mode 100644
index 0000000..dde5804
--- /dev/null
+++ b/src/CopyTmunu.F90
@@ -0,0 +1,44 @@
+#include "cctk.h"
+#include "cctk_Arguments.h"
+#include "cctk_Parameters.h"
+
+
+
+! Calculate the T2munu copy.
+! On input, T2munu contains the contribution to Tmunu that is calculated
+! via the CalcTmunu.inc mechanism, and Tmunu contains the complete stress
+! energy tensor.
+! On output, T2munu should contain the contribution to Tmunu that is
+! calculated via the AddToTmunu mechanism.
+! We just need to calculate the difference.
+
+subroutine TmunuBase_CopyTmunu (CCTK_ARGUMENTS)
+ implicit none
+ DECLARE_CCTK_ARGUMENTS
+ DECLARE_CCTK_PARAMETERS
+
+ if (support_old_CalcTmunu_mechanism == 0) then
+ call CCTK_WARN (0, "internal error")
+ end if
+
+ if (stress_energy_state == 0) then
+ call CCTK_WARN (1, "The stress energy tensor does not have storage")
+ return
+ end if
+
+ stress_energy_2_state = stress_energy_state
+
+ eT2tt = eTtt - eT2tt
+
+ eT2tx = eTtx - eT2tx
+ eT2ty = eTty - eT2ty
+ eT2tz = eTtz - eT2tz
+
+ eT2xx = eTxx - eT2xx
+ eT2xy = eTxy - eT2xy
+ eT2xz = eTxz - eT2xz
+ eT2yy = eTyy - eT2yy
+ eT2yz = eTyz - eT2yz
+ eT2zz = eTzz - eT2zz
+
+end subroutine TmunuBase_CopyTmunu