Skip to content

Commit

Permalink
TestDerivs: add unit test for finite difference, dissipation, upwind …
Browse files Browse the repository at this point in the history
…up to 8th order
  • Loading branch information
lwJi committed Sep 8, 2024
1 parent 7a8c17f commit 29834b0
Show file tree
Hide file tree
Showing 56 changed files with 3,028 additions and 69 deletions.
24 changes: 24 additions & 0 deletions TestDerivs/interface.ccl
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,27 @@ CCTK_REAL ddchi TYPE=gf CENTERING={VVV} TAGS='checkpoint="no"'
{
dxxchi dxychi dxzchi dyychi dyzchi dzzchi
} "2nd derivs of test grid function"

CCTK_REAL chi_diss TYPE=gf CENTERING={VVV} TAGS='checkpoint="no"' "dissipation term"

CCTK_REAL beta TYPE=gf CENTERING={VVV}
{
betax, betay, betaz
}"velocity function used for calculating upwind term"

CCTK_REAL chi_upwind TYPE=gf CENTERING={VVV} TAGS='checkpoint="no"' "upwind term"

CCTK_REAL dchi_error TYPE=gf CENTERING={VVV} TAGS='checkpoint="no"'
{
dxchi_error dychi_error dzchi_error
} "error of 1st derivs of test grid function"

CCTK_REAL ddchi_error TYPE=gf CENTERING={VVV} TAGS='checkpoint="no"'
{
dxxchi_error dxychi_error dxzchi_error dyychi_error dyzchi_error dzzchi_error
} "error of 2nd derivs of test grid function"

CCTK_REAL chi_diss_error TYPE=gf CENTERING={VVV} TAGS='checkpoint="no"' "error in dissipation term"

CCTK_REAL chi_upwind_error TYPE=gf CENTERING={VVV} TAGS='checkpoint="no"' "error in upwind term"

1 change: 1 addition & 0 deletions TestDerivs/param.ccl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ CCTK_INT deriv_order "Order of spatial finite differencing" STEERABLE=never
2 :: "Second order finite difference"
4 :: "Fourth order finite difference"
6 :: "Sixth order finite difference"
8 :: "Eighth order finite difference"
} 4

CCTK_REAL kxx "par for polynomial"
Expand Down
17 changes: 13 additions & 4 deletions TestDerivs/schedule.ccl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ SCHEDULE TestDerivs_Set AT initial
{
LANG: C
WRITES: chi(interior)
SYNC: chi
WRITES: beta(interior)
SYNC: chi beta
} "Set up test data"

SCHEDULE TestDerivs_Sync AT postregrid
Expand All @@ -27,7 +28,15 @@ SCHEDULE TestDerivs_Sync AT postregrid
SCHEDULE TestDerivs_CalcDerivs AT poststep
{
LANG: C
READS: chi(everywhere)
WRITES: dchi(interior) ddchi(interior)
SYNC: dchi ddchi
READS: chi(everywhere) beta(interior)
WRITES: dchi(interior) ddchi(interior) chi_diss(interior) chi_upwind(interior)
SYNC: dchi ddchi chi_diss chi_upwind
} "Calculate derivs"

SCHEDULE TestDerivs_CalcError AT poststep AFTER TestDerivs_CalcDerivs
{
LANG: C
READS: dchi(interior) ddchi(interior) chi_diss(interior) chi_upwind(interior)
WRITES: dchi_error(interior) ddchi_error(interior) chi_diss_error(interior) chi_upwind_error(interior)
SYNC: dchi_error ddchi_error chi_diss_error chi_upwind_error
} "Calculate derivs error"
Loading

0 comments on commit 29834b0

Please sign in to comment.