aboutsummaryrefslogtreecommitdiff
path: root/doc/documentation.tex
blob: 8a7961040f669cf8149ab3a226329f8ce077724b (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
\documentclass{article}
\begin{document}

\title{CartGrid3D}
\author{Gabrielle Allen, Gerd Lanfermann}
\date{1999}
\maketitle

\abstract{Cartesian coordinates and symmetries for 3D grids}

\section{Purpose}

Allows you to set up coordinates on a 3D Cartesian grid in a 
flexible manner. Different grid domains (e.g. octant) can 
be chosen to allow you to exploit any symmetry in your 
problem. Routines for registering symmetries of grid functions
and applying symmetry conditions across the coordinate axes 
are provided.

\section{Comments}

\subsection{Coordinates}

The Cartesian coordinates supplied by this thorn are
grid functions with the standard names {\tt x}, {\tt y}, and
{\tt z}. To use these coordinates you need to {\tt inherit}
from {\tt grid}.  The coordinates are
registered with the flesh using the same names "x", "y" 
and "z". In addition a grid function {\tt r} (registered as
"r") is provided, containing the radial coordinate from
the origin where
$$
r = \sqrt{x^2+y^2+z^2}
$$

{\tt CartGrid3D} registers the lower and upper range of each coordinate
with the flesh.

\subsection{Symmetries}

If your problem and initial data allow it, {\tt CartGrid3D}
allows you to enforce either an even or odd parity
symmetry condition for any grid functions at each
coordinate axes. For a function $\phi(x,y,z)$,
even parity symmetry on the $x$-axis means
$$
\phi(-x,y,z) = \phi(x,y,z)
$$
while odd parity symmetry means
$$
\phi(-x,y,z) = -\phi(x,y,z)
$$

Note that the symmetries will only be enforced if a 
symmetry domain is chosen (that is, if 
{\tt domain} is {\tt octant}, {\tt quadrant} or {\tt bitant}).

\subsection{Registering Symmetry Behaviour}

Each grid function can register how it behaves under a coordinate
change using function calls in {\tt CartGrid3D}. These symmetry
properties can then be used by other thorns, for example {\tt
CactusBase/Boundary} uses them to enforce symmetry boundary conditions
across coordinate axis. Symmetries should obviously be registered
before they are used, but since they can be different for different grids, 
they must be registered {\it after} the {\tt CCTK\_STARTUP} timebin. The
usual place to register symmetries is in the {\tt CCTK\_BASEGRID} timebin.

For example, to register the symmetries of the {\it xy} component of the
metric tensor from C

{\tt
\begin{verbatim}
static int one=1;
int sym[3];
sym[0] = -one;
sym[1] = -one;
sym[2] =  one;
SetCartSymVN(cctkGH, sym,"einstein::gxy");
\end{verbatim}
}

% Automatically created from the ccl files by using gmake thorndoc
\include{interface}
\include{param}
\include{schedule}

\end{document}