aboutsummaryrefslogtreecommitdiff
path: root/doc/documentation.tex
blob: 663abcd41d5777b99abf433d4a97cf7be0af4cbe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
\documentclass{article}

% Use the Cactus ThornGuide style file
% (Automatically used from Cactus distribution, if you have a 
%  thorn without the Cactus Flesh download this from the Cactus
%  homepage at www.cactuscode.org)
\usepackage{../../../../doc/latex/cactus}

\begin{document}

\title{ADMCoupling}
\author{Ian Hawke, David Rideout}
\date{$ $Date$ $}

\maketitle

% Do not delete next line
% START CACTUS THORNGUIDE

\begin{abstract}
This thorn allows seamless coupling of evolution and analysis thorns
to any thorns which contribute matter terms to the stress energy
tensor $T_{ab}$.
\end{abstract} 

\section{Purpose}

This thorn is completely trivial (there's already more words in the
documentation than in the code). The point is to allow clean coupling
of matter thorns and spacetime evolution thorns. By making a spacetime
thorn (such as BSSN) a friend of \texttt{ADMCoupling} it can know about the
variables of the matter thorns (such as Whisky) as long as they are
also friends of \texttt{ADMCoupling}, and then the appropriate stress energy
tensor terms can be included through the {\tt CalcTmunu} interface.
This avoids explicit dependencies between the spacetime and matter
evolution thorns. Note that we need to do the same for certain
analysis thorns, such as \texttt{ADMConstraints}.

\section{CalcTmunu}

\subsection{Background}
So what is this ``\texttt{CalcTmunu}'', anyway?
\texttt{CalcTmunu} is a general interface which allows any thorn to
`declare' that it contains matter variables, by adding terms to the
components of the stress energy tensor.  This is done using the Cactus
include file mechanism, which allows thorns to contribute code to
include files, which can then be included by any thorn which wishes to
use them.

For \texttt{CalcTmunu} there are two include files,
\texttt{CalcTmunu.inc} and \texttt{CalcTmunu\_temps.inc}.  
%The name ``temps'' is not so great, it would be better to have the
%one ``source'' and the other ``declarations'', or something.
In the former, one can place code of the form
\begin{verbatim}
	Ttt = Ttt + ...
	Ttx = Ttx + ...
	...
\end{verbatim}
to add terms to the components $T_{\mu\nu}$.  This code will be
executed for each point on the grid.  The latter will be
included in the variable declaration section for the block of code
which contains the
\begin{verbatim}
#include "CalcTmunu.inc"
\end{verbatim}
One can put local temporary variable declarations needed for the code
above into this file.  The \texttt{Ttt}, \texttt{Ttx}, etc.~will be
declared within a macro from \texttt{ADMMacros}.

\subsection{For matter thorns}
To make use of the {\tt CalcTmunu} interface, simply place the lines
\begin{verbatim}
INCLUDES HEADER: MyThorn_CalcTmunu_temps.inc in CalcTmunu_temps.inc
INCLUDES SOURCE: MyThorn_CalcTmunu.inc in CalcTmunu.inc
\end{verbatim}
in your thorn's \texttt{interface.ccl} file, and declare your thorn to
be friends with \texttt{ADMCoupling}.  Then provide the files
\texttt{MyThorn\_CalcTmunu\_temps.inc} and
\texttt{MyThorn\_CalcTmunu.inc} (or whatever you choose to name them)
somewhere in your thorn's source code.

\subsection{For thorns which need the stress energy tensor}

See thorn \texttt{CactusEinstein/ADM} for an example of a thorn which
uses the code inserted into the \texttt{CalcTmunu} include files.
There the macro \texttt{KSOURCES} (see \texttt{KSOURCES\_declare.h}
and \texttt{KSOURCES\_guts.h}) is called from the various time
integration source files \texttt{DoubleLeap.F},
\texttt{IterativeCN.F}, etc., which in turn include the
\texttt{CalcTmunu\_temps.inc} and \texttt{CalcTmunu.inc} files.  In
this example, the
$T_{\mu\nu}$ temporary variables are provided by including
\texttt{CactusEinstein/ADMMacros/src/macro/TRT\_declare.h}.

% Do not delete next line
% END CACTUS THORNGUIDE

\end{document}
% LocalWords:  ADMCoupling Hawke Whisky CalcTmunu ADMConstraints Ttt Ttx ccl
% LocalWords:  ADMMacros MyThorn KSOURCES DoubleLeap IterativeCN