summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac>2004-06-26 17:39:31 +0000
committertradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac>2004-06-26 17:39:31 +0000
commita8556c1d725ff15ad5a202690bfa845d0277739e (patch)
treedb12778ce21036fe10684c0825fa8e7e9c1aefe1
parent8f6de0e2111abd2dbc11aa64b92b9efbae58c63b (diff)
Document the new HAVE_CCTK_<datatype> macros.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@3796 17b73243-c579-4c4c-a9d2-2d5706c11dac
-rw-r--r--doc/UsersGuide/ThornWriters.tex55
1 files changed, 35 insertions, 20 deletions
diff --git a/doc/UsersGuide/ThornWriters.tex b/doc/UsersGuide/ThornWriters.tex
index e50ba409..8aa86bf5 100644
--- a/doc/UsersGuide/ThornWriters.tex
+++ b/doc/UsersGuide/ThornWriters.tex
@@ -4113,7 +4113,7 @@ allow for a homogeneous code.
\label{sect-ThornWriting/DataTypes}
\label{sec:datyansi}
-Cactus supports the following fixed size data types:
+Cactus knows about the following fixed size data types:
\begin{center}
\begin{tabular}{|l|l|l|l|}
@@ -4134,6 +4134,21 @@ Data Type & Size (bytes) & Variable Type & Fortran Equivalent\\
\end{tabular}
\end{center}
+The availability of these types, and the corresponding
+C data types are platform-dependent. For each fixed-size data type there exists
+a corresponding preprocessor macro {\t HAVE\_<data type>} which should be used
+to check whether the given CCTK data type is supported, eg.
+
+\begin{verbatim}
+ /* declare variable with extended-precision complex data type if available
+ otherwise with default CCTK precision */
+ #ifdef HAVE_CCTK_COMPLEX32
+ CCTK_COMPLEX32 var;
+ #else
+ CCTK_COMPLEX var;
+ #endif
+\end{verbatim}
+
In addition Cactus provides three generic numeric data types which map onto
the compilers' native data types used to represent integer, real, and complex
values. The size for these generic types can be chosen at configuration time
@@ -4161,23 +4176,6 @@ variables in the thorn routines. Note that variable declarations in
thorns should obviously match with definitions in the interface files
where appropriate.
-Cactus also provides generic data and function pointers, which can
-be used from either C or Fortran (these may not work yet for thorn interface
-files):
-
-\begin{center}
-\begin{tabular}{|l|l|l|}
-\hline
-Data Type & Variable Type & C equivalent \\
-\hline
-{\t CCTK\_POINTER} & {\t CCTK\_VARIABLE\_POINTER}
- & {\t void *data\_ptr} \\
-{\t CCTK\_FPOINTER} & {\t CCTK\_VARIABLE\_FPOINTER}
- & {\t void (*fn\_ptr)(void)} \\
-\hline
-\end{tabular}
-\end{center}
-
Also provided, are a set of macros which
are interpreted by the preprocessor at compile time to signify which
data size is being used:
@@ -4201,8 +4199,25 @@ Data Type & {\t \#define}\\
\end{tabular}
\end{center}
-Note that the availability of these types, and the corresponding
-C data types are platform dependent.
+Cactus also provides generic data and function pointers, which can
+be used from either C or Fortran (these may not work yet for thorn interface
+files):
+
+\begin{center}
+\begin{tabular}{|l|l|l|}
+\hline
+Data Type & Variable Type & C equivalent \\
+\hline
+{\t CCTK\_POINTER} & {\t CCTK\_VARIABLE\_POINTER}
+ & {\t void *data\_ptr} \\
+{\t CCTK\_POINTER\_TO\_CONST} & {\t CCTK\_VARIABLE\_POINTER}
+ & {\t const void *data\_ptr} \\
+{\t CCTK\_FPOINTER} & {\t CCTK\_VARIABLE\_FPOINTER}
+ & {\t void (*fn\_ptr)(void)} \\
+\hline
+\end{tabular}
+\end{center}
+
\subsection{Fortran Thorn Writers}