Index: comm/CactusDefaultComm.c =================================================================== RCS file: /cactusdevcvs/Cactus/src/comm/CactusDefaultComm.c,v retrieving revision 1.69 diff -u -r1.69 CactusDefaultComm.c --- comm/CactusDefaultComm.c 24 Jul 2006 08:37:47 -0000 1.69 +++ comm/CactusDefaultComm.c 20 Mar 2008 01:37:33 -0000 @@ -112,7 +112,7 @@ @desc Default cactus SetupGH routine. @enddesc - @calls CCTK_MaxDim + @calls CCTK_MaxGFDim CCTK_NumVars CCTK_MaxTimeLevelsVI CCTK_NumGroups @@ -157,7 +157,7 @@ thisGH = malloc(sizeof(cGH)); if(thisGH) { - thisGH->cctk_dim = CCTK_MaxDim(); + thisGH->cctk_dim = CCTK_MaxGFDim(); /* Need this to be at least one otherwise the memory allocation will fail */ cctk_dim = thisGH->cctk_dim; Index: include/cctk_Groups.h =================================================================== RCS file: /cactusdevcvs/Cactus/src/include/cctk_Groups.h,v retrieving revision 1.35 diff -u -r1.35 cctk_Groups.h --- include/cctk_Groups.h 28 Sep 2005 17:09:31 -0000 1.35 +++ include/cctk_Groups.h 20 Mar 2008 01:37:33 -0000 @@ -64,6 +64,7 @@ const char *CCTK_ImpFromVarI(int var); int CCTK_MaxDim(void); +int CCTK_MaxGFDim(void); int CCTK_NumGroups(void); Index: main/Groups.c =================================================================== RCS file: /cactusdevcvs/Cactus/src/main/Groups.c,v retrieving revision 1.140 diff -u -r1.140 Groups.c --- main/Groups.c 29 Feb 2008 14:39:47 -0000 1.140 +++ main/Groups.c 20 Mar 2008 01:37:35 -0000 @@ -82,6 +82,8 @@ (int *nchars, int *var, ONE_FORTSTRING_ARG); void CCTK_FCALL CCTK_FNAME (CCTK_MaxDim) (int *dim); +void CCTK_FCALL CCTK_FNAME (CCTK_MaxGFDim) + (int *dim); void CCTK_FCALL CCTK_FNAME (CCTK_MaxTimeLevels) (int *num, ONE_FORTSTRING_ARG); void CCTK_FCALL CCTK_FNAME (CCTK_MaxTimeLevelsGI) @@ -454,6 +456,31 @@ /*@@ + @routine CCTK_MaxGFDim + @date 2008-03-19 + @author Erik Schnetter + @desc + Gets the maximum dimension of all grid function groups. + @enddesc + + @returntype int + @returndesc + the maximum dimension of all grid function groups + @endreturndesc +@@*/ +int CCTK_MaxGFDim (void) +{ + return (gfdim); +} + +void CCTK_FCALL CCTK_FNAME (CCTK_MaxGFDim) + (int *dim) +{ + *dim = CCTK_MaxGFDim (); +} + + + /*@@ @routine CCTK_NumVars @date Mon Feb 8 12:04:50 1999 @author Tom Goodale Index: ReferenceManual/CCTKReference.tex =================================================================== RCS file: /cactusdevcvs/Cactus/doc/ReferenceManual/CCTKReference.tex,v retrieving revision 1.95 diff -u -r1.95 CCTKReference.tex --- ReferenceManual/CCTKReference.tex 17 Mar 2008 16:47:53 -0000 1.95 +++ ReferenceManual/CCTKReference.tex 20 Mar 2008 01:45:24 -0000 @@ -465,6 +465,9 @@ \item[\code{CCTK\_MaxDim}] [\pageref{CCTK-MaxDim}] Get the maximum dimension of any grid variable +\item[\code{CCTK\_MaxGFDim}] [\pageref{CCTK-MaxGFDim}] + Get the maximum dimension of all grid functions + \item[\code{CCTK\_MaxTimeLevels}] [\pageref{CCTK-MaxTimeLevels}] Gives the maximum number of timelevels for a group @@ -7046,6 +7085,31 @@ \end{CCTKFunc} +\begin{CCTKFunc}{CCTK\_MaxGFDim}{Get the maximum dimension of all grid + functions } +\label{CCTK-MaxGFDim} +\subroutine{int}{integer}{dim} +\showargs +\begin{params} +\parameter{dim}{The maximum dimension of all grid functions} +\end{params} +\begin{discussion} +Note that the maximum dimension will depend only on the active thorn list, +and not the compiled thorn list. +\end{discussion} +\begin{examples} +\begin{tabular}{@{}p{3cm}cp{11cm}} +\hfill {\bf C} && {\t dim = CCTK\_MaxGFDim() }; +\\ +\hfill {\bf Fortran} && {\t call CCTK\_MaxGFDim(dim)} +\\ +\end{tabular} +\end{examples} +\begin{errorcodes} +\end{errorcodes} +\end{CCTKFunc} + + \begin{CCTKFunc}{CCTK\_MaxTimeLevels}{Gives the number of timelevels for a group} \label{CCTK-MaxTimeLevels}