From 302ba3da79031ba347157c4c28ca82a9cf3ed4e6 Mon Sep 17 00:00:00 2001 From: goodale Date: Fri, 26 Apr 2002 16:22:11 +0000 Subject: Converted to new ADMBase, StaticConformal stuff. Tom git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinInitialData/IDLinearWaves/trunk@68 5c0f84ea-6048-4d6e-bfa4-55cd5f2e0dd7 --- src/ParamCheck.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/make.code.defn | 2 +- src/planewaves.F77 | 41 +++++++++++++++++++++++------------- src/teukwaves.F77 | 40 +++++++++++++++++++++++------------ 4 files changed, 115 insertions(+), 30 deletions(-) create mode 100644 src/ParamCheck.c (limited to 'src') diff --git a/src/ParamCheck.c b/src/ParamCheck.c new file mode 100644 index 0000000..c67605f --- /dev/null +++ b/src/ParamCheck.c @@ -0,0 +1,62 @@ + /*@@ + @file ParamCheck.c + @date Fri Apr 26 18:03:09 2002 + @author Tom Goodale + @desc + Check the parameters for IDLinearwaves + @enddesc + @version $Header$ + @@*/ + +#include "cctk.h" + +#include "cctk_Arguments.h" +#include "cctk_Parameters.h" + +static const char *rcsid = "$Header$"; + +CCTK_FILEVERSION(CactusEinstein_IDLinearWaves_ParamCheck_c) + +/******************************************************************** + ********************* Local Data Types *********************** + ********************************************************************/ + +/******************************************************************** + ********************* Local Routine Prototypes ********************* + ********************************************************************/ + +/******************************************************************** + ***************** Scheduled Routine Prototypes ********************* + ********************************************************************/ + +void IDLinearWaves_ParamChecker(CCTK_ARGUMENTS); + +/******************************************************************** + ********************* Other Routine Prototypes ********************* + ********************************************************************/ + +/******************************************************************** + ********************* Local Data ***************************** + ********************************************************************/ + +/******************************************************************** + ********************* External Routines ********************** + ********************************************************************/ + +void IDLinearWaves_ParamChecker(CCTK_ARGUMENTS) +{ + DECLARE_CCTK_ARGUMENTS + DECLARE_CCTK_PARAMETERS + + /* Do we know how to deal with this type of metric ? */ + if(! CCTK_EQUALS(metric_type, "physical") && + ! CCTK_EQUALS(metric_type, "static conformal")) + { + CCTK_PARAMWARN("Unknown ADMBase::metric_type - known types are \"physical\" and \"static conformal\""); + } +} + +/******************************************************************** + ********************* Local Routines ************************* + ********************************************************************/ + diff --git a/src/make.code.defn b/src/make.code.defn index a152d03..9969001 100644 --- a/src/make.code.defn +++ b/src/make.code.defn @@ -2,7 +2,7 @@ # $Header$ # Source files in this directory -SRCS = \ +SRCS = ParamCheck.c\ planewaves.F77\ teukwaves.F77 diff --git a/src/planewaves.F77 b/src/planewaves.F77 index 79c1d4e..880ff58 100644 --- a/src/planewaves.F77 +++ b/src/planewaves.F77 @@ -37,8 +37,6 @@ #include "cctk.h" #include "cctk_Arguments.h" #include "cctk_Parameters.h" -c Using macro definitions from Einstein -#include "CactusEinstein/Einstein/src/Einstein.h" subroutine planewaves(CCTK_ARGUMENTS) @@ -229,28 +227,41 @@ c loop over sh ends here: enddo c initialize the conformal factor - if (use_conformal == 1) then - conformal_state = CONFORMAL_METRIC +c Check if we should create and store conformal factor stuff */ + if (CCTK_EQUALS(metric_type, "static conformal")) then + + conformal_state = 1 + + if(CCTK_EQUALS(conformal_storage,"factor+derivs")) then + + conformal_state = 2; + + else if(CCTK_EQUALS(conformal_storage,"factor+derivs+2nd derivs")) then + conformal_state = 3; + end if + do k=1,cctk_lsh(3) do j=1,cctk_lsh(2) do i=1,cctk_lsh(1) psi(i,j,k) = 1d0 - psix(i,j,k) = 0d0 - psiy(i,j,k) = 0d0 - psiz(i,j,k) = 0d0 - psixy(i,j,k) = 0d0 - psixz(i,j,k) = 0d0 - psiyz(i,j,k) = 0d0 - psixx(i,j,k) = 0d0 - psiyy(i,j,k) = 0d0 - psizz(i,j,k) = 0d0 + if(conformal_state .gt. 1) then + psix(i,j,k) = 0d0 + psiy(i,j,k) = 0d0 + psiz(i,j,k) = 0d0 + endif + if(conformal_state .gt. 2) then + psixy(i,j,k) = 0d0 + psixz(i,j,k) = 0d0 + psiyz(i,j,k) = 0d0 + psixx(i,j,k) = 0d0 + psiyy(i,j,k) = 0d0 + psizz(i,j,k) = 0d0 + endif end do end do end do - else - conformal_state = NOCONFORMAL_METRIC end if diff --git a/src/teukwaves.F77 b/src/teukwaves.F77 index 9e02eb0..dd31347 100644 --- a/src/teukwaves.F77 +++ b/src/teukwaves.F77 @@ -569,30 +569,42 @@ c time symmetry enddo c initialize the conformal factor - if (use_conformal == 1) then - conformal_state = CONFORMAL_METRIC +c Check if we should create and store conformal factor stuff */ + if (CCTK_EQUALS(metric_type, "static conformal")) then + + conformal_state = 1 + + if(CCTK_EQUALS(conformal_storage,"factor+derivs")) then + + conformal_state = 2; + + else if(CCTK_EQUALS(conformal_storage,"factor+derivs+2nd derivs")) then + conformal_state = 3; + end if + do k=1,cctk_lsh(3) do j=1,cctk_lsh(2) do i=1,cctk_lsh(1) psi(i,j,k) = 1d0 - psix(i,j,k) = 0d0 - psiy(i,j,k) = 0d0 - psiz(i,j,k) = 0d0 - psixy(i,j,k) = 0d0 - psixz(i,j,k) = 0d0 - psiyz(i,j,k) = 0d0 - psixx(i,j,k) = 0d0 - psiyy(i,j,k) = 0d0 - psizz(i,j,k) = 0d0 + if(conformal_state .gt. 1) then + psix(i,j,k) = 0d0 + psiy(i,j,k) = 0d0 + psiz(i,j,k) = 0d0 + endif + if(conformal_state .gt. 2) then + psixy(i,j,k) = 0d0 + psixz(i,j,k) = 0d0 + psiyz(i,j,k) = 0d0 + psixx(i,j,k) = 0d0 + psiyy(i,j,k) = 0d0 + psizz(i,j,k) = 0d0 + endif end do end do end do - else - conformal_state = NOCONFORMAL_METRIC end if - return end -- cgit v1.2.3