Skip to content

Commit

Permalink
Merge branch 'xTensor'
Browse files Browse the repository at this point in the history
  • Loading branch information
barrywardell committed Mar 11, 2014
2 parents 098a823 + 809db1a commit 5c0bf77
Show file tree
Hide file tree
Showing 115 changed files with 5,088 additions and 3,180 deletions.
7 changes: 3 additions & 4 deletions Examples/Advect.m
Expand Up @@ -29,15 +29,14 @@
(* ShiftMinus[i_] -> EMinus *)
};

(* PD = PDstandard2nd; *)
PD = PDplus;
DefineDerivative[pd, PDstandard2nd];

(**************************************************************************************)
(* Tensors *)
(**************************************************************************************)

(* Register the tensor quantities with the TensorTools package *)
Map[DefineTensor, {Frho, F2rho, rho, v, dir}];
Map[DefineTensor, {Frho[ui], F2rho[ui], v[ui], rho, dir[li]}];

(**************************************************************************************)
(* Groups *)
Expand Down Expand Up @@ -96,7 +95,7 @@
Equations ->
{
(* dot[rho] -> PDplus[F2rho[ui], li] *)
dot[rho] -> PDstandard2nd[Frho[ui],li]
dot[rho] -> pd[Frho[ui],li]
(* alpha PDstandard2nd[rho,li,lj] Euc[ui,uj] *)
}
};
Expand Down
27 changes: 13 additions & 14 deletions Examples/Advect/interface.ccl
Expand Up @@ -2,15 +2,14 @@

implements: Advect

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 All @@ -28,12 +27,10 @@ CCTK_INT FUNCTION Boundary_SelectVarForBC(CCTK_POINTER_TO_CONST IN GH, CCTK_INT
USES FUNCTION Boundary_SelectVarForBC

public:
CCTK_REAL F2rho_group type=GF timelevels=1 tags='tensortypealias="U" tensorweight=0'
CCTK_REAL rho_group type=GF timelevels=3 tags='tensortypealias="Scalar" tensorweight=0'
{
F2rho1,
F2rho2,
F2rho3
} "F2rho_group"
rho
} "rho_group"

public:
CCTK_REAL Frho_group type=GF timelevels=1 tags='tensortypealias="U" tensorweight=0'
Expand All @@ -43,6 +40,14 @@ CCTK_REAL Frho_group type=GF timelevels=1 tags='tensortypealias="U" tensorweight
Frho3
} "Frho_group"

public:
CCTK_REAL F2rho_group type=GF timelevels=1 tags='tensortypealias="U" tensorweight=0'
{
F2rho1,
F2rho2,
F2rho3
} "F2rho_group"

public:
CCTK_REAL v_group type=GF timelevels=1 tags='tensortypealias="U" tensorweight=0'
{
Expand All @@ -51,12 +56,6 @@ CCTK_REAL v_group type=GF timelevels=1 tags='tensortypealias="U" tensorweight=0'
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 Prolongation="None"'
{
Expand Down
23 changes: 15 additions & 8 deletions Examples/Advect/param.ccl
Expand Up @@ -3,6 +3,7 @@

shares: GenericFD

USES CCTK_INT assume_stress_energy_state


shares: MethodOfLines
Expand All @@ -16,6 +17,12 @@ 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_REAL sigma "sigma"
{
Expand All @@ -34,11 +41,17 @@ CCTK_REAL amp "amp"
"*:*" :: ""
} 0

restricted:
CCTK_INT tile_size "Loop tile size"
{
*:* :: ""
} -1

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

restricted:
Expand All @@ -65,12 +78,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 advect_initial_sine_calc_every "advect_initial_sine_calc_every" STEERABLE=ALWAYS
{
Expand Down
83 changes: 26 additions & 57 deletions Examples/Advect/schedule.ccl
@@ -1,46 +1,15 @@
# File produced by Kranc


if (other_timelevels == 1)
{
STORAGE: F2rho_group[1]
}
STORAGE: rho_group[timelevels]

if (other_timelevels == 1)
{
STORAGE: Frho_group[1]
}
STORAGE: Frho_group[other_timelevels]

if (other_timelevels == 1)
{
STORAGE: v_group[1]
}
STORAGE: F2rho_group[other_timelevels]

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

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

schedule Advect_Startup at STARTUP
{
Expand All @@ -60,11 +29,11 @@ if (CCTK_EQUALS(initial_data, "sine"))
schedule advect_initial_sine at CCTK_INITIAL as advect_initial
{
LANG: C
READS: grid::x(Everywhere)
WRITES: Advect::rho(Everywhere)
WRITES: Advect::v1(Everywhere)
WRITES: Advect::v2(Everywhere)
WRITES: Advect::v3(Everywhere)
READS: grid::x(Everywhere)
WRITES: Advect::rho(Everywhere)
WRITES: Advect::v1(Everywhere)
WRITES: Advect::v2(Everywhere)
WRITES: Advect::v3(Everywhere)
} "advect_initial_sine"
}

Expand All @@ -74,33 +43,33 @@ if (CCTK_EQUALS(initial_data, "shock"))
schedule advect_initial_shock at CCTK_INITIAL as advect_initial
{
LANG: C
READS: grid::x(Everywhere)
WRITES: Advect::rho(Everywhere)
WRITES: Advect::v1(Everywhere)
WRITES: Advect::v2(Everywhere)
WRITES: Advect::v3(Everywhere)
READS: grid::x(Everywhere)
WRITES: Advect::rho(Everywhere)
WRITES: Advect::v1(Everywhere)
WRITES: Advect::v2(Everywhere)
WRITES: Advect::v3(Everywhere)
} "advect_initial_shock"
}

schedule advect_evol in MoL_CalcRHS
{
LANG: C
READS: Advect::Frho1(Everywhere)
READS: Advect::Frho2(Everywhere)
READS: Advect::Frho3(Everywhere)
WRITES: Advect::rhorhs(Interior)
READS: Advect::Frho1(Everywhere)
READS: Advect::Frho2(Everywhere)
READS: Advect::Frho3(Everywhere)
WRITES: Advect::rhorhs(Interior)
} "advect_evol"

schedule advect_flux in MoL_PostStep after Advect_ApplyBCs
{
LANG: C
READS: Advect::rho(Everywhere)
READS: Advect::v1(Everywhere)
READS: Advect::v2(Everywhere)
READS: Advect::v3(Everywhere)
WRITES: Advect::Frho1(Everywhere)
WRITES: Advect::Frho2(Everywhere)
WRITES: Advect::Frho3(Everywhere)
READS: Advect::rho(Everywhere)
READS: Advect::v1(Everywhere)
READS: Advect::v2(Everywhere)
READS: Advect::v3(Everywhere)
WRITES: Advect::Frho1(Everywhere)
WRITES: Advect::Frho2(Everywhere)
WRITES: Advect::Frho3(Everywhere)
} "advect_flux"

schedule Advect_SelectBoundConds in MoL_PostStep
Expand Down
10 changes: 5 additions & 5 deletions Examples/Advect/src/Boundaries.cc
Expand Up @@ -30,7 +30,7 @@ extern "C" void Advect_SelectBoundConds(CCTK_ARGUMENTS)
DECLARE_CCTK_ARGUMENTS;
DECLARE_CCTK_PARAMETERS;

CCTK_INT ierr CCTK_ATTRIBUTE_UNUSED = 0;
CCTK_INT ierr CCTK_ATTRIBUTE_UNUSED = 0;

if (CCTK_EQUALS(rho_group_bound, "none" ) ||
CCTK_EQUALS(rho_group_bound, "static") ||
Expand All @@ -57,7 +57,7 @@ extern "C" void Advect_SelectBoundConds(CCTK_ARGUMENTS)
if (CCTK_EQUALS(rho_group_bound, "radiative"))
{
/* select radiation boundary condition */
static CCTK_INT handle_rho_group_bound CCTK_ATTRIBUTE_UNUSED = -1;
static CCTK_INT handle_rho_group_bound CCTK_ATTRIBUTE_UNUSED = -1;
if (handle_rho_group_bound < 0) handle_rho_group_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE);
if (handle_rho_group_bound < 0) CCTK_WARN(0, "could not create table!");
if (Util_TableSetReal(handle_rho_group_bound , rho_group_bound_limit, "LIMIT") < 0)
Expand All @@ -76,7 +76,7 @@ extern "C" void Advect_SelectBoundConds(CCTK_ARGUMENTS)
if (CCTK_EQUALS(rho_bound, "radiative"))
{
/* select radiation boundary condition */
static CCTK_INT handle_rho_bound CCTK_ATTRIBUTE_UNUSED = -1;
static CCTK_INT handle_rho_bound CCTK_ATTRIBUTE_UNUSED = -1;
if (handle_rho_bound < 0) handle_rho_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE);
if (handle_rho_bound < 0) CCTK_WARN(0, "could not create table!");
if (Util_TableSetReal(handle_rho_bound , rho_bound_limit, "LIMIT") < 0)
Expand All @@ -95,7 +95,7 @@ extern "C" void Advect_SelectBoundConds(CCTK_ARGUMENTS)
if (CCTK_EQUALS(rho_group_bound, "scalar"))
{
/* select scalar boundary condition */
static CCTK_INT handle_rho_group_bound CCTK_ATTRIBUTE_UNUSED = -1;
static CCTK_INT handle_rho_group_bound CCTK_ATTRIBUTE_UNUSED = -1;
if (handle_rho_group_bound < 0) handle_rho_group_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE);
if (handle_rho_group_bound < 0) CCTK_WARN(0, "could not create table!");
if (Util_TableSetReal(handle_rho_group_bound ,rho_group_bound_scalar, "SCALAR") < 0)
Expand All @@ -112,7 +112,7 @@ extern "C" void Advect_SelectBoundConds(CCTK_ARGUMENTS)
if (CCTK_EQUALS(rho_bound, "scalar"))
{
/* select scalar boundary condition */
static CCTK_INT handle_rho_bound CCTK_ATTRIBUTE_UNUSED = -1;
static CCTK_INT handle_rho_bound CCTK_ATTRIBUTE_UNUSED = -1;
if (handle_rho_bound < 0) handle_rho_bound = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE);
if (handle_rho_bound < 0) CCTK_WARN(0, "could not create table!");
if (Util_TableSetReal(handle_rho_bound ,rho_bound_scalar, "SCALAR") < 0)
Expand Down

0 comments on commit 5c0bf77

Please sign in to comment.