diff options
author | allen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-07-30 10:50:15 +0000 |
---|---|---|
committer | allen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-07-30 10:50:15 +0000 |
commit | 3d5441fc4bec3a8460094139c8595ec62cc4d0b2 (patch) | |
tree | e80cbf6d268152ce32f6badeb4af8c9b2bcf3dd5 /doc/UsersGuide | |
parent | ae47350fd6992c0a3ebc378bae2453d8503549c8 (diff) |
Added CCTK functions
git-svn-id: http://svn.cactuscode.org/flesh/trunk@827 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'doc/UsersGuide')
-rw-r--r-- | doc/UsersGuide/FunctionReference.tex | 1412 | ||||
-rw-r--r-- | doc/UsersGuide/ThornWriters.tex | 4 |
2 files changed, 833 insertions, 583 deletions
diff --git a/doc/UsersGuide/FunctionReference.tex b/doc/UsersGuide/FunctionReference.tex index b599b962..5bd75372 100644 --- a/doc/UsersGuide/FunctionReference.tex +++ b/doc/UsersGuide/FunctionReference.tex @@ -3,6 +3,10 @@ \chapter{Cactus Functions} +In this section all Cactus functions are described. These functions are +callable from Fortran or C thorns. Note that whereas all functions are +available from C, not all are currently available from Fortran. + \section{Functions Alphabetically} \begin{description} @@ -23,11 +27,13 @@ \item[CCTK\_EnableGroupComm] Enable the communication for a group \item[CCTK\_EnableGroupStorage] Enable the storage for a group +\item[CCTK\_Equals] Check for equality of strings \item[CCTK\_Exit] \item[CCTK\_FullName] Given a variable index, returns the full name of the variable \item[CCTK\_FirstVarIndexI] Given a group index returns the first variable index in the group +\item[CCTK\_GHExtensionHandle] Get the handle associated with a extension to the Cactus GH structure \item[CCTK\_GroupIndex] Get the index number for a group name \item[CCTK\_GroupNameFromVarI] Given a variable index, return the name of the associated group \item[CCTK\_GroupIndexFromVarI] Given a variable index, returns the index of the associated group @@ -63,19 +69,23 @@ \item[CCTK\_QueryGroupStorage] \item[CCTK\_QueryGroupStorageI] + +\item[CCTK\_Reduce] Perform a reduction operation using a registered operator +\item[CCTK\_ReductionHandle] Get the handle for a registered reduction operator \item[CCTK\_RegisterBanner] Register a banner for a thorn \item[CCTK\_RegisterCoordI] Register a grid function index as identifying a coordinate with a given coordinate name and direction. \item[CCTK\_RegisterCoord] Register a grid function name as identifying a coordinate with a given coordinate name and direction. \item[CCTK\_RegisterCoordRange] Saves the global upper and lower bounds for a given coordinate name +\item[CCTK\_RegisterGHExtension] Register the name of an extension to the Cactus GH. +\item[CCTK\_RegisterGHExtensionInitGH] Register a routine for providing initialisation for an extension to the Cactus GH +\item[CCTK\_RegisterGHExtensionSetupGH] Register a routine for setting up an extension to the Cactus GH +\item[CCTK\_RegisterGHExtensionrfrTraverseGH] Register a routine for an extension to the Cactus GH which is run before any RFR traverse +\item[CCTK\_RegisterReductionOperator] Register a function a providing a reduction operation \item[CCTK\_RegisterIOMethod] Register an IO method name \item[CCTK\_RegisterIOMethodOutputGH] +\item[CCTK\_RegisterIOMethodOutputVarAs] \item[CCTK\_RegisterIOMethodTimeToOutput] Register a routine for deciding if it is time to output for an IO method \item[CCTK\_RegisterIOMethodTriggerOutput] Register a routine for dealing with trigger output for an IO method -\item[CCTK\_RegisterIOMethodOutputVarAs] -\item[CCTK\_RegisterGHExtension] Register the name of an extension to the Cactus GH. -\item[CCTK\_RegisterGHExtensionSetupGH] Register a routine for setting up an extension to the Cactus GH -\item[CCTK\_RegisterGHExtensionInitGH] Register a routine for providing initialisation for an extension to the Cactus GH -\item[CCTK\_RegisterGHExtensionrfrTraverseGH] Register a routine for an extension to the Cactus GH which is run before any RFR traverse \item[CCTK\_SetupGH] \item[CCTK\_SyncGroup] Synchronize the ghost zones for a group of variables @@ -83,6 +93,9 @@ \item[CCTK\_VarIndex] Get the index for a variable \item[CCTK\_VarName] Given a variable index, returns the variable name \item[CCTK\_VarTypeI] Provides variable type index from the variable index +\item[CCTK\_VarDataPtr]{Returns the data pointer for a grid variable} +\item[CCTK\_VarDataPtrB]{Returns the data pointer for a grid variable from the variable index or name} +\item[CCTK\_VarDataPtrI]{Returns the data pointer for a grid variable from the variable index} \item[CCTK\_WARN] Prints a warning message and possibly stops the code @@ -91,15 +104,40 @@ \section{Full Description of Functions} +%%%%% +% AAA +%%%%% + + % CommOverloadables.c -\begin{CCTKFunc}{CCTK\_ArrayGroupSizeB}{} +\begin{CCTKFunc}{CCTK\_Abort}{Exit the code abruptly} +\subroutine{int}{integer}{istat} +\argument{cGH *}{CCTK\_POINTER}{cctkGH} +\showargs +\begin{params} +\parameter{cctkGH}{pointer to CCTK grid hierarchy} +\end{params} +\begin{discussion} +\end{discussion} +\begin{examples} +\begin{tabular}{@{}p{3cm}cp{11cm}} +\end{tabular} +\end{examples} +\begin{errorcodes} +\end{errorcodes} +\end{CCTKFunc} + + + +% cctk_Comm.h +\begin{CCTKFunc}{CCTK\_ArrayGroupSize}{} \subroutine{int *}{}{size} -\argument{cGH *}{}{GH} +\argument{cGH *}{}{cctkGH} \argument{int}{}{groupindex} \argument{int}{}{dir} -\argument{const char *}{}{groupname} -\showargs +\showcargs \begin{params} +\parameter{cctkGH}{pointer to CCTK grid hierarchy} \end{params} \begin{discussion} \end{discussion} @@ -112,57 +150,21 @@ \end{CCTKFunc} -%\begin{CCTKFunc}{}{} -%\function{int}{CCTK\_INT}{storage} -%\subroutine{int}{CCTK\_INT}{storage} -%\argument{cGH *}{CCTK\_INT}{GH} -%\argument{const char *}{CCTK\_STRING}{group} -%\showargs -%\begin{params} -%\parameter{}{} -%\end{params} -%\begin{discussion} -%\end{discussion} -%\begin{examples} -%\begin{tabular}{@{}p{3cm}cp{11cm}} -%\hfill {\bf C} && storage = {\t CCTK\_EnableGroupStorage(GH,``imp::group'')}; -%\\ -%\hfill {\bf Fortran} && call {\t CCTK\_ENABLEGROUPSTORAGE(istorage,GH,``imp::gro -%up'')}; -%\\ -%\end{tabular} -%\end{examples} -%\begin{errorcodes} -%\errorcode{FIXME:CCTK\_NOSUCHVARIABLE}{The variable doesn't exist} -%\end{errorcodes} -%\end{CCTKFunc} -% Coord.c -\begin{CCTKFunc}{CCTK\_RegisterCoordI}{Register a grid function index as identifying a coordinate with a given coordinate name and direction.} -\subroutine{int}{integer}{handle} -\argument{int}{integer}{direction} -\argument{int}{integer}{index} -\argument{const char *}{character*(*)}{name} -\showargs +% cctk_Comm.h +\begin{CCTKFunc}{CCTK\_ArrayGroupSize}{} +\subroutine{int *}{}{size} +\argument{cGH *}{}{cctkGH} +\argument{const char *}{}{groupname} +\showcargs \begin{params} -\parameter{handle}{On success returns zero or a positive registration handle. Error codes have negative values.} -\parameter{direction}{The coordinate cartesian direction} -\parameter{index}{The index of the grid function representing the coordinate} -\parameter{name}{The name of the coordinate} +\parameter{cctkGH}{pointer to CCTK grid hierarchy} \end{params} \begin{discussion} -The coordinate name is independent of the grid function name. The direction should be given -as zero for a non-cartesian index. Currently only CCTK\_REAL grid functions can be registered -as coordinates. \end{discussion} \begin{examples} \begin{tabular}{@{}p{3cm}cp{11cm}} -\hfill {\bf C} && index = CCTK\_VarIndex(``MyImp::MyGF''); \\ - && handle = {\t CCTK\_RegisterCoordI(1,index,`xdir')}; -\\ -\hfill {\bf Fortran} && call {\t CCTK\_REGISTERCOORDI(handle,0,14,`radius')}; -\\ \end{tabular} \end{examples} \begin{errorcodes} @@ -170,30 +172,21 @@ as coordinates. \end{CCTKFunc} -% Coord.c -\begin{CCTKFunc}{CCTK\_RegisterCoord}{Register a grid function name as identifying a coordinate with a given coordinate name and direction.} -\subroutine{int}{integer}{handle} -\argument{int}{integer}{direction} -\argument{const char *}{character*(*)}{gfname} -\argument{const char *}{character*(*)}{coordname} +% CommOverloadables.c +\begin{CCTKFunc}{CCTK\_ArrayGroupSizeB}{} +\subroutine{int *}{}{size} +\argument{cGH *}{}{cctkGH} +\argument{int}{}{groupindex} +\argument{int}{}{dir} +\argument{const char *}{}{groupname} \showargs \begin{params} -\parameter{handle}{On success returns zero or a positive registration handle. Error codes have negative values.} -\parameter{direction}{The coordinate cartesian direction} -\parameter{gfname}{The full name of the grid function representing the coordinate} -\parameter{coordname}{The name of the coordinate} +\parameter{cctkGH}{pointer to CCTK grid hierarchy} \end{params} \begin{discussion} -The coordinate name is independent of the grid function name. The direction should be given -as zero for a non-cartesian index. Currently only CCTK\_REAL grid functions can be registered -as coordinates. \end{discussion} \begin{examples} \begin{tabular}{@{}p{3cm}cp{11cm}} -\hfill {\bf C} && handle = {\t CCTK\_RegisterCoord(1,`MyImp::MyGF',`xdir')}; -\\ -\hfill {\bf Fortran} && call {\t CCTK\_REGISTERCOORD(handle,0,`MyImp::MyGF',`radius')}; -\\ \end{tabular} \end{examples} \begin{errorcodes} @@ -201,24 +194,23 @@ as coordinates. \end{CCTKFunc} -% Coord.c -\begin{CCTKFunc}{CCTK\_RegisterBanner}{Register a banner for a thorn} -\subroutine{void}{}{} -\argument{const char *}{character}{message} -\showargs +%%%%% +% BBB +%%%%% + + +% CommOverloadables.c +\begin{CCTKFunc}{CCTK\_Barrier}{} +\subroutine{int}{integer}{istat} +\argument{cGH *}{CCTK\_POINTER}{cctkGH} +\showcargs \begin{params} -\parameter{banner}{String which will be displayed as a banner} +\parameter{cctkGH}{pointer to CCTK grid hierarchy} \end{params} \begin{discussion} -The banner must be register during {\t CCTK\_STARTUP}. The banners are -displayed in the order in which they are registered. \end{discussion} \begin{examples} \begin{tabular}{@{}p{3cm}cp{11cm}} -\hfill {\bf C} && {\t CCTK\_RegisterBanner(`My Thorn: Does Something Useful')}; -\\ -\hfill {\bf Fortran} && call {\t CCTK\_REGISTERBANNER(`*** MY THORN ***')}; -\\ \end{tabular} \end{examples} \begin{errorcodes} @@ -226,6 +218,10 @@ displayed in the order in which they are registered. \end{CCTKFunc} +%%%%% +% CCC +%%%%% + % Coord.c @@ -242,9 +238,9 @@ The coordinate name is independent of the grid function name. \end{discussion} \begin{examples} \begin{tabular}{@{}p{3cm}cp{11cm}} -\hfill {\bf C} && index = {\t CCTK\_CoordIndex(`xdir')}; +\hfill {\bf C} && {\t index = CCTK\_CoordIndex(`xdir')}; \\ -\hfill {\bf Fortran} && call {\t CCTK\_COORDINDEX(`radius')}; +\hfill {\bf Fortran} && {\t call CCTK\_COORDINDEX(`radius')}; \\ \end{tabular} \end{examples} @@ -257,14 +253,16 @@ The coordinate name is independent of the grid function name. % Coord.c \begin{CCTKFunc}{CCTK\_CoordRange}{Return the global upper and lower bounds for a given coordinate name} \subroutine{int}{integer}{ierr} +\argument{cGH *}{CCTK\_POINTER}{cctkGH} \argument{CCTK\_REAL}{CCTK\_REAL}{lower} \argument{CCTK\_REAL}{CCTK\_REAL}{upper} \argument{const char *}{character*(*)}{coordname} \showargs \begin{params} \parameter{ierr}{Error code} -\parameter{lower}{Global lower bound of the coordinate} -\parameter{upper}{Global upper bound of the coordinate} +\parameter{cctkGH}{pointer to CCTK grid hierarchy} +\parameter{lower}{Global lower bound of the coordinate (POINTER in C)} +\parameter{upper}{Global upper bound of the coordinate (POINTER in C)} \parameter{coordname}{Coordinate name} \end{params} \begin{discussion} @@ -273,9 +271,9 @@ is registered by {\t CCTK\_RegisterCoordRange}. \end{discussion} \begin{examples} \begin{tabular}{@{}p{3cm}cp{11cm}} -\hfill {\bf C} && ierr = {\t CCTK\_CoordRange(xmin,xmax,`xdir') }; +\hfill {\bf C} && {\t ierr = CCTK\_CoordRange(cctkGH,*xmin,*xmax,`xdir') }; \\ -\hfill {\bf Fortran} && call {\t CCTK\_COORDRANGE(ierr,Rmin,Rmax,`radius')}; +\hfill {\bf Fortran} && {\t call CCTK\_COORDRANGE(ierr,cctkGH,Rmin,Rmax,`radius')}; \\ \end{tabular} \end{examples} @@ -284,33 +282,25 @@ is registered by {\t CCTK\_RegisterCoordRange}. \end{CCTKFunc} +%%%%% +% DDD +%%%%% -% Coord.c -\begin{CCTKFunc}{CCTK\_RegisterCoordRange}{Saves the global upper and lower bounds for a given coordinate name} -\subroutine{int}{integer}{ierr} -\argument{CCTK\_REAL}{CCTK\_REAL}{lower} -\argument{CCTK\_REAL}{CCTK\_REAL}{upper} -\argument{const char *}{character*(*)}{coordname} -\showargs +% CommOverloadables.c +\begin{CCTKFunc}{CCTK\_DisableGroupComm}{Turn communications off for a group of grid variables} +\subroutine{int}{integer}{istat} +\argument{cGH *}{CCTK\_POINTER}{cctkGH} +\argument{const char *}{character*(*)}{group} +\showcargs \begin{params} -\parameter{ierr}{Error code} -\parameter{lower}{Global lower bound of the coordinate} -\parameter{upper}{Global upper bound of the coordinate} -\parameter{coordname}{Coordinate name} +\parameter{cctkGH}{pointer to CCTK grid hierarchy} \end{params} \begin{discussion} -The coordinate name is independent of the grid function name. There must already -be a coordinate registered with the given name, with {\t CCTK\_RegisterCoord}. -The coordinate range -can be accessed by {\t CCTK\_CoordRange}. +Turning off communications means that ghost zones will not be communicated during a call to {\tt CCTK\_SyncGroup}. By default communications are all off. \end{discussion} \begin{examples} \begin{tabular}{@{}p{3cm}cp{11cm}} -\hfill {\bf C} && ierr = {\t CCTK\_RegisterCoordRange(xmin,xmax,`xdir') }; -\\ -\hfill {\bf Fortran} && call {\t CCTK\_REGISTERCOORDRANGE(ierr,Rmin,Rmax,`radius')}; -\\ \end{tabular} \end{examples} \begin{errorcodes} @@ -319,29 +309,19 @@ can be accessed by {\t CCTK\_CoordRange}. - - - -% WarnLevel.c -\begin{CCTKFunc}{CCTK\_WARN}{Prints a warning message and possibly stops the code} -\subroutine{}{}{} -\argument{int}{integer}{level} -\argument{const char *}{character*(*)}{warning} -\showargs +% CommOverloadables.c +\begin{CCTKFunc}{CCTK\_DisableGroupStorage}{Free the storage associated with a group of grid variables} +\subroutine{int}{integer}{istat} +\argument{cGH *}{CCTK\_POINTER}{cctkGH} +\argument{const char *}{character*(*)}{group} +\showcargs \begin{params} -\parameter{level}{The warning level, lower numbers are the severest warnings} -\parameter{warning}{The warning message} +\parameter{cctkGH}{pointer to CCTK grid hierarchy} \end{params} \begin{discussion} -By default Cactus stops on a level 0 warning, and prints any level 1 warnings. -This behavious can be changed on the command line. \end{discussion} \begin{examples} \begin{tabular}{@{}p{3cm}cp{11cm}} -\hfill {\bf C} && {\t CCTK\_WARN(1,`This is not a good idea') }; -\\ -\hfill {\bf Fortran} && call {\t CCTK\_WARN(0,`Divide by zero')}; -\\ \end{tabular} \end{examples} \begin{errorcodes} @@ -350,22 +330,25 @@ This behavious can be changed on the command line. -% WarnLevel.c -\begin{CCTKFunc}{CCTK\_INFO}{Prints an information message} -\subroutine{}{}{} -\argument{const char *}{character*(*)}{message} -\showargs +% Groups.c +\begin{CCTKFunc}{CCTK\_DecomposeName}{Given the full name of a variable/group, separates the name returning both the implementation and the variable/group} +\subroutine{int}{integer}{istat} +\argument{char *}{}{fullname} +\argument{char **}{}{imp} +\argument{char **}{}{name} +\showcargs \begin{params} -\parameter{message}{The information message} +\parameter{istat}{Status flag returned by routine} +\parameter{fullname}{The full name of the group/variable} +\parameter{imp}{The implementation name} +\parameter{name}{The group/variable name} \end{params} \begin{discussion} +No Fortran routine exists at the moment. \end{discussion} \begin{examples} \begin{tabular}{@{}p{3cm}cp{11cm}} -\hfill {\bf C} && {\t CCTK\_INFO(`Entering interpolator') }; -\\ -\hfill {\bf Fortran} && call {\t CCTK\_INFO(`Inside interpolator')}; -\\ +\hfill {\bf C} && {\t istat = CCTK\_DecomposeName(`evolve::scalars',imp,name)}\\ \end{tabular} \end{examples} \begin{errorcodes} @@ -373,53 +356,29 @@ This behavious can be changed on the command line. \end{CCTKFunc} +%%%%% +% EEE +%%%%% -% WarnLevel.c -\begin{CCTKFunc}{CCTK\_PARAMWARN}{Prints a warning from parameter checking, and possibly stops the code} -\subroutine{}{}{} -\argument{const char *}{character*(*)}{message} -\showargs -\begin{params} -\parameter{message}{The warning message} -\end{params} -\begin{discussion} -The call should be used in routines registered at the RFR point {\t CCTK\_PARAMCHECK} -to indicate that there is parameter error or conflict and the code should -terminate. The code will terminate only after all the parameters have been -checked. -\end{discussion} -\begin{examples} -\begin{tabular}{@{}p{3cm}cp{11cm}} -\hfill {\bf C} && {\t CCTK\_PARAMWARN(`Mass cannot be negative') }; -\\ -\hfill {\bf Fortran} && call {\t CCTK\_PARAMWARN(`Inside interpolator')}; -\\ -\end{tabular} -\end{examples} -\begin{errorcodes} -\end{errorcodes} -\end{CCTKFunc} -% Groups.c -\begin{CCTKFunc}{CCTK\_GroupIndex}{Get the index number for a group name} -\subroutine{int}{integer}{index} -\argument{const char *}{character*(*)}{groupname} -\showargs +% CommOverloadables.c +\begin{CCTKFunc}{CCTK\_EnableGroupComm}{Turn communications on for a group of grid variables} +\subroutine{int}{integer}{istat} +\argument{cGH *}{CCTK\_POINTER}{cctkGH} +\argument{const char *}{character*(*)}{group} +\showcargs \begin{params} -\parameter{groupname}{The name of the group} +\parameter{cctkGH}{pointer to CCTK grid hierarchy} \end{params} \begin{discussion} -The group name should be given in the form {\t <implementation>::<group>} +Turning on communications means that ghost zones will be communicated during +a call to {\tt CCTK\_SyncGroup}. \end{discussion} \begin{examples} \begin{tabular}{@{}p{3cm}cp{11cm}} -\hfill {\bf C} && {\t index = CCTK\_GroupIndex(`evolve::scalars') }; -\\ -\hfill {\bf Fortran} && call {\t CCTK\_GroupIndex(index,`evolve::scalars')}; -\\ \end{tabular} \end{examples} \begin{errorcodes} @@ -428,24 +387,19 @@ The group name should be given in the form {\t <implementation>::<group>} - -% Groups.c -\begin{CCTKFunc}{CCTK\_VarIndex}{Get the index for a variable} -\subroutine{int}{integer}{index} -\argument{const char *}{character*(*)}{varname} -\showargs +% CommOverloadables.c +\begin{CCTKFunc}{CCTK\_EnableGroupStorage}{Assign the storage for a group of grid variables} +\subroutine{int}{integer}{istat} +\argument{cGH *}{CCTK\_POINTER}{cctkGH} +\argument{const char *}{character*(*)}{group} +\showcargs \begin{params} -\parameter{varname}{The name of the variable} +\parameter{cctkGH}{pointer to CCTK grid hierarchy} \end{params} \begin{discussion} -The variable name should be given in the form {\t <implementation>::<variable>} \end{discussion} \begin{examples} \begin{tabular}{@{}p{3cm}cp{11cm}} -\hfill {\bf C} && {\t index = CCTK\_VarIndex(`evolve::phi') }; -\\ -\hfill {\bf Fortran} && call {\t CCTK\_VarIndex(index,`evolve::phi')}; -\\ \end{tabular} \end{examples} \begin{errorcodes} @@ -453,25 +407,18 @@ The variable name should be given in the form {\t <implementation>::<variable>} \end{CCTKFunc} - - -% Groups.c -\begin{CCTKFunc}{CCTK\_MaxDim}{Get the maximum dimension of any grid variable } -\subroutine{int}{integer}{dim} +% CommOverloadables.c +\begin{CCTKFunc}{CCTK\_Exit}{Exit the code cleanly} +\subroutine{int}{integer}{istat} +\argument{cGH *}{CCTK\_POINTER}{cctkGH} \showargs \begin{params} -\parameter{dim}{The maximum dimension} +\parameter{cctkGH}{pointer to CCTK grid hierarchy} \end{params} \begin{discussion} -Note that the maximum dimension will depend on the compiled thorn list, -and not the active thorn list. \end{discussion} \begin{examples} \begin{tabular}{@{}p{3cm}cp{11cm}} -\hfill {\bf C} && {\t dim = CCTK\_MaxDim() }; -\\ -\hfill {\bf Fortran} && call {\t CCTK\_MaxDim(dim)}; -\\ \end{tabular} \end{examples} \begin{errorcodes} @@ -479,23 +426,25 @@ and not the active thorn list. \end{CCTKFunc} - - -% Groups.c -\begin{CCTKFunc}{CCTK\_NumGroups}{Get the number of groups of variables compiled in the code} -\subroutine{int}{integer}{number} +% CommOverloadables.c +\begin{CCTKFunc}{CCTK\_Equals}{Check for string equality} +\function{int}{integer}{istat} +\argument{const char *}{character*(*)}{string1} +\argument{const char *}{character*(*)}{string2} \showargs \begin{params} -\parameter{number}{The number of groups compiled from the thorns {\t interface.ccl} files} +\parameter{istat}{returns success or failure of equality} +\parameter{string1}{first string to be compared} +\parameter{string2}{second string to be compared} \end{params} \begin{discussion} +This function returns one if the strings are equals, for all other +values the strings are not equals. Note that the input strings in fortran +can be either string literals (`mystring') or CCTK string parameters +(defined by the macro {\tt CCTK\_DECLARE\_PARAMETERS} to be {\t CCTK\_POINTER}. \end{discussion} \begin{examples} \begin{tabular}{@{}p{3cm}cp{11cm}} -\hfill {\bf C} && {\t number = CCTK\_NumGroups() }; -\\ -\hfill {\bf Fortran} && call {\t CCTK\_NumGroups(number)}; -\\ \end{tabular} \end{examples} \begin{errorcodes} @@ -504,26 +453,30 @@ and not the active thorn list. +%%%%% +% FFF +%%%%% % Groups.c -\begin{CCTKFunc}{CCTK\_GroupNameFromVarI}{Given a variable index, return the name of the associated group} -\subroutine{char *}{character*(*)}{group} -\argument{int}{integer}{varindex} -\showcargs +\begin{CCTKFunc}{CCTK\_FirstVarIndexI}{Given a group index returns the first variable index in the group} +\subroutine{int}{integer}{firstvar} +\argument{int}{integer}{group} +\showargs \begin{params} -\parameter{group}{The name of the group} -\parameter{varindex}{The index of the variable} +\parameter{firstvar}{The the first variable index in the given group} +\parameter{group}{The group index} \end{params} \begin{discussion} + \end{discussion} \begin{examples} \begin{tabular}{@{}p{3cm}cp{11cm}} -\hfill {\bf C} && {\t index = CCTK\_VarIndex(`evolve::phi');} \\ - && {\t group = CCTK\_GroupNameFromVarI(index) ;} +\hfill {\bf C} && {\t index = CCTK\_GroupIndex(`evolve::scalars')}\\ + &&{\t firstvar = CCTK\_FirstVarIndexI(index) ;} \\ -\hfill {\bf Fortran} && call {\t CCTK\_GROUPNAMEFROMVARI(FIXME)}; +\hfill {\bf Fortran} && {\t call CCTK\_GroupIndex(index,3)}\\ \\ \end{tabular} \end{examples} @@ -533,24 +486,24 @@ and not the active thorn list. + % Groups.c -\begin{CCTKFunc}{CCTK\_GroupIndexFromVarI}{Given a variable index, returns the index of the associated group} -\subroutine{int}{integer}{groupindex} -\argument{int}{integer}{varindex} -\showargs +\begin{CCTKFunc}{CCTK\_FullName}{Given a variable index, returns the full name of the variable} +\subroutine{char *}{integer}{fullname} +\argument{int}{integer}{index} +\showcargs \begin{params} -\parameter{groupindex}{The index of the group} -\parameter{varindex}{The index of the variable} +\parameter{implementation}{The full variable name} +\parameter{index}{The variable index} \end{params} \begin{discussion} +No Fortran routine exists at the moment. The full variable name is in +the form {\t <implementation>::<variable>} \end{discussion} \begin{examples} \begin{tabular}{@{}p{3cm}cp{11cm}} -\hfill {\bf C} && {\t index = CCTK\_VarIndex(`evolve::phi');} \\ - && {\t groupindex = CCTK\_GroupIndexFromVarI(index) ;} -\\ -\hfill {\bf Fortran} && {\t call CCTK\_VARINDEX(`evolve::phi')}\\ - &&call {\t CCTK\_GROUPINDEXFROMVARI(groupindex,index)}; +\hfill {\bf C} && {\t index = CCTK\_VarIndex(`evolve::phi')}\\ + &&{\t fullname = CCTK\_FullName(index) ;} \\ \end{tabular} \end{examples} @@ -560,23 +513,27 @@ and not the active thorn list. -% Groups.c -\begin{CCTKFunc}{CCTK\_GroupIndexFromVar}{Given a variable name, returns the index of the associated group} -\subroutine{int}{integer}{groupindex} + +%%%%% +% GGG +%%%%% + +% cctk_GHExtensions.h +\begin{CCTKFunc}{CCTK\_GHExtensionHandle}{Get the handle associated with a extension to the Cactus GH structure} +\subroutine{int}{integer}{handle} \argument{const char *}{character*(*)}{name} \showargs \begin{params} -\parameter{groupindex}{The index of the group} -\parameter{name}{The full name of the variable} +\parameter{handle}{The GH extension handle} +\parameter{group}{The name of the GH extension} \end{params} \begin{discussion} -The variable name should be in the form {\t <implementation>::<variable>} \end{discussion} \begin{examples} \begin{tabular}{@{}p{3cm}cp{11cm}} -\hfill {\bf C} && {\t groupindex = CCTK\_GroupIndexFromVar(`evolve::phi') ;} +\hfill {\bf C} && {\t handle = CCTK\_GHExtension(`myExtension') ;} \\ -\hfill {\bf Fortran} && {\t call CCTK\_GROUPINDEXFROMVAR(groupindex,`evolve::phi')}; +\hfill {\bf Fortran} && {\t call CCTK\_GHExtension(handle,`myExtension')}\\ \\ \end{tabular} \end{examples} @@ -586,23 +543,26 @@ The variable name should be in the form {\t <implementation>::<variable>} - % Groups.c -\begin{CCTKFunc}{CCTK\_ImpFromVarI}{Given a variable index, returns the implementation name} -\subroutine{char *}{integer}{implementation} +\begin{CCTKFunc}{CCTK\_GroupTypeFromVarI}{Provides group type index from the group index} +\subroutine{int}{integer}{type} \argument{int}{integer}{index} -\showcargs +\showargs \begin{params} -\parameter{implementation}{The implementation name} -\parameter{index}{The variable index} +\parameter{type}{The group type index} +\parameter{group}{The group index} \end{params} \begin{discussion} -No Fortran routine exists at the moment +The group type index indicates the type of variables in the group. +Either scalars, grid functions or arrays. The group type can be checked +with the Cactus provided macros for {\t GROUP\_SCALAR}, {\t GROUP\_GF}, {\t GROUP\_ARRAY}. \end{discussion} \begin{examples} \begin{tabular}{@{}p{3cm}cp{11cm}} -\hfill {\bf C} && {\t index = CCTK\_VarIndex(`evolve::phi')}\\ - &&{\t implementation = CCTK\_ImpFromVarI(index) ;} +\hfill {\bf C} && {\t index = CCTK\_GroupIndex(`evolve::scalars')}\\ + &&{\t array = (GROUP\_ARRAY == CCTK\_GroupTypeFromVarI(index)) ;} +\\ +\hfill {\bf Fortran} && {\t call CCTK\_GROUPTYPEFROMVARI(type,3)}\\ \\ \end{tabular} \end{examples} @@ -614,22 +574,21 @@ No Fortran routine exists at the moment % Groups.c -\begin{CCTKFunc}{CCTK\_FullName}{Given a variable index, returns the full name of the variable} -\subroutine{char *}{integer}{fullname} +\begin{CCTKFunc}{CCTK\_GroupName}{Given a group index, returns the group name} +\subroutine{char *}{integer}{name} \argument{int}{integer}{index} \showcargs \begin{params} -\parameter{implementation}{The full variable name} -\parameter{index}{The variable index} +\parameter{name}{The group name} +\parameter{index}{The group index} \end{params} \begin{discussion} -No Fortran routine exists at the moment. The full variable name is in -the form {\t <implementation>::<variable>} +No Fortran routine exists at the moment. \end{discussion} \begin{examples} \begin{tabular}{@{}p{3cm}cp{11cm}} -\hfill {\bf C} && {\t index = CCTK\_VarIndex(`evolve::phi')}\\ - &&{\t fullname = CCTK\_FullName(index) ;} +\hfill {\bf C} && {\t index = CCTK\_GroupIndex(`evolve::scalars')}\\ + &&{\t name = CCTK\_GroupName(index) ;} \\ \end{tabular} \end{examples} @@ -676,23 +635,21 @@ No Fortran routine exists at the moment. - % Groups.c -\begin{CCTKFunc}{CCTK\_VarName}{Given a variable index, returns the variable name} -\subroutine{char *}{integer}{name} -\argument{int}{integer}{index} +\begin{CCTKFunc}{CCTK\_GroupNameFromVarI}{Given a variable index, return the name of the associated group} +\subroutine{char *}{character*(*)}{group} +\argument{int}{integer}{varindex} \showcargs \begin{params} -\parameter{name}{The variable name} -\parameter{index}{The variable index} +\parameter{group}{The name of the group} +\parameter{varindex}{The index of the variable} \end{params} \begin{discussion} -No Fortran routine exists at the moment. \end{discussion} \begin{examples} \begin{tabular}{@{}p{3cm}cp{11cm}} -\hfill {\bf C} && {\t index = CCTK\_VarIndex(`evolve::phi')}\\ - &&{\t name = CCTK\_VarName(index) ;} +\hfill {\bf C} && {\t index = CCTK\_VarIndex(`evolve::phi');} \\ + && {\t group = CCTK\_GroupNameFromVarI(index) ;} \\ \end{tabular} \end{examples} @@ -702,24 +659,24 @@ No Fortran routine exists at the moment. - - % Groups.c -\begin{CCTKFunc}{CCTK\_GroupName}{Given a group index, returns the group name} -\subroutine{char *}{integer}{name} -\argument{int}{integer}{index} -\showcargs +\begin{CCTKFunc}{CCTK\_GroupIndexFromVarI}{Given a variable index, returns the index of the associated group} +\subroutine{int}{integer}{groupindex} +\argument{int}{integer}{varindex} +\showargs \begin{params} -\parameter{name}{The group name} -\parameter{index}{The group index} +\parameter{groupindex}{The index of the group} +\parameter{varindex}{The index of the variable} \end{params} \begin{discussion} -No Fortran routine exists at the moment. \end{discussion} \begin{examples} \begin{tabular}{@{}p{3cm}cp{11cm}} -\hfill {\bf C} && {\t index = CCTK\_GroupIndex(`evolve::scalars')}\\ - &&{\t name = CCTK\_GroupName(index) ;} +\hfill {\bf C} && {\t index = CCTK\_VarIndex(`evolve::phi');} \\ + && {\t groupindex = CCTK\_GroupIndexFromVarI(index) ;} +\\ +\hfill {\bf Fortran} && {\t call CCTK\_VARINDEX(`evolve::phi')}\\ + &&call {\t CCTK\_GROUPINDEXFROMVARI(groupindex,index)}; \\ \end{tabular} \end{examples} @@ -729,27 +686,24 @@ No Fortran routine exists at the moment. - - % Groups.c -\begin{CCTKFunc}{CCTK\_DecomposeName}{Given the full name of a variable/group, separates the name returning both the implementation and the variable/group} -\subroutine{int}{integer}{istat} -\argument{char *}{}{fullname} -\argument{char **}{}{imp} -\argument{char **}{}{name} -\showcargs +\begin{CCTKFunc}{CCTK\_GroupIndexFromVar}{Given a variable name, returns the index of the associated group} +\subroutine{int}{integer}{groupindex} +\argument{const char *}{character*(*)}{name} +\showargs \begin{params} -\parameter{istat}{Status flag returned by routine} -\parameter{fullname}{The full name of the group/variable} -\parameter{imp}{The implementation name} -\parameter{name}{The group/variable name} +\parameter{groupindex}{The index of the group} +\parameter{name}{The full name of the variable} \end{params} \begin{discussion} -No Fortran routine exists at the moment. +The variable name should be in the form {\t <implementation>::<variable>} \end{discussion} \begin{examples} \begin{tabular}{@{}p{3cm}cp{11cm}} -\hfill {\bf C} && {\t istat = CCTK\_DecomposeName(`evolve::scalars',imp,name)}\\ +\hfill {\bf C} && {\t groupindex = CCTK\_GroupIndexFromVar(`evolve::phi') ;} +\\ +\hfill {\bf Fortran} && {\t call CCTK\_GROUPINDEXFROMVAR(groupindex,`evolve::phi')}; +\\ \end{tabular} \end{examples} \begin{errorcodes} @@ -759,25 +713,22 @@ No Fortran routine exists at the moment. - % Groups.c -\begin{CCTKFunc}{CCTK\_FirstVarIndexI}{Given a group index returns the first variable index in the group} -\subroutine{int}{integer}{firstvar} -\argument{int}{integer}{group} +\begin{CCTKFunc}{CCTK\_GroupIndex}{Get the index number for a group name} +\subroutine{int}{integer}{index} +\argument{const char *}{character*(*)}{groupname} \showargs \begin{params} -\parameter{firstvar}{The the first variable index in the given group} -\parameter{group}{The group index} +\parameter{groupname}{The name of the group} \end{params} \begin{discussion} - +The group name should be given in the form {\t <implementation>::<group>} \end{discussion} \begin{examples} \begin{tabular}{@{}p{3cm}cp{11cm}} -\hfill {\bf C} && {\t index = CCTK\_GroupIndex(`evolve::scalars')}\\ - &&{\t firstvar = CCTK\_FirstVarIndexI(index) ;} +\hfill {\bf C} && {\t index = CCTK\_GroupIndex(`evolve::scalars') }; \\ -\hfill {\bf Fortran} && {\t call CCTK\_GroupIndex(index,3)}\\ +\hfill {\bf Fortran} && call {\t CCTK\_GroupIndex(index,`evolve::scalars')}; \\ \end{tabular} \end{examples} @@ -786,27 +737,34 @@ No Fortran routine exists at the moment. \end{CCTKFunc} +%%%%% +% HHH +%%%%% + +%%%%% +% III +%%%%% + + % Groups.c -\begin{CCTKFunc}{CCTK\_NumVarsInGroupI}{Provides the number of variables in a group from the group index} -\subroutine{int}{integer}{num} +\begin{CCTKFunc}{CCTK\_ImpFromVarI}{Given a variable index, returns the implementation name} +\subroutine{char *}{integer}{implementation} \argument{int}{integer}{index} -\showargs +\showcargs \begin{params} -\parameter{num}{The number of variables in the group} -\parameter{group}{The group index} +\parameter{implementation}{The implementation name} +\parameter{index}{The variable index} \end{params} \begin{discussion} - +No Fortran routine exists at the moment \end{discussion} \begin{examples} \begin{tabular}{@{}p{3cm}cp{11cm}} -\hfill {\bf C} && {\t index = CCTK\_GroupIndex(`evolve::scalars')}\\ - &&{\t firstvar = CCTK\_NumVarsInGroupI(index) ;} -\\ -\hfill {\bf Fortran} && {\t call CCTK\_NUMVARSINGROUPI(firstvar,3)}\\ +\hfill {\bf C} && {\t index = CCTK\_VarIndex(`evolve::phi')}\\ + &&{\t implementation = CCTK\_ImpFromVarI(index) ;} \\ \end{tabular} \end{examples} @@ -817,23 +775,22 @@ No Fortran routine exists at the moment. -% Groups.c -\begin{CCTKFunc}{CCTK\_NumVarsInGroup}{Provides the number of variables in a group from the group name} -\subroutine{int}{integer}{num} -\argument{const char *}{character*(*)}{name} + +% WarnLevel.c +\begin{CCTKFunc}{CCTK\_INFO}{Prints an information message} +\subroutine{}{}{} +\argument{const char *}{character*(*)}{message} \showargs \begin{params} -\parameter{num}{The number of variables in the group} -\parameter{group}{The full group name} +\parameter{message}{The information message} \end{params} \begin{discussion} -The group name should be given in the form {\t <implementation>::<group>} \end{discussion} \begin{examples} \begin{tabular}{@{}p{3cm}cp{11cm}} -\hfill {\bf C} && {\t numvars = CCTK\_NumVarsInGroup(`evolve::scalars') ;} +\hfill {\bf C} && {\t CCTK\_INFO(`Entering interpolator') }; \\ -\hfill {\bf Fortran} && {\t call CCTK\_NUMVARSINGROUP(numvars,`evolve::scalars')}\\ +\hfill {\bf Fortran} && {\t call CCTK\_INFO(`Inside interpolator')}; \\ \end{tabular} \end{examples} @@ -843,27 +800,105 @@ The group name should be given in the form {\t <implementation>::<group>} +% cctk_Interp.h +\begin{CCTKFunc}{CCTK\_Interp}{Perform an interpolatation, using a chosen method} +\subroutine{int}{integer}{num} +\argument{cGH *}{CCTK\_POINTER}{cctkGH} +\argument{int}{integer}{handle} +\argument{int}{integer}{nPoints} +\argument{int}{integer}{nDims} +\argument{int}{integer}{nInFields} +\argument{int}{integer}{nOutFields} +\argument{...}{...}{} +\showargs +\begin{params} +\parameter{cctkGH}{pointer to CCTK grid hierarchy} +\parameter{handle}{handle for interpolation method} +\parameter{nPoints}{number of points to be interpolated on this processor} +\parameter{nDims}{number of passed coordinate fields} +\parameter{nInFields}{number of passed input fields} +\parameter{nOutFields}{number of passed output fields} +\parameter{...}{variable argument list containing coordinate details andvariable indices, described below} +\end{params} +\begin{discussion} +The handle for a given interpolation method can be found using +{\t CCTK\_InterpHandle}. The variable argument list contains +information in the order: +\begin{itemize} +\item{} nDim integers containing ?? +\item{} nDim coordinate grid indices +\item{} nDim coordinate variable types +\item{} nDim coordinate origins +\item{} nDim grid spacings +\item{} nInFields indices for the fields to be interpolated from +\item{} nInFields variable types for the fields to be interpolated from +\item{} nOutFields indices for the fields to be interpolated to +\item{} nOutFields variable types for the fields to be interpolated to +\end{itemize} + +\end{discussion} +\begin{examples} +\begin{tabular}{@{}p{3cm}cp{11cm}} +\end{tabular} +\end{examples} +\begin{errorcodes} +\end{errorcodes} +\end{CCTKFunc} + + + + + % Groups.c -\begin{CCTKFunc}{CCTK\_GroupTypeFromVarI}{Provides group type index from the group index} -\subroutine{int}{integer}{type} -\argument{int}{integer}{index} +\begin{CCTKFunc}{CCTK\_InterpHandle}{Return the handle for a given interpolation operator} +\subroutine{int}{integer}{handle} +\argument{const char *}{character*(*)}{operator} \showargs \begin{params} -\parameter{type}{The group type index} -\parameter{group}{The group index} +\parameter{hnadle}{Handle for the interpolation operator} +\parameter{operator}{Name of interpolation operator} \end{params} \begin{discussion} -The group type index indicates the type of variables in the group. -Either scalars, grid functions or arrays. The group type can be checked -with the Cactus provided macros for {\t GROUP\_SCALAR}, {\t GROUP\_GF}, {\t GROUP\_ARRAY}. \end{discussion} \begin{examples} \begin{tabular}{@{}p{3cm}cp{11cm}} -\hfill {\bf C} && {\t index = CCTK\_GroupIndex(`evolve::scalars')}\\ - &&{\t array = (GROUP\_ARRAY == CCTK\_GroupTypeFromVarI(index)) ;} -\\ -\hfill {\bf Fortran} && {\t call CCTK\_GROUPTYPEFROMVARI(type,3)}\\ -\\ +\end{tabular} +\end{examples} +\begin{errorcodes} +\end{errorcodes} +\end{CCTKFunc} + +%%%%% +% JJJ +%%%%% + +%%%%% +% KKK +%%%%% + +%%%%% +% LLL +%%%%% + +%%%%% +% MMM +%%%%% + + +% CommOverloadables.c +\begin{CCTKFunc}{CCTK\_MyProc}{Returns the number of the local processor for a parallel run} +\function{int}{integer}{myproc} +\argument{cGH *}{CCTK\_POINTER}{cctkGH} +\showargs +\begin{params} +\parameter{cctkGH}{pointer to CCTK grid hierarchy} +\end{params} +\begin{discussion} +For a single processor run this call will return zero. For multiprocessor +runs, this call will return $0\leq myproc < {\t CCTK\_nProcs(cctkGH)}$. +\end{discussion} +\begin{examples} +\begin{tabular}{@{}p{3cm}cp{11cm}} \end{tabular} \end{examples} \begin{errorcodes} @@ -872,26 +907,23 @@ with the Cactus provided macros for {\t GROUP\_SCALAR}, {\t GROUP\_GF}, {\t GROU + % Groups.c -\begin{CCTKFunc}{CCTK\_VarTypeI}{Provides variable type index from the variable index} -\subroutine{int}{integer}{type} -\argument{int}{integer}{index} +\begin{CCTKFunc}{CCTK\_MaxDim}{Get the maximum dimension of any grid variable } +\subroutine{int}{integer}{dim} \showargs \begin{params} -\parameter{type}{The variable type index} -\parameter{group}{The variable index} +\parameter{dim}{The maximum dimension} \end{params} \begin{discussion} -The variable type index indicates the type of the variable. -Either character, int, complex or real. The group type can be checked -with the Cactus provided macros for {\t CCTK\_VARIABLE\_INT}, {\t CCTK\_VARIABLE\_REAL}, {\t CCTK\_VARIABLE\_COMPLEX} or {\t CCTK\_VARIABLE\_CHAR}. +Note that the maximum dimension will depend on the compiled thorn list, +and not the active thorn list. \end{discussion} \begin{examples} \begin{tabular}{@{}p{3cm}cp{11cm}} -\hfill {\bf C} && {\t index = CCTK\_VarIndex(`evolve::phi')}\\ - &&{\t real = (CCTK\_VARIABLE\_REAL == CCTK\_VarTypeI(index)) ;} +\hfill {\bf C} && {\t dim = CCTK\_MaxDim() }; \\ -\hfill {\bf Fortran} && {\t call CCTK\_VARTYPEI(type,3)}\\ +\hfill {\bf Fortran} && {\t call CCTK\_MaxDim(dim)}; \\ \end{tabular} \end{examples} @@ -900,6 +932,30 @@ with the Cactus provided macros for {\t CCTK\_VARIABLE\_INT}, {\t CCTK\_VARIABLE \end{CCTKFunc} +%%%%% +% NNN +%%%%% + + + +% CommOverloadables.c +\begin{CCTKFunc}{CCTK\_nProcs}{Returns the number of processors being used for a parallel run} +\function{int}{integer}{nprocs} +\argument{cGH *}{CCTK\_POINTER}{cctkGH} +\showargs +\begin{params} +\parameter{cctkGH}{pointer to CCTK grid hierarchy} +\end{params} +\begin{discussion} +For a single processor run this call will return one. +\end{discussion} +\begin{examples} +\begin{tabular}{@{}p{3cm}cp{11cm}} +\end{tabular} +\end{examples} +\begin{errorcodes} +\end{errorcodes} +\end{CCTKFunc} @@ -958,21 +1014,23 @@ The variable name should be in the form {\t <implementation>::<variable>} % Groups.c -\begin{CCTKFunc}{CCTK\_PrintGroup}{Prints a group name from its index} -\subroutine{}{}{} +\begin{CCTKFunc}{CCTK\_NumVarsInGroupI}{Provides the number of variables in a group from the group index} +\subroutine{int}{integer}{num} \argument{int}{integer}{index} \showargs \begin{params} -\parameter{index}{The group index} +\parameter{num}{The number of variables in the group} +\parameter{group}{The group index} \end{params} \begin{discussion} -This routine is for debugging purposes for Fortran programmers. + \end{discussion} \begin{examples} \begin{tabular}{@{}p{3cm}cp{11cm}} -\hfill {\bf C} && {\t CCTK\_PrintGroup(1) ;} +\hfill {\bf C} && {\t index = CCTK\_GroupIndex(`evolve::scalars')}\\ + &&{\t firstvar = CCTK\_NumVarsInGroupI(index) ;} \\ -\hfill {\bf Fortran} && {\t call CCTK\_PRINTGROUP(1)}\\ +\hfill {\bf Fortran} && {\t call CCTK\_NUMVARSINGROUPI(firstvar,3)}\\ \\ \end{tabular} \end{examples} @@ -984,21 +1042,22 @@ This routine is for debugging purposes for Fortran programmers. % Groups.c -\begin{CCTKFunc}{CCTK\_PrintVar}{Prints a variable name from its index} -\subroutine{}{}{} -\argument{int}{integer}{index} +\begin{CCTKFunc}{CCTK\_NumVarsInGroup}{Provides the number of variables in a group from the group name} +\subroutine{int}{integer}{num} +\argument{const char *}{character*(*)}{name} \showargs \begin{params} -\parameter{index}{The variable index} +\parameter{num}{The number of variables in the group} +\parameter{group}{The full group name} \end{params} \begin{discussion} -This routine is for debugging purposes for Fortran programmers. +The group name should be given in the form {\t <implementation>::<group>} \end{discussion} \begin{examples} \begin{tabular}{@{}p{3cm}cp{11cm}} -\hfill {\bf C} && {\t CCTK\_PrintVar(1) ;} +\hfill {\bf C} && {\t numvars = CCTK\_NumVarsInGroup(`evolve::scalars') ;} \\ -\hfill {\bf Fortran} && {\t call CCTK\_PRINTVAR(1)}\\ +\hfill {\bf Fortran} && {\t call CCTK\_NUMVARSINGROUP(numvars,`evolve::scalars')}\\ \\ \end{tabular} \end{examples} @@ -1008,18 +1067,21 @@ This routine is for debugging purposes for Fortran programmers. -% CommOverloadables.c -\begin{CCTKFunc}{CCTK\_EnableGroupStorage}{} -\subroutine{int}{integer}{istat} -\argument{cGH *}{CCTK\_POINTER}{cctkGH} -\argument{const char *}{character*(*)}{group} -\showcargs +% Groups.c +\begin{CCTKFunc}{CCTK\_NumGroups}{Get the number of groups of variables compiled in the code} +\subroutine{int}{integer}{number} +\showargs \begin{params} +\parameter{number}{The number of groups compiled from the thorns {\t interface.ccl} files} \end{params} \begin{discussion} \end{discussion} \begin{examples} \begin{tabular}{@{}p{3cm}cp{11cm}} +\hfill {\bf C} && {\t number = CCTK\_NumGroups() }; +\\ +\hfill {\bf Fortran} && call {\t CCTK\_NumGroups(number)}; +\\ \end{tabular} \end{examples} \begin{errorcodes} @@ -1027,13 +1089,23 @@ This routine is for debugging purposes for Fortran programmers. \end{CCTKFunc} -% CommOverloadables.c -\begin{CCTKFunc}{CCTK\_DisableGroupStorage}{} -\subroutine{int}{integer}{istat} -\argument{cGH *}{CCTK\_POINTER}{cctkGH} -\argument{const char *}{character*(*)}{group} -\showcargs + + +%%%%% +% OOO +%%%%% + + +% IOOverloadables.h +\begin{CCTKFunc}{CCTK\_OutputVarAsByMethod}{} +\subroutine{int}{}{istat} +\argument{cGH *}{}{cctkGH} +\argument{const char *}{character*(*)}{variable} +\argument{const char *}{character*(*)}{method} +\argument{const char *}{character*(*)}{alias} +\showargs \begin{params} +\parameter{cctkGH}{pointer to CCTK grid hierarchy} \end{params} \begin{discussion} \end{discussion} @@ -1046,13 +1118,13 @@ This routine is for debugging purposes for Fortran programmers. \end{CCTKFunc} -% CommOverloadables.c -\begin{CCTKFunc}{CCTK\_SyncGroup}{} +% IOOverloadables.h +\begin{CCTKFunc}{CCTK\_OutputGH}{} \subroutine{int}{integer}{istat} \argument{cGH *}{CCTK\_POINTER}{cctkGH} -\argument{const char *}{character*(*)}{group} \showargs \begin{params} +\parameter{cctkGH}{pointer to CCTK grid hierarchy} \end{params} \begin{discussion} \end{discussion} @@ -1066,13 +1138,20 @@ This routine is for debugging purposes for Fortran programmers. +%%%%% +% PPP +%%%%% + + + + % CommOverloadables.c -\begin{CCTKFunc}{CCTK\_EnableGroupComm}{} +\begin{CCTKFunc}{CCTK\_ParallelInit}{} \subroutine{int}{integer}{istat} \argument{cGH *}{CCTK\_POINTER}{cctkGH} -\argument{const char *}{character*(*)}{group} \showcargs \begin{params} +\parameter{cctkGH}{pointer to CCTK grid hierarchy} \end{params} \begin{discussion} \end{discussion} @@ -1085,18 +1164,24 @@ This routine is for debugging purposes for Fortran programmers. \end{CCTKFunc} -% CommOverloadables.c -\begin{CCTKFunc}{CCTK\_DisableGroupComm}{} -\subroutine{int}{integer}{istat} -\argument{cGH *}{CCTK\_POINTER}{cctkGH} -\argument{const char *}{character*(*)}{group} -\showcargs + +% Groups.c +\begin{CCTKFunc}{CCTK\_PrintGroup}{Prints a group name from its index} +\subroutine{}{}{} +\argument{int}{integer}{index} +\showargs \begin{params} +\parameter{index}{The group index} \end{params} \begin{discussion} +This routine is for debugging purposes for Fortran programmers. \end{discussion} \begin{examples} \begin{tabular}{@{}p{3cm}cp{11cm}} +\hfill {\bf C} && {\t CCTK\_PrintGroup(1) ;} +\\ +\hfill {\bf Fortran} && {\t call CCTK\_PRINTGROUP(1)}\\ +\\ \end{tabular} \end{examples} \begin{errorcodes} @@ -1105,17 +1190,24 @@ This routine is for debugging purposes for Fortran programmers. -% CommOverloadables.c -\begin{CCTKFunc}{CCTK\_Barrier}{} -\subroutine{int}{integer}{istat} -\argument{cGH *}{CCTK\_POINTER}{cctkGH} -\showcargs + +% Groups.c +\begin{CCTKFunc}{CCTK\_PrintVar}{Prints a variable name from its index} +\subroutine{}{}{} +\argument{int}{integer}{index} +\showargs \begin{params} +\parameter{index}{The variable index} \end{params} \begin{discussion} +This routine is for debugging purposes for Fortran programmers. \end{discussion} \begin{examples} \begin{tabular}{@{}p{3cm}cp{11cm}} +\hfill {\bf C} && {\t CCTK\_PrintVar(1) ;} +\\ +\hfill {\bf Fortran} && {\t call CCTK\_PRINTVAR(1)}\\ +\\ \end{tabular} \end{examples} \begin{errorcodes} @@ -1123,17 +1215,27 @@ This routine is for debugging purposes for Fortran programmers. \end{CCTKFunc} -% CommOverloadables.c -\begin{CCTKFunc}{CCTK\_nProcs}{} -\function{int}{integer}{nprocs} -\argument{cGH *}{CCTK\_POINTER}{cctkGH} + +% WarnLevel.c +\begin{CCTKFunc}{CCTK\_PARAMWARN}{Prints a warning from parameter checking, and possibly stops the code} +\subroutine{}{}{} +\argument{const char *}{character*(*)}{message} \showargs \begin{params} +\parameter{message}{The warning message} \end{params} \begin{discussion} +The call should be used in routines registered at the RFR point {\t CCTK\_PARAMCHECK} +to indicate that there is parameter error or conflict and the code should +terminate. The code will terminate only after all the parameters have been +checked. \end{discussion} \begin{examples} \begin{tabular}{@{}p{3cm}cp{11cm}} +\hfill {\bf C} && {\t CCTK\_PARAMWARN(`Mass cannot be negative') }; +\\ +\hfill {\bf Fortran} && {\t call CCTK\_PARAMWARN(`Inside interpolator')}; +\\ \end{tabular} \end{examples} \begin{errorcodes} @@ -1141,12 +1243,20 @@ This routine is for debugging purposes for Fortran programmers. \end{CCTKFunc} -% CommOverloadables.c -\begin{CCTKFunc}{CCTK\_MyProc}{} -\function{int}{integer}{myproc} -\argument{cGH *}{CCTK\_POINTER}{cctkGH} -\showargs + +%%%%% +% QQQ +%%%%% + + +% cctk_Comm.h +\begin{CCTKFunc}{CCTK\_QueryGroupStorage}{} +\subroutine{int}{}{storage} +\argument{cGH *}{}{cctkGH} +\argument{const char *}{}{groupname} +\showcargs \begin{params} +\parameter{cctkGH}{pointer to CCTK grid hierarchy} \end{params} \begin{discussion} \end{discussion} @@ -1159,13 +1269,14 @@ This routine is for debugging purposes for Fortran programmers. \end{CCTKFunc} - -% CommOverloadables.c -\begin{CCTKFunc}{CCTK\_ParallelInit}{} -\subroutine{int}{integer}{istat} -\argument{cGH *}{CCTK\_POINTER}{cctkGH} +% cctk_Comm.h +\begin{CCTKFunc}{CCTK\_QueryGroupStorageI}{} +\subroutine{int}{}{storage} +\argument{cGH *}{}{cctkGH} +\argument{int}{}{groupindex} \showcargs \begin{params} +\parameter{cctkGH}{pointer to CCTK grid hierarchy} \end{params} \begin{discussion} \end{discussion} @@ -1178,13 +1289,15 @@ This routine is for debugging purposes for Fortran programmers. \end{CCTKFunc} - -% CommOverloadables.c -\begin{CCTKFunc}{CCTK\_Exit}{} -\subroutine{int}{integer}{istat} -\argument{cGH *}{CCTK\_POINTER}{cctkGH} -\showargs +% CommOverloadables.h +\begin{CCTKFunc}{CCTK\_QueryGroupStorageB}{} +\subroutine{int}{}{storage} +\argument{cGH *}{}{cctkGH} +\argument{int}{}{groupindex} +\argument{const char *}{}{groupname} +\showcargs \begin{params} +\parameter{cctkGH}{pointer to CCTK grid hierarchy} \end{params} \begin{discussion} \end{discussion} @@ -1198,14 +1311,22 @@ This routine is for debugging purposes for Fortran programmers. -% CommOverloadables.c -\begin{CCTKFunc}{CCTK\_Abort}{} -\subroutine{int}{integer}{istat} -\argument{cGH *}{CCTK\_POINTER}{cctkGH} +%%%%% +% RRR +%%%%% + + +% cctk_IOMethods.h +\begin{CCTKFunc}{CCTK\_RegisterIOMethod}{} +\function{int}{integer}{handle} +\argument{const char *}{}{name} \showargs \begin{params} +\parameter{handle}{handle returned by registration} +\parameter{name}{name of the IO method} \end{params} \begin{discussion} +IO methods should be registered at {\t CCTK\_STARTUP}. \end{discussion} \begin{examples} \begin{tabular}{@{}p{3cm}cp{11cm}} @@ -1216,11 +1337,11 @@ This routine is for debugging purposes for Fortran programmers. \end{CCTKFunc} -% CommOverloadables.c -\begin{CCTKFunc}{CCTK\_SetupGH}{} -\subroutine{cGH *}{}{GH} -\argument{tFleshConfig}{}{config} -\argument{int}{}{convlevel} +% cctk_IOMethods.h +\begin{CCTKFunc}{CCTK\_RegisterIOMethodOutputGH}{Register a routine for an IO method which will be called from {\tt CCTK\_OutputGH}.} +\function{int}{integer}{istat} +\argument{int}{}{handle} +\argument{int}{}{(* func)(cGH *)} \showcargs \begin{params} \end{params} @@ -1236,12 +1357,11 @@ This routine is for debugging purposes for Fortran programmers. -% CommOverloadables.h -\begin{CCTKFunc}{CCTK\_QueryGroupStorageB}{} -\subroutine{int}{}{storage} -\argument{cGH *}{}{GH} -\argument{int}{}{groupindex} -\argument{const char *}{}{groupname} +% cctk_IOMethods.h +\begin{CCTKFunc}{CCTK\_RegisterIOMethodTimeToOutput}{Register a routine for an IO method which will decide if it is time for the method to output.} +\function{int}{integer}{istat} +\argument{int}{}{handle} +\argument{int}{}{(* func)(cGH *,int)} \showcargs \begin{params} \end{params} @@ -1256,13 +1376,11 @@ This routine is for debugging purposes for Fortran programmers. \end{CCTKFunc} - -% Comm.h -\begin{CCTKFunc}{CCTK\_ArrayGroupSize}{} -\subroutine{int *}{}{size} -\argument{cGH *}{}{GH} -\argument{int}{}{groupindex} -\argument{int}{}{dir} +% cctk_IOMethods.h +\begin{CCTKFunc}{CCTK\_RegisterIOMethodTriggerOutput}{Register a routine for an IO method which will handle trigger output} +\function{int}{integer}{istat} +\argument{int}{}{handle} +\argument{int}{}{(* func)(cGH *,int)} \showcargs \begin{params} \end{params} @@ -1277,12 +1395,11 @@ This routine is for debugging purposes for Fortran programmers. \end{CCTKFunc} - -% Comm.h -\begin{CCTKFunc}{CCTK\_QueryGroupStorageI}{} -\subroutine{int}{}{storage} -\argument{cGH *}{}{GH} -\argument{int}{}{groupindex} +% cctk_IOMethods.h +\begin{CCTKFunc}{CCTK\_RegisterIOMethodOutputVarAs}{Register a routine for an IO method which will provide aliased variable output} +\function{int}{integer}{istat} +\argument{int}{}{handle} +\argument{int}{}{(* func)(cGH *,const char*, const char *)} \showcargs \begin{params} \end{params} @@ -1297,11 +1414,11 @@ This routine is for debugging purposes for Fortran programmers. \end{CCTKFunc} -% Comm.h -\begin{CCTKFunc}{CCTK\_ArrayGroupSize}{} -\subroutine{int *}{}{size} -\argument{cGH *}{}{GH} -\argument{const char *}{}{groupname} + +% cctk_GHExtensions.h +\begin{CCTKFunc}{CCTK\_RegisterGHExtension}{Register an extension to the CactusGH} +\function{int}{}{istat} +\argument{const char *}{}{name} \showcargs \begin{params} \end{params} @@ -1315,13 +1432,11 @@ This routine is for debugging purposes for Fortran programmers. \end{errorcodes} \end{CCTKFunc} - - -% Comm.h -\begin{CCTKFunc}{CCTK\_QueryGroupStorage}{} -\subroutine{int}{}{storage} -\argument{cGH *}{}{GH} -\argument{const char *}{}{groupname} +% cctk_GHExtensions.h +\begin{CCTKFunc}{CCTK\_RegisterGHExtensionSetupGH}{Register a function which will set up a given extension to the Cactus GH} +\function{int}{}{istat} +\argument{int}{}{handle} +\argument{void *}{}{(*func)(tFleshConfig *, int, cGH *)} \showcargs \begin{params} \end{params} @@ -1335,15 +1450,30 @@ This routine is for debugging purposes for Fortran programmers. \end{errorcodes} \end{CCTKFunc} +% cctk_GHExtensions.h +\begin{CCTKFunc}{CCTK\_RegisterGHExtensionInitGH}{Register a function which will initialise a given extension to the Cactus GH} +\function{int}{}{istat} +\argument{int}{}{handle} +\argument{void *}{}{(*func)(cGH *)} +\showcargs +\begin{params} +\end{params} +\begin{discussion} +\end{discussion} +\begin{examples} +\begin{tabular}{@{}p{3cm}cp{11cm}} +\end{tabular} +\end{examples} +\begin{errorcodes} +\end{errorcodes} +\end{CCTKFunc} -% IOOverloadables.h -\begin{CCTKFunc}{CCTK\_OutputVarAsByMethod}{} -\subroutine{int}{}{istat} -\argument{cGH *}{}{GH} -\argument{const char *}{character*(*)}{variable} -\argument{const char *}{character*(*)}{method} -\argument{const char *}{character*(*)}{alias} -\showargs +% cctk_GHExtensions.h +\begin{CCTKFunc}{CCTK\_RegisterGHExtensionrfrTraverseGH}{Register a routine which will be called to fill out an extension to a Cactus GH before a traverse of the RFR tree.} +\function{int}{}{istat} +\argument{int}{}{handle} +\argument{void *}{}{(*func)(cGH *,int)} +\showcargs \begin{params} \end{params} \begin{discussion} @@ -1357,17 +1487,88 @@ This routine is for debugging purposes for Fortran programmers. \end{CCTKFunc} -% IOOverloadables.h -\begin{CCTKFunc}{CCTK\_OutputGH}{} -\subroutine{int}{integer}{istat} -\argument{cGH *}{CCTK\_POINTER}{GH} + +% cctk_Interp.h +\begin{CCTKFunc}{CCTK\_RegisterInterpOperator}{Register a function + which will provide an interpolation operator} +\subroutine{int}{}{handle} +\argument{int}{}{(*function)(REGISTER\_INTERP\_ARGLIST)} +\argument{const char *}{}{name} +\showcargs +\begin{params} +\parameter{handle}{Handle from the registration} +\parameter{function}{Routine containing interpolation operator} +\parameter{name}{Name of interpolation operator} +\end{params} +\begin{discussion} +The argument list {\t REGISTER\_INTERP\_ARGLIST} + for the interpolation operator routine is +\begin{description} +\item[cGH *GH] + Pointer to CCTK grid hierachy (in) +\item[int nPoints] + Number of points to be interpolated on this processor (in) +\item[int nDims] + Number of coordinate dimensions for each point (in) +\item[int nInFields] + Number of input fields to interpolate from (in) +\item[int nOutFields] + Number of output fields to interpolate to (in) +\item[int *dims] + Size nDims array with dimensions of the underlying grid (in) +\item[void **coords] + Void *array of size nDims with coordinates of points to interpolate at (in) +\item[int *coordTypes] + size ndims array with variable type of coordinate fields (in) +\item[void *origin] + size ndims array with origin of the underlying grid (in) +\item[void *delta] + size ndims array with gridspacing of the underlying grid (in) +\item[void **inFields] + size nInFields *array of input fields to interpolate on (in) +\item[int *inTypes] + size ndims array with variable types of input fields (in) +\item[void **outFields] + size nOutFields *array of output fields to interpolate to (out) +\item[int *outTypes] + size ndims array with variable types of output fields (in) +\end{description} +\end{discussion} +\begin{examples} +\end{examples} +\begin{errorcodes} +\end{errorcodes} +\end{CCTKFunc} + + + + + +% Coord.c +\begin{CCTKFunc}{CCTK\_RegisterCoordI}{Register a grid function index as identifying a coordinate with a given coordinate name and direction.} +\subroutine{int}{integer}{handle} +\argument{int}{integer}{direction} +\argument{int}{integer}{index} +\argument{const char *}{character*(*)}{name} \showargs \begin{params} +\parameter{handle}{On success returns zero or a positive registration handle. Error codes have negative values.} +\parameter{direction}{The coordinate cartesian direction} +\parameter{index}{The index of the grid function representing the coordinate} +\parameter{name}{The name of the coordinate} \end{params} \begin{discussion} +The coordinate name is independent of the grid function name. The direction should be given +as zero for a non-cartesian index. Currently only CCTK\_REAL grid functions can be registered +as coordinates. \end{discussion} \begin{examples} \begin{tabular}{@{}p{3cm}cp{11cm}} +\hfill {\bf C} && {\t index = CCTK\_VarIndex(``MyImp::MyGF'');} \\ + && {\t handle = CCTK\_RegisterCoordI(1,index,`xdir')}; +\\ +\hfill {\bf Fortran} && {\t call CCTK\_REGISTERCOORDI(handle,0,14,`radius')}; +\\ \end{tabular} \end{examples} \begin{errorcodes} @@ -1375,18 +1576,30 @@ This routine is for debugging purposes for Fortran programmers. \end{CCTKFunc} - -% IOMethods.h -\begin{CCTKFunc}{CCTK\_RegisterIOMethod}{} -\function{int}{integer}{istat} -\argument{const char *}{}{name} +% Coord.c +\begin{CCTKFunc}{CCTK\_RegisterCoord}{Register a grid function name as identifying a coordinate with a given coordinate name and direction.} +\subroutine{int}{integer}{handle} +\argument{int}{integer}{direction} +\argument{const char *}{character*(*)}{gfname} +\argument{const char *}{character*(*)}{coordname} \showargs \begin{params} +\parameter{handle}{On success returns a zero or positive registration handle. Error codes have negative values.} +\parameter{direction}{The coordinate cartesian direction} +\parameter{gfname}{The full name of the grid function representing the coordinate} +\parameter{coordname}{The name of the coordinate} \end{params} \begin{discussion} +The coordinate name is independent of the grid function name. The direction should be given +as zero for a non-cartesian index. Currently only CCTK\_REAL grid functions can be registered +as coordinates. \end{discussion} \begin{examples} \begin{tabular}{@{}p{3cm}cp{11cm}} +\hfill {\bf C} && {\t handle = CCTK\_RegisterCoord(1,`MyImp::MyGF',`xdir')}; +\\ +\hfill {\bf Fortran} && {\t call CCTK\_REGISTERCOORD(handle,0,`MyImp::MyGF',`radius')}; +\\ \end{tabular} \end{examples} \begin{errorcodes} @@ -1394,18 +1607,24 @@ This routine is for debugging purposes for Fortran programmers. \end{CCTKFunc} -% IOMethods.h -\begin{CCTKFunc}{CCTK\_RegisterIOMethodOutputGH}{} -\function{int}{integer}{istat} -\argument{int}{}{handle} -\argument{int}{}{(* func)(cGH *)} +% Coord.c +\begin{CCTKFunc}{CCTK\_RegisterBanner}{Register a banner for a thorn} +\subroutine{void}{}{} +\argument{const char *}{character}{message} \showargs \begin{params} +\parameter{banner}{String which will be displayed as a banner} \end{params} \begin{discussion} +The banner must be register during {\t CCTK\_STARTUP}. The banners are +displayed in the order in which they are registered. \end{discussion} \begin{examples} \begin{tabular}{@{}p{3cm}cp{11cm}} +\hfill {\bf C} && {\t CCTK\_RegisterBanner(`My Thorn: Does Something Useful')}; +\\ +\hfill {\bf Fortran} && {\t call CCTK\_REGISTERBANNER(`*** MY THORN ***')}; +\\ \end{tabular} \end{examples} \begin{errorcodes} @@ -1414,18 +1633,33 @@ This routine is for debugging purposes for Fortran programmers. -% IOMethods.h -\begin{CCTKFunc}{CCTK\_RegisterIOMethodTimeToOutput}{} -\function{int}{integer}{istat} -\argument{int}{}{handle} -\argument{int}{}{(* func)(cGH *,int)} +% Coord.c +\begin{CCTKFunc}{CCTK\_RegisterCoordRange}{Saves the global upper and lower bounds for a given coordinate name} +\subroutine{int}{integer}{ierr} +\argument{cGH *}{CCTK\_POINTER}{cctkGH} +\argument{CCTK\_REAL}{CCTK\_REAL}{lower} +\argument{CCTK\_REAL}{CCTK\_REAL}{upper} +\argument{const char *}{character*(*)}{coordname} \showargs \begin{params} +\parameter{ierr}{Error code} +\parameter{cctkGH}{pointer to CCTK grid hierarchy} +\parameter{lower}{Global lower bound of the coordinate} +\parameter{upper}{Global upper bound of the coordinate} +\parameter{coordname}{Coordinate name} \end{params} \begin{discussion} +The coordinate name is independent of the grid function name. There must already +be a coordinate registered with the given name, with {\t CCTK\_RegisterCoord}. +The coordinate range +can be accessed by {\t CCTK\_CoordRange}. \end{discussion} \begin{examples} \begin{tabular}{@{}p{3cm}cp{11cm}} +\hfill {\bf C} && {\t ierr = CCTK\_RegisterCoordRange(xmin,xmax,`xdir') }; +\\ +\hfill {\bf Fortran} && {\t call CCTK\_REGISTERCOORDRANGE(ierr,Rmin,Rmax,`radius')}; +\\ \end{tabular} \end{examples} \begin{errorcodes} @@ -1433,12 +1667,18 @@ This routine is for debugging purposes for Fortran programmers. \end{CCTKFunc} -% IOMethods.h -\begin{CCTKFunc}{CCTK\_RegisterIOMethodTriggerOutput}{} -\function{int}{integer}{istat} -\argument{int}{}{handle} -\argument{int}{}{(* func)(cGH *,int)} -\showargs + +%%%%% +% SSS +%%%%% + + +% CommOverloadables.c +\begin{CCTKFunc}{CCTK\_SetupGH}{Setup a new GH} +\subroutine{cGH *}{}{cctkGH} +\argument{tFleshConfig}{}{config} +\argument{int}{}{convlevel} +\showcargs \begin{params} \end{params} \begin{discussion} @@ -1452,15 +1692,19 @@ This routine is for debugging purposes for Fortran programmers. \end{CCTKFunc} -% IOMethods.h -\begin{CCTKFunc}{CCTK\_RegisterIOMethodOutputVarAs}{} -\function{int}{integer}{istat} -\argument{int}{}{handle} -\argument{int}{}{(* func)(cGH *,const char*, const char *)} + + +% CommOverloadables.c +\begin{CCTKFunc}{CCTK\_SyncGroup}{Synchronise the ghostzones for a group of grid variables} +\subroutine{int}{integer}{istat} +\argument{cGH *}{CCTK\_POINTER}{cctkGH} +\argument{const char *}{character*(*)}{group} \showargs \begin{params} +\parameter{cctkGH}{pointer to CCTK grid hierarchy} \end{params} \begin{discussion} +Only those grid variables who have communication enabled will be synchronised. \end{discussion} \begin{examples} \begin{tabular}{@{}p{3cm}cp{11cm}} @@ -1472,201 +1716,207 @@ This routine is for debugging purposes for Fortran programmers. -% GHExtensions.h -\begin{CCTKFunc}{CCTK\_RegisterGHExtension}{} -\function{int}{}{istat} -\argument{const char *}{}{name} -\showcargs +%%%%% +% TTT +%%%%% + +%%%%% +% UUU +%%%%% + +%%%%% +% VVV +%%%%% + + +% Groups.c +\begin{CCTKFunc}{CCTK\_VarIndex}{Get the index for a variable} +\subroutine{int}{integer}{index} +\argument{const char *}{character*(*)}{varname} +\showargs \begin{params} +\parameter{varname}{The name of the variable} \end{params} \begin{discussion} +The variable name should be given in the form {\t <implementation>::<variable>} \end{discussion} \begin{examples} \begin{tabular}{@{}p{3cm}cp{11cm}} +\hfill {\bf C} && {\t index = CCTK\_VarIndex(`evolve::phi') }; +\\ +\hfill {\bf Fortran} && {\t call CCTK\_VarIndex(index,`evolve::phi')}; +\\ \end{tabular} \end{examples} \begin{errorcodes} \end{errorcodes} \end{CCTKFunc} -% GHExtensions.h -\begin{CCTKFunc}{CCTK\_RegisterGHExtensionSetupGH}{} -\function{int}{}{istat} -\argument{int}{}{handle} -\argument{void *}{}{(*func)(tFleshConfig *, int, cGH *)} + + + +% Groups.c +\begin{CCTKFunc}{CCTK\_VarName}{Given a variable index, returns the variable name} +\subroutine{char *}{integer}{name} +\argument{int}{integer}{index} \showcargs \begin{params} +\parameter{name}{The variable name} +\parameter{index}{The variable index} \end{params} \begin{discussion} +No Fortran routine exists at the moment. \end{discussion} \begin{examples} \begin{tabular}{@{}p{3cm}cp{11cm}} +\hfill {\bf C} && {\t index = CCTK\_VarIndex(`evolve::phi')}\\ + &&{\t name = CCTK\_VarName(index) ;} +\\ \end{tabular} \end{examples} \begin{errorcodes} \end{errorcodes} \end{CCTKFunc} -% GHExtensions.h -\begin{CCTKFunc}{CCTK\_RegisterGHExtensionInitGH}{} -\function{int}{}{istat} -\argument{int}{}{handle} -\argument{void *}{}{(*func)(cGH *)} -\showcargs + + + +% Groups.c +\begin{CCTKFunc}{CCTK\_VarTypeI}{Provides variable type index from the variable index} +\subroutine{int}{integer}{type} +\argument{int}{integer}{index} +\showargs \begin{params} +\parameter{type}{The variable type index} +\parameter{group}{The variable index} \end{params} \begin{discussion} +The variable type index indicates the type of the variable. +Either character, int, complex or real. The group type can be checked +with the Cactus provided macros for {\t CCTK\_VARIABLE\_INT}, {\t CCTK\_VARIABLE\_REAL}, {\t CCTK\_VARIABLE\_COMPLEX} or {\t CCTK\_VARIABLE\_CHAR}. \end{discussion} \begin{examples} \begin{tabular}{@{}p{3cm}cp{11cm}} +\hfill {\bf C} && {\t index = CCTK\_VarIndex(`evolve::phi')}\\ + &&{\t real = (CCTK\_VARIABLE\_REAL == CCTK\_VarTypeI(index)) ;} +\\ +\hfill {\bf Fortran} && {\t call CCTK\_VARTYPEI(type,3)}\\ +\\ \end{tabular} \end{examples} \begin{errorcodes} \end{errorcodes} \end{CCTKFunc} -% GHExtensions.h -\begin{CCTKFunc}{CCTK\_RegisterGHExtensionrfrTraverseGH}{} -\function{int}{}{istat} -\argument{int}{}{handle} -\argument{void *}{}{(*func)(cGH *,int)} + +\begin{CCTKFunc}{CCTK\_VarDataPtr}{Returns the data pointer for a grid variable} +\subroutine{void *}{}{ptr} +\argument{cGH *}{}{cctkGH} +\argument{int}{}{timelevel} +\argument{char *}{}{name} \showcargs \begin{params} +\parameter{cctkGH}{pointer to CCTK grid hierarchy} +\parameter{timelevel}{The timelevel of the grid variable} +\parameter{name}{The full name of the variable} \end{params} \begin{discussion} +The variable name should be in the form {\t <implementation>::<variable>}. \end{discussion} \begin{examples} \begin{tabular}{@{}p{3cm}cp{11cm}} +\hfill {\bf C} && {\t myVar = (CCTK\_REAL *)(CCTK\_VarDataPtr(GH,0,`imp::realvar'))}\\ +\\ \end{tabular} \end{examples} \begin{errorcodes} \end{errorcodes} \end{CCTKFunc} - - -% Interp.h -\begin{CCTKFunc}{CCTK\_RegisterInterpOperator}{Register a function - which will provide an interpolation operator} -\subroutine{int}{}{handle} -\argument{int}{}{(*function)(REGISTER\_INTERP\_ARGLIST)} -\argument{const char *}{}{name} +\begin{CCTKFunc}{CCTK\_VarDataPtrI}{Returns the data pointer for a grid variable from the variable index} +\subroutine{void *}{}{ptr} +\argument{cGH *}{}{cctkGH} +\argument{int}{}{timelevel} +\argument{int}{}{index} \showcargs \begin{params} -\parameter{handle}{Handle from the registration} -\parameter{function}{Routine containing interpolation operator} -\parameter{name}{Name of interpolation operator} +\parameter{cctkGH}{} +\parameter{timelevel}{The timelevel of the grid variable} +\parameter{index}{The index of the variable} \end{params} \begin{discussion} -The argument list {\t REGISTER\_INTERP\_ARGLIST} - for the interpolation operator routine is -\begin{description} -\item[cGH *GH] - Pointer to CCTK grid hierachy (in) -\item[int nPoints] - Number of points to be interpolated on this processor (in) -\item[int nDims] - Number of coordinate dimensions for each point (in) -\item[int nInFields] - Number of input fields to interpolate from (in) -\item[int nOutFields] - Number of output fields to interpolate to (in) -\item[int *dims] - Size nDims array with dimensions of the underlying grid (in) -\item[void **coords] - Void *array of size nDims with coordinates of points to interpolate at (in) -\item[int *coordTypes] - size ndims array with variable type of coordinate fields (in) -\item[void *origin] - size ndims array with origin of the underlying grid (in) -\item[void *delta] - size ndims array with gridspacing of the underlying grid (in) -\item[void **inFields] - size nInFields *array of input fields to interpolate on (in) -\item[int *inTypes] - size ndims array with variable types of input fields (in) -\item[void **outFields] - size nOutFields *array of output fields to interpolate to (out) -\item[int *outTypes] - size ndims array with variable types of output fields (in) -\end{description} \end{discussion} \begin{examples} +\begin{tabular}{@{}p{3cm}cp{11cm}} +\hfill {\bf C} && {\t myVar = (CCTK\_REAL *)(CCTK\_VarDataPtr(GH,0,CCTK\_VarIndex(`imp::realvar')))}\\ +\\ +\end{tabular} \end{examples} \begin{errorcodes} \end{errorcodes} \end{CCTKFunc} - - -% Interp.h -\begin{CCTKFunc}{CCTK\_Interp}{Perform an interpolatation, using a chosen method} -\subroutine{int}{integer}{num} -\argument{cGH *}{CCTK\_POINTER}{GH} -\argument{int}{integer}{handle} -\argument{int}{integer}{nPoints} -\argument{int}{integer}{nDims} -\argument{int}{integer}{nInFields} -\argument{int}{integer}{nOutFields} -\argument{...}{...}{} -\showargs +\begin{CCTKFunc}{CCTK\_VarDataPtrI}{Returns the data pointer for a grid variable from the variable index or the variable name} +\subroutine{void *}{}{ptr} +\argument{cGH *}{}{cctkGH} +\argument{int}{}{timelevel} +\argument{int}{}{index} +\argument{char *}{}{name} +\showcargs \begin{params} -\parameter{GH}{pointer to CCTK grid hierarchy} -\parameter{handle}{handle for interpolation method} -\parameter{nPoints}{number of points to be interpolated on this processor} -\parameter{nDims}{number of passed coordinate fields} -\parameter{nInFields}{number of passed input fields} -\parameter{nOutFields}{number of passed output fields} -\parameter{...}{variable argument list containing coordinate details andvariable indices, described below} +\parameter{ptr}{a void pointer to the grid variable data} +\parameter{cctkGH}{} +\parameter{timelevel}{The timelevel of the grid variable} +\parameter{index}{The index of the variable} +\parameter{name}{The full name of the variable} \end{params} \begin{discussion} -The handle for a given interpolation method can be found using -{\t CCTK\_InterpHandle}. The variable argument list contains -information in the order: -\begin{itemize} -\item{} nDim integers containing ?? -\item{} nDim coordinate grid indices -\item{} nDim coordinate variable types -\item{} nDim coordinate origins -\item{} nDim grid spacings -\item{} nInFields indices for the fields to be interpolated from -\item{} nInFields variable types for the fields to be interpolated from -\item{} nOutFields indices for the fields to be interpolated to -\item{} nOutFields variable types for the fields to be interpolated to -\end{itemize} - +If the name if {\t NULL} the index will be used, if the index is negative the name will be used. \end{discussion} \begin{examples} \begin{tabular}{@{}p{3cm}cp{11cm}} +\hfill {\bf C} && {\t myVar = (CCTK\_REAL *)(CCTK\_VarDataPtrB(GH,0,CCTK\_VarIndex(`imp::realvar'),NULL))}\\ +\\ \end{tabular} \end{examples} \begin{errorcodes} \end{errorcodes} -\end{CCTKFunc} +\end{CCTKFunc} +%%%%% +% WWW +%%%%% -% Groups.c -\begin{CCTKFunc}{CCTK\_InterpHandle}{Return the handle for a given interpolation operator} -\subroutine{int}{integer}{handle} -\argument{const char *}{character*(*)}{operator} + +% WarnLevel.c +\begin{CCTKFunc}{CCTK\_WARN}{Prints a warning message and possibly stops the code} +\subroutine{}{}{} +\argument{int}{integer}{level} +\argument{const char *}{character*(*)}{warning} \showargs \begin{params} -\parameter{hnadle}{Handle for the interpolation operator} -\parameter{operator}{Name of interpolation operator} +\parameter{level}{The warning level, lower numbers are the severest warnings} +\parameter{warning}{The warning message} \end{params} \begin{discussion} +By default Cactus stops on a level 0 warning, and prints any level 1 warnings. +This behavious can be changed on the command line. \end{discussion} \begin{examples} \begin{tabular}{@{}p{3cm}cp{11cm}} +\hfill {\bf C} && {\t CCTK\_WARN(1,`This is not a good idea') }; +\\ +\hfill {\bf Fortran} && {\t call CCTK\_WARN(0,`Divide by zero')}; +\\ \end{tabular} \end{examples} \begin{errorcodes} \end{errorcodes} -\end{CCTKFunc} +\end{CCTKFunc} diff --git a/doc/UsersGuide/ThornWriters.tex b/doc/UsersGuide/ThornWriters.tex index 5d49b90f..18bd812a 100644 --- a/doc/UsersGuide/ThornWriters.tex +++ b/doc/UsersGuide/ThornWriters.tex @@ -825,7 +825,7 @@ operators through the following function calls: {\t \begin{verbatim} -#include ``Reduction.h'' +#include ``cctk_Reduction.h'' int CCTK_GetReductionHandle(const char *reduction); \end{verbatim} @@ -842,7 +842,7 @@ argument lists). {\t \begin{verbatim} -#include ``Reduction.h'' +#include ``cctk_Reduction.h'' int CCTK_Reduce(cGH *GH, int retvaltype, int retvalnum, void *retval, int handle, int index, ...); \end{verbatim} |