aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/documentation.tex27
-rw-r--r--param.ccl15
-rw-r--r--schedule.ccl18
3 files changed, 54 insertions, 6 deletions
diff --git a/doc/documentation.tex b/doc/documentation.tex
index b8ca497..928c337 100644
--- a/doc/documentation.tex
+++ b/doc/documentation.tex
@@ -248,8 +248,31 @@ are using mesh refinement, and in particular {\tt Carpet}. With mesh
refinement it may be necessary to disable prolongation in intermediate
steps of MoL. This occurs when evolving systems containing second
spatial derivatives. This is done by default in MoL. If your system is
-purely first order in space and time you may wish to set this to {\tt
- "no"}.
+purely first order in space and time you may wish to set this to {\tt "no"}.
+
+Ideally, initial data thorns should always set initial data at all time
+levels. However, sometimes initial data thorns fail to do this. In
+this case you can do one of three things:
+\begin{itemize}
+\item Fix the initial data thorn. This is the best solution.
+\item If you're using Carpet, it has some facilities to take
+ forward/backward time steps to initialize multiple time
+ levels. See the Carpet parameters
+ \verb|init_each_timelevel| and
+ \verb|init_3_timelevels| for details.
+\item Finally, if you set (the MoL parameter) \verb|initial_data_is_crap|,
+ MoL will copy the current time level to all the past time
+ levels. \textbf{Note that this copies the \underline{same}
+ data to each past time level; this will be wrong if your
+ spacetime is time-dependent!}
+
+ If enabled, the copy happens in the \verb|CCTK_POSTINITIAL|
+ schedule bin. By default this happens \emph{before}
+ the \verb|MoL_PostStep| schedule group; the parameter
+ \verb|copy_ID_after_MoL_PostStep| can be used to change
+ this to \emph{after} \verb|MoL_PostStep|.
+\end{itemize}
+
\subsection{Thorn writers}
\label{CactusBase_MoL_sec:writeruse}
diff --git a/param.ccl b/param.ccl
index d9b6265..d18be54 100644
--- a/param.ccl
+++ b/param.ccl
@@ -116,6 +116,21 @@ BOOLEAN initial_data_is_crap "If the initial data routine fails to set up the pr
{
} "no"
+# If initial_data_is_crap is false, this parameter is ignored.
+# If initial_data_is_crap is true, this parameter controls *when*
+# in CCTK_POSTINITIAL we copy the initial data to previous time levels,
+# relative to our scheduling of MoL_PostStep.
+# false ==> copy *before* MoL_PostStep (default, matches old behavior)
+# true ==> copy *after* MoL_PostStep (may be preferable for new code)
+BOOLEAN copy_ID_after_MoL_PostStep \
+ "if initial_data_is_crap is true, *when* should we copy the \
+ current time level to all previous time levels: \
+ false ==> copy *before* MoL_PostStep (default, matches old behavior)\
+ true ==> copy *after* MoL_PostStep (maybe preferable for new code)"
+{
+} "no"
+
+
# The default for this parameter corresponds to generic RK2
STRING Generic_Method_Descriptor "A string used to create a table containing the description of the generic method"
{
diff --git a/schedule.ccl b/schedule.ccl
index ca5085e..55af153 100644
--- a/schedule.ccl
+++ b/schedule.ccl
@@ -130,10 +130,20 @@ schedule MoL_ReportNumberVariables AT Wragh AFTER MoL_Register
if (initial_data_is_crap)
{
- schedule MoL_FillAllLevels AT PostInitial
+ if (copy_ID_after_MoL_PostStep)
{
- LANG:C
- } "A bad routine. Fills all previous timelevels with data copied from the current."
+ schedule MoL_FillAllLevels AT PostInitial AFTER MoL_PostStep
+ {
+ LANG:C
+ } "A bad routine. Fills all previous timelevels with data copied from the current."
+ }
+ else
+ {
+ schedule MoL_FillAllLevels AT PostInitial BEFORE MoL_PostStep
+ {
+ LANG:C
+ } "A bad routine. Fills all previous timelevels with data copied from the current."
+ }
}
##########################################
@@ -569,7 +579,7 @@ schedule GROUP MoL_PostStep IN MoL_Step AFTER MoL_Add
{
} "The group for physics thorns to schedule boundary calls etc."
-schedule GROUP MoL_PostStep AT PostInitial AFTER MoL_FillAllLevels
+schedule GROUP MoL_PostStep AT PostInitial
{
} "Ensure that everything is correct after the initial data have been set up"