From 28c6a381fde4da9bef6afe81f131a6b1962f3e9b Mon Sep 17 00:00:00 2001 From: jthorn Date: Sun, 21 Nov 2004 12:55:34 +0000 Subject: document the need for Fortran code which uses macros which (directly or indirectoy) take derivatives, to #include "ADM_Spacing_declare.h" and "ADM_Spacing.h", and update the Fortran example to show this git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinBase/ADMMacros/trunk@86 b1d164ef-f17a-46e7-89d4-021c7118ef4e --- doc/documentation.tex | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/doc/documentation.tex b/doc/documentation.tex index 620fba2..4ad3974 100644 --- a/doc/documentation.tex +++ b/doc/documentation.tex @@ -196,8 +196,21 @@ yourself, since they may be used in later (hidden) calculations.} \subsection{Fortran} If you are using the macros inside a Fortran function then the -\texttt{i}, \texttt{j} and \texttt{k} indices are used directly. This is -shown in the Fortran example below. +\texttt{i}, \texttt{j} and \texttt{k} indices are used directly. + +If you're using (either directly or indirectly) any macro which computes +derivatives, you also need to \texttt{\#include} two additional files: +\begin{description} +\item[\texttt{ADM\_Spacing\_declare.h}]\mbox{}\\ + This must be \texttt{\#include}d \textbf{before} any of the + other \texttt{\_declare.h} files. +\item[\texttt{ADM\_Spacing.h}]\mbox{}\\ + This must be \texttt{\#include}d \textbf{after} all of the + other \texttt{\_declare.h} and \textbf{before} + any of the \texttt{\_guts.h} files. +\end{description} + +The Fortran example below should make this clear(er). \subsection{C} @@ -216,7 +229,7 @@ relative to $(i,j,k)$. That is, you should define \texttt{di = 1}, Since these don't depend on \texttt{i}, \texttt{j} and \texttt{k}, they can be assigned values once outside the loop-over-grid-points loops. -The C example below should make this clear. +The C example below should make this clear(er). Note that you should assign all these variables their values \textbf{before} \texttt{\#include}ing the \texttt{\_guts.h} macro (it may do @@ -235,6 +248,14 @@ the $trK$ macro to calculate the trace of the extrinsic curvature. c Declarations for macros. #include "CactusEinstein/ADMMacros/src/macro/TRK_declare.h" +c we're not taking any derivatives here, but if we were, +c we would also need the following line: +#include "CactusEinstein/ADMMacros/src/macro/ADM_Spacing_declare.h" + +c we're not taking any derivatives here, but if we were, +c we would also need the following line: +#include "CactusEinstein/ADMMacros/src/macro/ADM_Spacing.h" + c Add the shift term: N = B^i D_i(trK). -- cgit v1.2.3