Skip to content

Commit

Permalink
SimpleWave example: Add generated thorn
Browse files Browse the repository at this point in the history
  • Loading branch information
ianhinder committed Dec 15, 2011
1 parent 7040cf7 commit bf4d0bb
Show file tree
Hide file tree
Showing 12 changed files with 794 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Examples/SimpleWave/configuration.ccl
@@ -0,0 +1,3 @@
# File produced by Kranc

REQUIRES GenericFD
41 changes: 41 additions & 0 deletions Examples/SimpleWave/interface.ccl
@@ -0,0 +1,41 @@
# File produced by Kranc

implements: SimpleWave

inherits: Grid GenericFD Boundary



USES INCLUDE: GenericFD.h
USES INCLUDE: Symmetry.h
USES INCLUDE: sbp_calc_coeffs.h
USES INCLUDE: Boundary.h

CCTK_INT FUNCTION MoLRegisterEvolved(CCTK_INT IN EvolvedIndex, CCTK_INT IN RHSIndex)
USES FUNCTION MoLRegisterEvolved

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 MultiPatch_GetMap(CCTK_POINTER_TO_CONST IN cctkGH)
USES FUNCTION MultiPatch_GetMap

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 evolved_group type=GF timelevels=3 tags=''
{
phi,
pi
} "evolved_group"

public:
CCTK_REAL evolved_grouprhs type=GF timelevels=3 tags=''
{
phirhs,
pirhs
} "evolved_grouprhs"
155 changes: 155 additions & 0 deletions Examples/SimpleWave/param.ccl
@@ -0,0 +1,155 @@
# File produced by Kranc


shares: GenericFD



shares: MethodOfLines

USES CCTK_INT MoL_Num_Evolved_Vars

restricted:
CCTK_INT verbose "verbose" STEERABLE=ALWAYS
{
*:* :: ""
} 0

restricted:
CCTK_REAL hlleAlpha "hlleAlpha"
{
"*:*" :: ""
} 0

restricted:
CCTK_INT SimpleWave_MaxNumEvolvedVars "Number of evolved variables used by this thorn" ACCUMULATOR-BASE=MethodofLines::MoL_Num_Evolved_Vars STEERABLE=RECOVER
{
2:2 :: "Number of evolved variables used by this thorn"
} 2

restricted:
CCTK_INT timelevels "Number of active timelevels" STEERABLE=RECOVER
{
0:3 :: ""
} 3

restricted:
CCTK_INT rhs_timelevels "Number of active RHS timelevels" STEERABLE=RECOVER
{
0:3 :: ""
} 1

restricted:
CCTK_INT initial_sine_calc_every "initial_sine_calc_every" STEERABLE=ALWAYS
{
*:* :: ""
} 1

restricted:
CCTK_INT calc_rhs_calc_every "calc_rhs_calc_every" STEERABLE=ALWAYS
{
*:* :: ""
} 1

restricted:
CCTK_INT initial_sine_calc_offset "initial_sine_calc_offset" STEERABLE=ALWAYS
{
*:* :: ""
} 0

restricted:
CCTK_INT calc_rhs_calc_offset "calc_rhs_calc_offset" STEERABLE=ALWAYS
{
*:* :: ""
} 0

private:
KEYWORD phi_bound "Boundary condition to implement" STEERABLE=ALWAYS
{
"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 pi_bound "Boundary condition to implement" STEERABLE=ALWAYS
{
"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 evolved_group_bound "Boundary condition to implement" STEERABLE=ALWAYS
{
"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"
} "none"

private:
CCTK_REAL phi_bound_speed "characteristic speed at boundary" STEERABLE=ALWAYS
{
"0:*" :: "outgoing characteristic speed > 0"
} 1.

private:
CCTK_REAL pi_bound_speed "characteristic speed at boundary" STEERABLE=ALWAYS
{
"0:*" :: "outgoing characteristic speed > 0"
} 1.

private:
CCTK_REAL evolved_group_bound_speed "characteristic speed at boundary" STEERABLE=ALWAYS
{
"0:*" :: "outgoing characteristic speed > 0"
} 1.

private:
CCTK_REAL phi_bound_limit "limit value for r -> infinity" STEERABLE=ALWAYS
{
"*:*" :: "value of limit value is unrestricted"
} 0.

private:
CCTK_REAL pi_bound_limit "limit value for r -> infinity" STEERABLE=ALWAYS
{
"*:*" :: "value of limit value is unrestricted"
} 0.

private:
CCTK_REAL evolved_group_bound_limit "limit value for r -> infinity" STEERABLE=ALWAYS
{
"*:*" :: "value of limit value is unrestricted"
} 0.

private:
CCTK_REAL phi_bound_scalar "Dirichlet boundary value" STEERABLE=ALWAYS
{
"*:*" :: "unrestricted"
} 0.

private:
CCTK_REAL pi_bound_scalar "Dirichlet boundary value" STEERABLE=ALWAYS
{
"*:*" :: "unrestricted"
} 0.

private:
CCTK_REAL evolved_group_bound_scalar "Dirichlet boundary value" STEERABLE=ALWAYS
{
"*:*" :: "unrestricted"
} 0.

74 changes: 74 additions & 0 deletions Examples/SimpleWave/schedule.ccl
@@ -0,0 +1,74 @@
# File produced by Kranc


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

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

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

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

schedule SimpleWave_RegisterSymmetries in SymmetryRegister
{
LANG: C
OPTIONS: meta
} "register symmetries"

schedule initial_sine AT INITIAL
{
LANG: C
} "initial_sine"

schedule calc_rhs in MoL_CalcRHS
{
LANG: C
} "calc_rhs"

schedule SimpleWave_SelectBoundConds in MoL_PostStep
{
LANG: C
OPTIONS: level
SYNC: evolved_group
} "select boundary conditions"

schedule SimpleWave_CheckBoundaries at BASEGRID
{
LANG: C
OPTIONS: meta
} "check boundaries treatment"

schedule group ApplyBCs as SimpleWave_ApplyBCs in MoL_PostStep after SimpleWave_SelectBoundConds
{
# no language specified
} "Apply boundary conditions controlled by thorn Boundary"

0 comments on commit bf4d0bb

Please sign in to comment.