aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/documentation.tex1544
-rw-r--r--interface.ccl148
-rw-r--r--param.ccl51
-rw-r--r--schedule.ccl12
-rw-r--r--src/ChangeType.c125
-rw-r--r--src/Counter.c2
-rw-r--r--src/ExternalVariables.h37
-rw-r--r--src/GenericRK.c185
-rw-r--r--src/ICN.c56
-rw-r--r--src/IndexArrays.c178
-rw-r--r--src/InitialCopy.c211
-rw-r--r--src/ParamCheck.c2
-rw-r--r--src/RK2.c100
-rw-r--r--src/Registration.c1893
-rw-r--r--src/SandR.c17
-rw-r--r--src/SetTime.c2
-rw-r--r--src/Startup.c30
17 files changed, 4363 insertions, 230 deletions
diff --git a/doc/documentation.tex b/doc/documentation.tex
index d27c6ea..1b86f4b 100644
--- a/doc/documentation.tex
+++ b/doc/documentation.tex
@@ -280,8 +280,8 @@ to belong to the category with the highest priority.
MoL needs to know the total number of GFs in each category \textit{at
parameter time}. To do this, your thorn needs to use some
-accumulator parameters from MoL. As an example, here are the paramters
-from WaveMoL:
+accumulator parameters from MoL. As an example, here are the
+paramaters from WaveMoL:
\begin{verbatim}
shares: MethodOfLines
@@ -329,8 +329,8 @@ section~\ref{sec:molfns}.
These functions are provided using function aliasing. For details on
using function aliasing, see sections B10.5 and F2.2.3 of the
-UsersGuide. In this specific case, you simply add the following lines
-to your \texttt{interface.ccl}:
+UsersGuide. For the case of real GFs, you simply add the following
+lines to your \texttt{interface.ccl}:
\begin{verbatim}
##########################################
### PROTOTYPES - DELETE AS APPLICABLE! ###
@@ -364,6 +364,13 @@ USES FUNCTION MoLChangeToSaveAndRestore
USES FUNCTION MoLChangeToNone
\end{verbatim}
+Note that the list of paramters and functions is not complete; only
+the case of real GFs is covered. MoL will evolve complex GFs and real
+and complex grid arrays. For these cases the functions and parameters
+have different names but the use and interfaces are identical. See the
+section on parameters and the section on functions (\ref{sec:molfns})
+for the precise names.
+
Having done that, one routine (or group of routines) which we'll here
call {\tt Thorn\_CalcRHS} must be defined. This does all the finite
differencing that you'd usually do, applied to ${\bf q}$, and finds
@@ -512,198 +519,6 @@ variables back to the standard ADM variables in {\tt
ADM\_BSSN\_StandardVariables}, and also update the time derivative
of the lapse in {\tt ADM\_BSSN\_LapseChange}.
-% \section{The gory details}
-% \label{sec:gory}
-
-% This section is more for people wishing to maintain and extend the
-% code. {\bf NEEDS TOTAL REWRITE FOR MOL2}
-
-% There are three essential parts to the MoL thorn. The first is the
-% registration process where the MoL thorn is told just how many GFs it
-% should be looking to integrate, and where they and their RHSs
-% are. This is split into three separate routines.
-% \begin{itemize}
-% \item {\tt MoL\_Init\_Register} Called by the MoL thorn at {\tt
-% postinitial}. Initializes the number of variables to the maximum
-% possible number (given by {\tt CCTK\_NumVars()}). Sets up two arrays
-% of pointers to GFs (CCTK\_Real**), one for the data ({\tt qindex})
-% and one for the RHSs ({\tt qrhsindex}). It also sets up index arrays
-% for the primitive and dependent variables.
-% \item {\tt MoL\_Register} This group lets MoL knows where all the data
-% is and should contain all the user thorn calls to {\tt
-% MoL\_RegisterVar()}. This just associates the index of the
-% GFs to be evolved with their RHSs, and increments the number of
-% variables to be evolved. Also contains the routines to register the
-% primitive and dependent variables.
-% \item {\tt MoL\_End\_Register} This could be used to reallocate the
-% index arrays to the correct size. For the moment I've decided that
-% the tiny memory gain is outweighed by the possiblity of problems
-% using realloc.
-% \end{itemize}
-
-% The second part of the MoL thorn sets up all the scratch space and the
-% parameters for the generalized RK routines. This is also scheduled at
-% postinitial. This contains the routines
-
-% \begin{itemize}
-% \item {\tt MoL\_SetupScratch} Sets up the scratch space. Sets the
-% scalar {\tt mol\_num\_scratch} which is the size of the required
-% scratch space from the defaults, then allocates the scratch arrays.
-% \item {\tt MoL\_RKSetup} Sets up the $\alpha$ and $\beta$ arrays for
-% the generalized Runge Kutta step. Note that as we're currently only
-% storing the most recent RHS arrays the $\beta$ arrays are single
-% index only.
-% \end{itemize}
-
-% The final part of the MoL thorn is the evolution step. This is again
-% split into a number of separate routines and groups. Firstly we
-% describe a single evolution step, and what MoL expects.
-
-% By a single evolution step we here mean the execution of everything
-% inside the schedule bin {\tt EVOL}. MoL expects that every GF that it
-% knows about is allocated, initialized and lives at the same instant of
-% computational time. MoL also expects the ghost zones and boundaries to
-% be set correctly. Wherever possible the first two are checked. MoL
-% expects that the driver has rotated the timelevels so that the last
-% set of complete, consistent data is stored in ${\bf q}\_p$. MoL also
-% knows that the dependent variables may or may not have been evolved by
-% the time the MoL evolution group is executed.
-
-% \begin{figure}[ht]
-% \begin{center}
-% \includegraphics[width=3cm]{MoLdia1}
-% \includegraphics[width=3cm]{MoLdia2}
-% \includegraphics[width=3cm]{MoLdia3}
-% \end{center}
-% \caption{How MoL treats the three different types of variables. The
-% MoL step is performed at evolution after the driver has rotated the
-% timelevels, which occurs right at the start of every {\tt
-% CCTK\_EVOL} step. The physics thorns expect the most recent data
-% to be at the current time level (the top solid line). So the first
-% step for most types of variable is to copy or pointer switch the
-% data from the previous time level (bottom solid line) where the most
-% recent data exists after rotation. Figure (a) shows the {\it
-% evolved} variables. At each intermediate step the data is updated
-% into the current time level and, if necessary, stored in scratch
-% space. Figure (b) shows the {\it primitive} variables. As these are
-% set by the physics thorns into the current time level all that is
-% required is the initial copy. Figure (c) shows the {\it dependent}
-% variables for which we cannot know whether these variables are
-% evolved before or after MoL at evolution, and hence whether the
-% current data is already filled before MoL starts, we must store the
-% current data in scratch space first, then do the copy from the
-% previous level, and then at the end of the MoL step return the data
-% to the initial state.}
-% \label{MoLvariables}
-% \end{figure}
-
-% MoL plays around with the timelevels during the intermediate
-% steps. This is required so that the latest level in the MoL evolution
-% is always stored in the same place so that the user thorns can easily
-% access them. This place is the current time level ${\bf q}$. This
-% ensures that MoL works correctly with all the standard boundary
-% condition routines and minimizes the effort of porting non timelevel
-% aware thorns (I hope!).
-
-% An outline of the schedule is as follows:
-% \begin{equation}
-% \label{eq:schedoutline}
-% \begin{array}[l]{l}
-% \texttt{MoL\_StartStep} \\
-% \texttt{MoL\_Step WHILE counter \{} \\
-% \begin{array}[l]{l}
-% \texttt{MoL\_CalcRHS \{ \}} \\
-% \texttt{MoL\_Add} \\
-% \texttt{MoL\_PostStep \{ \}} \\
-% \end{array} \\
-% \texttt{\}} \\
-% \texttt{MoL\_EndStep \{ \}}
-% \end{array}
-% \end{equation}
-
-% Each different type of variable is treated slightly differently by
-% MoL. Each is assumed to have at least 2 timelevels (although this is
-% checked, a fatal error occurs otherwise). Before entering the loop
-% over the intermediate steps MoL will first copy (pointer switch?) the
-% data into the current time levels. Before doing this the current
-% timelevel of any {\it dependent} variables is copied to scratch space,
-% as it may have already been updated. During the loop over the
-% intermediate steps only the {\it evolved} variables are directly
-% altered by MoL. When all user thorns have given their right hand side
-% GFs the evolved variables are updated into the current time level.
-% This data may also be copied to scratch space if required for later.
-% The primitive variables are assumed to be set by the user thorn,
-% either in the calculation of the RHS or during {\tt MoL\_PostStep} at
-% the end of each intermediate step. The dependent variables are assumed
-% to remain completely unchanged. After all the intermediate steps the
-% data in the current and previous timelevels is ``correct'' and
-% consistent for the evolved and the temporary variables. The data for
-% the current timelevel for the dependent variables is recovered from
-% scratch space. Precisely how the different variables are
-% treated is shown in figure~\ref{MoLvariables}.
-
-% \begin{itemize}
-% \item {\tt MoL\_StartStep} This ensures that the integer keeping
-% track of where we are in the MoL step is set to the correct
-% value. It also copies the previous data ${\bf q}_p$ into the
-% current position ${\bf q}$ ready for the first step.
-% \item {\tt MoL\_Step} This is the main part of the thorn. The scheduler
-% allows us to loop over this group the correct number of times to
-% complete a single Cactus evolution step. Contained within this group
-% are:
-% \begin{itemize}
-% \item {\tt MoL\_CalcRHS} The schedule group within which the user
-% thorns will schedule their routines. These routines should
-% calculate the GFs ${\bf L}({\bf q})$. The order these routines are
-% scheduled within this group should not matter.
-% \item {\tt MoL\_Add} This step performs the time integration
-% depending on where in the MoL step we are. Updates directly into
-% the current GF and copies to the scratch space if required.
-% \item {\tt MoL\_PostStep} Another schedule group within which the
-% user thorns can schedule such things as primitive variable
-% recovery, boundary conditions, etc.
-% \item {\tt MoL\_End} Just alters the scalar tracking the position in
-% the MoL loop.
-% \end{itemize}
-% \end{itemize}
-
-% Finally, there are the routines {\tt MoL\_FreeScratch} and {\tt
-% MoL\_RKFree} which free up the memory that was explicitly taken. For
-% the moment these routines are scheduled at postevol.
-
-
-% \section{Adding new numerical integrators}
-% \label{sec:newmeth}
-
-% There are two obvious ways of adding new ODE integrators into MoL. The
-% first is to follow the route used in the efficient RK2 and ICN
-% methods. That is, you let the underlying infrastructure define the
-% scratch space but you do all the addition yourself. It's probably best
-% if you model your integrator on one of the efficient routines to start
-% with.
-
-% The alternative is to use the generic integrator. To use this you just
-% need to add the correct set of $\alpha$ and $\beta$ coefficients so
-% that the generic routine can perform the additions. You'll also have
-% to set up the keyword parameters and so on.
-
-% \section{To do list}
-% \label{sec:todo}
-
-% \begin{itemize}
-% \item The documentation must be improved, especially inside the code
-% itself.
-% \item Errors are currently not handled well (if at all). This must be
-% fixed.
-% \item A test suite is required. I'm not sure how to do this without
-% using WaveMoL, but we could try.
-% \item In order to make the code work with a Mesh Refinement driver,
-% the scratch spaces must be changed to be grid functions. This is
-% currently impossible, but Tom Goodale will add the appropriate bits
-% to the flesh to make it possible to do. At that point the entire
-% code will probably be rewritten.
-% \end{itemize}
-
\section{Functions provided by MoL}
\label{sec:molfns}
@@ -763,7 +578,7 @@ CCTK_INT ierr = MoLRegisterEvolved(CCTK_INT EvolvedIndex,
\begin{SeeAlsoSection}
\begin{SeeAlso}{CCTK\_VarIndex()}
- Get the GF index.
+ Get the variable index.
\end{SeeAlso}
\begin{SeeAlso}{MoLRegisterSaveAndRestore()}
Register Save and Restore variables.
@@ -836,7 +651,7 @@ CCTK_INT ierr = MoLRegisterConstrained(CCTK_INT ConstrainedIndex)
\begin{SeeAlsoSection}
\begin{SeeAlso}{CCTK\_VarIndex()}
- Get the GF index.
+ Get the variable index.
\end{SeeAlso}
\begin{SeeAlso}{MoLRegisterEvolved()}
Register evolved variables.
@@ -907,7 +722,7 @@ CCTK_INT ierr = MoLRegisterSaveAndRestore(CCTK_INT SandRIndex)
\begin{SeeAlsoSection}
\begin{SeeAlso}{CCTK\_VarIndex()}
- Get the GF index.
+ Get the variable index.
\end{SeeAlso}
\begin{SeeAlso}{MoLRegisterEvolved()}
Register evolved variables.
@@ -1015,7 +830,7 @@ ierr = MoLRegisterEvolvedGroup(EvolvedIndex, RHSIndex)
\begin{FunctionDescription}{MoLRegisterConstrainedGroup}
- \label{MoL-RegisterConstrainedGroup}
+ \label{MoLRegisterConstrainedGroup}
Tells MoL that the given group is in the constrained category.
@@ -1086,7 +901,7 @@ ierr = MoLRegisterConstrainedGroup(ConstrainedIndex)
\begin{FunctionDescription}{MoLRegisterSaveAndRestoreGroup}
- \label{MoL-RegisterSaveAndRestoreGroup}
+ \label{MoLRegisterSaveAndRestoreGroup}
Tells MoL that the given group is in the Save and Restore category.
@@ -1154,7 +969,7 @@ ierr = MoLRegisterSaveAndRestoreGroup(SandRIndex)
\begin{FunctionDescription}{MoLChangeToEvolved}
- \label{MoL-ChangeToEvolved}
+ \label{MoLChangeToEvolved}
Sets a GF to belong to the evolved category, with the associated
update GF. Not used for the initial setting.
@@ -1202,7 +1017,7 @@ CCTK_INT ierr = MoLChangeToEvolved(CCTK_INT EvolvedIndex,
\begin{SeeAlsoSection}
\begin{SeeAlso}{CCTK\_VarIndex()}
- Get the GF index.
+ Get the variable index.
\end{SeeAlso}
\begin{SeeAlso}{MoLRegisterEvolved()}
Register evolved variables.
@@ -1279,7 +1094,7 @@ CCTK_INT ierr = MoLChangeToConstrained(CCTK_INT EvolvedIndex)
\begin{SeeAlsoSection}
\begin{SeeAlso}{CCTK\_VarIndex()}
- Get the GF index.
+ Get the variable index.
\end{SeeAlso}
\begin{SeeAlso}{MoLRegisterConstrained()}
Register constrained variables.
@@ -1354,7 +1169,7 @@ CCTK_INT ierr = MoLChangeToSaveAndRestore(CCTK_INT SandRIndex)
\begin{SeeAlsoSection}
\begin{SeeAlso}{CCTK\_VarIndex()}
- Get the GF index.
+ Get the variable index.
\end{SeeAlso}
\begin{SeeAlso}{MoLRegisterSaveAndRestore()}
Register Save and Restore variables.
@@ -1429,7 +1244,7 @@ CCTK_INT ierr = MoLChangeToNone(CCTK_INT RemoveIndex)
\begin{SeeAlsoSection}
\begin{SeeAlso}{CCTK\_VarIndex()}
- Get the GF index.
+ Get the variable index.
\end{SeeAlso}
\begin{SeeAlso}{MoLChangeToEvolved()}
Change a variable at runtime to be evolved.
@@ -1458,6 +1273,1323 @@ ierr = MoLChangeToNone(RemoveIndex)
\end{FunctionDescription}
+
+
+\begin{FunctionDescription}{MoLRegisterEvolvedComplex}
+ \label{MoLRegisterEvolvedComplex}
+
+ Tells MoL that the given \textbf{complex} GF is in the evolved
+ category with the associated update \textbf{complex} GF.
+
+ \begin{SynopsisSection}
+ \begin{Synopsis}{C}
+\begin{verbatim}
+CCTK_INT ierr = MoLRegisterEvolvedComplex(CCTK_INT EvolvedIndex,
+ CCTK_INT RHSIndex)
+\end{verbatim}
+ \end{Synopsis}
+ \begin{Synopsis}{Fortran}
+\begin{verbatim}
+CCTK_INT ierr = MoLRegisterEvolvedComplex(CCTK_INT EvolvedIndex,
+ CCTK_INT RHSIndex)
+\end{verbatim}
+ \end{Synopsis}
+ \end{SynopsisSection}
+
+ \begin{ResultSection}
+ \begin{ResultNote}
+ Currently if there is an error, MoL will issue a level 0
+ warning. No sensible return codes exist.
+ \end{ResultNote}
+ \begin{Result}{\rm 0}
+ success
+ \end{Result}
+ \end{ResultSection}
+
+ \begin{ParameterSection}
+ \begin{Parameter}{EvolvedIndex}
+ Index of the GF to be evolved.
+ \end{Parameter}
+ \begin{Parameter}{RHSIndex}
+ Index of the associated update GF.
+ \end{Parameter}
+ \end{ParameterSection}
+
+ \begin{Discussion}
+ Should be called in a function scheduled in {\tt MoL\_Register}.
+ \end{Discussion}
+
+ \begin{SeeAlsoSection}
+ \begin{SeeAlso}{CCTK\_VarIndex()}
+ Get the variable index.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLRegisterSaveAndRestoreComplex()}
+ Register Save and Restore variables.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLRegisterConstrainedComplex()}
+ Register constrained variables.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLChangeToEvolvedComplex()}
+ Change a variable at runtime to be evolved.
+ \end{SeeAlso}
+ \end{SeeAlsoSection}
+
+ \begin{ExampleSection}
+ \begin{Example}{C}
+\begin{verbatim}
+ierr = MoLRegisterEvolvedComplex(CCTK_VarIndex("MyThorn::ComplexVar"),
+ CCTK_VarIndex("MyThorn::ComplexRHS"));
+\end{verbatim}
+ \end{Example}
+ \begin{Example}{Fortran}
+\begin{verbatim}
+call CCTK_VarIndex(EvolvedIndex, "MyThorn::ComplexVar")
+call CCTK_VarIndex(RHSIndex, "MyThorn::ComplexRHS")
+ierr = MoLRegisterEvolvedComplex(EvolvedIndex, RHSIndex)
+\end{verbatim}
+ \end{Example}
+ \end{ExampleSection}
+
+\end{FunctionDescription}
+
+
+
+\begin{FunctionDescription}{MoLRegisterConstrainedComplex}
+ \label{MoLRegisterConstrainedComplex}
+
+ Tells MoL that the given \textbf{complex} GF is in the constrained
+ category.
+
+ \begin{SynopsisSection}
+ \begin{Synopsis}{C}
+\begin{verbatim}
+CCTK_INT ierr = MoLRegisterConstrainedComplex(CCTK_INT ConstrainedIndex)
+\end{verbatim}
+ \end{Synopsis}
+ \begin{Synopsis}{Fortran}
+\begin{verbatim}
+CCTK_INT ierr = MoLRegisterConstrainedComplex(CCTK_INT ConstrainedIndex)
+\end{verbatim}
+ \end{Synopsis}
+ \end{SynopsisSection}
+
+ \begin{ResultSection}
+ \begin{ResultNote}
+ Currently if there is an error, MoL will issue a level 0
+ warning. No sensible return codes exist.
+ \end{ResultNote}
+ \begin{Result}{\rm 0}
+ success
+ \end{Result}
+ \end{ResultSection}
+
+ \begin{ParameterSection}
+ \begin{Parameter}{ConstrainedIndex}
+ Index of the constrained \textbf{complex} GF.
+ \end{Parameter}
+ \end{ParameterSection}
+
+ \begin{Discussion}
+ Should be called in a function scheduled in {\tt MoL\_Register}.
+ \end{Discussion}
+
+ \begin{SeeAlsoSection}
+ \begin{SeeAlso}{CCTK\_VarIndex()}
+ Get the variable index.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLRegisterEvolvedComplex()}
+ Register evolved variables.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLRegisterSaveAndRestoreComplex()}
+ Register Save and Restore variables.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLChangeToConstrainedComplex()}
+ Change a variable at runtime to be constrained.
+ \end{SeeAlso}
+ \end{SeeAlsoSection}
+
+ \begin{ExampleSection}
+ \begin{Example}{C}
+\begin{verbatim}
+ierr = MoLRegisterConstrainedComplex(CCTK_VarIndex("MyThorn::ComplexVar"));
+\end{verbatim}
+ \end{Example}
+ \begin{Example}{Fortran}
+\begin{verbatim}
+call CCTK_VarIndex(ConstrainedIndex, "MyThorn::ComplexVar")
+ierr = MoLRegisterConstrainedComplex(ConstrainedIndex)
+\end{verbatim}
+ \end{Example}
+ \end{ExampleSection}
+
+\end{FunctionDescription}
+
+
+
+\begin{FunctionDescription}{MoLRegisterSaveAndRestoreComplex}
+ \label{MoLRegisterSaveAndRestoreComplex}
+
+ Tells MoL that the given \textbf{complex} GF is in the Save and
+ Restore category.
+
+ \begin{SynopsisSection}
+ \begin{Synopsis}{C}
+\begin{verbatim}
+CCTK_INT ierr = MoLRegisterSaveAndRestoreComplex(CCTK_INT SandRIndex)
+\end{verbatim}
+ \end{Synopsis}
+ \begin{Synopsis}{Fortran}
+\begin{verbatim}
+CCTK_INT ierr = MoLRegisterSaveAndRestoreComplex(CCTK_INT SandRIndex)
+\end{verbatim}
+ \end{Synopsis}
+ \end{SynopsisSection}
+
+ \begin{ResultSection}
+ \begin{ResultNote}
+ Currently if there is an error, MoL will issue a level 0
+ warning. No sensible return codes exist.
+ \end{ResultNote}
+ \begin{Result}{\rm 0}
+ success
+ \end{Result}
+ \end{ResultSection}
+
+ \begin{ParameterSection}
+ \begin{Parameter}{SandRIndex}
+ Index of the Save and Restore \textbf{complex} GF.
+ \end{Parameter}
+ \end{ParameterSection}
+
+ \begin{Discussion}
+ Should be called in a function scheduled in {\tt MoL\_Register}.
+ \end{Discussion}
+
+ \begin{SeeAlsoSection}
+ \begin{SeeAlso}{CCTK\_VarIndex()}
+ Get the variable index.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLRegisterEvolvedComplex()}
+ Register evolved variables.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLRegisterConstrainedComplex()}
+ Register constrained variables.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLChangeToSaveAndRestoreComplex()}
+ Change a variable at runtime to be Save and Restore.
+ \end{SeeAlso}
+ \end{SeeAlsoSection}
+
+ \begin{ExampleSection}
+ \begin{Example}{C}
+\begin{verbatim}
+ierr = MoLRegisterSaveAndRestoreComplex(CCTK_VarIndex("MyThorn::ComplexVar"));
+\end{verbatim}
+ \end{Example}
+ \begin{Example}{Fortran}
+\begin{verbatim}
+call CCTK_VarIndex(SandRIndex, "MyThorn::ComplexVar")
+ierr = MoLRegisterSaveAndRestoreComplex(SandRIndex)
+\end{verbatim}
+ \end{Example}
+ \end{ExampleSection}
+
+\end{FunctionDescription}
+
+
+
+\begin{FunctionDescription}{MoLRegisterEvolvedComplexGroup}
+ \label{MoLRegisterEvolvedComplexGroup}
+
+ Tells MoL that the given \textbf{complex} group is in the evolved
+ category with the associated update group.
+
+ \begin{SynopsisSection}
+ \begin{Synopsis}{C}
+\begin{verbatim}
+CCTK_INT ierr = MoLRegisterEvolvedComplexGroup(CCTK_INT EvolvedIndex,
+ CCTK_INT RHSIndex)
+\end{verbatim}
+ \end{Synopsis}
+ \begin{Synopsis}{Fortran}
+\begin{verbatim}
+CCTK_INT ierr = MoLRegisterEvolvedComplexGroup(CCTK_INT EvolvedIndex,
+ CCTK_INT RHSIndex)
+\end{verbatim}
+ \end{Synopsis}
+ \end{SynopsisSection}
+
+ \begin{ResultSection}
+ \begin{ResultNote}
+ Currently if there is an error, MoL will issue a level 0
+ warning. No sensible return codes exist.
+ \end{ResultNote}
+ \begin{Result}{\rm 0}
+ success
+ \end{Result}
+ \end{ResultSection}
+
+ \begin{ParameterSection}
+ \begin{Parameter}{EvolvedIndex}
+ Index of the \textbf{complex} group to be evolved.
+ \end{Parameter}
+ \begin{Parameter}{RHSIndex}
+ Index of the associated update \textbf{complex} group.
+ \end{Parameter}
+ \end{ParameterSection}
+
+ \begin{Discussion}
+ Should be called in a function scheduled in {\tt MoL\_Register}.
+ \end{Discussion}
+
+ \begin{SeeAlsoSection}
+ \begin{SeeAlso}{CCTK\_GroupIndex()}
+ Get the group index.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLRegisterSaveAndRestoreComplexGroup()}
+ Register Save and Restore variables.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLRegisterConstrainedComplexGroup()}
+ Register constrained variables.
+ \end{SeeAlso}
+ \end{SeeAlsoSection}
+
+ \begin{ExampleSection}
+ \begin{Example}{C}
+\begin{verbatim}
+ierr = MoLRegisterEvolvedComplexGroup(CCTK_GroupIndex("MyThorn::ComplexVar"),
+ CCTK_GroupIndex("MyThorn::ComplexRHS"));
+\end{verbatim}
+ \end{Example}
+ \begin{Example}{Fortran}
+\begin{verbatim}
+call CCTK_GroupIndex(EvolvedIndex, "MyThorn::ComplexVar")
+call CCTK_GroupIndex(RHSIndex, "MyThorn::ComplexRHS")
+ierr = MoLRegisterEvolvedComplexGroup(EvolvedIndex, RHSIndex)
+\end{verbatim}
+ \end{Example}
+ \end{ExampleSection}
+
+\end{FunctionDescription}
+
+
+
+\begin{FunctionDescription}{MoLRegisterConstrainedComplexGroup}
+ \label{MoLRegisterConstrainedComplexGroup}
+
+ Tells MoL that the given \textbf{complex} group is in the
+ constrained category.
+
+ \begin{SynopsisSection}
+ \begin{Synopsis}{C}
+\begin{verbatim}
+CCTK_INT ierr = MoLRegisterConstrainedComplexGroup(CCTK_INT ConstrainedIndex)
+\end{verbatim}
+ \end{Synopsis}
+ \begin{Synopsis}{Fortran}
+\begin{verbatim}
+CCTK_INT ierr = MoLRegisterConstrainedComplexGroup(CCTK_INT ConstrainedIndex)
+\end{verbatim}
+ \end{Synopsis}
+ \end{SynopsisSection}
+
+ \begin{ResultSection}
+ \begin{ResultNote}
+ Currently if there is an error, MoL will issue a level 0
+ warning. No sensible return codes exist.
+ \end{ResultNote}
+ \begin{Result}{\rm 0}
+ success
+ \end{Result}
+ \end{ResultSection}
+
+ \begin{ParameterSection}
+ \begin{Parameter}{ConstrainedIndex}
+ Index of the constrained \textbf{complex} group.
+ \end{Parameter}
+ \end{ParameterSection}
+
+ \begin{Discussion}
+ Should be called in a function scheduled in {\tt MoL\_Register}.
+ \end{Discussion}
+
+ \begin{SeeAlsoSection}
+ \begin{SeeAlso}{CCTK\_GroupIndex()}
+ Get the group index.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLRegisterEvolvedComplexGroup()}
+ Register evolved variables.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLRegisterSaveAndRestoreComplexGroup()}
+ Register Save and Restore variables.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLChangeToConstrainedComplex()}
+ Change a variable at runtime to be constrained.
+ \end{SeeAlso}
+ \end{SeeAlsoSection}
+
+ \begin{ExampleSection}
+ \begin{Example}{C}
+\begin{verbatim}
+ierr = MoLRegisterConstrainedGroupComplex(CCTK_VarIndex("MyThorn::ComplexVar"));
+\end{verbatim}
+ \end{Example}
+ \begin{Example}{Fortran}
+\begin{verbatim}
+call CCTK_GroupIndex(ConstrainedIndex, "MyThorn::ComplexVar")
+ierr = MoLRegisterConstrainedComplexGroup(ConstrainedIndex)
+\end{verbatim}
+ \end{Example}
+ \end{ExampleSection}
+
+\end{FunctionDescription}
+
+
+
+\begin{FunctionDescription}{MoLRegisterSaveAndRestoreComplexGroup}
+ \label{MoLRegisterSaveAndRestoreComplexGroup}
+
+ Tells MoL that the given \textbf{complex} group is in the Save and
+ Restore category.
+
+ \begin{SynopsisSection}
+ \begin{Synopsis}{C}
+\begin{verbatim}
+CCTK_INT ierr = MoLRegisterSaveAndRestoreComplexGroup(CCTK_INT SandRIndex)
+\end{verbatim}
+ \end{Synopsis}
+ \begin{Synopsis}{Fortran}
+\begin{verbatim}
+CCTK_INT ierr = MoLRegisterSaveAndRestoreComplexGroup(CCTK_INT SandRIndex)
+\end{verbatim}
+ \end{Synopsis}
+ \end{SynopsisSection}
+
+ \begin{ResultSection}
+ \begin{ResultNote}
+ Currently if there is an error, MoL will issue a level 0
+ warning. No sensible return codes exist.
+ \end{ResultNote}
+ \begin{Result}{\rm 0}
+ success
+ \end{Result}
+ \end{ResultSection}
+
+ \begin{ParameterSection}
+ \begin{Parameter}{SandRIndex}
+ Index of the save and restore group.
+ \end{Parameter}
+ \end{ParameterSection}
+
+ \begin{Discussion}
+ Should be called in a function scheduled in {\tt MoL\_Register}.
+ \end{Discussion}
+
+ \begin{SeeAlsoSection}
+ \begin{SeeAlso}{CCTK\_GroupIndex()}
+ Get the group index.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLRegisterEvolvedComplexGroup()}
+ Register evolved variables.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLRegisterConstrainedComplexGroup()}
+ Register constrained variables.
+ \end{SeeAlso}
+ \end{SeeAlsoSection}
+
+ \begin{ExampleSection}
+ \begin{Example}{C}
+\begin{verbatim}
+ierr = MoLRegisterSaveAndRestoreComplexGroup(CCTK_GroupIndex("MyThorn::ComplexVar"));
+\end{verbatim}
+ \end{Example}
+ \begin{Example}{Fortran}
+\begin{verbatim}
+call CCTK_GroupIndex(SandRIndex, "MyThorn::ComplexVar")
+ierr = MoLRegisterSaveAndRestoreComplexGroup(SandRIndex)
+\end{verbatim}
+ \end{Example}
+ \end{ExampleSection}
+
+\end{FunctionDescription}
+
+
+\begin{FunctionDescription}{MoLRegisterEvolvedArray}
+ \label{MoLRegisterEvolvedArray}
+
+ Tells MoL that the given \textbf{array} GF is in the evolved
+ category with the associated update \textbf{array} GF.
+
+ \begin{SynopsisSection}
+ \begin{Synopsis}{C}
+\begin{verbatim}
+CCTK_INT ierr = MoLRegisterEvolvedArray(CCTK_INT EvolvedIndex,
+ CCTK_INT RHSIndex)
+\end{verbatim}
+ \end{Synopsis}
+ \begin{Synopsis}{Fortran}
+\begin{verbatim}
+CCTK_INT ierr = MoLRegisterEvolvedArray(CCTK_INT EvolvedIndex,
+ CCTK_INT RHSIndex)
+\end{verbatim}
+ \end{Synopsis}
+ \end{SynopsisSection}
+
+ \begin{ResultSection}
+ \begin{ResultNote}
+ Currently if there is an error, MoL will issue a level 0
+ warning. No sensible return codes exist.
+ \end{ResultNote}
+ \begin{Result}{\rm 0}
+ success
+ \end{Result}
+ \end{ResultSection}
+
+ \begin{ParameterSection}
+ \begin{Parameter}{EvolvedIndex}
+ Index of the \textbf{array} to be evolved.
+ \end{Parameter}
+ \begin{Parameter}{RHSIndex}
+ Index of the associated update \textbf{array}.
+ \end{Parameter}
+ \end{ParameterSection}
+
+ \begin{Discussion}
+ Should be called in a function scheduled in {\tt MoL\_Register}.
+ \end{Discussion}
+
+ \begin{SeeAlsoSection}
+ \begin{SeeAlso}{CCTK\_VarIndex()}
+ Get the variable index.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLRegisterSaveAndRestoreArray()}
+ Register Save and Restore variables.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLRegisterConstrainedArray()}
+ Register constrained variables.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLChangeToEvolvedArray()}
+ Change a variable at runtime to be evolved.
+ \end{SeeAlso}
+ \end{SeeAlsoSection}
+
+ \begin{ExampleSection}
+ \begin{Example}{C}
+\begin{verbatim}
+ierr = MoLRegisterEvolvedArray(CCTK_VarIndex("MyThorn::MyArray"),
+ CCTK_VarIndex("MyThorn::MyArray"));
+\end{verbatim}
+ \end{Example}
+ \begin{Example}{Fortran}
+\begin{verbatim}
+call CCTK_VarIndex(EvolvedIndex, "MyThorn::MyArray")
+call CCTK_VarIndex(RHSIndex, "MyThorn::MyArray")
+ierr = MoLRegisterEvolvedArray(EvolvedIndex, RHSIndex)
+\end{verbatim}
+ \end{Example}
+ \end{ExampleSection}
+
+\end{FunctionDescription}
+
+
+
+\begin{FunctionDescription}{MoLRegisterConstrainedArray}
+ \label{MoLRegisterConstrainedArray}
+
+ Tells MoL that the given \textbf{array} GF is in the constrained
+ category.
+
+ \begin{SynopsisSection}
+ \begin{Synopsis}{C}
+\begin{verbatim}
+CCTK_INT ierr = MoLRegisterConstrainedArray(CCTK_INT ConstrainedIndex)
+\end{verbatim}
+ \end{Synopsis}
+ \begin{Synopsis}{Fortran}
+\begin{verbatim}
+CCTK_INT ierr = MoLRegisterConstrainedArray(CCTK_INT ConstrainedIndex)
+\end{verbatim}
+ \end{Synopsis}
+ \end{SynopsisSection}
+
+ \begin{ResultSection}
+ \begin{ResultNote}
+ Currently if there is an error, MoL will issue a level 0
+ warning. No sensible return codes exist.
+ \end{ResultNote}
+ \begin{Result}{\rm 0}
+ success
+ \end{Result}
+ \end{ResultSection}
+
+ \begin{ParameterSection}
+ \begin{Parameter}{ConstrainedIndex}
+ Index of the constrained \textbf{array}.
+ \end{Parameter}
+ \end{ParameterSection}
+
+ \begin{Discussion}
+ Should be called in a function scheduled in {\tt MoL\_Register}.
+ \end{Discussion}
+
+ \begin{SeeAlsoSection}
+ \begin{SeeAlso}{CCTK\_VarIndex()}
+ Get the variable index.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLRegisterEvolvedArray()}
+ Register evolved variables.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLRegisterSaveAndRestoreArray()}
+ Register Save and Restore variables.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLChangeToConstrainedArray()}
+ Change a variable at runtime to be constrained.
+ \end{SeeAlso}
+ \end{SeeAlsoSection}
+
+ \begin{ExampleSection}
+ \begin{Example}{C}
+\begin{verbatim}
+ierr = MoLRegisterConstrainedArray(CCTK_VarIndex("MyThorn::MyArray"));
+\end{verbatim}
+ \end{Example}
+ \begin{Example}{Fortran}
+\begin{verbatim}
+call CCTK_VarIndex(ConstrainedIndex, "MyThorn::MyArray")
+ierr = MoLRegisterConstrainedArray(ConstrainedIndex)
+\end{verbatim}
+ \end{Example}
+ \end{ExampleSection}
+
+\end{FunctionDescription}
+
+
+
+\begin{FunctionDescription}{MoLRegisterSaveAndRestoreArray}
+ \label{MoLRegisterSaveAndRestoreArray}
+
+ Tells MoL that the given \textbf{array} GF is in the Save and
+ Restore category.
+
+ \begin{SynopsisSection}
+ \begin{Synopsis}{C}
+\begin{verbatim}
+CCTK_INT ierr = MoLRegisterSaveAndRestoreArray(CCTK_INT SandRIndex)
+\end{verbatim}
+ \end{Synopsis}
+ \begin{Synopsis}{Fortran}
+\begin{verbatim}
+CCTK_INT ierr = MoLRegisterSaveAndRestoreArray(CCTK_INT SandRIndex)
+\end{verbatim}
+ \end{Synopsis}
+ \end{SynopsisSection}
+
+ \begin{ResultSection}
+ \begin{ResultNote}
+ Currently if there is an error, MoL will issue a level 0
+ warning. No sensible return codes exist.
+ \end{ResultNote}
+ \begin{Result}{\rm 0}
+ success
+ \end{Result}
+ \end{ResultSection}
+
+ \begin{ParameterSection}
+ \begin{Parameter}{SandRIndex}
+ Index of the Save and Restore \textbf{array}.
+ \end{Parameter}
+ \end{ParameterSection}
+
+ \begin{Discussion}
+ Should be called in a function scheduled in {\tt MoL\_Register}.
+ \end{Discussion}
+
+ \begin{SeeAlsoSection}
+ \begin{SeeAlso}{CCTK\_VarIndex()}
+ Get the variable index.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLRegisterEvolvedArray()}
+ Register evolved variables.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLRegisterConstrainedArray()}
+ Register constrained variables.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLChangeToSaveAndRestoreArray()}
+ Change a variable at runtime to be Save and Restore.
+ \end{SeeAlso}
+ \end{SeeAlsoSection}
+
+ \begin{ExampleSection}
+ \begin{Example}{C}
+\begin{verbatim}
+ierr = MoLRegisterSaveAndRestoreArray(CCTK_VarIndex("MyThorn::MyArray"));
+\end{verbatim}
+ \end{Example}
+ \begin{Example}{Fortran}
+\begin{verbatim}
+call CCTK_VarIndex(SandRIndex, "MyThorn::MyArray")
+ierr = MoLRegisterSaveAndRestoreArray(SandRIndex)
+\end{verbatim}
+ \end{Example}
+ \end{ExampleSection}
+
+\end{FunctionDescription}
+
+
+
+\begin{FunctionDescription}{MoLRegisterEvolvedArrayGroup}
+ \label{MoLRegisterEvolvedArrayGroup}
+
+ Tells MoL that the given \textbf{array} group is in the evolved
+ category with the associated update group.
+
+ \begin{SynopsisSection}
+ \begin{Synopsis}{C}
+\begin{verbatim}
+CCTK_INT ierr = MoLRegisterEvolvedArrayGroup(CCTK_INT EvolvedIndex,
+ CCTK_INT RHSIndex)
+\end{verbatim}
+ \end{Synopsis}
+ \begin{Synopsis}{Fortran}
+\begin{verbatim}
+CCTK_INT ierr = MoLRegisterEvolvedArrayGroup(CCTK_INT EvolvedIndex,
+ CCTK_INT RHSIndex)
+\end{verbatim}
+ \end{Synopsis}
+ \end{SynopsisSection}
+
+ \begin{ResultSection}
+ \begin{ResultNote}
+ Currently if there is an error, MoL will issue a level 0
+ warning. No sensible return codes exist.
+ \end{ResultNote}
+ \begin{Result}{\rm 0}
+ success
+ \end{Result}
+ \end{ResultSection}
+
+ \begin{ParameterSection}
+ \begin{Parameter}{EvolvedIndex}
+ Index of the \textbf{array} group to be evolved.
+ \end{Parameter}
+ \begin{Parameter}{RHSIndex}
+ Index of the associated update \textbf{array} group.
+ \end{Parameter}
+ \end{ParameterSection}
+
+ \begin{Discussion}
+ Should be called in a function scheduled in {\tt MoL\_Register}.
+ \end{Discussion}
+
+ \begin{SeeAlsoSection}
+ \begin{SeeAlso}{CCTK\_GroupIndex()}
+ Get the group index.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLRegisterSaveAndRestoreArrayGroup()}
+ Register Save and Restore variables.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLRegisterConstrainedArrayGroup()}
+ Register constrained variables.
+ \end{SeeAlso}
+ \end{SeeAlsoSection}
+
+ \begin{ExampleSection}
+ \begin{Example}{C}
+\begin{verbatim}
+ierr = MoLRegisterEvolvedArrayGroup(CCTK_GroupIndex("MyThorn::MyArray"),
+ CCTK_GroupIndex("MyThorn::MyArrayRHS"));
+\end{verbatim}
+ \end{Example}
+ \begin{Example}{Fortran}
+\begin{verbatim}
+call CCTK_GroupIndex(EvolvedIndex, "MyThorn::MyArray")
+call CCTK_GroupIndex(RHSIndex, "MyThorn::MyArrayRHS")
+ierr = MoLRegisterEvolvedArrayGroup(EvolvedIndex, RHSIndex)
+\end{verbatim}
+ \end{Example}
+ \end{ExampleSection}
+
+\end{FunctionDescription}
+
+
+
+\begin{FunctionDescription}{MoLRegisterConstrainedArrayGroup}
+ \label{MoLRegisterConstrainedArrayGroup}
+
+ Tells MoL that the given \textbf{array} group is in the constrained
+ category.
+
+ \begin{SynopsisSection}
+ \begin{Synopsis}{C}
+\begin{verbatim}
+CCTK_INT ierr = MoLRegisterConstrainedArrayGroup(CCTK_INT ConstrainedIndex)
+\end{verbatim}
+ \end{Synopsis}
+ \begin{Synopsis}{Fortran}
+\begin{verbatim}
+CCTK_INT ierr = MoLRegisterConstrainedArrayGroup(CCTK_INT ConstrainedIndex)
+\end{verbatim}
+ \end{Synopsis}
+ \end{SynopsisSection}
+
+ \begin{ResultSection}
+ \begin{ResultNote}
+ Currently if there is an error, MoL will issue a level 0
+ warning. No sensible return codes exist.
+ \end{ResultNote}
+ \begin{Result}{\rm 0}
+ success
+ \end{Result}
+ \end{ResultSection}
+
+ \begin{ParameterSection}
+ \begin{Parameter}{ConstrainedIndex}
+ Index of the constrained \textbf{array} group.
+ \end{Parameter}
+ \end{ParameterSection}
+
+ \begin{Discussion}
+ Should be called in a function scheduled in {\tt MoL\_Register}.
+ \end{Discussion}
+
+ \begin{SeeAlsoSection}
+ \begin{SeeAlso}{CCTK\_GroupIndex()}
+ Get the group index.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLRegisterEvolvedArrayGroup()}
+ Register evolved variables.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLRegisterSaveAndRestoreArrayGroup()}
+ Register Save and Restore variables.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLChangeToConstrainedArray()}
+ Change a variable at runtime to be constrained.
+ \end{SeeAlso}
+ \end{SeeAlsoSection}
+
+ \begin{ExampleSection}
+ \begin{Example}{C}
+\begin{verbatim}
+ierr = MoLRegisterConstrainedGroupArray(CCTK_VarIndex("MyThorn::MyArray"));
+\end{verbatim}
+ \end{Example}
+ \begin{Example}{Fortran}
+\begin{verbatim}
+call CCTK_GroupIndex(ConstrainedIndex, "MyThorn::MyArray")
+ierr = MoLRegisterConstrainedArrayGroup(ConstrainedIndex)
+\end{verbatim}
+ \end{Example}
+ \end{ExampleSection}
+
+\end{FunctionDescription}
+
+
+
+\begin{FunctionDescription}{MoLRegisterSaveAndRestoreArrayGroup}
+ \label{MoLRegisterSaveAndRestoreArrayGroup}
+
+ Tells MoL that the given \textbf{array} group is in the Save and
+ Restore category.
+
+ \begin{SynopsisSection}
+ \begin{Synopsis}{C}
+\begin{verbatim}
+CCTK_INT ierr = MoLRegisterSaveAndRestoreArrayGroup(CCTK_INT SandRIndex)
+\end{verbatim}
+ \end{Synopsis}
+ \begin{Synopsis}{Fortran}
+\begin{verbatim}
+CCTK_INT ierr = MoLRegisterSaveAndRestoreArrayGroup(CCTK_INT SandRIndex)
+\end{verbatim}
+ \end{Synopsis}
+ \end{SynopsisSection}
+
+ \begin{ResultSection}
+ \begin{ResultNote}
+ Currently if there is an error, MoL will issue a level 0
+ warning. No sensible return codes exist.
+ \end{ResultNote}
+ \begin{Result}{\rm 0}
+ success
+ \end{Result}
+ \end{ResultSection}
+
+ \begin{ParameterSection}
+ \begin{Parameter}{SandRIndex}
+ Index of the save and restore group.
+ \end{Parameter}
+ \end{ParameterSection}
+
+ \begin{Discussion}
+ Should be called in a function scheduled in {\tt MoL\_Register}.
+ \end{Discussion}
+
+ \begin{SeeAlsoSection}
+ \begin{SeeAlso}{CCTK\_GroupIndex()}
+ Get the group index.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLRegisterEvolvedArrayGroup()}
+ Register evolved variables.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLRegisterConstrainedArrayGroup()}
+ Register constrained variables.
+ \end{SeeAlso}
+ \end{SeeAlsoSection}
+
+ \begin{ExampleSection}
+ \begin{Example}{C}
+\begin{verbatim}
+ierr = MoLRegisterSaveAndRestoreArrayGroup(CCTK_GroupIndex("MyThorn::MyArray"));
+\end{verbatim}
+ \end{Example}
+ \begin{Example}{Fortran}
+\begin{verbatim}
+call CCTK_GroupIndex(SandRIndex, "MyThorn::MyArray")
+ierr = MoLRegisterSaveAndRestoreArrayGroup(SandRIndex)
+\end{verbatim}
+ \end{Example}
+ \end{ExampleSection}
+
+\end{FunctionDescription}
+
+
+\begin{FunctionDescription}{MoLRegisterEvolvedComplexArray}
+ \label{MoLRegisterEvolvedComplexArray}
+
+ Tells MoL that the given \textbf{complex array} is in the evolved
+ category with the associated update \textbf{complex array}.
+
+ \begin{SynopsisSection}
+ \begin{Synopsis}{C}
+\begin{verbatim}
+CCTK_INT ierr = MoLRegisterEvolvedComplexArray(CCTK_INT EvolvedIndex,
+ CCTK_INT RHSIndex)
+\end{verbatim}
+ \end{Synopsis}
+ \begin{Synopsis}{Fortran}
+\begin{verbatim}
+CCTK_INT ierr = MoLRegisterEvolvedComplexArray(CCTK_INT EvolvedIndex,
+ CCTK_INT RHSIndex)
+\end{verbatim}
+ \end{Synopsis}
+ \end{SynopsisSection}
+
+ \begin{ResultSection}
+ \begin{ResultNote}
+ Currently if there is an error, MoL will issue a level 0
+ warning. No sensible return codes exist.
+ \end{ResultNote}
+ \begin{Result}{\rm 0}
+ success
+ \end{Result}
+ \end{ResultSection}
+
+ \begin{ParameterSection}
+ \begin{Parameter}{EvolvedIndex}
+ Index of the \textbf{complex array} to be evolved.
+ \end{Parameter}
+ \begin{Parameter}{RHSIndex}
+ Index of the associated update \textbf{complex array}.
+ \end{Parameter}
+ \end{ParameterSection}
+
+ \begin{Discussion}
+ Should be called in a function scheduled in {\tt MoL\_Register}.
+ \end{Discussion}
+
+ \begin{SeeAlsoSection}
+ \begin{SeeAlso}{CCTK\_VarIndex()}
+ Get the variable index.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLRegisterSaveAndRestoreComplexArray()}
+ Register Save and Restore variables.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLRegisterConstrainedComplexArray()}
+ Register constrained variables.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLChangeToEvolvedComplexArray()}
+ Change a variable at runtime to be evolved.
+ \end{SeeAlso}
+ \end{SeeAlsoSection}
+
+ \begin{ExampleSection}
+ \begin{Example}{C}
+\begin{verbatim}
+ierr = MoLRegisterEvolvedComplexArray(CCTK_VarIndex("MyThorn::MyComplexArray"),
+ CCTK_VarIndex("MyThorn::MyComplexArrayRHS"));
+\end{verbatim}
+ \end{Example}
+ \begin{Example}{Fortran}
+\begin{verbatim}
+call CCTK_VarIndex(EvolvedIndex, "MyThorn::MyComplexArray")
+call CCTK_VarIndex(RHSIndex, "MyThorn::MyComplexArrayRHS")
+ierr = MoLRegisterEvolvedComplexArray(EvolvedIndex, RHSIndex)
+\end{verbatim}
+ \end{Example}
+ \end{ExampleSection}
+
+\end{FunctionDescription}
+
+
+
+\begin{FunctionDescription}{MoLRegisterConstrainedComplexArray}
+ \label{MoLRegisterConstrainedComplexArray}
+
+ Tells MoL that the given \textbf{complex array} is in the
+ constrained category.
+
+ \begin{SynopsisSection}
+ \begin{Synopsis}{C}
+\begin{verbatim}
+CCTK_INT ierr = MoLRegisterConstrainedComplexArray(CCTK_INT ConstrainedIndex)
+\end{verbatim}
+ \end{Synopsis}
+ \begin{Synopsis}{Fortran}
+\begin{verbatim}
+CCTK_INT ierr = MoLRegisterConstrainedComplexArray(CCTK_INT ConstrainedIndex)
+\end{verbatim}
+ \end{Synopsis}
+ \end{SynopsisSection}
+
+ \begin{ResultSection}
+ \begin{ResultNote}
+ Currently if there is an error, MoL will issue a level 0
+ warning. No sensible return codes exist.
+ \end{ResultNote}
+ \begin{Result}{\rm 0}
+ success
+ \end{Result}
+ \end{ResultSection}
+
+ \begin{ParameterSection}
+ \begin{Parameter}{ConstrainedIndex}
+ Index of the constrained \textbf{complex array}.
+ \end{Parameter}
+ \end{ParameterSection}
+
+ \begin{Discussion}
+ Should be called in a function scheduled in {\tt MoL\_Register}.
+ \end{Discussion}
+
+ \begin{SeeAlsoSection}
+ \begin{SeeAlso}{CCTK\_VarIndex()}
+ Get the variable index.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLRegisterEvolvedComplexArray()}
+ Register evolved variables.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLRegisterSaveAndRestoreComplexArray()}
+ Register Save and Restore variables.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLChangeToConstrainedComplexArray()}
+ Change a variable at runtime to be constrained.
+ \end{SeeAlso}
+ \end{SeeAlsoSection}
+
+ \begin{ExampleSection}
+ \begin{Example}{C}
+\begin{verbatim}
+ierr = MoLRegisterConstrainedComplexArray(CCTK_VarIndex("MyThorn::MyComplexArray"));
+\end{verbatim}
+ \end{Example}
+ \begin{Example}{Fortran}
+\begin{verbatim}
+call CCTK_VarIndex(ConstrainedIndex, "MyThorn::MyComplexArray")
+ierr = MoLRegisterConstrainedComplexArray(ConstrainedIndex)
+\end{verbatim}
+ \end{Example}
+ \end{ExampleSection}
+
+\end{FunctionDescription}
+
+
+
+\begin{FunctionDescription}{MoLRegisterSaveAndRestoreComplexArray}
+ \label{MoLRegisterSaveAndRestoreComplexArray}
+
+ Tells MoL that the given \textbf{complex array} is in the Save and
+ Restore category.
+
+ \begin{SynopsisSection}
+ \begin{Synopsis}{C}
+\begin{verbatim}
+CCTK_INT ierr = MoLRegisterSaveAndRestoreComplexArray(CCTK_INT SandRIndex)
+\end{verbatim}
+ \end{Synopsis}
+ \begin{Synopsis}{Fortran}
+\begin{verbatim}
+CCTK_INT ierr = MoLRegisterSaveAndRestoreComplexArray(CCTK_INT SandRIndex)
+\end{verbatim}
+ \end{Synopsis}
+ \end{SynopsisSection}
+
+ \begin{ResultSection}
+ \begin{ResultNote}
+ Currently if there is an error, MoL will issue a level 0
+ warning. No sensible return codes exist.
+ \end{ResultNote}
+ \begin{Result}{\rm 0}
+ success
+ \end{Result}
+ \end{ResultSection}
+
+ \begin{ParameterSection}
+ \begin{Parameter}{SandRIndex}
+ Index of the Save and Restore \textbf{complex array}.
+ \end{Parameter}
+ \end{ParameterSection}
+
+ \begin{Discussion}
+ Should be called in a function scheduled in {\tt MoL\_Register}.
+ \end{Discussion}
+
+ \begin{SeeAlsoSection}
+ \begin{SeeAlso}{CCTK\_VarIndex()}
+ Get the variable index.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLRegisterEvolvedComplexArray()}
+ Register evolved variables.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLRegisterConstrainedComplexArray()}
+ Register constrained variables.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLChangeToSaveAndRestoreComplexArray()}
+ Change a variable at runtime to be Save and Restore.
+ \end{SeeAlso}
+ \end{SeeAlsoSection}
+
+ \begin{ExampleSection}
+ \begin{Example}{C}
+\begin{verbatim}
+ierr = MoLRegisterSaveAndRestoreComplexArray(CCTK_VarIndex("MyThorn::MyComplexArray"));
+\end{verbatim}
+ \end{Example}
+ \begin{Example}{Fortran}
+\begin{verbatim}
+call CCTK_VarIndex(SandRIndex, "MyThorn::MyComplexArray")
+ierr = MoLRegisterSaveAndRestoreComplexArray(SandRIndex)
+\end{verbatim}
+ \end{Example}
+ \end{ExampleSection}
+
+\end{FunctionDescription}
+
+
+
+\begin{FunctionDescription}{MoLRegisterEvolvedComplexArrayGroup}
+ \label{MoLRegisterEvolvedComplexArrayGroup}
+
+ Tells MoL that the given \textbf{complex array} group is in the
+ evolved category with the associated update group.
+
+ \begin{SynopsisSection}
+ \begin{Synopsis}{C}
+\begin{verbatim}
+CCTK_INT ierr = MoLRegisterEvolvedComplexArrayGroup(CCTK_INT EvolvedIndex,
+ CCTK_INT RHSIndex)
+\end{verbatim}
+ \end{Synopsis}
+ \begin{Synopsis}{Fortran}
+\begin{verbatim}
+CCTK_INT ierr = MoLRegisterEvolvedComplexArrayGroup(CCTK_INT EvolvedIndex,
+ CCTK_INT RHSIndex)
+\end{verbatim}
+ \end{Synopsis}
+ \end{SynopsisSection}
+
+ \begin{ResultSection}
+ \begin{ResultNote}
+ Currently if there is an error, MoL will issue a level 0
+ warning. No sensible return codes exist.
+ \end{ResultNote}
+ \begin{Result}{\rm 0}
+ success
+ \end{Result}
+ \end{ResultSection}
+
+ \begin{ParameterSection}
+ \begin{Parameter}{EvolvedIndex}
+ Index of the \textbf{complex array} group to be evolved.
+ \end{Parameter}
+ \begin{Parameter}{RHSIndex}
+ Index of the associated update \textbf{complex array} group.
+ \end{Parameter}
+ \end{ParameterSection}
+
+ \begin{Discussion}
+ Should be called in a function scheduled in {\tt MoL\_Register}.
+ \end{Discussion}
+
+ \begin{SeeAlsoSection}
+ \begin{SeeAlso}{CCTK\_GroupIndex()}
+ Get the group index.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLRegisterSaveAndRestoreComplexArrayGroup()}
+ Register Save and Restore variables.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLRegisterConstrainedComplexArrayGroup()}
+ Register constrained variables.
+ \end{SeeAlso}
+ \end{SeeAlsoSection}
+
+ \begin{ExampleSection}
+ \begin{Example}{C}
+\begin{verbatim}
+ierr = MoLRegisterEvolvedComplexArrayGroup(CCTK_GroupIndex("MyThorn::MyComplexArray"),
+ CCTK_GroupIndex("MyThorn::MyComplexArrayRHS"));
+\end{verbatim}
+ \end{Example}
+ \begin{Example}{Fortran}
+\begin{verbatim}
+call CCTK_GroupIndex(EvolvedIndex, "MyThorn::MyComplexArray")
+call CCTK_GroupIndex(RHSIndex, "MyThorn::MyComplexArrayRHS")
+ierr = MoLRegisterEvolvedComplexArrayGroup(EvolvedIndex, RHSIndex)
+\end{verbatim}
+ \end{Example}
+ \end{ExampleSection}
+
+\end{FunctionDescription}
+
+
+
+\begin{FunctionDescription}{MoLRegisterConstrainedComplexArrayGroup}
+ \label{MoLRegisterConstrainedComplexArrayGroup}
+
+ Tells MoL that the given \textbf{complex array} group is in the constrained category.
+
+ \begin{SynopsisSection}
+ \begin{Synopsis}{C}
+\begin{verbatim}
+CCTK_INT ierr = MoLRegisterConstrainedComplexArrayGroup(CCTK_INT ConstrainedIndex)
+\end{verbatim}
+ \end{Synopsis}
+ \begin{Synopsis}{Fortran}
+\begin{verbatim}
+CCTK_INT ierr = MoLRegisterConstrainedComplexArrayGroup(CCTK_INT ConstrainedIndex)
+\end{verbatim}
+ \end{Synopsis}
+ \end{SynopsisSection}
+
+ \begin{ResultSection}
+ \begin{ResultNote}
+ Currently if there is an error, MoL will issue a level 0
+ warning. No sensible return codes exist.
+ \end{ResultNote}
+ \begin{Result}{\rm 0}
+ success
+ \end{Result}
+ \end{ResultSection}
+
+ \begin{ParameterSection}
+ \begin{Parameter}{ConstrainedIndex}
+ Index of the constrained \textbf{complex array} group.
+ \end{Parameter}
+ \end{ParameterSection}
+
+ \begin{Discussion}
+ Should be called in a function scheduled in {\tt MoL\_Register}.
+ \end{Discussion}
+
+ \begin{SeeAlsoSection}
+ \begin{SeeAlso}{CCTK\_GroupIndex()}
+ Get the group index.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLRegisterEvolvedComplexArrayGroup()}
+ Register evolved variables.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLRegisterSaveAndRestoreComplexArrayGroup()}
+ Register Save and Restore variables.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLChangeToConstrainedComplexArray()}
+ Change a variable at runtime to be constrained.
+ \end{SeeAlso}
+ \end{SeeAlsoSection}
+
+ \begin{ExampleSection}
+ \begin{Example}{C}
+\begin{verbatim}
+ierr = MoLRegisterConstrainedGroupComplexArray(CCTK_VarIndex("MyThorn::MyComplexArray"));
+\end{verbatim}
+ \end{Example}
+ \begin{Example}{Fortran}
+\begin{verbatim}
+call CCTK_GroupIndex(ConstrainedIndex, "MyThorn::MyComplexArray")
+ierr = MoLRegisterConstrainedComplexArrayGroup(ConstrainedIndex)
+\end{verbatim}
+ \end{Example}
+ \end{ExampleSection}
+
+\end{FunctionDescription}
+
+
+
+\begin{FunctionDescription}{MoLRegisterSaveAndRestoreComplexArrayGroup}
+ \label{MoLRegisterSaveAndRestoreComplexArrayGroup}
+
+ Tells MoL that the given \textbf{complex array} group is in the Save
+ and Restore category.
+
+ \begin{SynopsisSection}
+ \begin{Synopsis}{C}
+\begin{verbatim}
+CCTK_INT ierr = MoLRegisterSaveAndRestoreComplexArrayGroup(CCTK_INT SandRIndex)
+\end{verbatim}
+ \end{Synopsis}
+ \begin{Synopsis}{Fortran}
+\begin{verbatim}
+CCTK_INT ierr = MoLRegisterSaveAndRestoreComplexArrayGroup(CCTK_INT SandRIndex)
+\end{verbatim}
+ \end{Synopsis}
+ \end{SynopsisSection}
+
+ \begin{ResultSection}
+ \begin{ResultNote}
+ Currently if there is an error, MoL will issue a level 0
+ warning. No sensible return codes exist.
+ \end{ResultNote}
+ \begin{Result}{\rm 0}
+ success
+ \end{Result}
+ \end{ResultSection}
+
+ \begin{ParameterSection}
+ \begin{Parameter}{SandRIndex}
+ Index of the save and restore group.
+ \end{Parameter}
+ \end{ParameterSection}
+
+ \begin{Discussion}
+ Should be called in a function scheduled in {\tt MoL\_Register}.
+ \end{Discussion}
+
+ \begin{SeeAlsoSection}
+ \begin{SeeAlso}{CCTK\_GroupIndex()}
+ Get the group index.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLRegisterEvolvedComplexArrayGroup()}
+ Register evolved variables.
+ \end{SeeAlso}
+ \begin{SeeAlso}{MoLRegisterConstrainedComplexArrayGroup()}
+ Register constrained variables.
+ \end{SeeAlso}
+ \end{SeeAlsoSection}
+
+ \begin{ExampleSection}
+ \begin{Example}{C}
+\begin{verbatim}
+ierr = MoLRegisterSaveAndRestoreComplexArrayGroup(CCTK_GroupIndex("MyThorn::MyComplexArray"));
+\end{verbatim}
+ \end{Example}
+ \begin{Example}{Fortran}
+\begin{verbatim}
+call CCTK_GroupIndex(SandRIndex, "MyThorn::MyComplexArray")
+ierr = MoLRegisterSaveAndRestoreComplexArrayGroup(SandRIndex)
+\end{verbatim}
+ \end{Example}
+ \end{ExampleSection}
+
+\end{FunctionDescription}
+
\begin{thebibliography}{9}
\bibitem{AlphaThorns_MoL_Thornburg93}
diff --git a/interface.ccl b/interface.ccl
index 46d3a96..36758a6 100644
--- a/interface.ccl
+++ b/interface.ccl
@@ -5,9 +5,15 @@ implements: MethodOfLines
inherits: nanchecker
-INCLUDE HEADER: MoLFunctions.h IN MoLFunctions.h
-INCLUDE HEADER: MoL.h IN MoL.h
+#INCLUDE HEADER: MoLFunctions.h IN MoLFunctions.h
+#INCLUDE HEADER: MoL.h IN MoL.h
USES INCLUDE: NaNChecker.h
+
+################################################################
+### Aliased registration and type changing functions for the ###
+### standard (i.e., real) GFs. ###
+################################################################
+
CCTK_INT FUNCTION MoLRegisterEvolved(CCTK_INT IN EvolvedIndex, \
CCTK_INT IN RHSIndex)
CCTK_INT FUNCTION MoLRegisterConstrained(CCTK_INT IN ConstrainedIndex)
@@ -40,6 +46,132 @@ PROVIDES FUNCTION MoLChangeToSaveAndRestore WITH MoL_ChangeToSaveAndRestore \
LANGUAGE C
PROVIDES FUNCTION MoLChangeToNone WITH MoL_ChangeToNone LANGUAGE C
+################################################################
+### Aliased registration and type changing functions for the ###
+### complex GFs. ###
+################################################################
+
+# CCTK_INT FUNCTION MoLRegisterEvolvedComplex(CCTK_INT IN EvolvedIndex, \
+# CCTK_INT IN RHSIndex)
+# CCTK_INT FUNCTION MoLRegisterConstrainedComplex(CCTK_INT IN ConstrainedIndex)
+# CCTK_INT FUNCTION MoLRegisterSaveAndRestoreComplex(CCTK_INT IN SandRIndex)
+# CCTK_INT FUNCTION MoLRegisterEvolvedComplexGroup(CCTK_INT IN EvolvedIndex, \
+# CCTK_INT IN RHSIndex)
+# CCTK_INT FUNCTION MoLRegisterConstrainedComplexGroup(CCTK_INT IN \
+# ConstrainedIndex)
+# CCTK_INT FUNCTION MoLRegisterSaveAndRestoreComplexGroup(CCTK_INT IN SandRIndex)
+# CCTK_INT FUNCTION MoLChangeToEvolvedComplex(CCTK_INT IN EvolvedIndex, \
+# CCTK_INT IN RHSIndex)
+# CCTK_INT FUNCTION MoLChangeToConstrainedComplex(CCTK_INT IN ConstrainedIndex)
+# CCTK_INT FUNCTION MoLChangeToSaveAndRestoreComplex(CCTK_INT IN SandRIndex)
+# CCTK_INT FUNCTION MoLChangeToNoneComplex(CCTK_INT IN RemoveIndex)
+#
+# PROVIDES FUNCTION MoLRegisterEvolvedComplex WITH MoL_RegisterEvolvedComplex \
+# LANGUAGE C
+# PROVIDES FUNCTION MoLRegisterConstrainedComplex WITH \
+# MoL_RegisterConstrainedComplex LANGUAGE C
+# PROVIDES FUNCTION MoLRegisterSaveAndRestoreComplex WITH \
+# MoL_RegisterSaveAndRestoreComplex LANGUAGE C
+# PROVIDES FUNCTION MoLRegisterEvolvedComplexGroup WITH \
+# MoL_RegisterEvolvedComplexGroup LANGUAGE C
+# PROVIDES FUNCTION MoLRegisterConstrainedComplexGroup WITH \
+# MoL_RegisterConstrainedComplexGroup LANGUAGE C
+# PROVIDES FUNCTION MoLRegisterSaveAndRestoreComplexGroup WITH \
+# MoL_RegisterSaveAndRestoreComplexGroup LANGUAGE C
+# PROVIDES FUNCTION MoLChangeToEvolvedComplex WITH \
+# MoL_ChangeToEvolvedComplex LANGUAGE C
+# PROVIDES FUNCTION MoLChangeToConstrainedComplex WITH \
+# MoL_ChangeToConstrainedComplex LANGUAGE C
+# PROVIDES FUNCTION MoLChangeToSaveAndRestoreComplex WITH \
+# MoL_ChangeToSaveAndRestoreComplex LANGUAGE C
+# PROVIDES FUNCTION MoLChangeToNoneComplex WITH MoL_ChangeToNoneComplex \
+# LANGUAGE C
+
+################################################################
+### Aliased registration and type changing function for real ###
+### grid arrays of all dimensions. ###
+################################################################
+
+# CCTK_INT FUNCTION MoLRegisterEvolvedArray(CCTK_INT IN EvolvedIndex, \
+# CCTK_INT IN RHSIndex)
+# CCTK_INT FUNCTION MoLRegisterConstrainedArray(CCTK_INT IN ConstrainedIndex)
+# CCTK_INT FUNCTION MoLRegisterSaveAndRestoreArray(CCTK_INT IN SandRIndex)
+# CCTK_INT FUNCTION MoLRegisterEvolvedArrayGroup(CCTK_INT IN EvolvedIndex, \
+# CCTK_INT IN RHSIndex)
+# CCTK_INT FUNCTION MoLRegisterConstrainedArrayGroup(CCTK_INT IN \
+# ConstrainedIndex)
+# CCTK_INT FUNCTION MoLRegisterSaveAndRestoreArrayGroup(CCTK_INT IN SandRIndex)
+# CCTK_INT FUNCTION MoLChangeToEvolvedArray(CCTK_INT IN EvolvedIndex, \
+# CCTK_INT IN RHSIndex)
+# CCTK_INT FUNCTION MoLChangeToConstrainedArray(CCTK_INT IN ConstrainedIndex)
+# CCTK_INT FUNCTION MoLChangeToSaveAndRestoreArray(CCTK_INT IN SandRIndex)
+# CCTK_INT FUNCTION MoLChangeToNoneArray(CCTK_INT IN RemoveIndex)
+#
+# PROVIDES FUNCTION MoLRegisterEvolvedArray WITH MoL_RegisterEvolvedArray \
+# LANGUAGE C
+# PROVIDES FUNCTION MoLRegisterConstrainedArray WITH \
+# MoL_RegisterConstrainedArray LANGUAGE C
+# PROVIDES FUNCTION MoLRegisterSaveAndRestoreArray WITH \
+# MoL_RegisterSaveAndRestoreArray LANGUAGE C
+# PROVIDES FUNCTION MoLRegisterEvolvedArrayGroup WITH \
+# MoL_RegisterEvolvedArrayGroup LANGUAGE C
+# PROVIDES FUNCTION MoLRegisterConstrainedArrayGroup WITH \
+# MoL_RegisterConstrainedArrayGroup LANGUAGE C
+# PROVIDES FUNCTION MoLRegisterSaveAndRestoreArrayGroup WITH \
+# MoL_RegisterSaveAndRestoreArrayGroup LANGUAGE C
+# PROVIDES FUNCTION MoLChangeToEvolvedArray WITH MoL_ChangeToEvolvedArray \
+# LANGUAGE C
+# PROVIDES FUNCTION MoLChangeToConstrainedArray WITH \
+# MoL_ChangeToConstrainedArray LANGUAGE C
+# PROVIDES FUNCTION MoLChangeToSaveAndRestoreArray WITH \
+# MoL_ChangeToSaveAndRestoreArray LANGUAGE C
+# PROVIDES FUNCTION MoLChangeToNoneArray WITH MoL_ChangeToNoneArray LANGUAGE C
+
+###################################################################
+### Aliased registration and type changing function for complex ###
+### grid arrays of all dimensions. ###
+###################################################################
+
+# CCTK_INT FUNCTION MoLRegisterEvolvedComplexArray(CCTK_INT IN EvolvedIndex, \
+# CCTK_INT IN RHSIndex)
+# CCTK_INT FUNCTION MoLRegisterConstrainedComplexArray(CCTK_INT IN \
+# ConstrainedIndex)
+# CCTK_INT FUNCTION MoLRegisterSaveAndRestoreComplexArray(CCTK_INT IN SandRIndex)
+# CCTK_INT FUNCTION MoLRegisterEvolvedComplexArrayGroup(CCTK_INT IN \
+# EvolvedIndex, \
+# CCTK_INT IN RHSIndex)
+# CCTK_INT FUNCTION MoLRegisterConstrainedComplexArrayGroup(CCTK_INT IN \
+# ConstrainedIndex)
+# CCTK_INT FUNCTION MoLRegisterSaveAndRestoreComplexArrayGroup(CCTK_INT IN \
+# SandRIndex)
+# CCTK_INT FUNCTION MoLChangeToEvolvedComplexArray(CCTK_INT IN EvolvedIndex, \
+# CCTK_INT IN RHSIndex)
+# CCTK_INT FUNCTION MoLChangeToConstrainedComplexArray(CCTK_INT IN \
+# ConstrainedIndex)
+# CCTK_INT FUNCTION MoLChangeToSaveAndRestoreComplexArray(CCTK_INT IN SandRIndex)
+# CCTK_INT FUNCTION MoLChangeToNoneComplexArray(CCTK_INT IN RemoveIndex)
+#
+# PROVIDES FUNCTION MoLRegisterEvolvedComplexArray WITH \
+# MoL_RegisterEvolvedComplexArray LANGUAGE C
+# PROVIDES FUNCTION MoLRegisterConstrainedComplexArray WITH \
+# MoL_RegisterConstrainedComplexArray LANGUAGE C
+# PROVIDES FUNCTION MoLRegisterSaveAndRestoreComplexArray WITH \
+# MoL_RegisterSaveAndRestoreComplexArray LANGUAGE C
+# PROVIDES FUNCTION MoLRegisterEvolvedComplexArrayGroup WITH \
+# MoL_RegisterEvolvedComplexArrayGroup LANGUAGE C
+# PROVIDES FUNCTION MoLRegisterConstrainedComplexArrayGroup WITH \
+# MoL_RegisterConstrainedComplexArrayGroup LANGUAGE C
+# PROVIDES FUNCTION MoLRegisterSaveAndRestoreComplexArrayGroup WITH \
+# MoL_RegisterSaveAndRestoreComplexArrayGroup LANGUAGE C
+# PROVIDES FUNCTION MoLChangeToEvolvedComplexArray WITH \
+# MoL_ChangeToEvolvedComplexArray LANGUAGE C
+# PROVIDES FUNCTION MoLChangeToConstrainedComplexArray WITH \
+# MoL_ChangeToConstrainedComplexArray LANGUAGE C
+# PROVIDES FUNCTION MoLChangeToSaveAndRestoreComplexArray WITH \
+# MoL_ChangeToSaveAndRestoreComplexArray LANGUAGE C
+# PROVIDES FUNCTION MoLChangeToNoneComplexArray WITH \
+# MoL_ChangeToNoneComplexArray LANGUAGE C
+
private:
CCTK_REAL RKAlphaCoefficients TYPE=ARRAY DIM=2 SIZE=MoL_Intermediate_Steps,MoL_Num_Scratch_Levels+1 DISTRIB=CONSTANT
@@ -70,3 +202,15 @@ CCTK_REAL ScratchSpace[MoL_Num_Evolved_Vars*MoL_Num_Scratch_Levels+1] TYPE = GF
CCTK_REAL SandRScratchSpace[MoL_Num_SaveAndRestore_Vars+1] TYPE = GF Timelevels = 1
+CCTK_COMPLEX ComplexScratchSpace[MoL_Num_ComplexEvolved_Vars*MoL_Num_Scratch_Levels+1] TYPE = GF Timelevels = 1
+
+CCTK_COMPLEX ComplexSandRScratchSpace[MoL_Num_ComplexSaveAndRestore_Vars+1] TYPE = GF Timelevels = 1
+
+CCTK_REAL ArrayScratchSpace[MoL_Num_Scratch_Levels+1] TYPE = ARRAY DIM = 1 SIZE = MoL_Max_Evolved_Array_Size Timelevels = 1
+
+CCTK_REAL ArraySandRScratchSpace[MoL_Num_Scratch_Levels+1] TYPE = ARRAY DIM = 1 SIZE = MoL_Max_Evolved_Array_Size Timelevels = 1
+
+CCTK_COMPLEX ComplexArraySandRScratchSpace[MoL_Num_Scratch_Levels+1] TYPE = ARRAY DIM = 1 SIZE = MoL_Max_Evolved_Array_Size Timelevels = 1
+
+CCTK_COMPLEX ComplexArrayScratchSpace[MoL_Num_Scratch_Levels+1] TYPE = ARRAY DIM = 1 SIZE = MoL_Max_Evolved_Array_Size Timelevels = 1
+
diff --git a/param.ccl b/param.ccl
index 4e5dfb8..9eba633 100644
--- a/param.ccl
+++ b/param.ccl
@@ -18,6 +18,57 @@ CCTK_INT MoL_Num_SaveAndRestore_Vars "The maximum number of variables to be evol
(0:* :: "Anything non negative. Added to by other thorns."
} 1
+CCTK_INT MoL_Num_ComplexEvolved_Vars "The maximum number of complex variables to be evolved by MoL" ACCUMULATOR = (x+y)
+{
+ (0:* :: "Anything non negative. Added to by other thorns."
+} 1
+
+CCTK_INT MoL_Num_ComplexConstrained_Vars "The maximum number of complex constrained variables with timelevels that MoL needs to know about" ACCUMULATOR = (x+y)
+{
+ (0:* :: "Anything non negative. Added to by other thorns."
+} 1
+
+CCTK_INT MoL_Num_ComplexSaveAndRestore_Vars "The maximum number of complex variables to be evolved outside of MoL but that MoL needs to know about" ACCUMULATOR = (x+y)
+{
+ (0:* :: "Anything non negative. Added to by other thorns."
+} 1
+
+CCTK_INT MoL_Max_Evolved_Array_Size "The maximum total size of any grid arrays to be evolved" ACCUMULATOR = (x+y)
+#ACCUMULATOR = (x>y?x:y)
+{
+ (0:* :: "Anything non negative. Accumulated by other thorns"
+} 1
+
+CCTK_INT MoL_Num_ArrayEvolved_Vars "The maximum number of array variables to be evolved by MoL" ACCUMULATOR = (x+y)
+{
+ (0:* :: "Anything non negative. Added to by other thorns."
+} 1
+
+CCTK_INT MoL_Num_ArrayConstrained_Vars "The maximum number of array constrained variables with timelevels that MoL needs to know about" ACCUMULATOR = (x+y)
+{
+ (0:* :: "Anything non negative. Added to by other thorns."
+} 1
+
+CCTK_INT MoL_Num_ArraySaveAndRestore_Vars "The maximum number of array variables to be evolved outside of MoL but that MoL needs to know about" ACCUMULATOR = (x+y)
+{
+ (0:* :: "Anything non negative. Added to by other thorns."
+} 1
+
+CCTK_INT MoL_Num_ComplexArrayEvolved_Vars "The maximum number of complex array variables to be evolved by MoL" ACCUMULATOR = (x+y)
+{
+ (0:* :: "Anything non negative. Added to by other thorns."
+} 1
+
+CCTK_INT MoL_Num_ComplexArrayConstrained_Vars "The maximum number of complex array constrained variables with timelevels that MoL needs to know about" ACCUMULATOR = (x+y)
+{
+ (0:* :: "Anything non negative. Added to by other thorns."
+} 1
+
+CCTK_INT MoL_Num_ComplexArraySaveAndRestore_Vars "The maximum number of complex array variables to be evolved outside of MoL but that MoL needs to know about" ACCUMULATOR = (x+y)
+{
+ (0:* :: "Anything non negative. Added to by other thorns."
+} 1
+
CCTK_INT MoL_Num_Scratch_Levels "Number of scratch levels required by the ODE method"
{
0:* :: "Anything non negative"
diff --git a/schedule.ccl b/schedule.ccl
index 70e3938..a14a2dd 100644
--- a/schedule.ccl
+++ b/schedule.ccl
@@ -15,6 +15,12 @@ if (MoL_Memory_Always_On)
{
STORAGE: ScratchSpace
STORAGE: SandRScratchSpace
+ STORAGE: ComplexScratchSpace
+ STORAGE: ComplexSandRScratchSpace
+ STORAGE: ArrayScratchSpace
+ STORAGE: ArraySandRScratchSpace
+ STORAGE: ComplexArrayScratchSpace
+ STORAGE: ComplexArraySandRScratchSpace
}
############################################################
@@ -101,6 +107,12 @@ schedule GROUP MoL_Evolution AT Evol
LANG: C
STORAGE: ScratchSpace
STORAGE: SandRScratchSpace
+ STORAGE: ComplexScratchSpace
+ STORAGE: ComplexSandRScratchSpace
+ STORAGE: ArrayScratchSpace
+ STORAGE: ArraySandRScratchSpace
+ STORAGE: ComplexArrayScratchSpace
+ STORAGE: ComplexArraySandRScratchSpace
} "A single Cactus evolution step using MoL"
######################################################
diff --git a/src/ChangeType.c b/src/ChangeType.c
index 5e229b4..966445e 100644
--- a/src/ChangeType.c
+++ b/src/ChangeType.c
@@ -47,6 +47,34 @@ CCTK_INT MoL_ChangeToSaveAndRestore(CCTK_INT SandRIndex);
CCTK_INT MoL_ChangeToNone(CCTK_INT RemoveIndex);
+
+CCTK_INT MoL_ChangeToEvolvedComplex(CCTK_INT EvolvedIndex, CCTK_INT RHSIndex);
+
+CCTK_INT MoL_ChangeToConstrainedComplex(CCTK_INT ConstrainedIndex);
+
+CCTK_INT MoL_ChangeToSaveAndRestoreComplex(CCTK_INT SandRIndex);
+
+CCTK_INT MoL_ChangeToNoneComplex(CCTK_INT RemoveIndex);
+
+
+CCTK_INT MoL_ChangeToEvolvedArray(CCTK_INT EvolvedIndex, CCTK_INT RHSIndex);
+
+CCTK_INT MoL_ChangeToConstrainedArray(CCTK_INT ConstrainedIndex);
+
+CCTK_INT MoL_ChangeToSaveAndRestoreArray(CCTK_INT SandRIndex);
+
+CCTK_INT MoL_ChangeToNoneArray(CCTK_INT RemoveIndex);
+
+
+CCTK_INT MoL_ChangeToEvolvedComplexArray(CCTK_INT EvolvedIndex,
+ CCTK_INT RHSIndex);
+
+CCTK_INT MoL_ChangeToConstrainedComplexArray(CCTK_INT ConstrainedIndex);
+
+CCTK_INT MoL_ChangeToSaveAndRestoreComplexArray(CCTK_INT SandRIndex);
+
+CCTK_INT MoL_ChangeToNoneComplexArray(CCTK_INT RemoveIndex);
+
/********************************************************************
********************* Local Data *****************************
********************************************************************/
@@ -441,7 +469,7 @@ CCTK_INT MoL_ChangeToNone(CCTK_INT RemoveIndex)
CCTK_INT index, usedindex;
CCTK_INT vartype; /* See the defines at the top of file */
- CCTK_INT timelevs;
+/* CCTK_INT timelevs; */
vartype = 0;
usedindex = -1;
@@ -531,13 +559,107 @@ CCTK_INT MoL_ChangeToNone(CCTK_INT RemoveIndex)
}
+/*
+ Currently no-op test functions.
+*/
+
+
+CCTK_INT MoL_ChangeToEvolvedComplex(CCTK_INT EvolvedIndex, CCTK_INT RHSIndex)
+{
+ CCTK_INT dummy;
+ dummy = EvolvedIndex;
+ dummy = RHSIndex;
+ return 0;
+}
+
+CCTK_INT MoL_ChangeToConstrainedComplex(CCTK_INT ConstrainedIndex)
+{
+ CCTK_INT dummy;
+ dummy = ConstrainedIndex;
+ return 0;
+}
+
+CCTK_INT MoL_ChangeToSaveAndRestoreComplex(CCTK_INT SandRIndex)
+{
+ CCTK_INT dummy;
+ dummy = SandRIndex;
+ return 0;
+}
+
+CCTK_INT MoL_ChangeToNoneComplex(CCTK_INT RemoveIndex)
+{
+ CCTK_INT dummy;
+ dummy = RemoveIndex;
+ return 0;
+}
+
+
+CCTK_INT MoL_ChangeToEvolvedArray(CCTK_INT EvolvedIndex, CCTK_INT RHSIndex)
+{
+ CCTK_INT dummy;
+ dummy = EvolvedIndex;
+ dummy = RHSIndex;
+ return 0;
+}
+
+CCTK_INT MoL_ChangeToConstrainedArray(CCTK_INT ConstrainedIndex)
+{
+ CCTK_INT dummy;
+ dummy = ConstrainedIndex;
+ return 0;
+}
+
+CCTK_INT MoL_ChangeToSaveAndRestoreArray(CCTK_INT SandRIndex)
+{
+ CCTK_INT dummy;
+ dummy = SandRIndex;
+ return 0;
+}
+
+CCTK_INT MoL_ChangeToNoneArray(CCTK_INT RemoveIndex)
+{
+ CCTK_INT dummy;
+ dummy = RemoveIndex;
+ return 0;
+}
+CCTK_INT MoL_ChangeToEvolvedComplexArray(CCTK_INT EvolvedIndex,
+ CCTK_INT RHSIndex)
+{
+ CCTK_INT dummy;
+ dummy = EvolvedIndex;
+ dummy = RHSIndex;
+ return 0;
+}
+
+CCTK_INT MoL_ChangeToConstrainedComplexArray(CCTK_INT ConstrainedIndex)
+{
+ CCTK_INT dummy;
+ dummy = ConstrainedIndex;
+ return 0;
+}
+
+CCTK_INT MoL_ChangeToSaveAndRestoreComplexArray(CCTK_INT SandRIndex)
+{
+ CCTK_INT dummy;
+ dummy = SandRIndex;
+ return 0;
+}
+
+CCTK_INT MoL_ChangeToNoneComplexArray(CCTK_INT RemoveIndex)
+{
+ CCTK_INT dummy;
+ dummy = RemoveIndex;
+ return 0;
+}
+
/*
Fortran wrappers for the above functions.
Should be replaced by using function aliasing eventually.
*/
+/*
void CCTK_FCALL CCTK_FNAME(MoL_ChangeToEvolved)(int *ierr,
CCTK_INT *EvolvedIndex,
CCTK_INT *RHSIndex)
@@ -566,6 +688,7 @@ void CCTK_FCALL CCTK_FNAME(MoL_ChangeToNone)(int *ierr,
*ierr = MoL_ChangeToNone(*EvolvedIndex);
return;
}
+*/
/********************************************************************
********************* Local Routines *************************
diff --git a/src/Counter.c b/src/Counter.c
index fca7f58..72ca776 100644
--- a/src/Counter.c
+++ b/src/Counter.c
@@ -65,7 +65,7 @@ int MoL_SetCounter(CCTK_ARGUMENTS)
DECLARE_CCTK_ARGUMENTS;
DECLARE_CCTK_PARAMETERS;
- CCTK_REAL *Var;
+/* CCTK_REAL *Var; */
*MoL_Intermediate_Step = MoL_Intermediate_Steps;
diff --git a/src/ExternalVariables.h b/src/ExternalVariables.h
index db4ea8f..229c6bb 100644
--- a/src/ExternalVariables.h
+++ b/src/ExternalVariables.h
@@ -24,3 +24,40 @@ extern CCTK_INT *SandRVariableIndex;
extern CCTK_INT MoLNumEvolvedVariables;
extern CCTK_INT MoLNumConstrainedVariables;
extern CCTK_INT MoLNumSandRVariables;
+
+
+
+extern CCTK_INT *EvolvedComplexVariableIndex;
+extern CCTK_INT *RHSComplexVariableIndex;
+extern CCTK_INT *ConstrainedComplexVariableIndex;
+extern CCTK_INT *SandRComplexVariableIndex;
+
+
+extern CCTK_INT MoLNumEvolvedComplexVariables;
+extern CCTK_INT MoLNumConstrainedComplexVariables;
+extern CCTK_INT MoLNumSandRComplexVariables;
+
+
+
+extern CCTK_INT *EvolvedArrayVariableIndex;
+extern CCTK_INT *RHSArrayVariableIndex;
+extern CCTK_INT *ConstrainedArrayVariableIndex;
+extern CCTK_INT *SandRArrayVariableIndex;
+
+
+extern CCTK_INT MoLNumEvolvedArrayVariables;
+extern CCTK_INT MoLNumConstrainedArrayVariables;
+extern CCTK_INT MoLNumSandRArrayVariables;
+
+
+
+extern CCTK_INT *EvolvedComplexArrayVariableIndex;
+extern CCTK_INT *RHSComplexArrayVariableIndex;
+extern CCTK_INT *ConstrainedComplexArrayVariableIndex;
+extern CCTK_INT *SandRComplexArrayVariableIndex;
+
+
+extern CCTK_INT MoLNumEvolvedComplexArrayVariables;
+extern CCTK_INT MoLNumConstrainedComplexArrayVariables;
+extern CCTK_INT MoLNumSandRComplexArrayVariables;
+
diff --git a/src/GenericRK.c b/src/GenericRK.c
index 939faa3..d1e3bc8 100644
--- a/src/GenericRK.c
+++ b/src/GenericRK.c
@@ -70,7 +70,16 @@ void MoL_GenericRKAdd(CCTK_ARGUMENTS)
DECLARE_CCTK_ARGUMENTS;
DECLARE_CCTK_PARAMETERS;
-
+
+ cGroupDynamicData arraydata;
+ CCTK_INT groupindex, ierr;
+ CCTK_INT arraytotalsize, arraydim;
+
+ CCTK_COMPLEX Complex_alpha, Complex_beta, Complex_Delta_Time;
+ CCTK_COMPLEX *UpdateComplexVar;
+ CCTK_COMPLEX *RHSComplexVar;
+ CCTK_COMPLEX *ScratchComplexVar;
+
CCTK_INT index, var, scratchstep, alphaindex, scratchindex;
CCTK_INT totalsize;
CCTK_REAL alpha, beta;
@@ -80,8 +89,13 @@ void MoL_GenericRKAdd(CCTK_ARGUMENTS)
totalsize = cctk_lsh[0] * cctk_lsh[1] * cctk_lsh[2];
+ Complex_Delta_Time = CCTK_Cmplx((*Original_Delta_Time), 0);
+
beta = RKBetaCoefficients[MoL_Intermediate_Steps -
(*MoL_Intermediate_Step)];
+ Complex_beta = CCTK_Cmplx(beta, 0);
+
+ /* Real GFs */
for (var = 0; var < MoLNumEvolvedVariables; var++)
{
@@ -176,6 +190,175 @@ void MoL_GenericRKAdd(CCTK_ARGUMENTS)
}
}
}
+
+ /* Complex GFs */
+
+ for (var = 0; var < MoLNumEvolvedComplexVariables; var++)
+ {
+
+ UpdateComplexVar = (CCTK_COMPLEX *)CCTK_VarDataPtrI(cctkGH, 0,
+ EvolvedComplexVariableIndex[var]);
+ RHSComplexVar = (CCTK_COMPLEX *)CCTK_VarDataPtrI(cctkGH, 0,
+ RHSVariableIndex[var]);
+
+ for (index = 0; index < totalsize; index++)
+ {
+ UpdateComplexVar[index] = CCTK_CmplxMul(Complex_Delta_Time,
+ CCTK_CmplxMul(Complex_beta, RHSComplexVar[index]));
+ }
+
+ for (scratchstep = 0;
+ scratchstep < MoL_Intermediate_Steps - (*MoL_Intermediate_Step) + 1;
+ scratchstep++)
+ {
+
+ alphaindex = AlphaIndex(*MoL_Intermediate_Step, scratchstep);
+ scratchindex = scratchstep - 1;
+
+ alpha = RKAlphaCoefficients[alphaindex];
+ Complex_alpha = CCTK_Cmplx(alpha, 0);
+
+ if (scratchstep)
+ {
+ ScratchComplexVar = &ComplexScratchSpace[(var *
+ MoL_Num_Scratch_Levels +
+ scratchindex) * totalsize];
+ }
+ else
+ {
+ ScratchComplexVar = (CCTK_COMPLEX*)CCTK_VarDataPtrI(cctkGH, 1,
+ EvolvedComplexVariableIndex[var]);
+ }
+
+ if ( (alpha > MoL_Tiny)||(alpha < -MoL_Tiny) )
+ {
+ for (index = 0; index < totalsize; index++)
+ {
+ UpdateComplexVar[index] =
+ CCTK_CmplxAdd(UpdateComplexVar[index],
+ CCTK_CmplxMul(Complex_alpha,
+ ScratchComplexVar[index]));
+ }
+ }
+
+ }
+
+ }
+
+ if (*MoL_Intermediate_Step > 1)
+ {
+ for (var = 0; var < MoLNumEvolvedComplexVariables; var++)
+ {
+ UpdateComplexVar = (CCTK_COMPLEX *)CCTK_VarDataPtrI(cctkGH, 0,
+ EvolvedComplexVariableIndex[var]);
+ ScratchComplexVar = &ComplexScratchSpace[(var * MoL_Num_Scratch_Levels +
+ MoL_Intermediate_Steps -
+ (*MoL_Intermediate_Step)) *
+ totalsize];
+ for (index = 0; index < totalsize; index++)
+ {
+ ScratchComplexVar[index] = UpdateComplexVar[index];
+ }
+ }
+ }
+
+ /* Real arrays */
+
+ for (var = 0; var < MoLNumEvolvedArrayVariables; var++)
+ {
+
+ UpdateVar = (CCTK_REAL *)CCTK_VarDataPtrI(cctkGH, 0,
+ EvolvedArrayVariableIndex[var]);
+ RHSVar = (CCTK_REAL *)CCTK_VarDataPtrI(cctkGH, 0,
+ RHSArrayVariableIndex[var]);
+
+ groupindex = CCTK_GroupIndexFromVarI(EvolvedArrayVariableIndex[var]);
+ ierr = CCTK_GroupDynamicData(cctkGH, groupindex,
+ &arraydata);
+ if (ierr)
+ {
+ CCTK_VWarn(0, __LINE__, __FILE__, "MoL",
+ "The driver does not return group information for group '%s'.",
+ CCTK_GroupName(groupindex));
+ }
+ arraytotalsize = 1;
+ for (arraydim = 0; arraydim < arraydata.dim; arraydim++)
+ {
+ arraytotalsize *= arraydata.lsh[arraydim];
+ }
+
+ for (index = 0; index < arraytotalsize; index++)
+ {
+ UpdateVar[index] = (*Original_Delta_Time) * beta * RHSVar[index];
+ }
+
+ for (scratchstep = 0;
+ scratchstep < MoL_Intermediate_Steps - (*MoL_Intermediate_Step) + 1;
+ scratchstep++)
+ {
+
+ alphaindex = AlphaIndex(*MoL_Intermediate_Step, scratchstep);
+ scratchindex = scratchstep - 1;
+
+ alpha = RKAlphaCoefficients[alphaindex];
+
+ if (scratchstep)
+ {
+ ScratchVar = &ScratchSpace[(var * MoL_Num_Scratch_Levels +
+ scratchindex) * totalsize];
+#ifdef MOLDEBUG
+ printf("Reading from scratch space, initial address %ld index %d\n",
+ ScratchVar, (var * MoL_Num_Scratch_Levels +
+ scratchindex) * totalsize);
+#endif
+ }
+ else
+ {
+ ScratchVar = (CCTK_REAL*)CCTK_VarDataPtrI(cctkGH, 1,
+ EvolvedVariableIndex[var]);
+ }
+
+ if ( (alpha > MoL_Tiny)||(alpha < -MoL_Tiny) )
+ {
+ for (index = 0; index < totalsize; index++)
+ {
+ UpdateVar[index] += alpha * ScratchVar[index];
+#ifdef MOLDEBUG
+ printf("Variable: %d. Index: %d. step: %d. alpha: %f. Scratch: %f. q: %f.\n",
+ var, index, (*MoL_Intermediate_Step), alpha, ScratchVar[index], UpdateVar[index]);
+#endif
+ }
+ }
+
+ }
+
+ }
+
+ if (*MoL_Intermediate_Step > 1)
+ {
+ for (var = 0; var < MoLNumEvolvedVariables; var++)
+ {
+ UpdateVar = (CCTK_REAL *)CCTK_VarDataPtrI(cctkGH, 0,
+ EvolvedVariableIndex[var]);
+ ScratchVar = &ScratchSpace[(var * MoL_Num_Scratch_Levels +
+ MoL_Intermediate_Steps -
+ (*MoL_Intermediate_Step)) * totalsize];
+#ifdef MOLDEBUG
+ printf("Writing to scratch space, initial address %ld, index %d \n",
+ ScratchVar, (var * MoL_Num_Scratch_Levels +
+ MoL_Intermediate_Steps -
+ (*MoL_Intermediate_Step)) * totalsize);
+#endif
+ for (index = 0; index < totalsize; index++)
+ {
+ ScratchVar[index] = UpdateVar[index];
+#ifdef MOLDEBUG
+ printf("Variable: %d. Index: %d. step: %d. Scratch: %f.\n",
+ var, index, (*MoL_Intermediate_Step), ScratchVar[index]);
+#endif
+ }
+ }
+ }
return;
}
diff --git a/src/ICN.c b/src/ICN.c
index cac5081..7284d00 100644
--- a/src/ICN.c
+++ b/src/ICN.c
@@ -69,12 +69,21 @@ void MoL_ICNAdd(CCTK_ARGUMENTS)
DECLARE_CCTK_ARGUMENTS;
DECLARE_CCTK_PARAMETERS;
+ cGroupDynamicData arraydata;
+ CCTK_INT groupindex, ierr;
+ CCTK_INT arraytotalsize, arraydim;
+
CCTK_INT index, var;
CCTK_INT totalsize;
CCTK_REAL *OldVar;
CCTK_REAL *UpdateVar;
CCTK_REAL *RHSVar;
+ CCTK_COMPLEX *OldComplexVar;
+ CCTK_COMPLEX *UpdateComplexVar;
+ CCTK_COMPLEX *RHSComplexVar;
+ CCTK_COMPLEX Complex_Delta_Time = CCTK_Cmplx(CCTK_DELTA_TIME, 0);
+
#ifdef MOLDEBUG
printf("Inside ICN.\nProcessor %d.\nStep %d.\nRefinement %d.\nTimestep %g.\nSpacestep %g.\nTime %g\n",
CCTK_MyProc(cctkGH),
@@ -104,6 +113,53 @@ void MoL_ICNAdd(CCTK_ARGUMENTS)
}
}
+ for (var = 0; var < MoLNumEvolvedArrayVariables; var++)
+ {
+ OldVar = (CCTK_REAL*)CCTK_VarDataPtrI(cctkGH, 1,
+ EvolvedArrayVariableIndex[var]);
+ UpdateVar = (CCTK_REAL*)CCTK_VarDataPtrI(cctkGH, 0,
+ EvolvedArrayVariableIndex[var]);
+ RHSVar = (CCTK_REAL*)CCTK_VarDataPtrI(cctkGH, 0,
+ RHSArrayVariableIndex[var]);
+
+ groupindex = CCTK_GroupIndexFromVarI(EvolvedArrayVariableIndex[var]);
+ ierr = CCTK_GroupDynamicData(cctkGH, groupindex,
+ &arraydata);
+ if (ierr)
+ {
+ CCTK_VWarn(0, __LINE__, __FILE__, "MoL",
+ "The driver does not return group information for group '%s'.",
+ CCTK_GroupName(groupindex));
+ }
+ arraytotalsize = 1;
+ for (arraydim = 0; arraydim < arraydata.dim; arraydim++)
+ {
+ arraytotalsize *= arraydata.lsh[arraydim];
+ }
+
+ for (index = 0; index < arraytotalsize; index++)
+ {
+ UpdateVar[index] = OldVar[index] + CCTK_DELTA_TIME * RHSVar[index];
+ }
+ }
+
+ for (var = 0; var < MoLNumEvolvedComplexVariables; var++)
+ {
+ OldComplexVar = (CCTK_COMPLEX*)CCTK_VarDataPtrI(cctkGH, 1,
+ EvolvedComplexVariableIndex[var]);
+ UpdateComplexVar = (CCTK_COMPLEX*)CCTK_VarDataPtrI(cctkGH, 0,
+ EvolvedComplexVariableIndex[var]);
+ RHSComplexVar = (CCTK_COMPLEX*)CCTK_VarDataPtrI(cctkGH, 0,
+ RHSComplexVariableIndex[var]);
+
+ for (index = 0; index < totalsize; index++)
+ {
+ UpdateComplexVar[index] = CCTK_CmplxAdd(OldComplexVar[index],
+ CCTK_CmplxMul(Complex_Delta_Time,
+ RHSComplexVar[index]));
+ }
+ }
+
return;
}
diff --git a/src/IndexArrays.c b/src/IndexArrays.c
index 7050e2d..01820eb 100644
--- a/src/IndexArrays.c
+++ b/src/IndexArrays.c
@@ -35,7 +35,7 @@ CCTK_FILEVERSION(AlphaThorns_MoL_IndexArrays_c);
void MoL_SetupIndexArrays(CCTK_ARGUMENTS);
-void MoL_FreeIndexArrays();
+void MoL_FreeIndexArrays(void);
/********************************************************************
********************* Other Routine Prototypes *********************
@@ -114,6 +114,108 @@ void MoL_SetupIndexArrays(CCTK_ARGUMENTS)
CCTK_WARN(0,"Failed to allocate the save and restore variable index array");
}
+
+ if (EvolvedComplexVariableIndex)
+ {
+ return;
+ }
+
+ EvolvedComplexVariableIndex = (CCTK_INT *)malloc(MoL_Num_ComplexEvolved_Vars *
+ sizeof(CCTK_INT));
+ if (!EvolvedComplexVariableIndex)
+ {
+ CCTK_WARN(0,"Failed to allocate the evolved complex variable index array");
+ }
+
+ RHSComplexVariableIndex = (CCTK_INT *)malloc(MoL_Num_ComplexEvolved_Vars *
+ sizeof(CCTK_INT));
+ if (!RHSComplexVariableIndex)
+ {
+ CCTK_WARN(0,"Failed to allocate the RHS complex variable index array");
+ }
+
+ ConstrainedComplexVariableIndex = (CCTK_INT *)malloc(MoL_Num_ComplexConstrained_Vars *
+ sizeof(CCTK_INT));
+ if (!ConstrainedComplexVariableIndex)
+ {
+ CCTK_WARN(0,"Failed to allocate the constrained complex variable index array");
+ }
+
+ SandRComplexVariableIndex = (CCTK_INT *)malloc(MoL_Num_ComplexSaveAndRestore_Vars *
+ sizeof(CCTK_INT));
+ if (!SandRComplexVariableIndex)
+ {
+ CCTK_WARN(0,"Failed to allocate the save and restore complex variable index array");
+ }
+
+
+ if (EvolvedArrayVariableIndex)
+ {
+ return;
+ }
+
+ EvolvedArrayVariableIndex = (CCTK_INT *)malloc(MoL_Num_ArrayEvolved_Vars *
+ sizeof(CCTK_INT));
+ if (!EvolvedArrayVariableIndex)
+ {
+ CCTK_WARN(0,"Failed to allocate the evolved array variable index array");
+ }
+
+ RHSArrayVariableIndex = (CCTK_INT *)malloc(MoL_Num_ArrayEvolved_Vars *
+ sizeof(CCTK_INT));
+ if (!RHSArrayVariableIndex)
+ {
+ CCTK_WARN(0,"Failed to allocate the RHS array variable index array");
+ }
+
+ ConstrainedArrayVariableIndex = (CCTK_INT *)malloc(MoL_Num_ArrayConstrained_Vars *
+ sizeof(CCTK_INT));
+ if (!ConstrainedArrayVariableIndex)
+ {
+ CCTK_WARN(0,"Failed to allocate the constrained array variable index array");
+ }
+
+ SandRArrayVariableIndex = (CCTK_INT *)malloc(MoL_Num_ArraySaveAndRestore_Vars *
+ sizeof(CCTK_INT));
+ if (!SandRArrayVariableIndex)
+ {
+ CCTK_WARN(0,"Failed to allocate the save and restore array variable index array");
+ }
+
+
+ if (EvolvedComplexArrayVariableIndex)
+ {
+ return;
+ }
+
+ EvolvedComplexArrayVariableIndex = (CCTK_INT *)malloc(MoL_Num_ComplexArrayEvolved_Vars *
+ sizeof(CCTK_INT));
+ if (!EvolvedComplexArrayVariableIndex)
+ {
+ CCTK_WARN(0,"Failed to allocate the evolved complex array variable index array");
+ }
+
+ RHSComplexArrayVariableIndex = (CCTK_INT *)malloc(MoL_Num_ComplexArrayEvolved_Vars *
+ sizeof(CCTK_INT));
+ if (!RHSComplexArrayVariableIndex)
+ {
+ CCTK_WARN(0,"Failed to allocate the RHS complex array variable index array");
+ }
+
+ ConstrainedComplexArrayVariableIndex = (CCTK_INT *)malloc(MoL_Num_ComplexArrayConstrained_Vars *
+ sizeof(CCTK_INT));
+ if (!ConstrainedComplexArrayVariableIndex)
+ {
+ CCTK_WARN(0,"Failed to allocate the constrained complex array variable index array");
+ }
+
+ SandRComplexArrayVariableIndex = (CCTK_INT *)malloc(MoL_Num_ComplexArraySaveAndRestore_Vars *
+ sizeof(CCTK_INT));
+ if (!SandRComplexArrayVariableIndex)
+ {
+ CCTK_WARN(0,"Failed to allocate the save and restore complex array variable index array");
+ }
+
infoline = (char *)malloc(100*sizeof(char));
if (!infoline)
{
@@ -175,7 +277,7 @@ void MoL_SetupIndexArrays(CCTK_ARGUMENTS)
@@*/
-void MoL_FreeIndexArrays()
+void MoL_FreeIndexArrays(void)
{
if (EvolvedVariableIndex)
@@ -201,6 +303,78 @@ void MoL_FreeIndexArrays()
free(SandRVariableIndex);
SandRVariableIndex = NULL;
}
+
+ if (EvolvedComplexVariableIndex)
+ {
+ free(EvolvedComplexVariableIndex);
+ EvolvedComplexVariableIndex = NULL;
+ }
+
+ if (RHSComplexVariableIndex)
+ {
+ free(RHSComplexVariableIndex);
+ RHSComplexVariableIndex = NULL;
+ }
+
+ if (ConstrainedComplexVariableIndex)
+ {
+ free(ConstrainedComplexVariableIndex);
+ ConstrainedComplexVariableIndex = NULL;
+ }
+
+ if (SandRComplexVariableIndex)
+ {
+ free(SandRComplexVariableIndex);
+ SandRComplexVariableIndex = NULL;
+ }
+
+ if (EvolvedArrayVariableIndex)
+ {
+ free(EvolvedArrayVariableIndex);
+ EvolvedArrayVariableIndex = NULL;
+ }
+
+ if (RHSArrayVariableIndex)
+ {
+ free(RHSArrayVariableIndex);
+ RHSArrayVariableIndex = NULL;
+ }
+
+ if (ConstrainedArrayVariableIndex)
+ {
+ free(ConstrainedArrayVariableIndex);
+ ConstrainedArrayVariableIndex = NULL;
+ }
+
+ if (SandRArrayVariableIndex)
+ {
+ free(SandRArrayVariableIndex);
+ SandRArrayVariableIndex = NULL;
+ }
+
+ if (EvolvedComplexArrayVariableIndex)
+ {
+ free(EvolvedComplexArrayVariableIndex);
+ EvolvedComplexArrayVariableIndex = NULL;
+ }
+
+ if (RHSComplexArrayVariableIndex)
+ {
+ free(RHSComplexArrayVariableIndex);
+ RHSComplexArrayVariableIndex = NULL;
+ }
+
+ if (ConstrainedComplexArrayVariableIndex)
+ {
+ free(ConstrainedComplexArrayVariableIndex);
+ ConstrainedComplexArrayVariableIndex = NULL;
+ }
+
+ if (SandRComplexArrayVariableIndex)
+ {
+ free(SandRComplexArrayVariableIndex);
+ SandRComplexArrayVariableIndex = NULL;
+ }
return;
diff --git a/src/InitialCopy.c b/src/InitialCopy.c
index 0a6a54b..9004f37 100644
--- a/src/InitialCopy.c
+++ b/src/InitialCopy.c
@@ -11,6 +11,8 @@
@version $Header$
@@*/
+#include <string.h>
+
#include "cctk.h"
#include "cctk_Arguments.h"
#include "cctk_Parameters.h"
@@ -54,10 +56,14 @@ void MoL_InitialCopy(CCTK_ARGUMENTS)
DECLARE_CCTK_ARGUMENTS
DECLARE_CCTK_PARAMETERS
+
+ cGroupDynamicData arraydata;
+ CCTK_INT groupindex, ierr;
+ CCTK_INT arraytotalsize, arraydim;
CCTK_INT var;
- CCTK_INT index;
- CCTK_INT i,j,k;
+/* CCTK_INT index; */
+/* CCTK_INT i,j,k; */
CCTK_INT totalsize;
CCTK_REAL *CurrentVar;
@@ -65,6 +71,10 @@ void MoL_InitialCopy(CCTK_ARGUMENTS)
CCTK_REAL *ScratchVar;
CCTK_INT StorageOn;
+ CCTK_COMPLEX *CurrentComplexVar;
+ CCTK_COMPLEX *PreviousComplexVar;
+ CCTK_COMPLEX *ScratchComplexVar;
+
totalsize = cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2];
for (var = 0; var < MoLNumEvolvedVariables; var++)
@@ -100,6 +110,77 @@ void MoL_InitialCopy(CCTK_ARGUMENTS)
}
}
+
+ for (var = 0; var < MoLNumEvolvedArrayVariables; var++)
+ {
+ PreviousVar = (CCTK_REAL*)CCTK_VarDataPtrI(cctkGH, 1,
+ EvolvedArrayVariableIndex[var]);
+ CurrentVar = (CCTK_REAL*)CCTK_VarDataPtrI(cctkGH, 0,
+ EvolvedArrayVariableIndex[var]);
+
+ groupindex = CCTK_GroupIndexFromVarI(EvolvedArrayVariableIndex[var]);
+ ierr = CCTK_GroupDynamicData(cctkGH, groupindex,
+ &arraydata);
+ if (ierr)
+ {
+ CCTK_VWarn(0, __LINE__, __FILE__, "MoL",
+ "The driver does not return group information for group '%s'.",
+ CCTK_GroupName(groupindex));
+ }
+ arraytotalsize = 1;
+ for (arraydim = 0; arraydim < arraydata.dim; arraydim++)
+ {
+ arraytotalsize *= arraydata.lsh[arraydim];
+ }
+
+ if (PreviousVar && CurrentVar)
+ {
+ memcpy(CurrentVar, PreviousVar, arraytotalsize * sizeof(CCTK_REAL));
+ }
+ else
+ {
+ printf("The pointers are %p (prev) and %p (curr)\n.",
+ PreviousVar, CurrentVar);
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","Null pointer for variable %s",
+ CCTK_VarName(EvolvedArrayVariableIndex[var]));
+ }
+
+ }
+
+
+ for (var = 0; var < MoLNumEvolvedComplexVariables; var++)
+ {
+
+ StorageOn = CCTK_QueryGroupStorage(cctkGH,
+ CCTK_GroupNameFromVarI(EvolvedComplexVariableIndex[var]));
+
+ if (StorageOn < 0)
+ {
+ CCTK_VWarn(1,__LINE__,__FILE__,"MoL","Warning for index %i",
+ EvolvedComplexVariableIndex[var]);
+ CCTK_WARN(0, "The index passed does not correspond to a GF.");
+ }
+ else if (StorageOn == 0) {
+ CCTK_VWarn(1,__LINE__,__FILE__,"MoL","Warning for GF %s",
+ CCTK_VarName(EvolvedComplexVariableIndex[var]));
+ CCTK_WARN(0, "The grid function does not have storage assigned.");
+ }
+
+ PreviousComplexVar = (CCTK_COMPLEX*)CCTK_VarDataPtrI(cctkGH, 1,
+ EvolvedComplexVariableIndex[var]);
+ CurrentComplexVar = (CCTK_COMPLEX*)CCTK_VarDataPtrI(cctkGH, 0,
+ EvolvedComplexVariableIndex[var]);
+ if (PreviousComplexVar && CurrentComplexVar)
+ {
+ memcpy(CurrentComplexVar, PreviousComplexVar, totalsize * sizeof(CCTK_COMPLEX));
+ }
+ else
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","Null pointer for variable %s",
+ CCTK_VarName(EvolvedComplexVariableIndex[var]));
+ }
+
+ }
/*
Now the Save and Restore variables. Shift the data in the
@@ -145,7 +226,7 @@ void MoL_InitialCopy(CCTK_ARGUMENTS)
else
{
CCTK_VWarn(0,__LINE__,__FILE__,"MoL","Null pointer for variable %s",
- CCTK_VarName(SandRScratchSpace[var]));
+ CCTK_VarName(SandRVariableIndex[var]));
}
#ifdef MOLDEBUG
printf("Init2:Variable %s, current %g, previous %g, scratch %g\n",
@@ -154,6 +235,46 @@ void MoL_InitialCopy(CCTK_ARGUMENTS)
#endif
}
+
+ for (var = 0; var < MoLNumSandRComplexVariables; var++)
+ {
+
+ StorageOn = CCTK_QueryGroupStorage(cctkGH,
+ CCTK_GroupNameFromVarI(SandRComplexVariableIndex[var]));
+
+ if (StorageOn < 0)
+ {
+ CCTK_VWarn(1,__LINE__,__FILE__,"MoL","Warning for index %i",
+ SandRComplexVariableIndex[var]);
+ CCTK_WARN(0, "The index passed does not correspond to a GF.");
+ }
+ else if (StorageOn == 0) {
+ CCTK_VWarn(1,__LINE__,__FILE__,"MoL","Warning for GF %s",
+ CCTK_VarName(SandRComplexVariableIndex[var]));
+ CCTK_WARN(0, "The grid function does not have storage assigned.");
+ }
+
+ PreviousComplexVar = (CCTK_COMPLEX*)CCTK_VarDataPtrI(cctkGH, 1,
+ SandRComplexVariableIndex[var]);
+ CurrentComplexVar = (CCTK_COMPLEX*)CCTK_VarDataPtrI(cctkGH, 0,
+ SandRComplexVariableIndex[var]);
+ ScratchComplexVar = &ComplexSandRScratchSpace[var*totalsize];
+#ifdef MOLDEBUG
+ printf("Pointers for the SandR vars are to %ld, %ld and %ld.\n",
+ PreviousComplexVar, CurrentComplexVar, ScratchComplexVar);
+#endif
+ if (PreviousComplexVar && CurrentComplexVar && ScratchComplexVar)
+ {
+ memcpy(ScratchComplexVar, CurrentComplexVar, totalsize * sizeof(CCTK_COMPLEX));
+ memcpy(CurrentComplexVar, PreviousComplexVar, totalsize * sizeof(CCTK_COMPLEX));
+ }
+ else
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","Null pointer for variable %s",
+ CCTK_VarName(SandRComplexVariableIndex[var]));
+ }
+ }
+
/*
Now do the constrained variables.
*/
@@ -193,6 +314,42 @@ void MoL_InitialCopy(CCTK_ARGUMENTS)
}
+
+ for (var = 0; var < MoLNumConstrainedComplexVariables; var++)
+ {
+
+ StorageOn = CCTK_QueryGroupStorage(cctkGH,
+ CCTK_GroupNameFromVarI(ConstrainedComplexVariableIndex[var]));
+
+ if (StorageOn < 0)
+ {
+ CCTK_VWarn(1,__LINE__,__FILE__,"MoL","Warning for index %i",
+ ConstrainedComplexVariableIndex[var]);
+ CCTK_WARN(0, "The index passed does not correspond to a GF.");
+ }
+ else if (StorageOn == 0) {
+ CCTK_VWarn(1,__LINE__,__FILE__,"MoL","Warning for GF %s",
+ CCTK_VarName(ConstrainedComplexVariableIndex[var]));
+ CCTK_WARN(0, "The grid function does not have storage assigned.");
+ }
+
+ PreviousComplexVar = (CCTK_COMPLEX*)CCTK_VarDataPtrI(cctkGH, 1,
+ ConstrainedComplexVariableIndex[var]);
+ CurrentComplexVar = (CCTK_COMPLEX*)CCTK_VarDataPtrI(cctkGH, 0,
+ ConstrainedComplexVariableIndex[var]);
+
+ if (PreviousComplexVar && CurrentComplexVar)
+ {
+ memcpy(CurrentComplexVar, PreviousComplexVar, totalsize * sizeof(CCTK_COMPLEX));
+ }
+ else
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","Null pointer for variable %s",
+ CCTK_VarName(ConstrainedComplexVariableIndex[var]));
+ }
+
+ }
+
return;
}
@@ -280,18 +437,60 @@ void MoL_FillAllLevels(CCTK_ARGUMENTS)
}
CCTK_VInfo(CCTK_THORNSTRING,
- "The maximum number of evolved variables is %d. %d are registered",
+ "The maximum number of evolved variables is %d. %d are registered.",
MoL_Num_Evolved_Vars,MoLNumEvolvedVariables);
CCTK_VInfo(CCTK_THORNSTRING,
- "The maximum number of constrained variables is %d. %d are registered",
+ "The maximum number of constrained variables is %d. %d are registered.",
MoL_Num_Constrained_Vars,MoLNumConstrainedVariables);
CCTK_VInfo(CCTK_THORNSTRING,
- "The maximum number of SandR variables is %d. %d are registered",
+ "The maximum number of SandR variables is %d. %d are registered.",
MoL_Num_SaveAndRestore_Vars,MoLNumSandRVariables);
+
+ CCTK_VInfo(CCTK_THORNSTRING,
+ "The maximum number of evolved complex variables is %d. %d are registered.",
+ MoL_Num_ComplexEvolved_Vars,MoLNumEvolvedComplexVariables);
+
+ CCTK_VInfo(CCTK_THORNSTRING,
+ "The maximum number of constrained complex variables is %d. %d are registered.",
+ MoL_Num_ComplexConstrained_Vars,MoLNumConstrainedComplexVariables);
+ CCTK_VInfo(CCTK_THORNSTRING,
+ "The maximum number of SandR complex variables is %d. %d are registered.",
+ MoL_Num_ComplexSaveAndRestore_Vars,MoLNumSandRComplexVariables);
+
+
+ CCTK_VInfo(CCTK_THORNSTRING,
+ "The maximum number of evolved array variables is %d. %d are registered.",
+ MoL_Num_ArrayEvolved_Vars,MoLNumEvolvedArrayVariables);
+
+ CCTK_VInfo(CCTK_THORNSTRING,
+ "The maximum number of constrained array variables is %d. %d are registered.",
+ MoL_Num_ArrayConstrained_Vars,MoLNumConstrainedArrayVariables);
+
+ CCTK_VInfo(CCTK_THORNSTRING,
+ "The maximum number of SandR array variables is %d. %d are registered.",
+ MoL_Num_ArraySaveAndRestore_Vars,MoLNumSandRArrayVariables);
+
+
+ CCTK_VInfo(CCTK_THORNSTRING,
+ "The maximum number of evolved complex array variables is %d. %d are registered.",
+ MoL_Num_ComplexArrayEvolved_Vars,MoLNumEvolvedComplexArrayVariables);
+
+ CCTK_VInfo(CCTK_THORNSTRING,
+ "The maximum number of constrained complex array variables is %d. %d are registered.",
+ MoL_Num_ComplexArrayConstrained_Vars,MoLNumConstrainedComplexArrayVariables);
+
+ CCTK_VInfo(CCTK_THORNSTRING,
+ "The maximum number of SandR complex array variables is %d. %d are registered.",
+ MoL_Num_ComplexArraySaveAndRestore_Vars,MoLNumSandRComplexArrayVariables);
+
+ CCTK_VInfo(CCTK_THORNSTRING,
+ "The maximum size of any array variables is %d.",
+ MoL_Max_Evolved_Array_Size);
+
return;
}
diff --git a/src/ParamCheck.c b/src/ParamCheck.c
index 8c44691..d9cf1ae 100644
--- a/src/ParamCheck.c
+++ b/src/ParamCheck.c
@@ -28,7 +28,7 @@ CCTK_FILEVERSION(AlphaThorns_MoL_ParamCheck_c);
***************** Scheduled Routine Prototypes *********************
********************************************************************/
-int ParamCheck(CCTK_ARGUMENTS);
+int MoL_ParamCheck(CCTK_ARGUMENTS);
/********************************************************************
********************* Other Routine Prototypes *********************
diff --git a/src/RK2.c b/src/RK2.c
index 2ff0d0a..34232be 100644
--- a/src/RK2.c
+++ b/src/RK2.c
@@ -67,12 +67,22 @@ void MoL_RK2Add(CCTK_ARGUMENTS)
DECLARE_CCTK_ARGUMENTS;
DECLARE_CCTK_PARAMETERS;
+
+ cGroupDynamicData arraydata;
+ CCTK_INT groupindex, ierr;
+ CCTK_INT arraytotalsize, arraydim;
CCTK_INT index, var;
CCTK_INT totalsize;
CCTK_REAL *OldVar;
CCTK_REAL *UpdateVar;
CCTK_REAL *RHSVar;
+
+ CCTK_COMPLEX *OldComplexVar;
+ CCTK_COMPLEX *UpdateComplexVar;
+ CCTK_COMPLEX *RHSComplexVar;
+ CCTK_COMPLEX Complex_Delta_Time = CCTK_Cmplx(CCTK_DELTA_TIME, 0);
+ CCTK_COMPLEX Complex_Half = CCTK_Cmplx(0.5, 0);
#ifdef MOLDEBUG
printf("Inside RK2.\nStep %d.\nRefinement %d.\nTimestep %g.\nSpacestep %g.\nTime %g\n",
@@ -102,6 +112,48 @@ void MoL_RK2Add(CCTK_ARGUMENTS)
UpdateVar[index] += CCTK_DELTA_TIME * RHSVar[index];
}
}
+
+ for (var = 0; var < MoLNumEvolvedArrayVariables; var++)
+ {
+ UpdateVar = (CCTK_REAL*)CCTK_VarDataPtrI(cctkGH, 0,
+ EvolvedArrayVariableIndex[var]);
+ RHSVar = (CCTK_REAL*)CCTK_VarDataPtrI(cctkGH, 0,
+ RHSArrayVariableIndex[var]);
+ groupindex = CCTK_GroupIndexFromVarI(EvolvedArrayVariableIndex[var]);
+ ierr = CCTK_GroupDynamicData(cctkGH, groupindex,
+ &arraydata);
+ if (ierr)
+ {
+ CCTK_VWarn(0, __LINE__, __FILE__, "MoL",
+ "The driver does not return group information for group '%s'.",
+ CCTK_GroupName(groupindex));
+ }
+ arraytotalsize = 1;
+ for (arraydim = 0; arraydim < arraydata.dim; arraydim++)
+ {
+ arraytotalsize *= arraydata.lsh[arraydim];
+ }
+
+ for (index = 0; index < arraytotalsize; index++)
+ {
+ UpdateVar[index] += CCTK_DELTA_TIME * RHSVar[index];
+ }
+ }
+
+ for (var = 0; var < MoLNumEvolvedComplexVariables; var++)
+ {
+ UpdateComplexVar = (CCTK_COMPLEX*)CCTK_VarDataPtrI(cctkGH, 0,
+ EvolvedComplexVariableIndex[var]);
+ RHSComplexVar = (CCTK_COMPLEX*)CCTK_VarDataPtrI(cctkGH, 0,
+ RHSComplexVariableIndex[var]);
+
+ for (index = 0; index < totalsize; index++)
+ {
+ UpdateComplexVar[index] = CCTK_CmplxAdd(UpdateComplexVar[index],
+ CCTK_CmplxMul(Complex_Delta_Time,
+ RHSComplexVar[index]));
+ }
+ }
break;
}
case 1:
@@ -121,6 +173,54 @@ void MoL_RK2Add(CCTK_ARGUMENTS)
CCTK_DELTA_TIME * RHSVar[index];
}
}
+
+ for (var = 0; var < MoLNumEvolvedArrayVariables; var++)
+ {
+ OldVar = (CCTK_REAL*)CCTK_VarDataPtrI(cctkGH, 1,
+ EvolvedVariableIndex[var]);
+ UpdateVar = (CCTK_REAL*)CCTK_VarDataPtrI(cctkGH, 0,
+ EvolvedVariableIndex[var]);
+ RHSVar = (CCTK_REAL*)CCTK_VarDataPtrI(cctkGH, 0,
+ RHSVariableIndex[var]);
+
+ groupindex = CCTK_GroupIndexFromVarI(EvolvedArrayVariableIndex[var]);
+ ierr = CCTK_GroupDynamicData(cctkGH, groupindex,
+ &arraydata);
+ if (ierr)
+ {
+ CCTK_VWarn(0, __LINE__, __FILE__, "MoL",
+ "The driver does not return group information for group '%s'.",
+ CCTK_GroupName(groupindex));
+ }
+ arraytotalsize = 1;
+ for (arraydim = 0; arraydim < arraydata.dim; arraydim++)
+ {
+ arraytotalsize *= arraydata.lsh[arraydim];
+ }
+
+ for (index = 0; index < arraytotalsize; index++)
+ {
+ UpdateVar[index] = 0.5 * (OldVar[index] + UpdateVar[index]) +
+ CCTK_DELTA_TIME * RHSVar[index];
+ }
+ }
+
+ for (var = 0; var < MoLNumEvolvedComplexVariables; var++)
+ {
+ OldComplexVar = (CCTK_COMPLEX*)CCTK_VarDataPtrI(cctkGH, 1,
+ EvolvedComplexVariableIndex[var]);
+ UpdateComplexVar = (CCTK_COMPLEX*)CCTK_VarDataPtrI(cctkGH, 0,
+ EvolvedComplexVariableIndex[var]);
+ RHSComplexVar = (CCTK_COMPLEX*)CCTK_VarDataPtrI(cctkGH, 0,
+ RHSComplexVariableIndex[var]);
+
+ for (index = 0; index < totalsize; index++)
+ {
+ UpdateComplexVar[index] =
+ CCTK_CmplxAdd(CCTK_CmplxMul(Complex_Half,
+ (CCTK_CmplxAdd(OldComplexVar[index], UpdateComplexVar[index]))), CCTK_CmplxMul(Complex_Delta_Time, RHSComplexVar[index]));
+ }
+ }
break;
}
default:
diff --git a/src/Registration.c b/src/Registration.c
index c0b33cd..71c98ee 100644
--- a/src/Registration.c
+++ b/src/Registration.c
@@ -48,6 +48,64 @@ CCTK_INT MoL_RegisterConstrainedGroup(CCTK_INT ConstrainedGroupIndex);
CCTK_INT MoL_RegisterSaveAndRestoreGroup(CCTK_INT SandRGroupIndex);
+
+
+CCTK_INT MoL_RegisterEvolvedReal(CCTK_INT EvolvedIndex, CCTK_INT RHSIndex);
+
+CCTK_INT MoL_RegisterConstrainedReal(CCTK_INT ConstrainedIndex);
+
+CCTK_INT MoL_RegisterSaveAndRestoreReal(CCTK_INT SandRIndex);
+
+CCTK_INT MoL_RegisterEvolvedRealGroup(CCTK_INT EvolvedGroupIndex,
+ CCTK_INT RHSGroupIndex);
+
+CCTK_INT MoL_RegisterConstrainedRealGroup(CCTK_INT ConstrainedGroupIndex);
+
+CCTK_INT MoL_RegisterSaveAndRestoreRealGroup(CCTK_INT SandRGroupIndex);
+
+
+CCTK_INT MoL_RegisterEvolvedComplex(CCTK_INT EvolvedIndex, CCTK_INT RHSIndex);
+
+CCTK_INT MoL_RegisterConstrainedComplex(CCTK_INT ConstrainedIndex);
+
+CCTK_INT MoL_RegisterSaveAndRestoreComplex(CCTK_INT SandRIndex);
+
+CCTK_INT MoL_RegisterEvolvedComplexGroup(CCTK_INT EvolvedGroupIndex,
+ CCTK_INT RHSGroupIndex);
+
+CCTK_INT MoL_RegisterConstrainedComplexGroup(CCTK_INT ConstrainedGroupIndex);
+
+CCTK_INT MoL_RegisterSaveAndRestoreComplexGroup(CCTK_INT SandRGroupIndex);
+
+
+CCTK_INT MoL_RegisterEvolvedArray(CCTK_INT EvolvedIndex, CCTK_INT RHSIndex);
+
+CCTK_INT MoL_RegisterConstrainedArray(CCTK_INT ConstrainedIndex);
+
+CCTK_INT MoL_RegisterSaveAndRestoreArray(CCTK_INT SandRIndex);
+
+CCTK_INT MoL_RegisterEvolvedArrayGroup(CCTK_INT EvolvedGroupIndex,
+ CCTK_INT RHSGroupIndex);
+
+CCTK_INT MoL_RegisterConstrainedArrayGroup(CCTK_INT ConstrainedGroupIndex);
+
+CCTK_INT MoL_RegisterSaveAndRestoreArrayGroup(CCTK_INT SandRGroupIndex);
+
+
+CCTK_INT MoL_RegisterEvolvedComplexArray(CCTK_INT EvolvedIndex,
+ CCTK_INT RHSIndex);
+
+CCTK_INT MoL_RegisterConstrainedComplexArray(CCTK_INT ConstrainedIndex);
+
+CCTK_INT MoL_RegisterSaveAndRestoreComplexArray(CCTK_INT SandRIndex);
+
+CCTK_INT MoL_RegisterEvolvedComplexArrayGroup(CCTK_INT EvolvedGroupIndex,
+ CCTK_INT RHSGroupIndex);
+
+CCTK_INT MoL_RegisterConstrainedComplexArrayGroup(CCTK_INT ConstrainedGroupIndex);
+
+CCTK_INT MoL_RegisterSaveAndRestoreComplexArrayGroup(CCTK_INT SandRGroupIndex);
+
/********************************************************************
********************* Local Data *****************************
********************************************************************/
@@ -75,9 +133,574 @@ CCTK_INT MoL_RegisterSaveAndRestoreGroup(CCTK_INT SandRGroupIndex);
CCTK_INT MoL_RegisterEvolved(CCTK_INT EvolvedIndex, CCTK_INT RHSIndex)
{
+ CCTK_INT retval, GroupType;
+
+ retval = 0;
+
+ GroupType = CCTK_GroupTypeFromVarI(EvolvedIndex);
+ if (GroupType < 0)
+ {
+ CCTK_VWarn(0, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "Evolved index %i is not a real variable index.",
+ EvolvedIndex);
+ retval++;
+ }
+
+ if (!retval)
+ {
+ switch (CCTK_VarTypeI(EvolvedIndex))
+ {
+ case CCTK_VARIABLE_REAL:
+ {
+ switch (GroupType)
+ {
+ case CCTK_GF:
+ {
+ retval +=
+ MoL_RegisterEvolvedReal(EvolvedIndex,
+ RHSIndex);
+ break;
+ }
+ case CCTK_ARRAY:
+ {
+ retval +=
+ MoL_RegisterEvolvedArray(EvolvedIndex,
+ RHSIndex);
+ break;
+ }
+ default:
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The variable '%s' is not a GF or an array",
+ CCTK_VarName(EvolvedIndex));
+ retval++;
+ break;
+ }
+ }
+ break;
+ }
+ case CCTK_VARIABLE_COMPLEX:
+ {
+ switch (GroupType)
+ {
+ case CCTK_GF:
+ {
+ retval +=
+ MoL_RegisterEvolvedComplex(EvolvedIndex,
+ RHSIndex);
+ break;
+ }
+ case CCTK_ARRAY:
+ {
+ retval +=
+ MoL_RegisterEvolvedComplexArray(EvolvedIndex,
+ RHSIndex);
+ break;
+ }
+ default:
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The variable '%s' is not a GF or an array",
+ CCTK_VarName(EvolvedIndex));
+ retval++;
+ break;
+ }
+ }
+ break;
+ }
+ default:
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The variable '%s' is neither REAL nor COMPLEX.",
+ CCTK_VarName(EvolvedIndex));
+ retval++;
+ break;
+ }
+ }
+ }
+
+ return retval;
+
+}
+
+ /*@@
+ @routine MoL_RegisterConstrained
+ @date Thu May 30 12:35:58 2002
+ @author Ian Hawke
+ @desc
+ Given the index of the GF, register it as a constrained variable.
+ If there's only one timelevel then ignore it as there will be no
+ rotation and so MoL doesn't have to do anything.
+ @enddesc
+ @calls
+ @calledby
+ @history
+
+ @endhistory
+
+@@*/
+
+CCTK_INT MoL_RegisterConstrained(CCTK_INT ConstrainedIndex)
+{
+
+ CCTK_INT retval, GroupType;
+
+ retval = 0;
+
+ GroupType = CCTK_GroupTypeFromVarI(ConstrainedIndex);
+ if (GroupType < 0)
+ {
+ CCTK_VWarn(0, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "Constrained index %i is not a real variable index.",
+ ConstrainedIndex);
+ retval++;
+ return retval;
+ }
+
+ switch (CCTK_VarTypeI(ConstrainedIndex))
+ {
+ case CCTK_VARIABLE_REAL:
+ {
+ switch (GroupType)
+ {
+ case CCTK_GF:
+ {
+ retval +=
+ MoL_RegisterConstrainedReal(ConstrainedIndex);
+ break;
+ }
+ case CCTK_ARRAY:
+ {
+ retval +=
+ MoL_RegisterConstrainedArray(ConstrainedIndex);
+ break;
+ }
+ default:
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The variable '%s' is not a GF or an array",
+ CCTK_VarName(ConstrainedIndex));
+ retval++;
+ break;
+ }
+ }
+ break;
+ }
+ case CCTK_VARIABLE_COMPLEX:
+ {
+ switch (GroupType)
+ {
+ case CCTK_GF:
+ {
+ retval +=
+ MoL_RegisterConstrainedComplex(ConstrainedIndex);
+ break;
+ }
+ case CCTK_ARRAY:
+ {
+ retval +=
+ MoL_RegisterConstrainedComplexArray(ConstrainedIndex);
+ break;
+ }
+ default:
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The variable '%s' is not a GF or an array",
+ CCTK_VarName(ConstrainedIndex));
+ retval++;
+ break;
+ }
+ }
+ break;
+ }
+ default:
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The variable '%s' is neither REAL nor COMPLEX.",
+ CCTK_VarName(ConstrainedIndex));
+ retval++;
+ break;
+ }
+ }
+
+ return retval;
+
+}
+
+ /*@@
+ @routine MoL_RegisterSaveAndRestore
+ @date Thu May 30 12:37:40 2002
+ @author Ian Hawke
+ @desc
+ Given a GF index store it for later use as a save and restore type.
+ @enddesc
+ @calls
+ @calledby
+ @history
+
+ @endhistory
+
+@@*/
+
+CCTK_INT MoL_RegisterSaveAndRestore(CCTK_INT SandRIndex)
+{
+
+ CCTK_INT retval, GroupType;
+
+ retval = 0;
+
+ GroupType = CCTK_GroupTypeFromVarI(SandRIndex);
+ if (GroupType < 0)
+ {
+ CCTK_VWarn(0, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "SaveAndRestore index %i is not a real variable index.",
+ SandRIndex);
+ retval++;
+ return retval;
+ }
+
+ switch (CCTK_VarTypeI(SandRIndex))
+ {
+ case CCTK_VARIABLE_REAL:
+ {
+ switch (GroupType)
+ {
+ case CCTK_GF:
+ {
+ retval +=
+ MoL_RegisterSaveAndRestoreReal(SandRIndex);
+ break;
+ }
+ case CCTK_ARRAY:
+ {
+ retval +=
+ MoL_RegisterSaveAndRestoreArray(SandRIndex);
+ break;
+ }
+ default:
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The variable '%s' is not a GF or an array",
+ CCTK_VarName(SandRIndex));
+ retval++;
+ break;
+ }
+ }
+ break;
+ }
+ case CCTK_VARIABLE_COMPLEX:
+ {
+ switch (GroupType)
+ {
+ case CCTK_GF:
+ {
+ retval +=
+ MoL_RegisterSaveAndRestoreComplex(SandRIndex);
+ break;
+ }
+ case CCTK_ARRAY:
+ {
+ retval +=
+ MoL_RegisterSaveAndRestoreComplexArray(SandRIndex);
+ break;
+ }
+ default:
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The variable '%s' is not a GF or an array",
+ CCTK_VarName(SandRIndex));
+ retval++;
+ break;
+ }
+ }
+ break;
+ }
+ default:
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The variable '%s' is neither REAL nor COMPLEX.",
+ CCTK_VarName(SandRIndex));
+ retval++;
+ break;
+ }
+ }
+
+ return retval;
+
+}
+
+CCTK_INT MoL_RegisterEvolvedGroup(CCTK_INT EvolvedGroupIndex,
+ CCTK_INT RHSGroupIndex)
+{
+
+ CCTK_INT retval, GroupFirstVar;
+
+ retval = 0;
+
+ GroupFirstVar = CCTK_FirstVarIndexI(EvolvedGroupIndex);
+ if (GroupFirstVar < 0)
+ {
+ CCTK_VWarn(0, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "Evolved group index %i is not a real group index.",
+ EvolvedGroupIndex);
+ retval++;
+ }
+
+ switch (CCTK_VarTypeI(CCTK_FirstVarIndexI(EvolvedGroupIndex)))
+ {
+ case CCTK_VARIABLE_REAL:
+ {
+ switch (CCTK_GroupTypeI(EvolvedGroupIndex))
+ {
+ case CCTK_GF:
+ {
+ retval +=
+ MoL_RegisterEvolvedRealGroup(EvolvedGroupIndex,
+ RHSGroupIndex);
+ break;
+ }
+ case CCTK_ARRAY:
+ {
+ retval +=
+ MoL_RegisterEvolvedArrayGroup(EvolvedGroupIndex,
+ RHSGroupIndex);
+ break;
+ }
+ default:
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The group '%s' is not a GF or an array",
+ CCTK_GroupName(EvolvedGroupIndex));
+ retval++;
+ break;
+ }
+ }
+ break;
+ }
+ case CCTK_VARIABLE_COMPLEX:
+ {
+ switch (CCTK_GroupTypeI(EvolvedGroupIndex))
+ {
+ case CCTK_GF:
+ {
+ retval +=
+ MoL_RegisterEvolvedComplexGroup(EvolvedGroupIndex,
+ RHSGroupIndex);
+ break;
+ }
+ case CCTK_ARRAY:
+ {
+ retval +=
+ MoL_RegisterEvolvedComplexArrayGroup(EvolvedGroupIndex,
+ RHSGroupIndex);
+ break;
+ }
+ default:
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The group '%s' is not a GF or an array",
+ CCTK_GroupName(EvolvedGroupIndex));
+ retval++;
+ break;
+ }
+ }
+ break;
+ }
+ default:
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The group '%s' is neither REAL nor COMPLEX.",
+ CCTK_GroupName(EvolvedGroupIndex));
+ retval++;
+ break;
+ }
+ }
+
+ return retval;
+
+}
+
+
+CCTK_INT MoL_RegisterConstrainedGroup(CCTK_INT ConstrainedGroupIndex)
+{
+
+ CCTK_INT retval, GroupFirstVar;
+
+ retval = 0;
+
+ GroupFirstVar = CCTK_FirstVarIndexI(ConstrainedGroupIndex);
+ if (GroupFirstVar < 0)
+ {
+ CCTK_VWarn(0, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "Constrained group index %i is not a real group index.",
+ ConstrainedGroupIndex);
+ retval++;
+ }
+
+ switch (CCTK_VarTypeI(CCTK_FirstVarIndexI(ConstrainedGroupIndex)))
+ {
+ case CCTK_VARIABLE_REAL:
+ {
+ switch (CCTK_GroupTypeI(ConstrainedGroupIndex))
+ {
+ case CCTK_GF:
+ {
+ retval +=
+ MoL_RegisterConstrainedRealGroup(ConstrainedGroupIndex);
+ break;
+ }
+ case CCTK_ARRAY:
+ {
+ retval +=
+ MoL_RegisterConstrainedArrayGroup(ConstrainedGroupIndex);
+ break;
+ }
+ default:
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The group '%s' is not a GF or an array",
+ CCTK_GroupName(ConstrainedGroupIndex));
+ retval++;
+ break;
+ }
+ }
+ break;
+ }
+ case CCTK_VARIABLE_COMPLEX:
+ {
+ switch (CCTK_GroupTypeI(ConstrainedGroupIndex))
+ {
+ case CCTK_GF:
+ {
+ retval +=
+ MoL_RegisterConstrainedComplexGroup(ConstrainedGroupIndex);
+ break;
+ }
+ case CCTK_ARRAY:
+ {
+ retval +=
+ MoL_RegisterConstrainedComplexArrayGroup(ConstrainedGroupIndex);
+ break;
+ }
+ default:
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The group '%s' is not a GF or an array",
+ CCTK_GroupName(ConstrainedGroupIndex));
+ retval++;
+ break;
+ }
+ }
+ break;
+ }
+ default:
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The group '%s' is neither REAL nor COMPLEX.",
+ CCTK_GroupName(ConstrainedGroupIndex));
+ retval++;
+ break;
+ }
+ }
+
+ return retval;
+
+}
+
+CCTK_INT MoL_RegisterSaveAndRestoreGroup(CCTK_INT SandRGroupIndex)
+{
+
+ CCTK_INT retval, GroupFirstVar;
+
+ retval = 0;
+
+ GroupFirstVar = CCTK_FirstVarIndexI(SandRGroupIndex);
+ if (GroupFirstVar < 0)
+ {
+ CCTK_VWarn(0, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "SaveAndRestore group index %i is not a real group index.",
+ SandRGroupIndex);
+ retval++;
+ }
+
+ switch (CCTK_VarTypeI(CCTK_FirstVarIndexI(SandRGroupIndex)))
+ {
+ case CCTK_VARIABLE_REAL:
+ {
+ switch (CCTK_GroupTypeI(SandRGroupIndex))
+ {
+ case CCTK_GF:
+ {
+ retval +=
+ MoL_RegisterSaveAndRestoreRealGroup(SandRGroupIndex);
+ break;
+ }
+ case CCTK_ARRAY:
+ {
+ retval +=
+ MoL_RegisterSaveAndRestoreArrayGroup(SandRGroupIndex);
+ break;
+ }
+ default:
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The group '%s' is not a GF or an array",
+ CCTK_GroupName(SandRGroupIndex));
+ retval++;
+ break;
+ }
+ }
+ break;
+ }
+ case CCTK_VARIABLE_COMPLEX:
+ {
+ switch (CCTK_GroupTypeI(SandRGroupIndex))
+ {
+ case CCTK_GF:
+ {
+ retval +=
+ MoL_RegisterSaveAndRestoreComplexGroup(SandRGroupIndex);
+ break;
+ }
+ case CCTK_ARRAY:
+ {
+ retval +=
+ MoL_RegisterSaveAndRestoreComplexArrayGroup(SandRGroupIndex);
+ break;
+ }
+ default:
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The group '%s' is not a GF or an array",
+ CCTK_GroupName(SandRGroupIndex));
+ retval++;
+ break;
+ }
+ }
+ break;
+ }
+ default:
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The group '%s' is neither REAL nor COMPLEX.",
+ CCTK_GroupName(SandRGroupIndex));
+ retval++;
+ break;
+ }
+ }
+
+ return retval;
+
+}
+
+/*
+ Temporary no-op functions for testing.
+*/
+
+ /*@@
+ @routine MoL_RegisterEvolved
+ @date Thu May 30 11:36:59 2002
+ @author Ian Hawke
+ @desc
+ Given the index of the GF to be evolved and the RHS GF, it stores
+ the indexes for later use together with various error checking.
+ @enddesc
+ @calls
+ @calledby
+ @history
+
+ @endhistory
+
+@@*/
+
+CCTK_INT MoL_RegisterEvolvedReal(CCTK_INT EvolvedIndex, CCTK_INT RHSIndex)
+{
+
DECLARE_CCTK_PARAMETERS;
- CCTK_INT ierr, index, varused, numtimelevs1, numtimelevs2;
+ CCTK_INT /* ierr, */ index, varused, numtimelevs1, numtimelevs2;
#ifdef MOLDEBUG
printf("Arrived in MoLRegisterEvolved \n");
@@ -88,6 +711,30 @@ CCTK_INT MoL_RegisterEvolved(CCTK_INT EvolvedIndex, CCTK_INT RHSIndex)
EvolvedVariableIndex);
#endif
+ if (!(CCTK_GroupTypeFromVarI(EvolvedIndex)==CCTK_GF))
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The variable %s is not a GF and so should not be registered with MoLRegisterEvolved.",
+ CCTK_VarName(EvolvedIndex));
+ }
+
+ if (!(CCTK_GroupTypeFromVarI(RHSIndex)==CCTK_GF))
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The rhs variable %s is not a GF and so should not be registered with MoLRegisterEvolved.",
+ CCTK_VarName(RHSIndex));
+ }
+
+ if (!(CCTK_VarTypeI(EvolvedIndex)==CCTK_VARIABLE_REAL))
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The variable %s is not of type CCTK_REAL and so should not be registered with MoLRegisterEvolved.",
+ CCTK_VarName(EvolvedIndex));
+ }
+
+ if (!(CCTK_VarTypeI(RHSIndex)==CCTK_VARIABLE_REAL))
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The rhs variable %s is not of type CCTK_REAL and so should not be registered with MoLRegisterEvolved.",
+ CCTK_VarName(RHSIndex));
+ }
+
numtimelevs1 = CCTK_NumTimeLevelsFromVarI(EvolvedIndex);
numtimelevs2 = CCTK_NumTimeLevelsFromVarI(RHSIndex);
@@ -192,12 +839,24 @@ CCTK_INT MoL_RegisterEvolved(CCTK_INT EvolvedIndex, CCTK_INT RHSIndex)
@@*/
-CCTK_INT MoL_RegisterConstrained(CCTK_INT ConstrainedIndex)
+CCTK_INT MoL_RegisterConstrainedReal(CCTK_INT ConstrainedIndex)
{
DECLARE_CCTK_PARAMETERS;
CCTK_INT numtimelevs, varused, evolved, index;
+
+ if (!(CCTK_GroupTypeFromVarI(ConstrainedIndex)==CCTK_GF))
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The variable %s is not a GF and so should not be registered with MoLRegisterConstrained.",
+ CCTK_VarName(ConstrainedIndex));
+ }
+
+ if (!(CCTK_VarTypeI(ConstrainedIndex)==CCTK_VARIABLE_REAL))
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The variable %s is not of type CCTK_REAL and so should not be registered with MoLRegisterConstrained.",
+ CCTK_VarName(ConstrainedIndex));
+ }
numtimelevs = CCTK_NumTimeLevelsFromVarI(ConstrainedIndex);
@@ -278,12 +937,24 @@ CCTK_INT MoL_RegisterConstrained(CCTK_INT ConstrainedIndex)
@@*/
-CCTK_INT MoL_RegisterSaveAndRestore(CCTK_INT SandRIndex)
+CCTK_INT MoL_RegisterSaveAndRestoreReal(CCTK_INT SandRIndex)
{
DECLARE_CCTK_PARAMETERS;
CCTK_INT numtimelevs, varused, evolved;
+
+ if (!(CCTK_GroupTypeFromVarI(SandRIndex)==CCTK_GF))
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The variable %s is not a GF and so should not be registered with MoLRegisterSaveAndRestore.",
+ CCTK_VarName(SandRIndex));
+ }
+
+ if (!(CCTK_VarTypeI(SandRIndex)==CCTK_VARIABLE_REAL))
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The variable %s is not of type CCTK_REAL and so should not be registered with MoLRegisterSaveAndRestore.",
+ CCTK_VarName(SandRIndex));
+ }
numtimelevs = CCTK_NumTimeLevelsFromVarI(SandRIndex);
@@ -338,7 +1009,7 @@ CCTK_INT MoL_RegisterSaveAndRestore(CCTK_INT SandRIndex)
}
-CCTK_INT MoL_RegisterEvolvedGroup(CCTK_INT EvolvedGroupIndex,
+CCTK_INT MoL_RegisterEvolvedRealGroup(CCTK_INT EvolvedGroupIndex,
CCTK_INT RHSGroupIndex)
{
@@ -374,14 +1045,14 @@ CCTK_INT MoL_RegisterEvolvedGroup(CCTK_INT EvolvedGroupIndex,
EvolvedVar < EvolvedGroupFirstVar + GroupNumVars;
EvolvedVar++, RHSVar++)
{
- retval += MoLRegisterEvolved(EvolvedVar, RHSVar);
+ retval += MoL_RegisterEvolvedReal(EvolvedVar, RHSVar);
}
return retval;
}
-CCTK_INT MoL_RegisterConstrainedGroup(CCTK_INT ConstrainedGroupIndex)
+CCTK_INT MoL_RegisterConstrainedRealGroup(CCTK_INT ConstrainedGroupIndex)
{
CCTK_INT ConstrainedGroupFirstVar, GroupNumVars, retval;
@@ -403,13 +1074,13 @@ CCTK_INT MoL_RegisterConstrainedGroup(CCTK_INT ConstrainedGroupIndex)
ConstrainedVar < ConstrainedGroupFirstVar + GroupNumVars;
ConstrainedVar++)
{
- retval += MoLRegisterConstrained(ConstrainedVar);
+ retval += MoL_RegisterConstrainedReal(ConstrainedVar);
}
return retval;
}
-CCTK_INT MoL_RegisterSaveAndRestoreGroup(CCTK_INT SandRGroupIndex)
+CCTK_INT MoL_RegisterSaveAndRestoreRealGroup(CCTK_INT SandRGroupIndex)
{
CCTK_INT SandRGroupFirstVar, GroupNumVars, retval;
@@ -431,17 +1102,1214 @@ CCTK_INT MoL_RegisterSaveAndRestoreGroup(CCTK_INT SandRGroupIndex)
SandRVar < SandRGroupFirstVar + GroupNumVars;
SandRVar++)
{
- retval += MoLRegisterSaveAndRestore(SandRVar);
+ retval += MoL_RegisterSaveAndRestoreReal(SandRVar);
}
return retval;
}
+CCTK_INT MoL_RegisterEvolvedComplex(CCTK_INT EvolvedIndex, CCTK_INT RHSIndex)
+{
+
+ DECLARE_CCTK_PARAMETERS;
+
+ CCTK_INT /* ierr, */ index, varused, numtimelevs1, numtimelevs2;
+
+#ifdef MOLDEBUG
+ printf("Arrived in MoLRegisterEvolvedComplex \n");
+ printf("The indexes are %d and %d.\n",EvolvedIndex, RHSIndex);
+ printf("These correspond to variables %s and %s.\n",
+ CCTK_VarName(EvolvedIndex),CCTK_VarName(RHSIndex));
+ printf("The pointer to EvolvedVariableIndex: %p\n",
+ EvolvedComplexVariableIndex);
+#endif
+
+ if (!(CCTK_GroupTypeFromVarI(EvolvedIndex)==CCTK_GF))
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The variable %s is not a GF and so should not be registered with MoLRegisterEvolved.",
+ CCTK_VarName(EvolvedIndex));
+ }
+
+ if (!(CCTK_GroupTypeFromVarI(RHSIndex)==CCTK_GF))
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The rhs variable %s is not a GF and so should not be registered with MoLRegisterEvolved.",
+ CCTK_VarName(RHSIndex));
+ }
+
+ if (!(CCTK_VarTypeI(EvolvedIndex)==CCTK_VARIABLE_REAL))
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The variable %s is not of type CCTK_REAL and so should not be registered with MoLRegisterEvolved.",
+ CCTK_VarName(EvolvedIndex));
+ }
+
+ if (!(CCTK_VarTypeI(EvolvedIndex)==CCTK_VARIABLE_COMPLEX))
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The variable %s is not of type CCTK_COMPLEX and so should not be registered with MoLRegisterEvolvedComplex.",
+ CCTK_VarName(EvolvedIndex));
+ }
+
+ if (!(CCTK_VarTypeI(RHSIndex)==CCTK_VARIABLE_COMPLEX))
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The rhs variable %s is not of type CCTK_COMPLEX and so should not be registered with MoLRegisterEvolvedComplex.",
+ CCTK_VarName(RHSIndex));
+ }
+
+ numtimelevs1 = CCTK_NumTimeLevelsFromVarI(EvolvedIndex);
+ numtimelevs2 = CCTK_NumTimeLevelsFromVarI(RHSIndex);
+
+ if ( (numtimelevs1 < 0) || (numtimelevs2 < 0) )
+ {
+ CCTK_VWarn(1,__LINE__,__FILE__,"MoL","Warning for variable index %i", EvolvedIndex);
+ CCTK_WARN(0, "The index passed does not correspond to a GF.");
+ }
+
+ if (numtimelevs1 < 2)
+ {
+ CCTK_VWarn(1,__LINE__,__FILE__,"MoL","Warning for variable index %i name %s", EvolvedIndex, CCTK_VarName(EvolvedIndex));
+ CCTK_WARN(0, "The GF passed only has one timelevel. It must have at least two.");
+ }
+
+ varused = 0;
+
+ for (index = 0; (index < MoLNumEvolvedComplexVariables)&&(!varused); index++)
+ {
+ varused = (EvolvedIndex == EvolvedComplexVariableIndex[index]);
+#ifdef MOLDEBUG
+ printf("Registering %d. Checking index %d which is %d\n",EvolvedIndex,
+ index,EvolvedComplexVariableIndex[index]);
+#endif
+ }
+
+ if (varused)
+ {
+
+ CCTK_VWarn(2,__LINE__,__FILE__,"MoL",
+ "The GF %s has already been registered as a complex evolved variable with RHS GF %s. The attempt to register with RHS GF %s will be ignored",
+ CCTK_VarName(EvolvedIndex),
+ CCTK_VarName(RHSComplexVariableIndex[index-1]),
+ CCTK_VarName(RHSIndex));
+
+ }
+ else
+ {
+
+ EvolvedComplexVariableIndex[MoLNumEvolvedComplexVariables] = EvolvedIndex;
+ RHSComplexVariableIndex[MoLNumEvolvedComplexVariables] = RHSIndex;
+
+ MoLNumEvolvedComplexVariables++;
+
+ if (MoLNumEvolvedComplexVariables > MoL_Num_ComplexEvolved_Vars)
+ {
+ CCTK_WARN(0,"You have tried to register more evolved complex variables than the accumulator parameter MoL_Num_ComplexEvolved_Variables allows. Check that you are accumulating onto this parameter correctly");
+ }
+
+ }
+
+ varused = 0;
+
+ for (index = 0; (index <
+ MoLNumConstrainedComplexVariables)&&(!varused);
+ index++)
+ {
+ varused = (EvolvedIndex == ConstrainedComplexVariableIndex[index]);
+ }
+
+ if (varused)
+ {
+ for (index = varused; index < MoLNumConstrainedComplexVariables-1; index++)
+ {
+ ConstrainedComplexVariableIndex[index] =
+ ConstrainedComplexVariableIndex[index+1];
+ }
+ MoLNumConstrainedComplexVariables--;
+ }
+
+ varused = 0;
+
+ for (index = 0; (index < MoLNumSandRComplexVariables)&&(!varused); index++)
+ {
+ varused = (EvolvedIndex == SandRComplexVariableIndex[index]);
+ }
+
+ if (varused)
+ {
+ for (index = varused; index < MoLNumSandRComplexVariables-1; index++)
+ {
+ SandRComplexVariableIndex[index] = SandRComplexVariableIndex[index+1];
+ }
+ MoLNumSandRComplexVariables--;
+ }
+
+ return 0;
+
+}
+
+CCTK_INT MoL_RegisterConstrainedComplex(CCTK_INT ConstrainedIndex)
+{
+
+ DECLARE_CCTK_PARAMETERS;
+
+ CCTK_INT numtimelevs, varused, evolved, index;
+
+ if (!(CCTK_GroupTypeFromVarI(ConstrainedIndex)==CCTK_GF))
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The variable %s is not a GF and so should not be registered with MoLRegisterConstrained.",
+ CCTK_VarName(ConstrainedIndex));
+ }
+
+ if (!(CCTK_VarTypeI(ConstrainedIndex)==CCTK_VARIABLE_COMPLEX))
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The variable %s is not of type CCTK_COMPLEX and so should not be registered with MoLRegisterConstrainedComplex.",
+ CCTK_VarName(ConstrainedIndex));
+ }
+
+ numtimelevs = CCTK_NumTimeLevelsFromVarI(ConstrainedIndex);
+
+ if (numtimelevs < 1) {
+
+ CCTK_VWarn(1,__LINE__,__FILE__,"MoL","Warning for constrained complex variable index %i", ConstrainedIndex);
+ CCTK_WARN(0, "The index passed does not correspond to a GF.");
+
+ }
+ else if (numtimelevs > 1) {
+
+ varused = 0;
+
+ for (evolved = 0; (evolved < MoLNumEvolvedComplexVariables)&&(!varused); evolved++)
+ {
+ varused = (EvolvedComplexVariableIndex[evolved] == ConstrainedIndex);
+ }
+
+ for (evolved = 0; (evolved <
+ MoLNumConstrainedComplexVariables)&&(!varused);
+ evolved++)
+ {
+ varused = (ConstrainedComplexVariableIndex[evolved] == ConstrainedIndex);
+ }
+
+ if (!varused)
+ {
+ ConstrainedComplexVariableIndex[MoLNumConstrainedComplexVariables] = ConstrainedIndex;
+ MoLNumConstrainedComplexVariables++;
+
+ if (MoLNumConstrainedComplexVariables >
+ MoL_Num_ComplexConstrained_Vars)
+ {
+ CCTK_WARN(0,"You have tried to register more evolved complex variables than the accumulator parameter MoL_Num_ComplexEvolved_Variables allows. Check that you are accumulating onto this parameter correctly");
+ }
+
+ }
+
+ varused = 0;
+
+ for (evolved = 0; (evolved <
+ MoLNumSandRComplexVariables)&&(!varused);
+ evolved++)
+ {
+ varused = (SandRComplexVariableIndex[evolved] == ConstrainedIndex);
+ }
+
+ if (varused)
+ {
+ for (index = evolved; index < MoLNumSandRComplexVariables-1; index++)
+ {
+ SandRComplexVariableIndex[index] = SandRComplexVariableIndex[index+1];
+ }
+ MoLNumSandRComplexVariables--;
+ }
+
+ }
+ else
+ {
+
+ CCTK_VInfo(CCTK_THORNSTRING,
+ "MoL will not treat variable %s as a constrained complex variable at it has only one timelevel. This should not cause problems with the evolution.\n",
+ CCTK_VarName(ConstrainedIndex));
+
+ }
+
+ return 0;
+
+}
+
+CCTK_INT MoL_RegisterSaveAndRestoreComplex(CCTK_INT SandRIndex)
+{
+
+ DECLARE_CCTK_PARAMETERS;
+
+ CCTK_INT numtimelevs, varused, evolved;
+
+ if (!(CCTK_GroupTypeFromVarI(SandRIndex)==CCTK_GF))
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The variable %s is not a GF and so should not be registered with MoLRegisterSaveAndRestore.",
+ CCTK_VarName(SandRIndex));
+ }
+
+ if (!(CCTK_VarTypeI(SandRIndex)==CCTK_VARIABLE_COMPLEX))
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The variable %s is not of type CCTK_COMPLEX and so should not be registered with MoLRegisterSaveAndRestoreComplex.",
+ CCTK_VarName(SandRIndex));
+ }
+
+ numtimelevs = CCTK_NumTimeLevelsFromVarI(SandRIndex);
+
+ if (numtimelevs < 1) {
+
+ CCTK_VWarn(1,__LINE__,__FILE__,"MoL","Warning for save and restore complex variable index %i", SandRIndex);
+ CCTK_WARN(0, "The index passed does not correspond to a GF.");
+
+ }
+ else if (numtimelevs > 1) {
+
+ varused = 0;
+
+ for (evolved = 0; (evolved < MoLNumEvolvedComplexVariables)&&(!varused); evolved++)
+ {
+ varused = (EvolvedComplexVariableIndex[evolved] == SandRIndex);
+ }
+
+ for (evolved = 0; (evolved <
+ MoLNumConstrainedComplexVariables)&&(!varused);
+ evolved++)
+ {
+ varused = (ConstrainedComplexVariableIndex[evolved] == SandRIndex);
+ }
+
+ for (evolved = 0; (evolved <
+ MoLNumSandRComplexVariables)&&(!varused);
+ evolved++)
+ {
+ varused = (SandRComplexVariableIndex[evolved] == SandRIndex);
+ }
+
+ if (!varused)
+ {
+ SandRComplexVariableIndex[MoLNumSandRComplexVariables] = SandRIndex;
+ MoLNumSandRComplexVariables++;
+
+ if (MoLNumSandRComplexVariables > MoL_Num_ComplexSaveAndRestore_Vars)
+ {
+ CCTK_WARN(0,"You have tried to register more evolved complex variables than the accumulator parameter MoL_Num_ComplexEvolved_Variables allows. Check that you are accumulating onto this parameter correctly");
+ }
+
+ }
+
+ }
+ else
+ {
+
+ CCTK_VInfo(CCTK_THORNSTRING,
+ "MoL will not treat variable %s as a save and restore complex variable at it has only one timelevel. This should not cause problems with the evolution.\n",
+ CCTK_VarName(SandRIndex));
+
+ }
+
+ return 0;
+
+}
+
+CCTK_INT MoL_RegisterEvolvedComplexGroup(CCTK_INT EvolvedGroupIndex,
+ CCTK_INT RHSGroupIndex)
+{
+
+ CCTK_INT EvolvedGroupFirstVar, RHSGroupFirstVar, GroupNumVars, retval;
+ CCTK_INT EvolvedVar, RHSVar;
+
+ EvolvedGroupFirstVar = CCTK_FirstVarIndexI(EvolvedGroupIndex);
+ if (EvolvedGroupFirstVar < 0)
+ {
+ CCTK_VWarn(0, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "Evolved complex group index %i is not a real group index.",
+ EvolvedGroupIndex);
+ }
+
+ RHSGroupFirstVar = CCTK_FirstVarIndexI(RHSGroupIndex);
+ if (RHSGroupFirstVar < 0)
+ {
+ CCTK_VWarn(0, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "RHS complex group index %d is not a real group index.",
+ RHSGroupIndex);
+ }
+
+ GroupNumVars = CCTK_NumVarsInGroupI(EvolvedGroupIndex);
+ if (CCTK_NumVarsInGroupI(RHSGroupIndex) != GroupNumVars)
+ {
+ CCTK_VWarn(0, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "There are a different number of variables in evolved complex group %d and RHS group %d.", EvolvedGroupIndex, RHSGroupIndex);
+ }
+
+ retval = 0;
+
+ for (EvolvedVar = EvolvedGroupFirstVar, RHSVar = RHSGroupFirstVar;
+ EvolvedVar < EvolvedGroupFirstVar + GroupNumVars;
+ EvolvedVar++, RHSVar++)
+ {
+ retval += MoL_RegisterEvolvedComplex(EvolvedVar, RHSVar);
+ }
+
+ return retval;
+
+}
+
+CCTK_INT MoL_RegisterConstrainedComplexGroup(CCTK_INT ConstrainedGroupIndex)
+{
+
+ CCTK_INT ConstrainedGroupFirstVar, GroupNumVars, retval;
+ CCTK_INT ConstrainedVar;
+
+ ConstrainedGroupFirstVar = CCTK_FirstVarIndexI(ConstrainedGroupIndex);
+ if (ConstrainedGroupFirstVar < 0)
+ {
+ CCTK_VWarn(0, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "Constrained complex group index %i is not a real group index.",
+ ConstrainedGroupIndex);
+ }
+
+ GroupNumVars = CCTK_NumVarsInGroupI(ConstrainedGroupIndex);
+
+ retval = 0;
+
+ for (ConstrainedVar = ConstrainedGroupFirstVar;
+ ConstrainedVar < ConstrainedGroupFirstVar + GroupNumVars;
+ ConstrainedVar++)
+ {
+ retval += MoL_RegisterConstrainedComplex(ConstrainedVar);
+ }
+
+ return retval;
+
+}
+
+CCTK_INT MoL_RegisterSaveAndRestoreComplexGroup(CCTK_INT SandRGroupIndex)
+{
+
+ CCTK_INT SandRGroupFirstVar, GroupNumVars, retval;
+ CCTK_INT SandRVar;
+
+ SandRGroupFirstVar = CCTK_FirstVarIndexI(SandRGroupIndex);
+ if (SandRGroupFirstVar < 0)
+ {
+ CCTK_VWarn(0, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "Save and Restore complex group index %i is not a real group index.",
+ SandRGroupIndex);
+ }
+
+ GroupNumVars = CCTK_NumVarsInGroupI(SandRGroupIndex);
+
+ retval = 0;
+
+ for (SandRVar = SandRGroupFirstVar;
+ SandRVar < SandRGroupFirstVar + GroupNumVars;
+ SandRVar++)
+ {
+ retval += MoL_RegisterSaveAndRestoreComplex(SandRVar);
+ }
+
+ return retval;
+
+}
+
+
+CCTK_INT MoL_RegisterEvolvedArray(CCTK_INT EvolvedIndex, CCTK_INT RHSIndex)
+{
+
+ DECLARE_CCTK_PARAMETERS;
+
+ CCTK_INT /* ierr, */ index, varused, numtimelevs1, numtimelevs2;
+
+#ifdef MOLDEBUG
+ printf("Arrived in MoLRegisterEvolvedArray \n");
+ printf("The indexes are %d and %d.\n",EvolvedIndex, RHSIndex);
+ printf("These correspond to variables %s and %s.\n",
+ CCTK_VarName(EvolvedIndex),CCTK_VarName(RHSIndex));
+ printf("The pointer to EvolvedVariableIndex: %p\n",
+ EvolvedArrayVariableIndex);
+#endif
+
+ if (!(CCTK_GroupTypeFromVarI(EvolvedIndex)==CCTK_ARRAY))
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The variable %s is not a ARRAY and so should not be registered with MoLRegisterEvolved.",
+ CCTK_VarName(EvolvedIndex));
+ }
+
+ if (!(CCTK_GroupTypeFromVarI(RHSIndex)==CCTK_ARRAY))
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The rhs variable %s is not a ARRAY and so should not be registered with MoLRegisterEvolved.",
+ CCTK_VarName(RHSIndex));
+ }
+
+ if (!(CCTK_VarTypeI(EvolvedIndex)==CCTK_VARIABLE_REAL))
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The variable %s is not of type CCTK_REAL and so should not be registered with MoLRegisterEvolvedArray.",
+ CCTK_VarName(EvolvedIndex));
+ }
+
+ if (!(CCTK_VarTypeI(RHSIndex)==CCTK_VARIABLE_REAL))
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The rhs variable %s is not of type CCTK_REAL and so should not be registered with MoLRegisterEvolvedArray.",
+ CCTK_VarName(RHSIndex));
+ }
+
+ numtimelevs1 = CCTK_NumTimeLevelsFromVarI(EvolvedIndex);
+ numtimelevs2 = CCTK_NumTimeLevelsFromVarI(RHSIndex);
+
+ if ( (numtimelevs1 < 0) || (numtimelevs2 < 0) )
+ {
+ CCTK_VWarn(1,__LINE__,__FILE__,"MoL","Warning for variable index %i", EvolvedIndex);
+ CCTK_WARN(0, "The index passed does not correspond to an array.");
+ }
+
+ if (numtimelevs1 < 2)
+ {
+ CCTK_VWarn(1,__LINE__,__FILE__,"MoL","Warning for variable index %i name %s", EvolvedIndex, CCTK_VarName(EvolvedIndex));
+ CCTK_WARN(0, "The ARRAY passed only has one timelevel. It must have at least two.");
+ }
+
+ varused = 0;
+
+ for (index = 0; (index < MoLNumEvolvedArrayVariables)&&(!varused); index++)
+ {
+ varused = (EvolvedIndex == EvolvedArrayVariableIndex[index]);
+#ifdef MOLDEBUG
+ printf("Registering %d. Checking index %d which is %d\n",EvolvedIndex,
+ index,EvolvedArrayVariableIndex[index]);
+#endif
+ }
+
+ if (varused)
+ {
+
+ CCTK_VWarn(2,__LINE__,__FILE__,"MoL",
+ "The array %s has already been registered as a array evolved variable with RHS array %s. The attempt to register with RHS array %s will be ignored",
+ CCTK_VarName(EvolvedIndex),
+ CCTK_VarName(RHSArrayVariableIndex[index-1]),
+ CCTK_VarName(RHSIndex));
+
+ }
+ else
+ {
+
+ EvolvedArrayVariableIndex[MoLNumEvolvedArrayVariables] = EvolvedIndex;
+ RHSArrayVariableIndex[MoLNumEvolvedArrayVariables] = RHSIndex;
+
+ MoLNumEvolvedArrayVariables++;
+
+ if (MoLNumEvolvedArrayVariables > MoL_Num_ArrayEvolved_Vars)
+ {
+ CCTK_WARN(0,"You have tried to register more evolved array variables than the accumulator parameter MoL_Num_ArrayEvolved_Variables allows. Check that you are accumulating onto this parameter correctly");
+ }
+
+ }
+
+ varused = 0;
+
+ for (index = 0; (index <
+ MoLNumConstrainedArrayVariables)&&(!varused);
+ index++)
+ {
+ varused = (EvolvedIndex == ConstrainedArrayVariableIndex[index]);
+ }
+
+ if (varused)
+ {
+ for (index = varused; index < MoLNumConstrainedArrayVariables-1; index++)
+ {
+ ConstrainedArrayVariableIndex[index] =
+ ConstrainedArrayVariableIndex[index+1];
+ }
+ MoLNumConstrainedArrayVariables--;
+ }
+
+ varused = 0;
+
+ for (index = 0; (index < MoLNumSandRArrayVariables)&&(!varused); index++)
+ {
+ varused = (EvolvedIndex == SandRArrayVariableIndex[index]);
+ }
+
+ if (varused)
+ {
+ for (index = varused; index < MoLNumSandRArrayVariables-1; index++)
+ {
+ SandRArrayVariableIndex[index] = SandRArrayVariableIndex[index+1];
+ }
+ MoLNumSandRArrayVariables--;
+ }
+
+ return 0;
+
+}
+
+CCTK_INT MoL_RegisterConstrainedArray(CCTK_INT ConstrainedIndex)
+{
+
+ DECLARE_CCTK_PARAMETERS;
+
+ CCTK_INT numtimelevs, varused, evolved, index;
+
+ if (!(CCTK_GroupTypeFromVarI(ConstrainedIndex)==CCTK_ARRAY))
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The variable %s is not a ARRAY and so should not be registered with MoLRegisterConstrained.",
+ CCTK_VarName(ConstrainedIndex));
+ }
+
+ if (!(CCTK_VarTypeI(ConstrainedIndex)==CCTK_VARIABLE_REAL))
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The variable %s is not of type CCTK_REAL and so should not be registered with MoLRegisterConstrainedArray.",
+ CCTK_VarName(ConstrainedIndex));
+ }
+
+ numtimelevs = CCTK_NumTimeLevelsFromVarI(ConstrainedIndex);
+
+ if (numtimelevs < 1) {
+
+ CCTK_VWarn(1,__LINE__,__FILE__,"MoL","Warning for constrained array variable index %i", ConstrainedIndex);
+ CCTK_WARN(0, "The index passed does not correspond to a array.");
+
+ }
+ else if (numtimelevs > 1) {
+
+ varused = 0;
+
+ for (evolved = 0; (evolved < MoLNumEvolvedArrayVariables)&&(!varused); evolved++)
+ {
+ varused = (EvolvedArrayVariableIndex[evolved] == ConstrainedIndex);
+ }
+
+ for (evolved = 0; (evolved <
+ MoLNumConstrainedArrayVariables)&&(!varused);
+ evolved++)
+ {
+ varused = (ConstrainedArrayVariableIndex[evolved] == ConstrainedIndex);
+ }
+
+ if (!varused)
+ {
+ ConstrainedArrayVariableIndex[MoLNumConstrainedArrayVariables] = ConstrainedIndex;
+ MoLNumConstrainedArrayVariables++;
+
+ if (MoLNumConstrainedArrayVariables >
+ MoL_Num_ArrayConstrained_Vars)
+ {
+ CCTK_WARN(0,"You have tried to register more evolved array variables than the accumulator parameter MoL_Num_ArrayEvolved_Variables allows. Check that you are accumulating onto this parameter correctly");
+ }
+
+ }
+
+ varused = 0;
+
+ for (evolved = 0; (evolved <
+ MoLNumSandRArrayVariables)&&(!varused);
+ evolved++)
+ {
+ varused = (SandRArrayVariableIndex[evolved] == ConstrainedIndex);
+ }
+
+ if (varused)
+ {
+ for (index = evolved; index < MoLNumSandRArrayVariables-1; index++)
+ {
+ SandRArrayVariableIndex[index] = SandRArrayVariableIndex[index+1];
+ }
+ MoLNumSandRArrayVariables--;
+ }
+
+ }
+ else
+ {
+
+ CCTK_VInfo(CCTK_THORNSTRING,
+ "MoL will not treat variable %s as a constrained array variable at it has only one timelevel. This should not cause problems with the evolution.\n",
+ CCTK_VarName(ConstrainedIndex));
+
+ }
+
+ return 0;
+
+}
+
+CCTK_INT MoL_RegisterSaveAndRestoreArray(CCTK_INT SandRIndex)
+{
+
+ DECLARE_CCTK_PARAMETERS;
+
+ CCTK_INT numtimelevs, varused, evolved;
+
+ if (!(CCTK_GroupTypeFromVarI(SandRIndex)==CCTK_ARRAY))
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The variable %s is not a ARRAY and so should not be registered with MoLRegisterSaveAndRestore.",
+ CCTK_VarName(SandRIndex));
+ }
+
+ if (!(CCTK_VarTypeI(SandRIndex)==CCTK_VARIABLE_REAL))
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The variable %s is not of type CCTK_REAL and so should not be registered with MoLRegisterSaveAndRestoreArray.",
+ CCTK_VarName(SandRIndex));
+ }
+
+ numtimelevs = CCTK_NumTimeLevelsFromVarI(SandRIndex);
+
+ if (numtimelevs < 1) {
+
+ CCTK_VWarn(1,__LINE__,__FILE__,"MoL","Warning for save and restore array variable index %i", SandRIndex);
+ CCTK_WARN(0, "The index passed does not correspond to a GF.");
+
+ }
+ else if (numtimelevs > 1) {
+
+ varused = 0;
+
+ for (evolved = 0; (evolved < MoLNumEvolvedArrayVariables)&&(!varused); evolved++)
+ {
+ varused = (EvolvedArrayVariableIndex[evolved] == SandRIndex);
+ }
+
+ for (evolved = 0; (evolved <
+ MoLNumConstrainedArrayVariables)&&(!varused);
+ evolved++)
+ {
+ varused = (ConstrainedArrayVariableIndex[evolved] == SandRIndex);
+ }
+
+ for (evolved = 0; (evolved <
+ MoLNumSandRArrayVariables)&&(!varused);
+ evolved++)
+ {
+ varused = (SandRArrayVariableIndex[evolved] == SandRIndex);
+ }
+
+ if (!varused)
+ {
+ SandRArrayVariableIndex[MoLNumSandRArrayVariables] = SandRIndex;
+ MoLNumSandRArrayVariables++;
+
+ if (MoLNumSandRArrayVariables > MoL_Num_ArraySaveAndRestore_Vars)
+ {
+ CCTK_WARN(0,"You have tried to register more evolved array variables than the accumulator parameter MoL_Num_ArrayEvolved_Variables allows. Check that you are accumulating onto this parameter correctly");
+ }
+
+ }
+
+ }
+ else
+ {
+
+ CCTK_VInfo(CCTK_THORNSTRING,
+ "MoL will not treat variable %s as a save and restore array variable at it has only one timelevel. This should not cause problems with the evolution.\n",
+ CCTK_VarName(SandRIndex));
+
+ }
+
+ return 0;
+
+}
+
+CCTK_INT MoL_RegisterEvolvedArrayGroup(CCTK_INT EvolvedGroupIndex,
+ CCTK_INT RHSGroupIndex)
+{
+
+ CCTK_INT EvolvedGroupFirstVar, RHSGroupFirstVar, GroupNumVars, retval;
+ CCTK_INT EvolvedVar, RHSVar;
+
+ EvolvedGroupFirstVar = CCTK_FirstVarIndexI(EvolvedGroupIndex);
+ if (EvolvedGroupFirstVar < 0)
+ {
+ CCTK_VWarn(0, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "Evolved array group index %i is not a real group index.",
+ EvolvedGroupIndex);
+ }
+
+ RHSGroupFirstVar = CCTK_FirstVarIndexI(RHSGroupIndex);
+ if (RHSGroupFirstVar < 0)
+ {
+ CCTK_VWarn(0, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "RHS array group index %d is not a real group index.",
+ RHSGroupIndex);
+ }
+
+ GroupNumVars = CCTK_NumVarsInGroupI(EvolvedGroupIndex);
+ if (CCTK_NumVarsInGroupI(RHSGroupIndex) != GroupNumVars)
+ {
+ CCTK_VWarn(0, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "There are a different number of variables in evolved array group %d and RHS group %d.", EvolvedGroupIndex, RHSGroupIndex);
+ }
+
+ retval = 0;
+
+ for (EvolvedVar = EvolvedGroupFirstVar, RHSVar = RHSGroupFirstVar;
+ EvolvedVar < EvolvedGroupFirstVar + GroupNumVars;
+ EvolvedVar++, RHSVar++)
+ {
+ retval += MoL_RegisterEvolvedArray(EvolvedVar, RHSVar);
+ }
+
+ return retval;
+
+}
+
+CCTK_INT MoL_RegisterConstrainedArrayGroup(CCTK_INT ConstrainedGroupIndex)
+{
+
+ CCTK_INT ConstrainedGroupFirstVar, GroupNumVars, retval;
+ CCTK_INT ConstrainedVar;
+
+ ConstrainedGroupFirstVar = CCTK_FirstVarIndexI(ConstrainedGroupIndex);
+ if (ConstrainedGroupFirstVar < 0)
+ {
+ CCTK_VWarn(0, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "Constrained array group index %i is not a real group index.",
+ ConstrainedGroupIndex);
+ }
+
+ GroupNumVars = CCTK_NumVarsInGroupI(ConstrainedGroupIndex);
+
+ retval = 0;
+
+ for (ConstrainedVar = ConstrainedGroupFirstVar;
+ ConstrainedVar < ConstrainedGroupFirstVar + GroupNumVars;
+ ConstrainedVar++)
+ {
+ retval += MoL_RegisterConstrainedArray(ConstrainedVar);
+ }
+
+ return retval;
+
+}
+
+CCTK_INT MoL_RegisterSaveAndRestoreArrayGroup(CCTK_INT SandRGroupIndex)
+{
+
+ CCTK_INT SandRGroupFirstVar, GroupNumVars, retval;
+ CCTK_INT SandRVar;
+
+ SandRGroupFirstVar = CCTK_FirstVarIndexI(SandRGroupIndex);
+ if (SandRGroupFirstVar < 0)
+ {
+ CCTK_VWarn(0, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "Save and Restore array group index %i is not a real group index.",
+ SandRGroupIndex);
+ }
+
+ GroupNumVars = CCTK_NumVarsInGroupI(SandRGroupIndex);
+
+ retval = 0;
+
+ for (SandRVar = SandRGroupFirstVar;
+ SandRVar < SandRGroupFirstVar + GroupNumVars;
+ SandRVar++)
+ {
+ retval += MoL_RegisterSaveAndRestoreArray(SandRVar);
+ }
+
+ return retval;
+
+}
+
+
+CCTK_INT MoL_RegisterEvolvedComplexArray(CCTK_INT EvolvedIndex,
+ CCTK_INT RHSIndex)
+{
+
+ DECLARE_CCTK_PARAMETERS;
+
+ CCTK_INT /* ierr, */ index, varused, numtimelevs1, numtimelevs2;
+
+#ifdef MOLDEBUG
+ printf("Arrived in MoLRegisterEvolvedComplexArray \n");
+ printf("The indexes are %d and %d.\n",EvolvedIndex, RHSIndex);
+ printf("These correspond to variables %s and %s.\n",
+ CCTK_VarName(EvolvedIndex),CCTK_VarName(RHSIndex));
+ printf("The pointer to EvolvedVariableIndex: %p\n",
+ EvolvedComplexArrayVariableIndex);
+#endif
+
+ if (!(CCTK_GroupTypeFromVarI(EvolvedIndex)==CCTK_ARRAY))
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The variable %s is not a ARRAY and so should not be registered with MoLRegisterEvolved.",
+ CCTK_VarName(EvolvedIndex));
+ }
+
+ if (!(CCTK_GroupTypeFromVarI(RHSIndex)==CCTK_ARRAY))
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The rhs variable %s is not a ARRAY and so should not be registered with MoLRegisterEvolved.",
+ CCTK_VarName(RHSIndex));
+ }
+
+ if (!(CCTK_VarTypeI(EvolvedIndex)==CCTK_VARIABLE_COMPLEX))
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The variable %s is not of type CCTK_COMPLEX and so should not be registered with MoLRegisterEvolvedArrayComplex.",
+ CCTK_VarName(EvolvedIndex));
+ }
+
+ if (!(CCTK_VarTypeI(RHSIndex)==CCTK_VARIABLE_COMPLEX))
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The rhs variable %s is not of type CCTK_COMPLEX and so should not be registered with MoLRegisterEvolvedArrayComplex.",
+ CCTK_VarName(RHSIndex));
+ }
+
+ numtimelevs1 = CCTK_NumTimeLevelsFromVarI(EvolvedIndex);
+ numtimelevs2 = CCTK_NumTimeLevelsFromVarI(RHSIndex);
+
+ if ( (numtimelevs1 < 0) || (numtimelevs2 < 0) )
+ {
+ CCTK_VWarn(1,__LINE__,__FILE__,"MoL","Warning for variable index %i", EvolvedIndex);
+ CCTK_WARN(0, "The index passed does not correspond to a GF.");
+ }
+
+ if (numtimelevs1 < 2)
+ {
+ CCTK_VWarn(1,__LINE__,__FILE__,"MoL","Warning for variable index %i name %s", EvolvedIndex, CCTK_VarName(EvolvedIndex));
+ CCTK_WARN(0, "The GF passed only has one timelevel. It must have at least two.");
+ }
+
+ varused = 0;
+
+ for (index = 0; (index < MoLNumEvolvedComplexArrayVariables)&&(!varused); index++)
+ {
+ varused = (EvolvedIndex == EvolvedComplexArrayVariableIndex[index]);
+#ifdef MOLDEBUG
+ printf("Registering %d. Checking index %d which is %d\n",EvolvedIndex,
+ index,EvolvedComplexArrayVariableIndex[index]);
+#endif
+ }
+
+ if (varused)
+ {
+
+ CCTK_VWarn(2,__LINE__,__FILE__,"MoL",
+ "The GF %s has already been registered as a complex array evolved variable with RHS GF %s. The attempt to register with RHS GF %s will be ignored",
+ CCTK_VarName(EvolvedIndex),
+ CCTK_VarName(RHSComplexArrayVariableIndex[index-1]),
+ CCTK_VarName(RHSIndex));
+
+ }
+ else
+ {
+
+ EvolvedComplexArrayVariableIndex[MoLNumEvolvedComplexArrayVariables] = EvolvedIndex;
+ RHSComplexArrayVariableIndex[MoLNumEvolvedComplexArrayVariables] = RHSIndex;
+
+ MoLNumEvolvedComplexArrayVariables++;
+
+ if (MoLNumEvolvedComplexArrayVariables > MoL_Num_ComplexArrayEvolved_Vars)
+ {
+ CCTK_WARN(0,"You have tried to register more evolved complex array variables than the accumulator parameter MoL_Num_ComplexArrayEvolved_Variables allows. Check that you are accumulating onto this parameter correctly");
+ }
+
+ }
+
+ varused = 0;
+
+ for (index = 0; (index <
+ MoLNumConstrainedComplexArrayVariables)&&(!varused);
+ index++)
+ {
+ varused = (EvolvedIndex == ConstrainedComplexArrayVariableIndex[index]);
+ }
+
+ if (varused)
+ {
+ for (index = varused; index < MoLNumConstrainedComplexArrayVariables-1; index++)
+ {
+ ConstrainedComplexArrayVariableIndex[index] =
+ ConstrainedComplexArrayVariableIndex[index+1];
+ }
+ MoLNumConstrainedComplexArrayVariables--;
+ }
+
+ varused = 0;
+
+ for (index = 0; (index < MoLNumSandRComplexArrayVariables)&&(!varused); index++)
+ {
+ varused = (EvolvedIndex == SandRComplexArrayVariableIndex[index]);
+ }
+
+ if (varused)
+ {
+ for (index = varused; index < MoLNumSandRComplexArrayVariables-1; index++)
+ {
+ SandRComplexArrayVariableIndex[index] = SandRComplexArrayVariableIndex[index+1];
+ }
+ MoLNumSandRComplexArrayVariables--;
+ }
+
+ return 0;
+
+}
+
+CCTK_INT MoL_RegisterConstrainedComplexArray(CCTK_INT ConstrainedIndex)
+{
+
+ DECLARE_CCTK_PARAMETERS;
+
+ CCTK_INT numtimelevs, varused, evolved, index;
+
+ if (!(CCTK_GroupTypeFromVarI(ConstrainedIndex)==CCTK_ARRAY))
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The variable %s is not a ARRAY and so should not be registered with MoLRegisterConstrained.",
+ CCTK_VarName(ConstrainedIndex));
+ }
+
+ if (!(CCTK_VarTypeI(ConstrainedIndex)==CCTK_VARIABLE_COMPLEX))
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The variable %s is not of type CCTK_COMPLEX and so should not be registered with MoLRegisterConstrainedArrayComplex.",
+ CCTK_VarName(ConstrainedIndex));
+ }
+
+ numtimelevs = CCTK_NumTimeLevelsFromVarI(ConstrainedIndex);
+
+ if (numtimelevs < 1) {
+
+ CCTK_VWarn(1,__LINE__,__FILE__,"MoL","Warning for constrained complex array variable index %i", ConstrainedIndex);
+ CCTK_WARN(0, "The index passed does not correspond to a GF.");
+
+ }
+ else if (numtimelevs > 1) {
+
+ varused = 0;
+
+ for (evolved = 0; (evolved < MoLNumEvolvedComplexArrayVariables)&&(!varused); evolved++)
+ {
+ varused = (EvolvedComplexArrayVariableIndex[evolved] == ConstrainedIndex);
+ }
+
+ for (evolved = 0; (evolved <
+ MoLNumConstrainedComplexArrayVariables)&&(!varused);
+ evolved++)
+ {
+ varused = (ConstrainedComplexArrayVariableIndex[evolved] == ConstrainedIndex);
+ }
+
+ if (!varused)
+ {
+ ConstrainedComplexArrayVariableIndex[MoLNumConstrainedComplexArrayVariables] = ConstrainedIndex;
+ MoLNumConstrainedComplexArrayVariables++;
+
+ if (MoLNumConstrainedComplexArrayVariables >
+ MoL_Num_ComplexArrayConstrained_Vars)
+ {
+ CCTK_WARN(0,"You have tried to register more evolved complex array variables than the accumulator parameter MoL_Num_ComplexArrayEvolved_Variables allows. Check that you are accumulating onto this parameter correctly");
+ }
+
+ }
+
+ varused = 0;
+
+ for (evolved = 0; (evolved <
+ MoLNumSandRComplexArrayVariables)&&(!varused);
+ evolved++)
+ {
+ varused = (SandRComplexArrayVariableIndex[evolved] == ConstrainedIndex);
+ }
+
+ if (varused)
+ {
+ for (index = evolved; index < MoLNumSandRComplexArrayVariables-1; index++)
+ {
+ SandRComplexArrayVariableIndex[index] = SandRComplexArrayVariableIndex[index+1];
+ }
+ MoLNumSandRComplexArrayVariables--;
+ }
+
+ }
+ else
+ {
+
+ CCTK_VInfo(CCTK_THORNSTRING,
+ "MoL will not treat variable %s as a constrained complex array variable at it has only one timelevel. This should not cause problems with the evolution.\n",
+ CCTK_VarName(ConstrainedIndex));
+
+ }
+
+ return 0;
+
+}
+
+CCTK_INT MoL_RegisterSaveAndRestoreComplexArray(CCTK_INT SandRIndex)
+{
+
+ DECLARE_CCTK_PARAMETERS;
+
+ CCTK_INT numtimelevs, varused, evolved;
+
+ if (!(CCTK_GroupTypeFromVarI(SandRIndex)==CCTK_ARRAY))
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The variable %s is not a ARRAY and so should not be registered with MoLRegisterSaveAndRestore.",
+ CCTK_VarName(SandRIndex));
+ }
+
+ if (!(CCTK_VarTypeI(SandRIndex)==CCTK_VARIABLE_COMPLEX))
+ {
+ CCTK_VWarn(0,__LINE__,__FILE__,"MoL","The variable %s is not of type CCTK_COMPLEX and so should not be registered with MoLRegisterSaveAndRestoreArrayComplex.",
+ CCTK_VarName(SandRIndex));
+ }
+
+ numtimelevs = CCTK_NumTimeLevelsFromVarI(SandRIndex);
+
+ if (numtimelevs < 1) {
+
+ CCTK_VWarn(1,__LINE__,__FILE__,"MoL","Warning for save and restore complex array variable index %i", SandRIndex);
+ CCTK_WARN(0, "The index passed does not correspond to a GF.");
+
+ }
+ else if (numtimelevs > 1) {
+
+ varused = 0;
+
+ for (evolved = 0; (evolved < MoLNumEvolvedComplexArrayVariables)&&(!varused); evolved++)
+ {
+ varused = (EvolvedComplexArrayVariableIndex[evolved] == SandRIndex);
+ }
+
+ for (evolved = 0; (evolved <
+ MoLNumConstrainedComplexArrayVariables)&&(!varused);
+ evolved++)
+ {
+ varused = (ConstrainedComplexArrayVariableIndex[evolved] == SandRIndex);
+ }
+
+ for (evolved = 0; (evolved <
+ MoLNumSandRComplexArrayVariables)&&(!varused);
+ evolved++)
+ {
+ varused = (SandRComplexArrayVariableIndex[evolved] == SandRIndex);
+ }
+
+ if (!varused)
+ {
+ SandRComplexArrayVariableIndex[MoLNumSandRComplexArrayVariables] = SandRIndex;
+ MoLNumSandRComplexArrayVariables++;
+
+ if (MoLNumSandRComplexArrayVariables > MoL_Num_ComplexArraySaveAndRestore_Vars)
+ {
+ CCTK_WARN(0,"You have tried to register more evolved complex array variables than the accumulator parameter MoL_Num_ComplexArrayEvolved_Variables allows. Check that you are accumulating onto this parameter correctly");
+ }
+
+ }
+
+ }
+ else
+ {
+
+ CCTK_VInfo(CCTK_THORNSTRING,
+ "MoL will not treat variable %s as a save and restore complex array variable at it has only one timelevel. This should not cause problems with the evolution.\n",
+ CCTK_VarName(SandRIndex));
+
+ }
+
+ return 0;
+
+}
+
+CCTK_INT MoL_RegisterEvolvedComplexArrayGroup(CCTK_INT EvolvedGroupIndex,
+ CCTK_INT RHSGroupIndex)
+{
+
+ CCTK_INT EvolvedGroupFirstVar, RHSGroupFirstVar, GroupNumVars, retval;
+ CCTK_INT EvolvedVar, RHSVar;
+
+ EvolvedGroupFirstVar = CCTK_FirstVarIndexI(EvolvedGroupIndex);
+ if (EvolvedGroupFirstVar < 0)
+ {
+ CCTK_VWarn(0, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "Evolved complex array group index %i is not a real group index.",
+ EvolvedGroupIndex);
+ }
+
+ RHSGroupFirstVar = CCTK_FirstVarIndexI(RHSGroupIndex);
+ if (RHSGroupFirstVar < 0)
+ {
+ CCTK_VWarn(0, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "RHS complex array group index %d is not a real group index.",
+ RHSGroupIndex);
+ }
+
+ GroupNumVars = CCTK_NumVarsInGroupI(EvolvedGroupIndex);
+ if (CCTK_NumVarsInGroupI(RHSGroupIndex) != GroupNumVars)
+ {
+ CCTK_VWarn(0, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "There are a different number of variables in evolved complex array group %d and RHS group %d.", EvolvedGroupIndex, RHSGroupIndex);
+ }
+
+ retval = 0;
+
+ for (EvolvedVar = EvolvedGroupFirstVar, RHSVar = RHSGroupFirstVar;
+ EvolvedVar < EvolvedGroupFirstVar + GroupNumVars;
+ EvolvedVar++, RHSVar++)
+ {
+ retval += MoL_RegisterEvolvedComplexArray(EvolvedVar, RHSVar);
+ }
+
+ return retval;
+
+}
+
+CCTK_INT MoL_RegisterConstrainedComplexArrayGroup(CCTK_INT ConstrainedGroupIndex)
+{
+
+ CCTK_INT ConstrainedGroupFirstVar, GroupNumVars, retval;
+ CCTK_INT ConstrainedVar;
+
+ ConstrainedGroupFirstVar = CCTK_FirstVarIndexI(ConstrainedGroupIndex);
+ if (ConstrainedGroupFirstVar < 0)
+ {
+ CCTK_VWarn(0, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "Constrained complex array group index %i is not a real group index.",
+ ConstrainedGroupIndex);
+ }
+
+ GroupNumVars = CCTK_NumVarsInGroupI(ConstrainedGroupIndex);
+
+ retval = 0;
+
+ for (ConstrainedVar = ConstrainedGroupFirstVar;
+ ConstrainedVar < ConstrainedGroupFirstVar + GroupNumVars;
+ ConstrainedVar++)
+ {
+ retval += MoL_RegisterConstrainedComplexArray(ConstrainedVar);
+ }
+
+ return retval;
+
+}
+
+CCTK_INT MoL_RegisterSaveAndRestoreComplexArrayGroup(CCTK_INT SandRGroupIndex)
+{
+
+ CCTK_INT SandRGroupFirstVar, GroupNumVars, retval;
+ CCTK_INT SandRVar;
+
+ SandRGroupFirstVar = CCTK_FirstVarIndexI(SandRGroupIndex);
+ if (SandRGroupFirstVar < 0)
+ {
+ CCTK_VWarn(0, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "Save and Restore complex array group index %i is not a real group index.",
+ SandRGroupIndex);
+ }
+
+ GroupNumVars = CCTK_NumVarsInGroupI(SandRGroupIndex);
+
+ retval = 0;
+
+ for (SandRVar = SandRGroupFirstVar;
+ SandRVar < SandRGroupFirstVar + GroupNumVars;
+ SandRVar++)
+ {
+ retval += MoL_RegisterSaveAndRestoreComplexArray(SandRVar);
+ }
+
+ return retval;
+
+}
+
+
/*
Old function names. Just calls the new version.
Included for compatibility
+ Now removed.
*/
+/*
CCTK_INT MoL_RegisterVar(CCTK_INT molvarindex,CCTK_INT molrhsvarindex)
{
return MoL_RegisterEvolved(molvarindex, molrhsvarindex);
@@ -491,12 +2359,15 @@ CCTK_INT MoL_ChangeVarToNone(CCTK_INT removeindex)
{
return MoL_ChangeToNone(removeindex);
}
+*/
/*
Fortran wrappers for the above functions.
Should be replaced by using function aliasing eventually.
+ Now removed.
*/
+/*
void CCTK_FCALL CCTK_FNAME(MoL_RegisterEvolved)(int *ierr,
CCTK_INT *EvolvedIndex,
CCTK_INT *RHSIndex)
@@ -518,9 +2389,12 @@ void CCTK_FCALL CCTK_FNAME(MoL_RegisterSaveAndRestore)(int *ierr,
*ierr = MoL_RegisterSaveAndRestore(*EvolvedIndex);
return;
}
+*/
/* And for MoL compatibility... */
+/* Now removed */
+/*
void CCTK_FCALL CCTK_FNAME(MoL_RegisterVar)(int *ierr,
CCTK_INT *molvarindex,
CCTK_INT *molrhsvarindex)
@@ -593,6 +2467,7 @@ void CCTK_FCALL CCTK_FNAME(MoL_ChangeVarToNone)(int *ierr,
*ierr = MoL_ChangeVarToNone(*removeindex);
return;
}
+*/
/********************************************************************
********************* Local Routines *************************
diff --git a/src/SandR.c b/src/SandR.c
index ea419ff..586b31f 100644
--- a/src/SandR.c
+++ b/src/SandR.c
@@ -8,6 +8,8 @@
@version $Header$
@@*/
+#include <string.h>
+
#include "cctk.h"
#include "cctk_Arguments.h"
#include "cctk_Parameters.h"
@@ -72,10 +74,11 @@ void MoL_RestoreSandR(CCTK_ARGUMENTS)
DECLARE_CCTK_ARGUMENTS;
DECLARE_CCTK_PARAMETERS;
- CCTK_INT index, var;
+ CCTK_INT /* index, */ var;
CCTK_INT totalsize;
CCTK_INT vectorstart;
CCTK_REAL *SandRDataArray;
+ CCTK_COMPLEX *SandRComplexDataArray;
totalsize = cctk_lsh[0] * cctk_lsh[1] * cctk_lsh[2];
@@ -96,6 +99,18 @@ void MoL_RestoreSandR(CCTK_ARGUMENTS)
memcpy(SandRDataArray, &SandRScratchSpace[vectorstart],
totalsize * sizeof(CCTK_REAL));
}
+
+ for (var = 0; var < MoLNumSandRComplexVariables; var++)
+ {
+
+ SandRComplexDataArray = (CCTK_COMPLEX *)CCTK_VarDataPtrI(cctkGH, 0,
+ SandRComplexVariableIndex[var]);
+
+ vectorstart = var * totalsize;
+
+ memcpy(SandRComplexDataArray, &ComplexSandRScratchSpace[vectorstart],
+ totalsize * sizeof(CCTK_COMPLEX));
+ }
return;
diff --git a/src/SetTime.c b/src/SetTime.c
index 71d2f61..aeeee77 100644
--- a/src/SetTime.c
+++ b/src/SetTime.c
@@ -9,6 +9,8 @@
@version $Header$
@@*/
+#include <stdlib.h>
+
#include "cctk.h"
#include "cctk_Arguments.h"
#include "cctk_Parameters.h"
diff --git a/src/Startup.c b/src/Startup.c
index 3839de6..01ff6d6 100644
--- a/src/Startup.c
+++ b/src/Startup.c
@@ -32,6 +32,36 @@ CCTK_INT MoLNumEvolvedVariables = 0;
CCTK_INT MoLNumConstrainedVariables = 0;
CCTK_INT MoLNumSandRVariables = 0;
+
+CCTK_INT *EvolvedComplexVariableIndex = NULL;
+CCTK_INT *RHSComplexVariableIndex = NULL;
+CCTK_INT *ConstrainedComplexVariableIndex = NULL;
+CCTK_INT *SandRComplexVariableIndex = NULL;
+
+CCTK_INT MoLNumEvolvedComplexVariables = 0;
+CCTK_INT MoLNumConstrainedComplexVariables = 0;
+CCTK_INT MoLNumSandRComplexVariables = 0;
+
+
+CCTK_INT *EvolvedArrayVariableIndex = NULL;
+CCTK_INT *RHSArrayVariableIndex = NULL;
+CCTK_INT *ConstrainedArrayVariableIndex = NULL;
+CCTK_INT *SandRArrayVariableIndex = NULL;
+
+CCTK_INT MoLNumEvolvedArrayVariables = 0;
+CCTK_INT MoLNumConstrainedArrayVariables = 0;
+CCTK_INT MoLNumSandRArrayVariables = 0;
+
+
+CCTK_INT *EvolvedComplexArrayVariableIndex = NULL;
+CCTK_INT *RHSComplexArrayVariableIndex = NULL;
+CCTK_INT *ConstrainedComplexArrayVariableIndex = NULL;
+CCTK_INT *SandRComplexArrayVariableIndex = NULL;
+
+CCTK_INT MoLNumEvolvedComplexArrayVariables = 0;
+CCTK_INT MoLNumConstrainedComplexArrayVariables = 0;
+CCTK_INT MoLNumSandRComplexArrayVariables = 0;
+
/********************************************************************
********************* Local Data Types ***********************
********************************************************************/