Skip to content

Commit

Permalink
Examples: Regenerate SimpleWaveScript
Browse files Browse the repository at this point in the history
  • Loading branch information
ianhinder committed Feb 21, 2014
1 parent 88cad4c commit 72b15a3
Show file tree
Hide file tree
Showing 10 changed files with 344 additions and 289 deletions.
9 changes: 4 additions & 5 deletions Examples/SimpleWaveScript/interface.ccl
Expand Up @@ -2,15 +2,14 @@

implements: SimpleWaveScript

inherits: Grid GenericFD Boundary
inherits: Boundary GenericFD Grid



USES INCLUDE: GenericFD.h
USES INCLUDE: loopcontrol.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
Expand Down Expand Up @@ -40,13 +39,13 @@ CCTK_REAL pi_group type=GF timelevels=3 tags='tensortypealias="Scalar" tensorwei
} "pi_group"

public:
CCTK_REAL phi_grouprhs type=GF timelevels=3 tags='tensortypealias="Scalar" tensorweight=0'
CCTK_REAL phi_grouprhs type=GF timelevels=3 tags='tensortypealias="Scalar" tensorweight=0 Prolongation="None"'
{
phirhs
} "phi_grouprhs"

public:
CCTK_REAL pi_grouprhs type=GF timelevels=3 tags='tensortypealias="Scalar" tensorweight=0'
CCTK_REAL pi_grouprhs type=GF timelevels=3 tags='tensortypealias="Scalar" tensorweight=0 Prolongation="None"'
{
pirhs
} "pi_grouprhs"
16 changes: 9 additions & 7 deletions Examples/SimpleWaveScript/param.ccl
Expand Up @@ -3,6 +3,7 @@

shares: GenericFD

USES CCTK_INT assume_stress_energy_state


shares: MethodOfLines
Expand All @@ -16,10 +17,17 @@ CCTK_INT verbose "verbose" STEERABLE=ALWAYS
*:* :: ""
} 0

restricted:
CCTK_INT other_timelevels "Number of active timelevels for non-evolved grid functions" STEERABLE=RECOVER
{
0:3 :: ""
} 1

restricted:
CCTK_INT fdOrder "fdOrder"
{
*:* :: ""
2 :: ""
4 :: ""
} 2

restricted:
Expand All @@ -46,12 +54,6 @@ CCTK_INT rhs_timelevels "Number of active RHS timelevels" STEERABLE=RECOVER
0:3 :: ""
} 1

restricted:
CCTK_INT other_timelevels "Number of active timelevels for non-evolved grid functions" STEERABLE=RECOVER
{
0:3 :: ""
} 1

restricted:
CCTK_INT initial_sine_calc_calc_every "initial_sine_calc_calc_every" STEERABLE=ALWAYS
{
Expand Down
73 changes: 18 additions & 55 deletions Examples/SimpleWaveScript/schedule.ccl
@@ -1,70 +1,20 @@
# File produced by Kranc


if (timelevels == 1)
{
STORAGE: phi_group[1]
}
if (timelevels == 2)
{
STORAGE: phi_group[2]
}
if (timelevels == 3)
{
STORAGE: phi_group[3]
}
STORAGE: phi_group[timelevels]

if (timelevels == 1)
{
STORAGE: pi_group[1]
}
if (timelevels == 2)
{
STORAGE: pi_group[2]
}
if (timelevels == 3)
{
STORAGE: pi_group[3]
}
STORAGE: pi_group[timelevels]

if (rhs_timelevels == 1)
{
STORAGE: phi_grouprhs[1]
}
if (rhs_timelevels == 2)
{
STORAGE: phi_grouprhs[2]
}
if (rhs_timelevels == 3)
{
STORAGE: phi_grouprhs[3]
}
STORAGE: phi_grouprhs[rhs_timelevels]

if (rhs_timelevels == 1)
{
STORAGE: pi_grouprhs[1]
}
if (rhs_timelevels == 2)
{
STORAGE: pi_grouprhs[2]
}
if (rhs_timelevels == 3)
{
STORAGE: pi_grouprhs[3]
}
STORAGE: pi_grouprhs[rhs_timelevels]

schedule SimpleWaveScript_Startup at STARTUP
{
LANG: C
OPTIONS: meta
} "create banner"

schedule SimpleWaveScript_RegisterVars in MoL_Register
{
LANG: C
OPTIONS: meta
} "Register Variables for MoL"

schedule SimpleWaveScript_RegisterSymmetries in SymmetryRegister
{
LANG: C
Expand All @@ -74,11 +24,19 @@ schedule SimpleWaveScript_RegisterSymmetries in SymmetryRegister
schedule initial_sine_calc at initial
{
LANG: C
READS: grid::x(Everywhere)
READS: SimpleWaveScript::pi(Everywhere)
WRITES: SimpleWaveScript::phi(ERROR(Automatic))
WRITES: SimpleWaveScript::pi(ERROR(Automatic))
} "initial_sine_calc"

schedule calc_rhs in mol_calcrhs
{
LANG: C
READS: SimpleWaveScript::phi(Everywhere)
READS: SimpleWaveScript::pi(Everywhere)
WRITES: SimpleWaveScript::phirhs(ERROR(Automatic))
WRITES: SimpleWaveScript::pirhs(ERROR(Automatic))
} "calc_rhs"

schedule SimpleWaveScript_SelectBoundConds in MoL_PostStep
Expand All @@ -95,7 +53,12 @@ schedule SimpleWaveScript_CheckBoundaries at BASEGRID
OPTIONS: meta
} "check boundaries treatment"

schedule SimpleWaveScript_RegisterVars in MoL_Register
{
LANG: C
OPTIONS: meta
} "Register Variables for MoL"

schedule group ApplyBCs as SimpleWaveScript_ApplyBCs in MoL_PostStep after SimpleWaveScript_SelectBoundConds
{
# no language specified
} "Apply boundary conditions controlled by thorn Boundary"
18 changes: 9 additions & 9 deletions Examples/SimpleWaveScript/src/Boundaries.cc
Expand Up @@ -30,7 +30,7 @@ extern "C" void SimpleWaveScript_SelectBoundConds(CCTK_ARGUMENTS)
DECLARE_CCTK_ARGUMENTS;
DECLARE_CCTK_PARAMETERS;

CCTK_INT ierr = 0;
CCTK_INT ierr CCTK_ATTRIBUTE_UNUSED = 0;

if (CCTK_EQUALS(phi_group_bound, "none" ) ||
CCTK_EQUALS(phi_group_bound, "static") ||
Expand Down Expand Up @@ -79,7 +79,7 @@ extern "C" void SimpleWaveScript_SelectBoundConds(CCTK_ARGUMENTS)
if (CCTK_EQUALS(phi_group_bound, "radiative"))
{
/* select radiation boundary condition */
static CCTK_INT handle_phi_group_bound = -1;
static CCTK_INT handle_phi_group_bound CCTK_ATTRIBUTE_UNUSED = -1;
if (handle_phi_group_bound < 0) handle_phi_group_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE);
if (handle_phi_group_bound < 0) CCTK_WARN(0, "could not create table!");
if (Util_TableSetReal(handle_phi_group_bound , phi_group_bound_limit, "LIMIT") < 0)
Expand All @@ -98,7 +98,7 @@ extern "C" void SimpleWaveScript_SelectBoundConds(CCTK_ARGUMENTS)
if (CCTK_EQUALS(pi_group_bound, "radiative"))
{
/* select radiation boundary condition */
static CCTK_INT handle_pi_group_bound = -1;
static CCTK_INT handle_pi_group_bound CCTK_ATTRIBUTE_UNUSED = -1;
if (handle_pi_group_bound < 0) handle_pi_group_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE);
if (handle_pi_group_bound < 0) CCTK_WARN(0, "could not create table!");
if (Util_TableSetReal(handle_pi_group_bound , pi_group_bound_limit, "LIMIT") < 0)
Expand All @@ -117,7 +117,7 @@ extern "C" void SimpleWaveScript_SelectBoundConds(CCTK_ARGUMENTS)
if (CCTK_EQUALS(phi_bound, "radiative"))
{
/* select radiation boundary condition */
static CCTK_INT handle_phi_bound = -1;
static CCTK_INT handle_phi_bound CCTK_ATTRIBUTE_UNUSED = -1;
if (handle_phi_bound < 0) handle_phi_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE);
if (handle_phi_bound < 0) CCTK_WARN(0, "could not create table!");
if (Util_TableSetReal(handle_phi_bound , phi_bound_limit, "LIMIT") < 0)
Expand All @@ -136,7 +136,7 @@ extern "C" void SimpleWaveScript_SelectBoundConds(CCTK_ARGUMENTS)
if (CCTK_EQUALS(pi_bound, "radiative"))
{
/* select radiation boundary condition */
static CCTK_INT handle_pi_bound = -1;
static CCTK_INT handle_pi_bound CCTK_ATTRIBUTE_UNUSED = -1;
if (handle_pi_bound < 0) handle_pi_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE);
if (handle_pi_bound < 0) CCTK_WARN(0, "could not create table!");
if (Util_TableSetReal(handle_pi_bound , pi_bound_limit, "LIMIT") < 0)
Expand All @@ -155,7 +155,7 @@ extern "C" void SimpleWaveScript_SelectBoundConds(CCTK_ARGUMENTS)
if (CCTK_EQUALS(phi_group_bound, "scalar"))
{
/* select scalar boundary condition */
static CCTK_INT handle_phi_group_bound = -1;
static CCTK_INT handle_phi_group_bound CCTK_ATTRIBUTE_UNUSED = -1;
if (handle_phi_group_bound < 0) handle_phi_group_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE);
if (handle_phi_group_bound < 0) CCTK_WARN(0, "could not create table!");
if (Util_TableSetReal(handle_phi_group_bound ,phi_group_bound_scalar, "SCALAR") < 0)
Expand All @@ -172,7 +172,7 @@ extern "C" void SimpleWaveScript_SelectBoundConds(CCTK_ARGUMENTS)
if (CCTK_EQUALS(pi_group_bound, "scalar"))
{
/* select scalar boundary condition */
static CCTK_INT handle_pi_group_bound = -1;
static CCTK_INT handle_pi_group_bound CCTK_ATTRIBUTE_UNUSED = -1;
if (handle_pi_group_bound < 0) handle_pi_group_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE);
if (handle_pi_group_bound < 0) CCTK_WARN(0, "could not create table!");
if (Util_TableSetReal(handle_pi_group_bound ,pi_group_bound_scalar, "SCALAR") < 0)
Expand All @@ -189,7 +189,7 @@ extern "C" void SimpleWaveScript_SelectBoundConds(CCTK_ARGUMENTS)
if (CCTK_EQUALS(phi_bound, "scalar"))
{
/* select scalar boundary condition */
static CCTK_INT handle_phi_bound = -1;
static CCTK_INT handle_phi_bound CCTK_ATTRIBUTE_UNUSED = -1;
if (handle_phi_bound < 0) handle_phi_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE);
if (handle_phi_bound < 0) CCTK_WARN(0, "could not create table!");
if (Util_TableSetReal(handle_phi_bound ,phi_bound_scalar, "SCALAR") < 0)
Expand All @@ -206,7 +206,7 @@ extern "C" void SimpleWaveScript_SelectBoundConds(CCTK_ARGUMENTS)
if (CCTK_EQUALS(pi_bound, "scalar"))
{
/* select scalar boundary condition */
static CCTK_INT handle_pi_bound = -1;
static CCTK_INT handle_pi_bound CCTK_ATTRIBUTE_UNUSED = -1;
if (handle_pi_bound < 0) handle_pi_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE);
if (handle_pi_bound < 0) CCTK_WARN(0, "could not create table!");
if (Util_TableSetReal(handle_pi_bound ,pi_bound_scalar, "SCALAR") < 0)
Expand Down

0 comments on commit 72b15a3

Please sign in to comment.