diff options
-rw-r--r-- | interface.ccl | 2 | ||||
-rw-r--r-- | param.ccl | 2 | ||||
-rw-r--r-- | src/Registration.c | 40 |
3 files changed, 43 insertions, 1 deletions
diff --git a/interface.ccl b/interface.ccl index c2bcd1c..58e5ea6 100644 --- a/interface.ccl +++ b/interface.ccl @@ -29,6 +29,7 @@ CCTK_INT FUNCTION MoLChangeToEvolved(CCTK_INT IN EvolvedIndex, \ CCTK_INT FUNCTION MoLChangeToConstrained(CCTK_INT IN ConstrainedIndex) CCTK_INT FUNCTION MoLChangeToSaveAndRestore(CCTK_INT IN SandRIndex) CCTK_INT FUNCTION MoLChangeToNone(CCTK_INT IN RemoveIndex) +CCTK_INT FUNCTION MoLQueryEvolvedRHS(CCTK_INT IN EvolvedIndex) PROVIDES FUNCTION MoLRegisterEvolved WITH MoL_RegisterEvolved LANGUAGE C PROVIDES FUNCTION MoLRegisterConstrained WITH MoL_RegisterConstrained \ @@ -47,6 +48,7 @@ PROVIDES FUNCTION MoLChangeToConstrained WITH MoL_ChangeToConstrained \ PROVIDES FUNCTION MoLChangeToSaveAndRestore WITH MoL_ChangeToSaveAndRestore \ LANGUAGE C PROVIDES FUNCTION MoLChangeToNone WITH MoL_ChangeToNone LANGUAGE C +PROVIDES FUNCTION MoLQueryEvolvedRHS WITH MoL_QueryEvolvedRHS LANGUAGE C ################################################################ ### Aliased registration and type changing functions for the ### @@ -124,4 +124,4 @@ STRING Generic_Method_Descriptor "A string used to create a table containing the BOOLEAN MoL_NaN_Check "Should the RHS GFs be checked for NaNs?" { -} "no"
\ No newline at end of file +} "no" diff --git a/src/Registration.c b/src/Registration.c index 8ba9e78..5693156 100644 --- a/src/Registration.c +++ b/src/Registration.c @@ -105,6 +105,8 @@ CCTK_INT MoL_RegisterEvolvedComplexArrayGroup(CCTK_INT EvolvedGroupIndex, CCTK_INT MoL_RegisterConstrainedComplexArrayGroup(CCTK_INT ConstrainedGroupIndex); CCTK_INT MoL_RegisterSaveAndRestoreComplexArrayGroup(CCTK_INT SandRGroupIndex); + +CCTK_INT MoL_QueryEvolvedRHS(CCTK_INT EvolvedIndex); /******************************************************************** ********************* Local Data ***************************** @@ -2581,6 +2583,44 @@ CCTK_INT MoL_RegisterSaveAndRestoreComplexArrayGroup(CCTK_INT SandRGroupIndex) } + /*@@ + @routine MoL_QueryEvolvedRHS + @date Thu Dec 25 2004 + @author Erik Schnetter + @desc + Given the index of a registered evolved GF, + returns the corresponding RHS GF. + @enddesc + @calls + @calledby + @history + + @endhistory + +@@*/ + +CCTK_INT MoL_QueryEvolvedRHS(CCTK_INT EvolvedIndex) +{ + CCTK_INT index; + + if (EvolvedIndex < 0) + { + CCTK_VWarn(0, __LINE__, __FILE__, CCTK_THORNSTRING, + "Evolved variables index %i is not a real variable index.", + EvolvedIndex); + } + + for (index = 0; index < MoLNumEvolvedVariables; index++) + { + if (EvolvedVariableIndex[index] == EvolvedIndex) + { + return RHSVariableIndex[index]; + } + } + + return -1; + +} /* Old function names. Just calls the new version. |