From 2802d63d6f953d6d53886f653d5a74ff6b2f1319 Mon Sep 17 00:00:00 2001 From: schnetter Date: Mon, 7 Apr 2008 02:41:08 +0000 Subject: Add a new function CCTK_MaxGFDim to the flesh which returns the (maximum) dimension of all grid functions. Cactus can currently not handle the case where one uses grid arrays of dimension D while grid functions have a dimension less than D. During initialisation, Cactus sets cctk_dim to the largest dimension of all grid variables in all active thorns. This is arguably wrong; cctk_dim should be set to the (maximum) dimension of the grid functions. This patch adds a new function CCTK_MaxGFDim to the flesh which returns the (maximum) dimension of all grid functions. This function is used to set cctk_dim. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4476 17b73243-c579-4c4c-a9d2-2d5706c11dac --- doc/ReferenceManual/CCTKReference.tex | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'doc/ReferenceManual') diff --git a/doc/ReferenceManual/CCTKReference.tex b/doc/ReferenceManual/CCTKReference.tex index ca9de66d..ffac6aa5 100644 --- a/doc/ReferenceManual/CCTKReference.tex +++ b/doc/ReferenceManual/CCTKReference.tex @@ -465,6 +465,9 @@ from Fortran. \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 +7049,31 @@ and not the active thorn list. \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} -- cgit v1.2.3