From 10c12785c16c95c1f987fb9280064bce5b783329 Mon Sep 17 00:00:00 2001 From: rhaas Date: Thu, 17 Jan 2013 16:59:32 +0000 Subject: support "new" interface to TmunuBase we check at runtime if storage was allocated for Tmunu and use the data stored there rather than re-computing it using hte include file. Note: this requires that we inherit from TmunuBase, hence all runs even vacuum runs using ADMConstraints need to activate TmunuBase (but need not allocate storage for it). git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/ADMConstraints/trunk@154 b7a48df3-cbbf-4440-997f-b4b717c9f7fc --- interface.ccl | 2 +- src/ADMConstraints.F | 27 ++++++++++++++++++++------- test/ADMConstraints_Mask.par | 2 +- test/ADMConstraints_Physical.par | 2 +- test/ADMConstraints_Shift.par | 2 +- test/test_ADM.par | 2 +- 6 files changed, 25 insertions(+), 12 deletions(-) diff --git a/interface.ccl b/interface.ccl index 34c1184..4ebf229 100644 --- a/interface.ccl +++ b/interface.ccl @@ -2,7 +2,7 @@ # $Header$ implements: admconstraints -inherits: ADMBase, StaticConformal, SpaceMask, grid, ADMMacros +inherits: ADMBase, StaticConformal, SpaceMask, grid, ADMMacros, TmunuBase friend: ADMCoupling USES INCLUDE: CalcTmunu.inc diff --git a/src/ADMConstraints.F b/src/ADMConstraints.F index 83d3aa0..8c7658a 100644 --- a/src/ADMConstraints.F +++ b/src/ADMConstraints.F @@ -157,16 +157,29 @@ c This may be needed for CalcTmunu c Initialize stress-energy tensor components. - Ttt = 0.0D0 - - Ttx = 0.0D0; Tty = 0.0D0; Ttz = 0.0D0 - - Txx = 0.0D0; Tyy = 0.0D0; Tzz = 0.0D0 - Txy = 0.0D0; Txz = 0.0D0; Tyz = 0.0D0 + if (stress_energy_state .ne. 0) then + + Ttt = eTtt(i,j,k) + + Ttx = eTtx(i,j,k); Tty = eTty(i,j,k); Ttz = eTtz(i,j,k) -c Include macro for stress energy tensor. + Txx = eTxx(i,j,k); Tyy = eTyy(i,j,k); Tzz = eTzz(i,j,k) + + + else + + Ttt = 0.0D0 + + Ttx = 0.0D0; Tty = 0.0D0; Ttz = 0.0D0 + + Txx = 0.0D0; Tyy = 0.0D0; Tzz = 0.0D0 + Txy = 0.0D0; Txz = 0.0D0; Tyz = 0.0D0 + +c Include macro for stress energy tensor. #include "CalcTmunu.inc" + + end if c Calculate the hamiltonian constraint c ------------------------------------ diff --git a/test/ADMConstraints_Mask.par b/test/ADMConstraints_Mask.par index b63396d..594005e 100644 --- a/test/ADMConstraints_Mask.par +++ b/test/ADMConstraints_Mask.par @@ -12,7 +12,7 @@ # @@*/ # Required thorns -ActiveThorns = "ADMCoupling Boundary Time ADMconstraints pugh ADM CoordGauge pughreduce CartGrid3D CoordBase SymBase ADMBase StaticConformal admmacros spacemask idanalyticbh ioutil iobasic localreduce" +ActiveThorns = "ADMCoupling Boundary Time ADMconstraints pugh ADM CoordGauge pughreduce CartGrid3D CoordBase SymBase TmunuBase ADMBase StaticConformal admmacros spacemask idanalyticbh ioutil iobasic localreduce" # GENERAL diff --git a/test/ADMConstraints_Physical.par b/test/ADMConstraints_Physical.par index 16980e3..22e9d52 100644 --- a/test/ADMConstraints_Physical.par +++ b/test/ADMConstraints_Physical.par @@ -12,7 +12,7 @@ # @@*/ # Required thorns -ActiveThorns = "ADMCoupling Boundary Time ADMconstraints ADM CoordGauge pugh pughreduce CartGrid3D CoordBase SymBase ADMBase StaticConformal admmacros spacemask idanalyticbh ioutil iobasic localreduce" +ActiveThorns = "ADMCoupling Boundary Time ADMconstraints ADM CoordGauge pugh pughreduce CartGrid3D CoordBase SymBase TmunuBase ADMBase StaticConformal admmacros spacemask idanalyticbh ioutil iobasic localreduce" # GENERAL diff --git a/test/ADMConstraints_Shift.par b/test/ADMConstraints_Shift.par index 6bfd5a4..ef1891f 100644 --- a/test/ADMConstraints_Shift.par +++ b/test/ADMConstraints_Shift.par @@ -12,7 +12,7 @@ # @@*/ # Required thorns -ActiveThorns = "ADMCoupling Boundary Time ADMconstraints ADM CoordGauge pugh pughreduce CartGrid3D CoordBase SymBase ADMBase StaticConformal admmacros spacemask idanalyticbh ioutil iobasic localreduce" +ActiveThorns = "ADMCoupling Boundary Time ADMconstraints ADM CoordGauge pugh pughreduce CartGrid3D CoordBase SymBase TmunuBase ADMBase StaticConformal admmacros spacemask idanalyticbh ioutil iobasic localreduce" # GENERAL diff --git a/test/test_ADM.par b/test/test_ADM.par index 018af0d..785642b 100644 --- a/test/test_ADM.par +++ b/test/test_ADM.par @@ -12,7 +12,7 @@ # @@*/ # Required thorns -ActiveThorns = "ADMCoupling Boundary Time ADMconstraints pugh pughreduce CartGrid3D CoordBase SymBase ADMBase StaticConformal admmacros coordgauge spacemask ADM idanalyticbh ioutil iobasic localreduce" +ActiveThorns = "ADMCoupling Boundary Time ADMconstraints pugh pughreduce CartGrid3D CoordBase SymBase TmunuBase ADMBase StaticConformal admmacros coordgauge spacemask ADM idanalyticbh ioutil iobasic localreduce" # GENERAL -- cgit v1.2.3