diff options
author | Erik Schnetter <schnetter@cct.lsu.edu> | 2007-11-30 16:00:52 -0600 |
---|---|---|
committer | Erik Schnetter <schnetter@cct.lsu.edu> | 2007-11-30 16:00:52 -0600 |
commit | 6dd7c9aa7a6bee46307ad81b1227005e6e808e0a (patch) | |
tree | 6ea5764cc953da42ecd40ac0c419ffc2548b64d6 /ML_WaveToy | |
parent | d6f2e631dd77da91ef29f9d1ea88642fa9e81636 (diff) |
Add Kranc generated WaveToy
Diffstat (limited to 'ML_WaveToy')
-rw-r--r-- | ML_WaveToy/configuration.ccl | 6 | ||||
-rw-r--r-- | ML_WaveToy/interface.ccl | 55 | ||||
-rw-r--r-- | ML_WaveToy/param.ccl | 182 | ||||
-rw-r--r-- | ML_WaveToy/schedule.ccl | 71 | ||||
-rw-r--r-- | ML_WaveToy/src/Boundaries.c | 244 | ||||
-rw-r--r-- | ML_WaveToy/src/Differencing.h | 12 | ||||
-rw-r--r-- | ML_WaveToy/src/RegisterMoL.c | 21 | ||||
-rw-r--r-- | ML_WaveToy/src/RegisterSymmetries.c | 32 | ||||
-rw-r--r-- | ML_WaveToy/src/Startup.c | 13 | ||||
-rw-r--r-- | ML_WaveToy/src/WT_Gaussian.c | 136 | ||||
-rw-r--r-- | ML_WaveToy/src/WT_RHS.c | 144 | ||||
-rw-r--r-- | ML_WaveToy/src/make.code.defn | 6 |
12 files changed, 922 insertions, 0 deletions
diff --git a/ML_WaveToy/configuration.ccl b/ML_WaveToy/configuration.ccl new file mode 100644 index 0000000..0374af4 --- /dev/null +++ b/ML_WaveToy/configuration.ccl @@ -0,0 +1,6 @@ +# File produced by user eschnett +# Produced with Mathematica Version 6.0 for Mac OS X x86 (32-bit) (April 20, 2007) + +# Mathematica script written by Ian Hinder and Sascha Husa + +REQUIRES LoopControl diff --git a/ML_WaveToy/interface.ccl b/ML_WaveToy/interface.ccl new file mode 100644 index 0000000..2d00bb3 --- /dev/null +++ b/ML_WaveToy/interface.ccl @@ -0,0 +1,55 @@ +# File produced by user eschnett +# Produced with Mathematica Version 6.0 for Mac OS X x86 (32-bit) (April 20, 2007) + +# Mathematica script written by Ian Hinder and Sascha Husa + +implements: ML_WaveToy + +inherits: Grid GenericFD Boundary + + + +USES INCLUDE: GenericFD.h +USES INCLUDE: Symmetry.h +USES INCLUDE: sbp_calc_coeffs.h +USES INCLUDE: Boundary.h +USES INCLUDE: loopcontrol.h + +CCTK_INT FUNCTION MoLRegisterEvolved(CCTK_INT IN EvolvedIndex, CCTK_INT IN RHSIndex) +USES FUNCTION MoLRegisterEvolved + +CCTK_INT FUNCTION MoLRegisterConstrained(CCTK_INT IN ConstrainedIndex) +USES FUNCTION MoLRegisterConstrained + +SUBROUTINE Diff_coeff(CCTK_POINTER_TO_CONST IN cctkGH, CCTK_INT IN dir, CCTK_INT IN nsize, CCTK_INT OUT ARRAY imin, CCTK_INT OUT ARRAY imax, CCTK_REAL OUT ARRAY q, CCTK_INT IN table_handle) +USES FUNCTION Diff_coeff + +CCTK_INT FUNCTION Boundary_SelectGroupForBC(CCTK_POINTER_TO_CONST IN GH, CCTK_INT IN faces, CCTK_INT IN boundary_width, CCTK_INT IN table_handle, CCTK_STRING IN group_name, CCTK_STRING IN bc_name) +USES FUNCTION Boundary_SelectGroupForBC + +CCTK_INT FUNCTION Boundary_SelectVarForBC(CCTK_POINTER_TO_CONST IN GH, CCTK_INT IN faces, CCTK_INT IN boundary_width, CCTK_INT IN table_handle, CCTK_STRING IN var_name, CCTK_STRING IN bc_name) +USES FUNCTION Boundary_SelectVarForBC + +public: +CCTK_REAL WT_rhorhs type=GF timelevels=1 tags='tensortypealias="Scalar" tensorweight=1.0000000000000000000' +{ + rhorhs +} "WT_rhorhs" + +public: +CCTK_REAL WT_urhs type=GF timelevels=1 tags='tensortypealias="Scalar" tensorweight=1.0000000000000000000' +{ + urhs +} "WT_urhs" + +public: +CCTK_REAL WT_rho type=GF timelevels=3 tags='tensortypealias="Scalar" tensorweight=1.0000000000000000000' +{ + rho +} "WT_rho" + +public: +CCTK_REAL WT_u type=GF timelevels=3 tags='tensortypealias="Scalar" tensorweight=1.0000000000000000000' +{ + u +} "WT_u" diff --git a/ML_WaveToy/param.ccl b/ML_WaveToy/param.ccl new file mode 100644 index 0000000..606ee34 --- /dev/null +++ b/ML_WaveToy/param.ccl @@ -0,0 +1,182 @@ +# File produced by user eschnett +# Produced with Mathematica Version 6.0 for Mac OS X x86 (32-bit) (April 20, 2007) + +# Mathematica script written by Ian Hinder and Sascha Husa + + +shares: GenericFD + +USES CCTK_INT stencil_width +USES CCTK_INT stencil_width_x +USES CCTK_INT stencil_width_y +USES CCTK_INT stencil_width_z +USES CCTK_INT boundary_width + + +shares: MethodOfLines + +USES CCTK_INT MoL_Num_Evolved_Vars +USES CCTK_INT MoL_Num_Constrained_Vars + +restricted: +CCTK_REAL verbose "verbose" +{ + "*:*" :: "no restrictions" +} 0 + +restricted: +CCTK_INT ML_WaveToy_MaxNumEvolvedVars "Number of evolved variables used by this thorn" ACCUMULATOR-BASE=MethodofLines::MoL_Num_Evolved_Vars +{ + 2:2 :: "Number of evolved variables used by this thorn" +} 2 + +restricted: +CCTK_INT ML_WaveToy_MaxNumConstrainedVars "Number of constrained variables used by this thorn" ACCUMULATOR-BASE=MethodofLines::MoL_Num_Constrained_Vars +{ + 4:4 :: "Number of constrained variables used by this thorn" +} 4 + +restricted: +CCTK_INT WT_Gaussian_calc_every "WT_Gaussian_calc_every" +{ + *:* :: "no restrictions" +} 1 + +restricted: +CCTK_INT WT_RHS_calc_every "WT_RHS_calc_every" +{ + *:* :: "no restrictions" +} 1 + +restricted: +CCTK_INT WT_Gaussian_calc_offset "WT_Gaussian_calc_offset" +{ + *:* :: "no restrictions" +} 0 + +restricted: +CCTK_INT WT_RHS_calc_offset "WT_RHS_calc_offset" +{ + *:* :: "no restrictions" +} 0 + +private: +KEYWORD rho_bound "Boundary condition to implement" +{ + "flat" :: "Flat boundary condition" + "none" :: "No boundary condition" + "static" :: "Boundaries held fixed" + "radiative" :: "Radiation boundary condition" + "scalar" :: "Dirichlet boundary condition" + "newrad" :: "Improved radiative boundary condition" + "skip" :: "skip boundary condition code" +} "skip" + +private: +KEYWORD u_bound "Boundary condition to implement" +{ + "flat" :: "Flat boundary condition" + "none" :: "No boundary condition" + "static" :: "Boundaries held fixed" + "radiative" :: "Radiation boundary condition" + "scalar" :: "Dirichlet boundary condition" + "newrad" :: "Improved radiative boundary condition" + "skip" :: "skip boundary condition code" +} "skip" + +private: +KEYWORD WT_rho_bound "Boundary condition to implement" +{ + "flat" :: "Flat boundary condition" + "none" :: "No boundary condition" + "static" :: "Boundaries held fixed" + "radiative" :: "Radiation boundary condition" + "scalar" :: "Dirichlet boundary condition" + "newrad" :: "Improved radiative boundary condition" + "skip" :: "skip boundary condition code" +} "skip" + +private: +KEYWORD WT_u_bound "Boundary condition to implement" +{ + "flat" :: "Flat boundary condition" + "none" :: "No boundary condition" + "static" :: "Boundaries held fixed" + "radiative" :: "Radiation boundary condition" + "scalar" :: "Dirichlet boundary condition" + "newrad" :: "Improved radiative boundary condition" + "skip" :: "skip boundary condition code" +} "skip" + +private: +CCTK_REAL rho_bound_speed "characteristic speed at boundary" +{ + "0:*" :: "outgoing characteristic speed > 0" +} 1. + +private: +CCTK_REAL u_bound_speed "characteristic speed at boundary" +{ + "0:*" :: "outgoing characteristic speed > 0" +} 1. + +private: +CCTK_REAL WT_rho_bound_speed "characteristic speed at boundary" +{ + "0:*" :: "outgoing characteristic speed > 0" +} 1. + +private: +CCTK_REAL WT_u_bound_speed "characteristic speed at boundary" +{ + "0:*" :: "outgoing characteristic speed > 0" +} 1. + +private: +CCTK_REAL rho_bound_limit "limit value for r -> infinity" +{ + "*:*" :: "value of limit value is unrestricted" +} 0. + +private: +CCTK_REAL u_bound_limit "limit value for r -> infinity" +{ + "*:*" :: "value of limit value is unrestricted" +} 0. + +private: +CCTK_REAL WT_rho_bound_limit "limit value for r -> infinity" +{ + "*:*" :: "value of limit value is unrestricted" +} 0. + +private: +CCTK_REAL WT_u_bound_limit "limit value for r -> infinity" +{ + "*:*" :: "value of limit value is unrestricted" +} 0. + +private: +CCTK_REAL rho_bound_scalar "Dirichlet boundary value" +{ + "*:*" :: "unrestricted" +} 0. + +private: +CCTK_REAL u_bound_scalar "Dirichlet boundary value" +{ + "*:*" :: "unrestricted" +} 0. + +private: +CCTK_REAL WT_rho_bound_scalar "Dirichlet boundary value" +{ + "*:*" :: "unrestricted" +} 0. + +private: +CCTK_REAL WT_u_bound_scalar "Dirichlet boundary value" +{ + "*:*" :: "unrestricted" +} 0. + diff --git a/ML_WaveToy/schedule.ccl b/ML_WaveToy/schedule.ccl new file mode 100644 index 0000000..f02078a --- /dev/null +++ b/ML_WaveToy/schedule.ccl @@ -0,0 +1,71 @@ +# File produced by user eschnett +# Produced with Mathematica Version 6.0 for Mac OS X x86 (32-bit) (April 20, 2007) + +# Mathematica script written by Ian Hinder and Sascha Husa + + +STORAGE: WT_rhorhs[1] + +STORAGE: WT_urhs[1] + +STORAGE: WT_rho[3] + +STORAGE: WT_u[3] + +schedule ML_WaveToy_Startup at STARTUP +{ + LANG: C + OPTIONS: meta +} "create banner" + +schedule ML_WaveToy_RegisterVars in MoL_Register +{ + LANG: C + OPTIONS: meta +} "Register Variables for MoL" + +schedule ML_WaveToy_RegisterSymmetries at BASEGRID +{ + LANG: C + OPTIONS: meta +} "register symmetries" + +schedule WT_Gaussian AT initial +{ + LANG: C + +} "WT_Gaussian" + +schedule WT_RHS IN MoL_CalcRHS +{ + LANG: C + +} "WT_RHS" + +schedule WT_RHS AT analysis +{ + LANG: C + + SYNC: WT_rhorhs + SYNC: WT_urhs +} "WT_RHS" + +schedule ML_WaveToy_ApplyBoundConds in MoL_PostStep +{ + LANG: C + OPTIONS: level + SYNC: WT_rho + SYNC: WT_u +} "apply boundary conditions" + +schedule ML_WaveToy_CheckBoundaries at BASEGRID +{ + LANG: C + OPTIONS: meta +} "check boundaries treatment" + +schedule group ApplyBCs as ML_WaveToy_ApplyBCs in MoL_PostStep after ML_WaveToy_ApplyBoundConds +{ + # no language specified + +} "Apply boundary conditions controlled by thorn Boundary" diff --git a/ML_WaveToy/src/Boundaries.c b/ML_WaveToy/src/Boundaries.c new file mode 100644 index 0000000..563f55d --- /dev/null +++ b/ML_WaveToy/src/Boundaries.c @@ -0,0 +1,244 @@ +/* File produced by user eschnett */ +/* Produced with Mathematica Version 6.0 for Mac OS X x86 (32-bit) (April 20, 2007) */ + +/* Mathematica script written by Ian Hinder and Sascha Husa */ + +#include "cctk.h" +#include "cctk_Arguments.h" +#include "cctk_Parameters.h" +#include "cctk_Faces.h" +#include "util_Table.h" +#include "Symmetry.h" + + +/* the boundary treatment is split into 3 steps: */ +/* 1. excision */ +/* 2. symmetries */ +/* 3. "other" boundary conditions, e.g. radiative */ + +/* to simplify scheduling and testing, the 3 steps */ +/* are currently applied in separate functions */ + + +void ML_WaveToy_CheckBoundaries(CCTK_ARGUMENTS) +{ + DECLARE_CCTK_ARGUMENTS + DECLARE_CCTK_PARAMETERS + + return; +} + +void ML_WaveToy_ApplyBoundConds(CCTK_ARGUMENTS) +{ + DECLARE_CCTK_ARGUMENTS + DECLARE_CCTK_PARAMETERS + + CCTK_INT ierr = 0; + + if (CCTK_EQUALS(WT_rho_bound, "none" ) || + CCTK_EQUALS(WT_rho_bound, "static") || + CCTK_EQUALS(WT_rho_bound, "flat" ) || + CCTK_EQUALS(WT_rho_bound, "zero" ) ) + { + ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + "ML_WaveToy::WT_rho", WT_rho_bound); + if (ierr < 0) + CCTK_WARN(-1, "Failed to register WT_rho_bound BC for ML_WaveToy::WT_rho!"); + } + + if (CCTK_EQUALS(WT_u_bound, "none" ) || + CCTK_EQUALS(WT_u_bound, "static") || + CCTK_EQUALS(WT_u_bound, "flat" ) || + CCTK_EQUALS(WT_u_bound, "zero" ) ) + { + ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + "ML_WaveToy::WT_u", WT_u_bound); + if (ierr < 0) + CCTK_WARN(-1, "Failed to register WT_u_bound BC for ML_WaveToy::WT_u!"); + } + + if (CCTK_EQUALS(rho_bound, "none" ) || + CCTK_EQUALS(rho_bound, "static") || + CCTK_EQUALS(rho_bound, "flat" ) || + CCTK_EQUALS(rho_bound, "zero" ) ) + { + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + "ML_WaveToy::rho", rho_bound); + if (ierr < 0) + CCTK_WARN(-1, "Failed to register rho_bound BC for ML_WaveToy::rho!"); + } + + if (CCTK_EQUALS(u_bound, "none" ) || + CCTK_EQUALS(u_bound, "static") || + CCTK_EQUALS(u_bound, "flat" ) || + CCTK_EQUALS(u_bound, "zero" ) ) + { + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, -1, + "ML_WaveToy::u", u_bound); + if (ierr < 0) + CCTK_WARN(-1, "Failed to register u_bound BC for ML_WaveToy::u!"); + } + + if (CCTK_EQUALS(WT_rho_bound, "radiative")) + { + /* apply radiation boundary condition */ + CCTK_INT handle_WT_rho_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_WT_rho_bound < 0) CCTK_WARN(-1, "could not create table!"); + if (Util_TableSetReal(handle_WT_rho_bound , WT_rho_bound_limit, "LIMIT") < 0) + CCTK_WARN(-1, "could not set LIMIT value in table!"); + if (Util_TableSetReal(handle_WT_rho_bound ,WT_rho_bound_speed, "SPEED") < 0) + CCTK_WARN(-1, "could not set SPEED value in table!"); + + ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, handle_WT_rho_bound, + "ML_WaveToy::WT_rho", "Radiation"); + + if (ierr < 0) + CCTK_WARN(-1, "Failed to register Radiation BC for ML_WaveToy::WT_rho!"); + + } + + if (CCTK_EQUALS(WT_u_bound, "radiative")) + { + /* apply radiation boundary condition */ + CCTK_INT handle_WT_u_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_WT_u_bound < 0) CCTK_WARN(-1, "could not create table!"); + if (Util_TableSetReal(handle_WT_u_bound , WT_u_bound_limit, "LIMIT") < 0) + CCTK_WARN(-1, "could not set LIMIT value in table!"); + if (Util_TableSetReal(handle_WT_u_bound ,WT_u_bound_speed, "SPEED") < 0) + CCTK_WARN(-1, "could not set SPEED value in table!"); + + ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, handle_WT_u_bound, + "ML_WaveToy::WT_u", "Radiation"); + + if (ierr < 0) + CCTK_WARN(-1, "Failed to register Radiation BC for ML_WaveToy::WT_u!"); + + } + + if (CCTK_EQUALS(rho_bound, "radiative")) + { + /* apply radiation boundary condition */ + CCTK_INT handle_rho_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_rho_bound < 0) CCTK_WARN(-1, "could not create table!"); + if (Util_TableSetReal(handle_rho_bound , rho_bound_limit, "LIMIT") < 0) + CCTK_WARN(-1, "could not set LIMIT value in table!"); + if (Util_TableSetReal(handle_rho_bound ,rho_bound_speed, "SPEED") < 0) + CCTK_WARN(-1, "could not set SPEED value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_rho_bound, + "ML_WaveToy::rho", "Radiation"); + + if (ierr < 0) + CCTK_WARN(-1, "Failed to register Radiation BC for ML_WaveToy::rho!"); + + } + + if (CCTK_EQUALS(u_bound, "radiative")) + { + /* apply radiation boundary condition */ + CCTK_INT handle_u_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_u_bound < 0) CCTK_WARN(-1, "could not create table!"); + if (Util_TableSetReal(handle_u_bound , u_bound_limit, "LIMIT") < 0) + CCTK_WARN(-1, "could not set LIMIT value in table!"); + if (Util_TableSetReal(handle_u_bound ,u_bound_speed, "SPEED") < 0) + CCTK_WARN(-1, "could not set SPEED value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_u_bound, + "ML_WaveToy::u", "Radiation"); + + if (ierr < 0) + CCTK_WARN(-1, "Failed to register Radiation BC for ML_WaveToy::u!"); + + } + + if (CCTK_EQUALS(WT_rho_bound, "scalar")) + { + /* apply scalar boundary condition */ + CCTK_INT handle_WT_rho_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_WT_rho_bound < 0) CCTK_WARN(-1, "could not create table!"); + if (Util_TableSetReal(handle_WT_rho_bound ,WT_rho_bound_scalar, "SCALAR") < 0) + CCTK_WARN(-1, "could not set SCALAR value in table!"); + + ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, handle_WT_rho_bound, + "ML_WaveToy::WT_rho", "scalar"); + + if (ierr < 0) + CCTK_WARN(-1, "Failed to register Scalar BC for ML_WaveToy::WT_rho!"); + + } + + if (CCTK_EQUALS(WT_u_bound, "scalar")) + { + /* apply scalar boundary condition */ + CCTK_INT handle_WT_u_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_WT_u_bound < 0) CCTK_WARN(-1, "could not create table!"); + if (Util_TableSetReal(handle_WT_u_bound ,WT_u_bound_scalar, "SCALAR") < 0) + CCTK_WARN(-1, "could not set SCALAR value in table!"); + + ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, 1, handle_WT_u_bound, + "ML_WaveToy::WT_u", "scalar"); + + if (ierr < 0) + CCTK_WARN(-1, "Failed to register Scalar BC for ML_WaveToy::WT_u!"); + + } + + if (CCTK_EQUALS(rho_bound, "scalar")) + { + /* apply scalar boundary condition */ + CCTK_INT handle_rho_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_rho_bound < 0) CCTK_WARN(-1, "could not create table!"); + if (Util_TableSetReal(handle_rho_bound ,rho_bound_scalar, "SCALAR") < 0) + CCTK_WARN(-1, "could not set SCALAR value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_rho_bound, + "ML_WaveToy::rho", "scalar"); + + if (ierr < 0) + CCTK_WARN(-1, "Error in registering Scalar BC for ML_WaveToy::rho!"); + + } + + if (CCTK_EQUALS(u_bound, "scalar")) + { + /* apply scalar boundary condition */ + CCTK_INT handle_u_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE); + if (handle_u_bound < 0) CCTK_WARN(-1, "could not create table!"); + if (Util_TableSetReal(handle_u_bound ,u_bound_scalar, "SCALAR") < 0) + CCTK_WARN(-1, "could not set SCALAR value in table!"); + + ierr = Boundary_SelectVarForBC(cctkGH, CCTK_ALL_FACES, 1, handle_u_bound, + "ML_WaveToy::u", "scalar"); + + if (ierr < 0) + CCTK_WARN(-1, "Error in registering Scalar BC for ML_WaveToy::u!"); + + } + return; +} + + + +/* template for entries in parameter file: +#$bound$#ML_WaveToy::WT_rho_bound = "skip" +#$bound$#ML_WaveToy::WT_rho_bound_speed = 1.0 +#$bound$#ML_WaveToy::WT_rho_bound_limit = 0.0 +#$bound$#ML_WaveToy::WT_rho_bound_scalar = 0.0 + +#$bound$#ML_WaveToy::WT_u_bound = "skip" +#$bound$#ML_WaveToy::WT_u_bound_speed = 1.0 +#$bound$#ML_WaveToy::WT_u_bound_limit = 0.0 +#$bound$#ML_WaveToy::WT_u_bound_scalar = 0.0 + +#$bound$#ML_WaveToy::rho_bound = "skip" +#$bound$#ML_WaveToy::rho_bound_speed = 1.0 +#$bound$#ML_WaveToy::rho_bound_limit = 0.0 +#$bound$#ML_WaveToy::rho_bound_scalar = 0.0 + +#$bound$#ML_WaveToy::u_bound = "skip" +#$bound$#ML_WaveToy::u_bound_speed = 1.0 +#$bound$#ML_WaveToy::u_bound_limit = 0.0 +#$bound$#ML_WaveToy::u_bound_scalar = 0.0 + +*/ + diff --git a/ML_WaveToy/src/Differencing.h b/ML_WaveToy/src/Differencing.h new file mode 100644 index 0000000..876855b --- /dev/null +++ b/ML_WaveToy/src/Differencing.h @@ -0,0 +1,12 @@ +#define PDstandardNth1(u,i,j,k) (p1o12dx*(-8*u[CCTK_GFINDEX3D(cctkGH,-1 + i,j,k)] + 8*u[CCTK_GFINDEX3D(cctkGH,1 + i,j,k)] + u[CCTK_GFINDEX3D(cctkGH,-2 + i,j,k)] - u[CCTK_GFINDEX3D(cctkGH,2 + i,j,k)])) +#define PDstandardNth2(u,i,j,k) (p1o12dy*(-8*u[CCTK_GFINDEX3D(cctkGH,i,-1 + j,k)] + 8*u[CCTK_GFINDEX3D(cctkGH,i,1 + j,k)] + u[CCTK_GFINDEX3D(cctkGH,i,-2 + j,k)] - u[CCTK_GFINDEX3D(cctkGH,i,2 + j,k)])) +#define PDstandardNth3(u,i,j,k) (p1o12dz*(-8*u[CCTK_GFINDEX3D(cctkGH,i,j,-1 + k)] + 8*u[CCTK_GFINDEX3D(cctkGH,i,j,1 + k)] + u[CCTK_GFINDEX3D(cctkGH,i,j,-2 + k)] - u[CCTK_GFINDEX3D(cctkGH,i,j,2 + k)])) +#define PDstandardNth11(u,i,j,k) (pm1o12dx2*(-16*(u[CCTK_GFINDEX3D(cctkGH,-1 + i,j,k)] + u[CCTK_GFINDEX3D(cctkGH,1 + i,j,k)]) + u[CCTK_GFINDEX3D(cctkGH,-2 + i,j,k)] + u[CCTK_GFINDEX3D(cctkGH,2 + i,j,k)] + 30*u[CCTK_GFINDEX3D(cctkGH,i,j,k)])) +#define PDstandardNth22(u,i,j,k) (pm1o12dy2*(-16*(u[CCTK_GFINDEX3D(cctkGH,i,-1 + j,k)] + u[CCTK_GFINDEX3D(cctkGH,i,1 + j,k)]) + u[CCTK_GFINDEX3D(cctkGH,i,-2 + j,k)] + u[CCTK_GFINDEX3D(cctkGH,i,2 + j,k)] + 30*u[CCTK_GFINDEX3D(cctkGH,i,j,k)])) +#define PDstandardNth33(u,i,j,k) (pm1o12dz2*(-16*(u[CCTK_GFINDEX3D(cctkGH,i,j,-1 + k)] + u[CCTK_GFINDEX3D(cctkGH,i,j,1 + k)]) + u[CCTK_GFINDEX3D(cctkGH,i,j,-2 + k)] + u[CCTK_GFINDEX3D(cctkGH,i,j,2 + k)] + 30*u[CCTK_GFINDEX3D(cctkGH,i,j,k)])) +#define PDstandardNth12(u,i,j,k) (p1o144dxdy*(-64*(u[CCTK_GFINDEX3D(cctkGH,-1 + i,1 + j,k)] + u[CCTK_GFINDEX3D(cctkGH,1 + i,-1 + j,k)]) + 64*(u[CCTK_GFINDEX3D(cctkGH,-1 + i,-1 + j,k)] + u[CCTK_GFINDEX3D(cctkGH,1 + i,1 + j,k)]) + 8*(u[CCTK_GFINDEX3D(cctkGH,-1 + i,2 + j,k)] + u[CCTK_GFINDEX3D(cctkGH,1 + i,-2 + j,k)] + u[CCTK_GFINDEX3D(cctkGH,-2 + i,1 + j,k)] + u[CCTK_GFINDEX3D(cctkGH,2 + i,-1 + j,k)]) - 8*(u[CCTK_GFINDEX3D(cctkGH,-1 + i,-2 + j,k)] + u[CCTK_GFINDEX3D(cctkGH,1 + i,2 + j,k)] + u[CCTK_GFINDEX3D(cctkGH,-2 + i,-1 + j,k)] + u[CCTK_GFINDEX3D(cctkGH,2 + i,1 + j,k)]) + u[CCTK_GFINDEX3D(cctkGH,-2 + i,-2 + j,k)] - u[CCTK_GFINDEX3D(cctkGH,-2 + i,2 + j,k)] - u[CCTK_GFINDEX3D(cctkGH,2 + i,-2 + j,k)] + u[CCTK_GFINDEX3D(cctkGH,2 + i,2 + j,k)])) +#define PDstandardNth13(u,i,j,k) (p1o144dxdz*(-64*(u[CCTK_GFINDEX3D(cctkGH,-1 + i,j,1 + k)] + u[CCTK_GFINDEX3D(cctkGH,1 + i,j,-1 + k)]) + 64*(u[CCTK_GFINDEX3D(cctkGH,-1 + i,j,-1 + k)] + u[CCTK_GFINDEX3D(cctkGH,1 + i,j,1 + k)]) + 8*(u[CCTK_GFINDEX3D(cctkGH,-1 + i,j,2 + k)] + u[CCTK_GFINDEX3D(cctkGH,1 + i,j,-2 + k)] + u[CCTK_GFINDEX3D(cctkGH,-2 + i,j,1 + k)] + u[CCTK_GFINDEX3D(cctkGH,2 + i,j,-1 + k)]) - 8*(u[CCTK_GFINDEX3D(cctkGH,-1 + i,j,-2 + k)] + u[CCTK_GFINDEX3D(cctkGH,1 + i,j,2 + k)] + u[CCTK_GFINDEX3D(cctkGH,-2 + i,j,-1 + k)] + u[CCTK_GFINDEX3D(cctkGH,2 + i,j,1 + k)]) + u[CCTK_GFINDEX3D(cctkGH,-2 + i,j,-2 + k)] - u[CCTK_GFINDEX3D(cctkGH,-2 + i,j,2 + k)] - u[CCTK_GFINDEX3D(cctkGH,2 + i,j,-2 + k)] + u[CCTK_GFINDEX3D(cctkGH,2 + i,j,2 + k)])) +#define PDstandardNth21(u,i,j,k) (p1o144dxdy*(-64*(u[CCTK_GFINDEX3D(cctkGH,-1 + i,1 + j,k)] + u[CCTK_GFINDEX3D(cctkGH,1 + i,-1 + j,k)]) + 64*(u[CCTK_GFINDEX3D(cctkGH,-1 + i,-1 + j,k)] + u[CCTK_GFINDEX3D(cctkGH,1 + i,1 + j,k)]) + 8*(u[CCTK_GFINDEX3D(cctkGH,-1 + i,2 + j,k)] + u[CCTK_GFINDEX3D(cctkGH,1 + i,-2 + j,k)] + u[CCTK_GFINDEX3D(cctkGH,-2 + i,1 + j,k)] + u[CCTK_GFINDEX3D(cctkGH,2 + i,-1 + j,k)]) - 8*(u[CCTK_GFINDEX3D(cctkGH,-1 + i,-2 + j,k)] + u[CCTK_GFINDEX3D(cctkGH,1 + i,2 + j,k)] + u[CCTK_GFINDEX3D(cctkGH,-2 + i,-1 + j,k)] + u[CCTK_GFINDEX3D(cctkGH,2 + i,1 + j,k)]) + u[CCTK_GFINDEX3D(cctkGH,-2 + i,-2 + j,k)] - u[CCTK_GFINDEX3D(cctkGH,-2 + i,2 + j,k)] - u[CCTK_GFINDEX3D(cctkGH,2 + i,-2 + j,k)] + u[CCTK_GFINDEX3D(cctkGH,2 + i,2 + j,k)])) +#define PDstandardNth23(u,i,j,k) (p1o144dydz*(-64*(u[CCTK_GFINDEX3D(cctkGH,i,-1 + j,1 + k)] + u[CCTK_GFINDEX3D(cctkGH,i,1 + j,-1 + k)]) + 64*(u[CCTK_GFINDEX3D(cctkGH,i,-1 + j,-1 + k)] + u[CCTK_GFINDEX3D(cctkGH,i,1 + j,1 + k)]) + 8*(u[CCTK_GFINDEX3D(cctkGH,i,-1 + j,2 + k)] + u[CCTK_GFINDEX3D(cctkGH,i,1 + j,-2 + k)] + u[CCTK_GFINDEX3D(cctkGH,i,-2 + j,1 + k)] + u[CCTK_GFINDEX3D(cctkGH,i,2 + j,-1 + k)]) - 8*(u[CCTK_GFINDEX3D(cctkGH,i,-1 + j,-2 + k)] + u[CCTK_GFINDEX3D(cctkGH,i,1 + j,2 + k)] + u[CCTK_GFINDEX3D(cctkGH,i,-2 + j,-1 + k)] + u[CCTK_GFINDEX3D(cctkGH,i,2 + j,1 + k)]) + u[CCTK_GFINDEX3D(cctkGH,i,-2 + j,-2 + k)] - u[CCTK_GFINDEX3D(cctkGH,i,-2 + j,2 + k)] - u[CCTK_GFINDEX3D(cctkGH,i,2 + j,-2 + k)] + u[CCTK_GFINDEX3D(cctkGH,i,2 + j,2 + k)])) +#define PDstandardNth31(u,i,j,k) (p1o144dxdz*(-64*(u[CCTK_GFINDEX3D(cctkGH,-1 + i,j,1 + k)] + u[CCTK_GFINDEX3D(cctkGH,1 + i,j,-1 + k)]) + 64*(u[CCTK_GFINDEX3D(cctkGH,-1 + i,j,-1 + k)] + u[CCTK_GFINDEX3D(cctkGH,1 + i,j,1 + k)]) + 8*(u[CCTK_GFINDEX3D(cctkGH,-1 + i,j,2 + k)] + u[CCTK_GFINDEX3D(cctkGH,1 + i,j,-2 + k)] + u[CCTK_GFINDEX3D(cctkGH,-2 + i,j,1 + k)] + u[CCTK_GFINDEX3D(cctkGH,2 + i,j,-1 + k)]) - 8*(u[CCTK_GFINDEX3D(cctkGH,-1 + i,j,-2 + k)] + u[CCTK_GFINDEX3D(cctkGH,1 + i,j,2 + k)] + u[CCTK_GFINDEX3D(cctkGH,-2 + i,j,-1 + k)] + u[CCTK_GFINDEX3D(cctkGH,2 + i,j,1 + k)]) + u[CCTK_GFINDEX3D(cctkGH,-2 + i,j,-2 + k)] - u[CCTK_GFINDEX3D(cctkGH,-2 + i,j,2 + k)] - u[CCTK_GFINDEX3D(cctkGH,2 + i,j,-2 + k)] + u[CCTK_GFINDEX3D(cctkGH,2 + i,j,2 + k)])) +#define PDstandardNth32(u,i,j,k) (p1o144dydz*(-64*(u[CCTK_GFINDEX3D(cctkGH,i,-1 + j,1 + k)] + u[CCTK_GFINDEX3D(cctkGH,i,1 + j,-1 + k)]) + 64*(u[CCTK_GFINDEX3D(cctkGH,i,-1 + j,-1 + k)] + u[CCTK_GFINDEX3D(cctkGH,i,1 + j,1 + k)]) + 8*(u[CCTK_GFINDEX3D(cctkGH,i,-1 + j,2 + k)] + u[CCTK_GFINDEX3D(cctkGH,i,1 + j,-2 + k)] + u[CCTK_GFINDEX3D(cctkGH,i,-2 + j,1 + k)] + u[CCTK_GFINDEX3D(cctkGH,i,2 + j,-1 + k)]) - 8*(u[CCTK_GFINDEX3D(cctkGH,i,-1 + j,-2 + k)] + u[CCTK_GFINDEX3D(cctkGH,i,1 + j,2 + k)] + u[CCTK_GFINDEX3D(cctkGH,i,-2 + j,-1 + k)] + u[CCTK_GFINDEX3D(cctkGH,i,2 + j,1 + k)]) + u[CCTK_GFINDEX3D(cctkGH,i,-2 + j,-2 + k)] - u[CCTK_GFINDEX3D(cctkGH,i,-2 + j,2 + k)] - u[CCTK_GFINDEX3D(cctkGH,i,2 + j,-2 + k)] + u[CCTK_GFINDEX3D(cctkGH,i,2 + j,2 + k)])) diff --git a/ML_WaveToy/src/RegisterMoL.c b/ML_WaveToy/src/RegisterMoL.c new file mode 100644 index 0000000..b394a5d --- /dev/null +++ b/ML_WaveToy/src/RegisterMoL.c @@ -0,0 +1,21 @@ +/* File produced by user eschnett */ +/* Produced with Mathematica Version 6.0 for Mac OS X x86 (32-bit) (April 20, 2007) */ + +/* Mathematica script written by Ian Hinder and Sascha Husa */ + +#include "cctk.h" +#include "cctk_Arguments.h" +#include "cctk_Parameters.h" + +void ML_WaveToy_RegisterVars(CCTK_ARGUMENTS) +{ + DECLARE_CCTK_ARGUMENTS + DECLARE_CCTK_PARAMETERS + + CCTK_INT ierr = 0; + + /* Register all the evolved grid functions with MoL */ + ierr += MoLRegisterEvolved(CCTK_VarIndex("ML_WaveToy::rho"), CCTK_VarIndex("ML_WaveToy::rhorhs")); + ierr += MoLRegisterEvolved(CCTK_VarIndex("ML_WaveToy::u"), CCTK_VarIndex("ML_WaveToy::urhs")); + return; +} diff --git a/ML_WaveToy/src/RegisterSymmetries.c b/ML_WaveToy/src/RegisterSymmetries.c new file mode 100644 index 0000000..cf9633e --- /dev/null +++ b/ML_WaveToy/src/RegisterSymmetries.c @@ -0,0 +1,32 @@ +/* File produced by user eschnett */ +/* Produced with Mathematica Version 6.0 for Mac OS X x86 (32-bit) (April 20, 2007) */ + +/* Mathematica script written by Ian Hinder and Sascha Husa */ + +#include "cctk.h" +#include "cctk_Arguments.h" +#include "cctk_Parameters.h" +#include "Symmetry.h" + +void ML_WaveToy_RegisterSymmetries(CCTK_ARGUMENTS) +{ + DECLARE_CCTK_ARGUMENTS + DECLARE_CCTK_PARAMETERS + + + /* array holding symmetry definitions */ + CCTK_INT sym[3]; + + + /* Register symmetries of grid functions */ + sym[0] = 1; + sym[1] = 1; + sym[2] = 1; + SetCartSymVN(cctkGH, sym, "ML_WaveToy::rho"); + + sym[0] = 1; + sym[1] = 1; + sym[2] = 1; + SetCartSymVN(cctkGH, sym, "ML_WaveToy::u"); + +} diff --git a/ML_WaveToy/src/Startup.c b/ML_WaveToy/src/Startup.c new file mode 100644 index 0000000..71be71f --- /dev/null +++ b/ML_WaveToy/src/Startup.c @@ -0,0 +1,13 @@ +/* File produced by user eschnett */ +/* Produced with Mathematica Version 6.0 for Mac OS X x86 (32-bit) (April 20, 2007) */ + +/* Mathematica script written by Ian Hinder and Sascha Husa */ + +#include "cctk.h" + +int ML_WaveToy_Startup(void) +{ + const char * banner = "ML_WaveToy"; + CCTK_RegisterBanner(banner); + return 0; +} diff --git a/ML_WaveToy/src/WT_Gaussian.c b/ML_WaveToy/src/WT_Gaussian.c new file mode 100644 index 0000000..2b1e3b7 --- /dev/null +++ b/ML_WaveToy/src/WT_Gaussian.c @@ -0,0 +1,136 @@ +/* File produced by user eschnett */ +/* Produced with Mathematica Version 6.0 for Mac OS X x86 (32-bit) (April 20, 2007) */ + +/* Mathematica script written by Ian Hinder and Sascha Husa */ + +#define KRANC_C + +#include <math.h> +#include "cctk.h" +#include "cctk_Arguments.h" +#include "cctk_Parameters.h" +#include "GenericFD.h" +#include "Differencing.h" +#include "loopcontrol.h" + +/* Define macros used in calculations */ +#define INITVALUE (42) +#define INV(x) ((1.0) / (x)) +#define SQR(x) ((x) * (x)) +#define CUB(x) ((x) * (x) * (x)) +#define QAD(x) ((x) * (x) * (x) * (x)) + +void WT_Gaussian_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL normal[3], CCTK_REAL tangentA[3], CCTK_REAL tangentB[3], CCTK_INT min[3], CCTK_INT max[3], CCTK_INT n_subblock_gfs, CCTK_REAL *subblock_gfs[]) +{ + DECLARE_CCTK_ARGUMENTS + DECLARE_CCTK_PARAMETERS + + + /* Declare finite differencing variables */ + CCTK_REAL dx = INITVALUE, dy = INITVALUE, dz = INITVALUE; + CCTK_REAL dxi = INITVALUE, dyi = INITVALUE, dzi = INITVALUE; + CCTK_REAL khalf = INITVALUE, kthird = INITVALUE, ktwothird = INITVALUE, kfourthird = INITVALUE, keightthird = INITVALUE; + CCTK_REAL hdxi = INITVALUE, hdyi = INITVALUE, hdzi = INITVALUE; + + + /* Declare predefined quantities */ + CCTK_REAL p1o12dx = INITVALUE; + CCTK_REAL p1o12dy = INITVALUE; + CCTK_REAL p1o12dz = INITVALUE; + CCTK_REAL p1o144dxdy = INITVALUE; + CCTK_REAL p1o144dxdz = INITVALUE; + CCTK_REAL p1o144dydz = INITVALUE; + CCTK_REAL pm1o12dx2 = INITVALUE; + CCTK_REAL pm1o12dy2 = INITVALUE; + CCTK_REAL pm1o12dz2 = INITVALUE; + + if (verbose > 1) + { + CCTK_VInfo(CCTK_THORNSTRING,"Entering WT_Gaussian_Body"); + } + + if (cctk_iteration % WT_Gaussian_calc_every != WT_Gaussian_calc_offset) + { + return; + } + + /* Include user-supplied include files */ + + /* Initialise finite differencing variables */ + dx = CCTK_DELTA_SPACE(0); + dy = CCTK_DELTA_SPACE(1); + dz = CCTK_DELTA_SPACE(2); + dxi = 1.0 / dx; + dyi = 1.0 / dy; + dzi = 1.0 / dz; + khalf = 0.5; + kthird = 1/3.0; + ktwothird = 2.0/3.0; + kfourthird = 4.0/3.0; + keightthird = 8.0/3.0; + hdxi = 0.5 * dxi; + hdyi = 0.5 * dyi; + hdzi = 0.5 * dzi; + + /* Initialize predefined quantities */ + p1o12dx = INV(dx)/12.; + p1o12dy = INV(dy)/12.; + p1o12dz = INV(dz)/12.; + p1o144dxdy = (INV(dx)*INV(dy))/144.; + p1o144dxdz = (INV(dx)*INV(dz))/144.; + p1o144dydz = (INV(dy)*INV(dz))/144.; + pm1o12dx2 = -pow(dx,-2)/12.; + pm1o12dy2 = -pow(dy,-2)/12.; + pm1o12dz2 = -pow(dz,-2)/12.; + + /* Loop over the grid points */ + LC_LOOP3 (WT_Gaussian, + i,j,k, min[0],min[1],min[2], max[0],max[1],max[2], + cctk_lsh[0],cctk_lsh[1],cctk_lsh[2]) + { + int index = INITVALUE; + int subblock_index = INITVALUE; + index = CCTK_GFINDEX3D(cctkGH,i,j,k); + subblock_index = i - min[0] + (max[0] - min[0]) * (j - min[1] + (max[1]-min[1]) * (k - min[2])); + + /* Declare shorthands */ + + /* Declare local copies of grid functions */ + CCTK_REAL rhoL = INITVALUE; + CCTK_REAL uL = INITVALUE; + /* Declare precomputed derivatives*/ + + /* Declare derivatives */ + + /* Assign local copies of grid functions */ + + /* Assign local copies of subblock grid functions */ + + /* Include user supplied include files */ + + /* Precompute derivatives (new style) */ + + /* Precompute derivatives (old style) */ + + /* Calculate temporaries and grid functions */ + uL = 0; + + rhoL = 0; + + + /* Copy local copies back to grid functions */ + rho[index] = rhoL; + u[index] = uL; + + /* Copy local copies back to subblock grid functions */ + } + LC_ENDLOOP3 (WT_Gaussian); +} + +void WT_Gaussian(CCTK_ARGUMENTS) +{ + DECLARE_CCTK_ARGUMENTS + DECLARE_CCTK_PARAMETERS + + GenericFD_LoopOverEverything(cctkGH, &WT_Gaussian_Body); +} diff --git a/ML_WaveToy/src/WT_RHS.c b/ML_WaveToy/src/WT_RHS.c new file mode 100644 index 0000000..1b56982 --- /dev/null +++ b/ML_WaveToy/src/WT_RHS.c @@ -0,0 +1,144 @@ +/* File produced by user eschnett */ +/* Produced with Mathematica Version 6.0 for Mac OS X x86 (32-bit) (April 20, 2007) */ + +/* Mathematica script written by Ian Hinder and Sascha Husa */ + +#define KRANC_C + +#include <math.h> +#include "cctk.h" +#include "cctk_Arguments.h" +#include "cctk_Parameters.h" +#include "GenericFD.h" +#include "Differencing.h" +#include "loopcontrol.h" + +/* Define macros used in calculations */ +#define INITVALUE (42) +#define INV(x) ((1.0) / (x)) +#define SQR(x) ((x) * (x)) +#define CUB(x) ((x) * (x) * (x)) +#define QAD(x) ((x) * (x) * (x) * (x)) + +void WT_RHS_Body(cGH *cctkGH, CCTK_INT dir, CCTK_INT face, CCTK_REAL normal[3], CCTK_REAL tangentA[3], CCTK_REAL tangentB[3], CCTK_INT min[3], CCTK_INT max[3], CCTK_INT n_subblock_gfs, CCTK_REAL *subblock_gfs[]) +{ + DECLARE_CCTK_ARGUMENTS + DECLARE_CCTK_PARAMETERS + + + /* Declare finite differencing variables */ + CCTK_REAL dx = INITVALUE, dy = INITVALUE, dz = INITVALUE; + CCTK_REAL dxi = INITVALUE, dyi = INITVALUE, dzi = INITVALUE; + CCTK_REAL khalf = INITVALUE, kthird = INITVALUE, ktwothird = INITVALUE, kfourthird = INITVALUE, keightthird = INITVALUE; + CCTK_REAL hdxi = INITVALUE, hdyi = INITVALUE, hdzi = INITVALUE; + + + /* Declare predefined quantities */ + CCTK_REAL p1o12dx = INITVALUE; + CCTK_REAL p1o12dy = INITVALUE; + CCTK_REAL p1o12dz = INITVALUE; + CCTK_REAL p1o144dxdy = INITVALUE; + CCTK_REAL p1o144dxdz = INITVALUE; + CCTK_REAL p1o144dydz = INITVALUE; + CCTK_REAL pm1o12dx2 = INITVALUE; + CCTK_REAL pm1o12dy2 = INITVALUE; + CCTK_REAL pm1o12dz2 = INITVALUE; + + if (verbose > 1) + { + CCTK_VInfo(CCTK_THORNSTRING,"Entering WT_RHS_Body"); + } + + if (cctk_iteration % WT_RHS_calc_every != WT_RHS_calc_offset) + { + return; + } + + /* Include user-supplied include files */ + + /* Initialise finite differencing variables */ + dx = CCTK_DELTA_SPACE(0); + dy = CCTK_DELTA_SPACE(1); + dz = CCTK_DELTA_SPACE(2); + dxi = 1.0 / dx; + dyi = 1.0 / dy; + dzi = 1.0 / dz; + khalf = 0.5; + kthird = 1/3.0; + ktwothird = 2.0/3.0; + kfourthird = 4.0/3.0; + keightthird = 8.0/3.0; + hdxi = 0.5 * dxi; + hdyi = 0.5 * dyi; + hdzi = 0.5 * dzi; + + /* Initialize predefined quantities */ + p1o12dx = INV(dx)/12.; + p1o12dy = INV(dy)/12.; + p1o12dz = INV(dz)/12.; + p1o144dxdy = (INV(dx)*INV(dy))/144.; + p1o144dxdz = (INV(dx)*INV(dz))/144.; + p1o144dydz = (INV(dy)*INV(dz))/144.; + pm1o12dx2 = -pow(dx,-2)/12.; + pm1o12dy2 = -pow(dy,-2)/12.; + pm1o12dz2 = -pow(dz,-2)/12.; + + /* Loop over the grid points */ + LC_LOOP3 (WT_RHS, + i,j,k, min[0],min[1],min[2], max[0],max[1],max[2], + cctk_lsh[0],cctk_lsh[1],cctk_lsh[2]) + { + int index = INITVALUE; + int subblock_index = INITVALUE; + index = CCTK_GFINDEX3D(cctkGH,i,j,k); + subblock_index = i - min[0] + (max[0] - min[0]) * (j - min[1] + (max[1]-min[1]) * (k - min[2])); + + /* Declare shorthands */ + + /* Declare local copies of grid functions */ + CCTK_REAL rhoL = INITVALUE, rhorhsL = INITVALUE; + CCTK_REAL uL = INITVALUE, urhsL = INITVALUE; + /* Declare precomputed derivatives*/ + + /* Declare derivatives */ + CCTK_REAL PDstandardNth11u = INITVALUE; + CCTK_REAL PDstandardNth22u = INITVALUE; + CCTK_REAL PDstandardNth33u = INITVALUE; + + /* Assign local copies of grid functions */ + rhoL = rho[index]; + uL = u[index]; + + /* Assign local copies of subblock grid functions */ + + /* Include user supplied include files */ + + /* Precompute derivatives (new style) */ + PDstandardNth11u = PDstandardNth11(u, i, j, k); + PDstandardNth22u = PDstandardNth22(u, i, j, k); + PDstandardNth33u = PDstandardNth33(u, i, j, k); + + /* Precompute derivatives (old style) */ + + /* Calculate temporaries and grid functions */ + urhsL = rhoL; + + rhorhsL = PDstandardNth11u + PDstandardNth22u + PDstandardNth33u; + + + /* Copy local copies back to grid functions */ + rhorhs[index] = rhorhsL; + urhs[index] = urhsL; + + /* Copy local copies back to subblock grid functions */ + } + LC_ENDLOOP3 (WT_RHS); +} + +void WT_RHS(CCTK_ARGUMENTS) +{ + DECLARE_CCTK_ARGUMENTS + DECLARE_CCTK_PARAMETERS + + GenericFD_LoopOverInterior(cctkGH, &WT_RHS_Body); +} diff --git a/ML_WaveToy/src/make.code.defn b/ML_WaveToy/src/make.code.defn new file mode 100644 index 0000000..1cd6049 --- /dev/null +++ b/ML_WaveToy/src/make.code.defn @@ -0,0 +1,6 @@ +# File produced by user eschnett +# Produced with Mathematica Version 6.0 for Mac OS X x86 (32-bit) (April 20, 2007) + +# Mathematica script written by Ian Hinder and Sascha Husa + +SRCS = Startup.c RegisterMoL.c RegisterSymmetries.c WT_Gaussian.c WT_RHS.c Boundaries.c |