From 71dc800db76cce021294def0e6c36997a0b76f85 Mon Sep 17 00:00:00 2001 From: goodale Date: Mon, 11 Oct 1999 10:30:21 +0000 Subject: Modified to have precisely the functionality of IDScalarWave - now is another implementation of IDScalarWave. Tom git-svn-id: http://svn.cactuscode.org/arrangements/CactusWave/IDScalarWaveCXX/trunk@3 7ec00dc9-1e7a-42ad-bf73-a299ee168e72 --- src/CheckParameters.cc | 51 ++++++++++++++++++++++++ src/InitialData.cc | 104 ++++++++++++++++++++++++++++++++++++------------- src/make.code.defn | 2 +- 3 files changed, 128 insertions(+), 29 deletions(-) create mode 100644 src/CheckParameters.cc (limited to 'src') diff --git a/src/CheckParameters.cc b/src/CheckParameters.cc new file mode 100644 index 0000000..f0f6fdb --- /dev/null +++ b/src/CheckParameters.cc @@ -0,0 +1,51 @@ +/* + @file CheckParameters.F77 + @date + @author Gabrielle Allen + @desc + Check parameters for the wave equation initial data + @enddesc + @@*/ + +#include "cctk.h" +#include "cctk_parameters.h" +#include "cctk_arguments.h" + +static char *rcsid = "$Header$"; + + /*@@ + @routine IDScalarWave_CheckParameters + @date + @author Gabrielle Allen + @desc + Check parameters for the wave equation initial data + @enddesc + @calls + @calledby + @history + @hdate Mon Oct 11 11:49:21 1999 @hauthor Tom Goodale + @hdesc Converted to C++ + @endhistory + +@@*/ + +extern "C" void IDScalarWaveCXX_CheckParameters(CCTK_CARGUMENTS) +{ + DECLARE_CCTK_CARGUMENTS + DECLARE_CCTK_PARAMETERS + + if(CCTK_Equals(initial_data,"box")) + { + if (!CCTK_Equals(type, "box")) + { + CCTK_PARAMWARN("Must have a box grid with box initial data"); + } + + if (kx == 0 || ky == 0 || kz == 0) + { + CCTK_PARAMWARN("Cannot have zero kx,ky,kz for box initial data"); + } + } + return; +} + diff --git a/src/InitialData.cc b/src/InitialData.cc index c8d790d..8b770dc 100644 --- a/src/InitialData.cc +++ b/src/InitialData.cc @@ -8,23 +8,24 @@ @enddesc @@*/ +#include + #include "cctk.h" #include "cctk_Flesh.h" #include "cctk_parameters.h" #include "cctk_Groups.h" #include "cctk_arguments.h" -#include "cctk_Comm.h" +#include "cctk_Misc.h" -#include "CactusBase/CartGrid3D/src/Symmetry.h" +static char *rcsid = "$Header$"; -#include - -inline double sqr(double val) +inline CCTK_REAL sqr(CCTK_REAL val) { - return val*val; + return val*val; } + /*@@ @routine IDScalarWave_InitialData @date @@ -35,39 +36,86 @@ inline double sqr(double val) @calls @calledby @history - + @hdate Mon Oct 11 11:48:03 1999 @hauthor Werner Benger + @hdesc Converted to C++ + @hdate Mon Oct 11 11:48:20 1999 @hauthor Tom Goodale + @hdesc Added the rest of the initial data. @endhistory @@*/ extern "C" void IDScalarWaveCXX_InitialData(CCTK_CARGUMENTS) { - DECLARE_CCTK_CARGUMENTS - DECLARE_CCTK_PARAMETERS + DECLARE_CCTK_CARGUMENTS + DECLARE_CCTK_PARAMETERS + + CCTK_REAL dt = CCTK_DELTA_TIME; + + if(CCTK_Equals(initial_data, "plane")) + { + CCTK_REAL omega = sqrt(sqr(kx)+sqr(ky)+sqr(kz)); + + for(int k=0; k