Skip to content

Commit

Permalink
Advect 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 2b992b0 commit 77f157f
Show file tree
Hide file tree
Showing 14 changed files with 1,195 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Examples/Advect/configuration.ccl
@@ -0,0 +1,3 @@
# File produced by Kranc

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

implements: Advect

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 F2rho_group type=GF timelevels=1 tags='tensortypealias="U" tensorweight=0'
{
F2rho1,
F2rho2,
F2rho3
} "F2rho_group"

public:
CCTK_REAL Frho_group type=GF timelevels=1 tags='tensortypealias="U" tensorweight=0'
{
Frho1,
Frho2,
Frho3
} "Frho_group"

public:
CCTK_REAL v_group type=GF timelevels=1 tags='tensortypealias="U" tensorweight=0'
{
v1,
v2,
v3
} "v_group"

public:
CCTK_REAL rho_group type=GF timelevels=3 tags='tensortypealias="Scalar" tensorweight=0'
{
rho
} "rho_group"

public:
CCTK_REAL rho_grouprhs type=GF timelevels=3 tags='tensortypealias="Scalar" tensorweight=0'
{
rhorhs
} "rho_grouprhs"
174 changes: 174 additions & 0 deletions Examples/Advect/param.ccl
@@ -0,0 +1,174 @@
# 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 sigma "sigma"
{
"*:*" :: ""
} 0

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

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

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

private:
KEYWORD initial_data "initial_data"
{
"sine" :: "sine"
"shock" :: "shock"
} "sine"

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

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 advect_initial_sine_calc_every "advect_initial_sine_calc_every" STEERABLE=ALWAYS
{
*:* :: ""
} 1

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

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

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

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

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

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

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

private:
KEYWORD rho_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 rho_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 rho_bound_speed "characteristic speed at boundary" STEERABLE=ALWAYS
{
"0:*" :: "outgoing characteristic speed > 0"
} 1.

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

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

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

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

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

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


STORAGE: F2rho_group[1]

STORAGE: Frho_group[1]

STORAGE: v_group[1]

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

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

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

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

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


if (CCTK_EQUALS(initial_data, "sine"))
{
schedule advect_initial_sine at CCTK_INITIAL as advect_initial
{
LANG: C
} "advect_initial_sine"
}


if (CCTK_EQUALS(initial_data, "shock"))
{
schedule advect_initial_shock at CCTK_INITIAL as advect_initial
{
LANG: C
} "advect_initial_shock"
}

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

schedule advect_flux in MoL_PostStep after Advect_ApplyBCs
{
LANG: C
} "advect_flux"

schedule Advect_SelectBoundConds in MoL_PostStep
{
LANG: C
OPTIONS: level
SYNC: rho_group
} "select boundary conditions"

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

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

0 comments on commit 77f157f

Please sign in to comment.