aboutsummaryrefslogtreecommitdiff
path: root/doc/documention.tex
blob: 6f03b59f30770ac7e4d695a929af4825959c4462 (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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
\documentclass{article}
\begin{document}

\title{Boundary}
\author{Miguel Alcubierre, Gabrielle Allen, Gerd Lanfermann}
\date{1999}
\maketitle

\abstract{Standard boundary conditions with can be provided to
grid functions, or groups of grid functions. Currently only available 
for 3D grid functions}

\section{Purpose}

Allows you to apply standard boundary conditions to grid functions
or groups of grid functions, taking into account a parallel
decomposition of the grid. The routines are callable from 
C or Fortran. Currently these are only available for
3D. The boundary conditions available are
\begin{itemize}
\item Constant
\item Flat (copying)
\item Radiation
\end{itemize}


\section{Comments}

All the boundary conditions here take a stencil size as an 
argument. The stencil size is used to determine how many points
at the boundary should be updated with a boundary condition.
For example, a stencil size of two in each direction means
that the boundary points, and also the points one in from the boundary
must be calculated.

\subsection{Constant Boundary Condition}

A constant boundary condition means that the value of the given 
field or fields at the boundary is set to a given number, for 
example zero. The routine is called {\tt ApplyConstantBC}, which 
from C is given by:

\begin{verbatim}
int ierr = ApplyConstantBC(cGH *cctkGH, CCTK_REAL var0, int *stencil_size, char *name)
\end{verbatim}

and from Fortran

\begin{verbatim}
call ApplyConstantBC(ierr, cctkGH, var0, stencil_size, name)
integer ierr
CCTK_POINTER cctkGH
CCTK_REAL var0
integer stencil_size(3)
character*(*) name
\end{verbatim}

Where
\begin{itemize}
\item [{\tt ierr}] will be negative if the boundary condition has
                   not been successfully applied
\item [{\tt cctkGH}] is the grid hierachy pointer
\item [{\tt var0}] is the value to be applied at each point on the boundary
\item [{\tt stencil\_size}] is an array holding the stencil size to be
      used in each direction
\item [{\tt name}] is the name of the grid function, or group of grid 
   functions to which the boundary condition should be applied
\end{itemize} 

\subsection{Flat Boundary Condition}

A flat (or copying) boundary condition means that the value of the given 
field or fields at the boundary is copied from the value on grid point in,
in any direction. For example, for a stencil width of one, the
boundary value of phi {\tt phi(nx,j,k)}, on the positive x-boundary will
be copied from {\tt phi(nx-1,j,k)}.
 The routine is called {\tt ApplyFlatBC}, which 
from C is given by:

\begin{verbatim}
int ierr = ApplyFlatBC(cGH *cctkGH, int *stencil_size, char *name)
\end{verbatim}

and from Fortran

\begin{verbatim}
call ApplyConstantBC(ierr, cctkGH, stencil_size, name)
integer ierr
CCTK_POINTER cctkGH
integer stencil_size(3)
character*(*) name
\end{verbatim}

Where
\begin{itemize}
\item [{\tt ierr}] will be negative if the boundary condition has
                   not been successfully applied
\item [{\tt cctkGH}] is the grid hierachy pointer
\item [{\tt stencil\_size}] is an array holding the stencil size to be
      used in each direction
\item [{\tt name}] is the name of the grid function, or group of grid 
   functions to which the boundary condition should be applied
\end{itemize} 


\subsection{Radiation Boundary Condition}

This is a two level scheme. Currently radiative boundary conditions
can only be applied with a stencil width of one in each direction.
 The routine is called {\tt ApplyRadiativeBC}, which 
from C is given by:

\begin{verbatim}
int ierr = ApplyRadiativeBC(cGH *cctkGH, CCTK_REAL var0, int *stencil_size, char *name, char *name_past)
\end{verbatim}

and from Fortran

\begin{verbatim}
call ApplyConstantBC(ierr, cctkGH, var0, stencil_size, name, name_past)
integer ierr
CCTK_POINTER cctkGH
CCTK_REAL var0
integer stencil_size(3)
character*(*) name
character*(*) name_past
\end{verbatim}

Where
\begin{itemize}
\item [{\tt ierr}] will be negative if the boundary condition has
                   not been successfully applied
\item [{\tt cctkGH}] is the grid hierachy pointer
\item [{\tt var0}]
\item [{\tt stencil\_size}] is an array holding the stencil size to be
      used in each direction
\item [{\tt name}] is the name of the grid function, or group of grid 
   functions to which the boundary condition will be applied
\item [{\tt name\_past}] is the name of the grid function, or group of grid 
   functions containing the values on the past time level
\end{itemize} 



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

\end{document}