next up previous contents
Next: Fortran Up: ADMMacros Previous: Finite Differencing   Contents

Using ADM Macros

Each macro described in Section D6.5 is implemented using three include files:

<MACRONAME>_declare.h
sets up the declarations for the internal macro variables. All the internal (hidden) variables have names beginning with the macro name. This file should be included in the declarations section of your routine.

<MACRONAME>_guts.h
is the actual included source code which will calculate the quantities.

<MACRONAME>_undefine.h
resets the macros. This file must be #included at the end of every loop using macros. Without this, a second loop using macros would assume that quantities have already been calculated (and thus get wrong results).

The macros which compute derivatives also use the following variables; you should avoid using these in your code, in either lower or upper case:

di2, dj2, dk2        /* only in C, not in Fortran */
dt, dx, dy, dz
idx, idy, idz
i2dx, i2dy, i2dz
i12dx, i12dy, i12dz
idxx, idxy, idxz, idyy, idyz, idzz
i12dxx, i12dyy, i12dzz
i36dxy, i36dxz, i36dyz

To use the macros, first find the name of the macro from the table in Section D6.5 and put the include files in the correct place following the instructions above. Note that all ADMMacro include files are in the directory CactusEinstein/ADMMacros/src/macro/, so you include the macros with lines such as

#include "CactusEinstein/ADMMacros/src/macro/<MACRONAME>_<TYPE>.h"
(Recall that Cactus uses a C-style preprocessor for Fortran as well as C/C++ code; you use the same #includes for all these languages.)

Each variable that the macro calculates is listed in the table of Section D6.5. Note that these variable names are themselves macros and are case sensitive. Always use the macro variables on the right hand sides of equations, never redefine them yourself, since they may be used in later (hidden) calculations.



Subsections
next up previous contents
Next: Fortran Up: ADMMacros Previous: Finite Differencing   Contents