From c3b57a963f4125e0e53c4b76eaeca586ccad4b12 Mon Sep 17 00:00:00 2001 From: miguel Date: Wed, 24 Oct 2001 10:21:44 +0000 Subject: Commiting changes needed to include cartoon. Major change is that the group ADMConstraints::constraints does not exist any more, it has been replaced by two separate groups: ADMConstraints::hamiltonian ADMConstraints::momentum The reason for this change is that cartoon needs to have groups that correspond to scalars, vectors or tensors. These changes were coded by Ryoji, even if I am commiting them. git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/ADMConstraints/trunk@51 b7a48df3-cbbf-4440-997f-b4b717c9f7fc --- interface.ccl | 14 +++++++---- param.ccl | 4 ++++ schedule.ccl | 11 +++------ src/ADMConstraints.F | 67 ++++++++++++++++++++++++++++++++++++---------------- 4 files changed, 62 insertions(+), 34 deletions(-) diff --git a/interface.ccl b/interface.ccl index 5554ee9..63755b1 100644 --- a/interface.ccl +++ b/interface.ccl @@ -5,14 +5,18 @@ inherits: einstein USES INCLUDE: CalcTmunu.inc USES INCLUDE: CalcTmunu_temps.inc +USES INCLUDE: CalcTmunu_rfr.inc private: -real ADMconstraints type=GF +real hamiltonian type=GF { - momx, - momy, - momz, ham -} "ADM constraints" +} "Hamiltonian constraint" +real momentum type=GF +{ + momx, + momy, + momz +} "Momentum constraints" diff --git a/param.ccl b/param.ccl index 8f9ce6c..a494f7c 100644 --- a/param.ccl +++ b/param.ccl @@ -11,6 +11,10 @@ BOOLEAN constraint_communication "If yes sychronise the constraints" { } "no" +BOOLEAN cartoon "Cartoon BC" +{ +} "no" + KEYWORD bound "Which boundary condition to apply" { "flat" :: "Flat (copy) boundary condition" diff --git a/schedule.ccl b/schedule.ccl index adddd25..650e61b 100644 --- a/schedule.ccl +++ b/schedule.ccl @@ -5,7 +5,7 @@ schedule ADMConstraint_InitSymBound at CCTK_BASEGRID if (constraints_persist) { - STORAGE: ADMconstraints + STORAGE: hamiltonian,momentum schedule ADMConstraints at CCTK_POSTSTEP { LANG: Fortran @@ -16,15 +16,10 @@ else schedule ADMConstraints at CCTK_ANALYSIS { LANG: Fortran - STORAGE: ADMconstraints - TRIGGERS: ADMconstraints + STORAGE: hamiltonian,momentum + TRIGGERS: hamiltonian,momentum } "Evaluate ADM constraints" } - - - - - diff --git a/src/ADMConstraints.F b/src/ADMConstraints.F index 2fe6c23..1bcbe5f 100644 --- a/src/ADMConstraints.F +++ b/src/ADMConstraints.F @@ -1,26 +1,32 @@ -cc/*@@ -c @file ADMConstraints.F -c @date Aug 98 -c @desc -c Calculate the ADM Constraints for output: -c -c Hamiltonian Constraint is: -c -c R - K^i_j K^j_i + trK^2 - 16 Pi rho -c -c Momentum Constraints are: -c -c Del_j K_i^j - Del_i trK - 8 Pi j_i -c -c @enddesc -c@@*/ +/*@@ + @file ADMConstraints.F + @date August 98 + @desc + Calculate the ADM Constraints for output: + + Hamiltonian Constraint is: + + H = R - K^i_j K^j_i + trK^2 - 16 Pi rho + + Momentum Constraints are: + + M_i = Del_j K_i^j - Del_i trK - 8 Pi j_i + + @enddesc + @version $Header$ +@@*/ #include "cctk.h" + #include "cctk_Parameters.h" #include "cctk_Arguments.h" - +#include "cctk_DefineThorn.h" + #include "CactusEinstein/Einstein/src/Einstein.h" +#ifdef BETATHORNS_CARTOON2D +#include "BetaThorns/Cartoon2D/src/Cartoon2D_tensors.h" +#endif subroutine ADMConstraints(CCTK_ARGUMENTS) @@ -63,7 +69,8 @@ c Macros from Standard Einstein. #include "CactusEinstein/Einstein/src/macro/MOMXADM_declare.h" #include "CactusEinstein/Einstein/src/macro/MOMYADM_declare.h" #include "CactusEinstein/Einstein/src/macro/MOMZADM_declare.h" - +#include "CactusEinstein/Einstein/src/macro/DETG_declare.h" +#include "CactusEinstein/Einstein/src/macro/UPPERMET_declare.h" c -------------------------------------------------------------- @@ -204,6 +211,8 @@ c = - (T_{i0} - beta^j T_{ij})/alpha end do end do +#include "CactusEinstein/Einstein/src/macro/DETG_undefine.h" +#include "CactusEinstein/Einstein/src/macro/UPPERMET_undefine.h" #include "CactusEinstein/Einstein/src/macro/HAMADM_undefine.h" #include "CactusEinstein/Einstein/src/macro/MOMXADM_undefine.h" #include "CactusEinstein/Einstein/src/macro/MOMYADM_undefine.h" @@ -211,18 +220,34 @@ c = - (T_{i0} - beta^j T_{ij})/alpha c Apply symmetry boundary conditions. - call CartSymGN(ierr,cctkGH,"admconstraints::admconstraints") + call CartSymGN(ierr,cctkGH,"admconstraints::hamiltonian") + call CartSymGN(ierr,cctkGH,"admconstraints::momentum") c Apply flat boundary conditions at outer boundaries. if (CCTK_Equals(bound,"flat") == 1) then - call BndFlatGN(ierr,cctkGH,sw,"admconstraints::admconstraints") + call BndFlatGN(ierr,cctkGH,sw,"admconstraints::hamiltonian") + call BndFlatGN(ierr,cctkGH,sw,"admconstraints::momentum") end if c Synchronize. if (constraint_communication.eq.1) then - call CCTK_SyncGroup(cctkGH,"admconstraints::admconstraints") + call CCTK_SyncGroup(cctkGH,"admconstraints::hamiltonian") + call CCTK_SyncGroup(cctkGH,"admconstraints::momentum") + end if + +c Cartoon. + + if (cartoon==1) then + +#ifdef BETATHORNS_CARTOON2D + call BndCartoon2DGN(ierr,cctkGH,TENSORTYPE_SCALAR,"admconstraints::hamiltonian") + call BndCartoon2DGN(ierr,cctkGH,TENSORTYPE_U,"admconstraints::momentum") +#else + call CCTK_WARN(0,"You have not compiled with Cartoon2D") +#endif + end if c End -- cgit v1.2.3