% *======================================================================*
%  Cactus Thorn template for ThornGuide documentation
%  Author: Ian Kelley
%  Date: Sun Jun 02, 2002
%
%  Thorn documentation in the latex file doc/documentation.tex
%  will be included in ThornGuides built with the Cactus make system.
%  The scripts employed by the make system automatically include
%  pages about variables, parameters and scheduling parsed from the
%  relevant thorn CCL files.
%
%  This template contains guidelines which help to assure that your
%  documentation will be correctly added to ThornGuides. More
%  information is available in the Cactus UsersGuide.
%
%  Guidelines:
%   - Do not change anything before the line
%       % START CACTUS THORNGUIDE",
%     except for filling in the title, author, date, etc. fields.
%        - Each of these fields should only be on ONE line.
%        - Author names should be separated with a \\ or a comma.
%   - You can define your own macros, but they must appear after
%     the START CACTUS THORNGUIDE line, and must not redefine standard
%     latex commands.
%   - To avoid name clashes with other thorns, 'labels', 'citations',
%     'references', and 'image' names should conform to the following
%     convention:
%       ARRANGEMENT_THORN_LABEL
%     For example, an image wave.eps in the arrangement CactusWave and
%     thorn WaveToyC should be renamed to CactusWave_WaveToyC_wave.eps
%   - Graphics should only be included using the graphicx package.
%     More specifically, with the "\includegraphics" command.  Do
%     not specify any graphic file extensions in your .tex file. This
%     will allow us to create a PDF version of the ThornGuide
%     via pdflatex.
%   - References should be included with the latex "\bibitem" command.
%   - Use \begin{abstract}...\end{abstract} instead of \abstract{...}
%   - Do not use \appendix, instead include any appendices you need as
%     standard sections.
%   - For the benefit of our Perl scripts, and for future extensions,
%     please use simple latex.
%
% *======================================================================*
%
% Example of including a graphic image:
%    \begin{figure}[ht]
% 	\begin{center}
%    	   \includegraphics[width=6cm]{MyArrangement_MyThorn_MyFigure}
% 	\end{center}
% 	\caption{Illustration of this and that}
% 	\label{MyArrangement_MyThorn_MyLabel}
%    \end{figure}
%
% Example of using a label:
%   \label{MyArrangement_MyThorn_MyLabel}
%
% Example of a citation:
%    \cite{MyArrangement_MyThorn_Author99}
%
% Example of including a reference
%   \bibitem{MyArrangement_MyThorn_Author99}
%   {J. Author, {\em The Title of the Book, Journal, or periodical}, 1 (1999),
%   1--16. {\tt http://www.nowhere.com/}}
%
% *======================================================================*

% If you are using CVS use this line to give version information

\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}

% The author of the documentation
\author{Erik Schnetter \textless schnetter@cct.lsu.edu\textgreater}

% The title of the document (not necessarily the name of the Thorn)
\title{InterpToArray}

\date{June 30, 2010}

\maketitle

% Do not delete next line
% START CACTUS THORNGUIDE

% Add all definitions used in this documentation here
%   \def\mydef etc

% Add an abstract for this thorn's documentation
\begin{abstract}
  Interpolate grid functions to grid arrays on a regular grid of
  locations, so that these can e.g.\ be output more easily.
\end{abstract}

% The following sections are suggestive only.
% Remove them or add your own.

\section{Introduction}
Some post-processing and visualisation tools cannot handle mesh
refinement or multi-block systems.  These tools then require
interpolating the result onto a regular, uniform grid.  This is what
this thorn does.

InterpToArray can interpolate to 0D, 1D, 2D, and 3D grids.  The
interpolation result is stored in grid arrays.  These can be either
replicated or distributed over all processes.  Note that using
replicated (DISTRIB=constant) grid arrays can require a substantial
amount of memory on each process.

\section{Numerical Implementation}
InterpToArray uses standard Cactus interpolators such as PUGHInterp or
CarpetInterp.

\section{Using This Thorn}
The variables which should be interpolated are specified by
parameters; currently, up to 100 variables can be interpolated.

The interpolator and its options are also specified via parameters.

Finally, the locations of the points of the regular grid are also
specified via parameters.  These grid points are specified via an
\emph{origin} and \emph{offsets}, and they do not have to be aligned
with the coordinate axes.  For example, a 2D grid is specified via
three (real) vectors $x^a$, $di^a$, and $dj^a$, and via its (integer)
size $ni$ and $nj$.  The coordinates of the grid points are then given
via
$$
x^a(i,j) = x^a + i \cdot di^a + j \cdot dj^a
$$
for $0 \le i < ni$ and $0 \le j < nj$.  Grids with other dimensions
are specified equivalently.

% Do not delete next line
% END CACTUS THORNGUIDE

\end{document}
