
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright (c) 2003-2016 by The University of Queensland
% http://www.uq.edu.au
%
% Primary Business: Queensland, Australia
% Licensed under the Apache License, version 2.0
% http://www.apache.org/licenses/LICENSE-2.0
%
% Development until 2012 by Earth Systems Science Computational Center (ESSCC)
% Development 2012-2013 by School of Earth Sciences
% Development from 2014 by Centre for Geoscience Computing (GeoComp)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage{subfigure}
\usepackage{color}

\graphicspath{{figures/}}
\setcounter{secnumdepth}{3}


% default width for figures
\newcommand{\figwidth}{100mm}

% commands useful in cross-referencing
\newcommand{\Ref}[1]{Reference~\cite{#1}}
\newcommand{\Sec}[1]{Section~\ref{#1}}
\newcommand{\App}[1]{Appendix~\ref{#1}}
\newcommand{\Chap}[1]{Chapter~\ref{#1}}
\newcommand{\etal}{\emph{~et~al.}}
\newcommand{\fig}[1]{Figure~\ref{#1}}
\newcommand{\eqn}[1]{Equation~(\ref{#1})} 
\newcommand{\tab}[1]{Table~\ref{#1}}
\newcommand{\env}[1]{\textbf{\mbox{#1}}\index{Environment!#1}}
\newcommand{\fracp}[2]{\frac{\partial #1}{\partial #2}}

% define some handy commands for escript stuff
\newcommand{\CUDA}{{\it CUDA}\xspace}
\newcommand{\LINUX}{{\it Linux}\xspace}
\newcommand{\WINDOWS}{{\it MS Windows}\xspace}
\newcommand{\PYTHON}{{\it python}\xspace}
\newcommand{\pythonthree}{\textit{python3}\xspace}
\newcommand{\pythontwo}{\textit{python2}\xspace}
\newcommand{\netCDF}{{\it netCDF}\index{netCDF}\xspace}
\newcommand{\escript}{\module{esys.escript}\xspace}
\newcommand{\dudley}{\module{esys.dudley}\xspace}
\newcommand{\finley}{\module{esys.finley}\xspace}
\newcommand{\ripley}{\module{esys.ripley}\xspace}
\newcommand{\speckley}{\module{esys.speckley}\xspace}
\newcommand{\weipa}{\module{esys.weipa}\xspace}
\newcommand{\esys}{\module{esys}\xspace}
\newcommand{\pycad}{\module{esys.pycad}\xspace}
\newcommand{\downunder}{\module{esys.downunder}\xspace}
\newcommand{\gmsh}{\module{esys.pycad.gmsh}\xspace}
\newcommand{\gmshextern}{{\it Gmsh}\cite{GMSH}\index{Gmsh}\xspace}
\newcommand{\SCIPY}{{\it SciPy}\cite{SCIPY}\index{SciPy}\xspace}
\newcommand{\MPI}{{\it MPI}\index{Message Passing Interface!MPI}\xspace}
\newcommand{\OPENMP}{{\it OpenMP}\xspace\index{OpenMP!threading}\xspace}
\newcommand{\linearPDEs}{\module{esys.escript.linearPDEs}\xspace}
\newcommand{\LinearPDE}{\class{LinearPDE}\xspace}
\newcommand{\NLPDE}{\class{NonlinearPDE}\xspace}
\newcommand{\modelframe}{\module{esys.modelframe}\xspace}
\newcommand{\pdetools}{\module{esys.escript.pdetools}\xspace}
\newcommand{\False}{\constant{False}\xspace}
\newcommand{\True}{\constant{True}\xspace}
\newcommand{\warning}[1]{\emph{Warning: #1}}

\newcommand{\SolverOptions}{\class{SolverOptions}\xspace}
\newcommand{\Poisson}{\class{Poisson}\xspace}
\newcommand{\Helmholtz}{\class{Helmholtz}\xspace}
\newcommand{\Lame}{\class{Lame}\xspace}
\newcommand{\Data}{\class{Data}\xspace}
\newcommand{\EmptyData}{empty \class{Data}\index{empty Data}\xspace}
\newcommand{\Domain}{\class{Domain}\xspace}
\newcommand{\gnuplot}{{\it gnuplot}\cite{GNUPLOT}\index{visualization!gnuplot}\index{gnuplot}\xspace}
\newcommand{\finleyelement}[1]{{\it #1}\index{finley!#1}}
\newcommand{\PCG}{\member{SolverOptions.PCG}\xspace\index{linear solver!PCG}\index{PCG}}
\newcommand{\BiCGStab}{\member{SolverOptions.BICGSTAB}\xspace\index{linear solver!BiCGStab}\index{BiCGStab}}
\newcommand{\Direct}{\member{SolverOptions.DIRECT}\xspace\index{linear solver!Direct}\index{Direct solver}}
\newcommand{\GMRES}{\member{SolverOptions.GMRES}\xspace\index{linear solver!GMRES}\index{GMRES}}
\newcommand{\PRESTWENTY}{\member{SolverOptions.PRES20}\xspace\index{linear solver!PRES20}\index{PRES20}}
\newcommand{\JACOBI}{\member{SolverOptions.JACOBI}\xspace\index{preconditioner!Jacobi}\index{Jacobi}}
\newcommand{\ILU}{\member{SolverOptions.ILU0}\xspace\index{preconditioner!ILU0}\index{ILU0}}
\newcommand{\ILUT}{\member{SolverOptions.ILUT}\xspace\index{preconditioner!ILUT}\index{ILUT}}
\newcommand{\RILU}{\member{SolverOptions.RILU}\xspace\index{preconditioner!RILU}\index{RILU}}
\newcommand{\HRZLUMPING}{\member{SolverOptions.HRZ_LUMPING}\xspace\index{linear solver!row sum lumping}\index{row sum lumping}}
\newcommand{\ROWSUMLUMPING}{\member{SolverOptions.ROWSUM_LUMPING}\xspace\index{linear solver!HRZ lumping}\index{HRZ lumping}}
\newcommand{\NOREORDERING}{\member{SolverOptions.NO_REORDERING}\xspace}
\newcommand{\AMG}{\member{SolverOptions.AMG}\xspace\index{linear solver!AMG}\index{algebraic Multi-grid}\index{AMG}}
\newcommand{\GAUSSSEIDEL}{\member{SolverOptions.GAUSS_SEIDEL}\xspace\index{linear solver!Gauss-Seidel}\index{preconditioner!Gauss-Seidel}\index{Gauss-Seidel Scheme}}
\newcommand{\LOCALGAUSSSEIDEL}{\member{SolverOptions.LOCAL_GAUSS_SEIDEL}\xspace\index{linear solver!Gauss-Seidel}\index{preconditioner!Gauss-Seidel}\index{Gauss-Seidel Scheme}}
\newcommand{\MKL}{\texttt{MKL}\xspace\index{packages!MKL}\index{MKL}}
\newcommand{\UMFPACK}{\texttt{UMFPACK}\xspace\index{packages!UMFPACK}\index{UMFPACK}}
\newcommand{\PASO}{\texttt{PASO}\xspace\index{packages!PASO}\index{PASO}}

\newcommand{\FunctionSpace}{\class{FunctionSpace}\xspace}
\newcommand{\Operator}{\class{Operator}\xspace}
\newcommand{\SolutionFS}{solution \class{FunctionSpace}\index{solution}\xspace}
\newcommand{\ReducedSolutionFS}{reduced solution \class{FunctionSpace}\index{solution!reduced}\xspace}
\newcommand{\FunctionOnBoundary}{boundary \class{FunctionSpace}\xspace}
\newcommand{\Function}{general \class{FunctionSpace}\xspace}
\newcommand{\FunctionOnContactZero}{contact \class{FunctionSpace} on side 0\xspace}
\newcommand{\FunctionOnContactOne}{contact \class{FunctionSpace} on side 1\xspace}
\newcommand{\ContinuousFunction}{continuous \class{FunctionSpace}\xspace}
\newcommand{\DiracDeltaFunctions}{Dirac delta-function \class{FunctionSpace}\xspace}
\newcommand{\RankOne}{{rank-1 \Data object}\xspace}
\newcommand{\RankTwo}{{rank-2 \Data object}\xspace}
\newcommand{\RankThree}{{rank-3 \Data object}\xspace}
\newcommand{\RankFour}{{rank-4 \Data object}\xspace}
\newcommand{\Tensor}{{tensor \Data object}\xspace}
\newcommand{\Vector}{{vector \Data object}\xspace}
\newcommand{\Scalar}{{scalar \Data object}\xspace}
\newcommand{\DataSample}{{data sample}\index{data sample}\xspace}
\newcommand{\DataSamplePoints}{{data sample points}\index{data sample!points}\xspace}
\newcommand{\numpy}{\module{numpy}\xspace}
\newcommand{\numpyNDA}{\module{numpy.\class{ndarray}}\xspace}

\newcommand{\Shape}{shape\xspace\index{shape}}
\newcommand{\Rank}{rank\xspace\index{shape}}
\newcommand{\ExampleDirectory}{example directory\xspace}
\newcommand{\ReferenceGuide}{\url{http://esys.geocomp.uq.edu.au/docs.html}\xspace}
\newcommand{\Point}{\class{Point}\xspace}
\newcommand{\PropertySet}{\class{PropertySet}\xspace}
\newcommand{\Design}{\class{Design}\xspace}
\newcommand{\TagMap}{\class{TagMap}\xspace}
\newcommand{\ManifoldOneD}{\class{Manifold1D}\xspace}
\newcommand{\ManifoldTwoD}{\class{Manifold2D}\xspace}
\newcommand{\ManifoldThreeD}{\class{Manifold3D}\xspace}

% handy commands related to visualization
\newcommand{\VTK}{{\it VTK}\index{visualization!VTK}\index{VTK}\xspace}
\newcommand{\SILO}{{\it SILO}\index{visualization!SILO}\index{SILO}\xspace}
\newcommand{\Voxet}{{\it Voxet}\index{visualization!Voxet}\index{Voxet}\xspace}
\newcommand{\MATPLOTLIB}{\module{matplotlib}\index{visualization!matplotlib}\index{matplotlib}\xspace}
\newcommand{\VTKUrl}{\url{http://www.vtk.org/}\index{visualization!VTK}\index{VTK}\xspace}
\newcommand{\VisIt}{{\it VisIt}\index{visualization!VisIt}\index{VisIt}\xspace}
\newcommand{\mayavi}{{\it Mayavi2}\index{visualization!mayavi}\index{mayavi}\xspace}
\newcommand{\GOCAD}{{\it GOCAD}\index{visualization!GOCAD}\index{GOCAD}\xspace}
\newcommand{\OpenDX}{{\it OpenDX}\index{visualization!OpenDX}\index{OpenDX}\cite{OPENDX}\xspace}

% handy commands related to Symbolics
\newcommand{\EVALUATOR}{{\class{Evaluator}}\xspace}
\newcommand{\SYMBOL}{{\class{Symbol}}\xspace}



% this stops one figure taking up a whole page and lets more text onto
% the one page when a figure exists
\renewcommand{\floatpagefraction}{0.8} % Default = 0.5

% improved version of caption handling
\usepackage{ccaption}
\captionnamefont{\scshape}
\captionstyle{}
\makeatletter
\renewcommand{\fnum@figure}[1]{\quad\small\textsc{\figurename~\thefigure}:}
\renewcommand{\@makecaption}[2]{%
\vskip\abovecaptionskip
\sbox\@tempboxa{#1: #2}%
\ifdim \wd\@tempboxa >\hsize
  \def\baselinestretch{1}\@normalsize
  #1: #2\par
  \def\baselinestretch{1.5}\@normalsize
\else
  \global \@minipagefalse
  \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
\fi
\vskip\belowcaptionskip}
\makeatother

% this is for when one uses pdflatex and therefore needs to load pdf
% figures into \includegraphics
\ifpdf
	\DeclareGraphicsExtensions{.pdf,.png}  % this command defined in graphicx
	\pdfcompresslevel=9  % 0: no compression, 9: highest compression
			     % or, set compress_level 9 in file pdftex.cfg
\else
	\DeclareGraphicsExtensions{.eps}
\fi

\include{elist}



%Ensures that latex doesn't have an error if we don't specify the version
\providecommand{\RepVersion}{Unknown\xspace}
% to set this value use:
% (pdf)latex '\newcommand{\RepVersion}{version\xspace}\input{guide.tex}'
% as your command-line
