1 |
% $Id$ |
2 |
% |
3 |
% Copyright © 2006 by ACcESS MNRF |
4 |
% \url{http://www.access.edu.au |
5 |
% Primary Business: Queensland, Australia. |
6 |
% Licensed under the Open Software License version 3.0 |
7 |
% http://www.opensource.org/licenses/osl-3.0.php |
8 |
% |
9 |
|
10 |
|
11 |
\usepackage{epsfig} |
12 |
\usepackage{graphicx,color} |
13 |
\usepackage{makeidx} % handle the index properly |
14 |
\usepackage{xspace} % handle spaces after commands more nicely |
15 |
% use the ams math stuff, as it makes the maths easier to code, and |
16 |
% nicer output than the standard LaTeX stuff |
17 |
\usepackage{amsmath,amsfonts,amssymb} % this is handy for mathematicians and physicists |
18 |
% see http://www.ams.org/tex/amslatex.html |
19 |
\usepackage{alltt} % handy verbatim stuff |
20 |
|
21 |
|
22 |
% define some handy commands for escript stuff |
23 |
\newcommand{\LINUX}{{\it Linux}\xspace} |
24 |
\newcommand{\netCDF}{{\it netCDF}\cite{NETCDF}\index{netCDF} \xspace} |
25 |
\newcommand{\escript}{\module{esys.escript}\xspace} |
26 |
\newcommand{\finley}{\module{esys.finley}\xspace} |
27 |
\newcommand{\bruce}{\module{esys.bruce}\xspace} |
28 |
\newcommand{\pyvisi}{\module{esys.pyvisi}\xspace} |
29 |
\newcommand{\pycad}{\module{esys.pycad}\xspace} |
30 |
|
31 |
\newcommand{\linearPDEs}{\module{esys.escript.linearPDEs}\xspace} |
32 |
\newcommand{\LinearPDE}{\class{LinearPDE}\xspace} |
33 |
\newcommand{\timeseries}{\module{esys.timeseries}\xspace} |
34 |
\newcommand{\modelframe}{\module{esys.modelframe}\xspace} |
35 |
\newcommand{\pdetools}{\module{esys.pdetools}\xspace} |
36 |
|
37 |
\newcommand{\AdvectivePDE}{\class{AdvectivePDE}\xspace} |
38 |
\newcommand{\Poisson}{\class{Poisson}\xspace} |
39 |
\newcommand{\Helmholtz}{\class{Helmholtz}\xspace} |
40 |
\newcommand{\Lame}{\class{Lame}\xspace} |
41 |
\newcommand{\Data}{\class{Data}\xspace} |
42 |
\newcommand{\EmptyData}{empty \class{Data} \index{empty Data}\xspace} |
43 |
\newcommand{\Domain}{\class{Domain}\xspace} |
44 |
\newcommand{\VTK}{{\it vtk} \cite{VTK}\index{visualization!vtk} \xspace} |
45 |
\newcommand{\GnuPlot}{{\it gnuplot} \cite{GNUPLOT}\index{visualization!gnuplot}\index{gnuplot}} |
46 |
\newcommand{\mayavi}{{\it mayavi} \index{visualization!mayavi}\index{mayavi}} |
47 |
\newcommand{\OpenDX}{{\it OpenDX} \cite{OPENDX}\xspace} |
48 |
\newcommand{\finleyelement}[1]{{\it #1}\index{finley!#1}} |
49 |
\newcommand{\False}{\constant{False}\xspace} |
50 |
\newcommand{\True}{\constant{True}\xspace} |
51 |
\newcommand{\PCG}{\constant{LinearPDE.PCG}\xspace\index{linear solver!PCG}\index{PCG}} |
52 |
\newcommand{\BiCGStab}{\constant{LinearPDE.BICGSTAB}\xspace\index{linear solver!BiCGStab}\index{BiCGStab}} |
53 |
\newcommand{\Direct}{\constant{LinearPDE.DIRECT}\xspace\index{linear solver!Direct}\index{Direct solver}} |
54 |
\newcommand{\GMRES}{\constant{LinearPDE.GMRES}\xspace\index{linear solver!GMRES}\index{GMRES}} |
55 |
\newcommand{\PRESTWENTY}{\constant{LinearPDE.PRES20}\xspace\index{linear solver!PRES20}\index{PRES20}} |
56 |
\newcommand{\JACOBI}{\constant{LinearPDE.JACOBI}\xspace\index{preconditioner!Jacobi}\index{Jacobi}} |
57 |
\newcommand{\ILU}{\constant{LinearPDE.ILU0}\xspace\index{preconditioner!ILU0}\index{ILU0}} |
58 |
\newcommand{\ILUT}{\constant{LinearPDE.ILUT}\xspace\index{preconditioner!ILUT}\index{ILUT}} |
59 |
\newcommand{\LUMPING}{\constant{LinearPDE.LUMPING}\xspace\index{linear solver!lumping}\index{lumping}} |
60 |
\newcommand{\NOREORDERING}{\constant{LinearPDE.NO\hackscore REORDERING}\xspace} |
61 |
\newcommand{\MINIMUMFILLIN}{\constant{LinearPDE.MINIMUM\hackscore FILL\hackscore IN}\xspace\index{linear solver!minimum fill-in ordering}\index{minimum fill-in ordering}} |
62 |
\newcommand{\NESTEDDESCTION}{\constant{LinearPDE.NESTED\hackscore DISSECTION}\xspace\index{linear solver!nested dissection ordering}\index{nested dissection}} |
63 |
|
64 |
\newcommand{\FunctionSpace}{\class{FunctionSpace}\xspace} |
65 |
\newcommand{\Operator}{\class{Operator}\xspace} |
66 |
\newcommand{\SolutionFS}{solution \class{FunctionSpace}\index{solution}\xspace} |
67 |
\newcommand{\ReducedSolutionFS}{reduced solution \class{FunctionSpace}\index{solution!reduced}\xspace} |
68 |
\newcommand{\FunctionOnBoundary}{boundary \class{FunctionSpace}\xspace} |
69 |
\newcommand{\Function}{general \class{FunctionSpace}\xspace} |
70 |
\newcommand{\FunctionOnContactZero}{contact \class{FunctionSpace} on side 0\xspace} |
71 |
\newcommand{\FunctionOnContactOne}{contact \class{FunctionSpace} on side 1\xspace} |
72 |
\newcommand{\ContinuousFunction}{continuous \class{FunctionSpace}\xspace} |
73 |
\newcommand{\RankOne}{{rank-1 \Data object}\xspace} |
74 |
\newcommand{\RankTwo}{{rank-2 \Data object}\xspace} |
75 |
\newcommand{\RankThree}{{rank-3 \Data object}\xspace} |
76 |
\newcommand{\RankFour}{{rank-4 \Data object}\xspace} |
77 |
\newcommand{\Tensor}{{tensor \Data object}\xspace} |
78 |
\newcommand{\Vector}{{vector \Data object}\xspace} |
79 |
\newcommand{\Scalar}{{scalar \Data object}\xspace} |
80 |
\newcommand{\DataSample}{{data sample} \index{data sample}\xspace} |
81 |
\newcommand{\DataSamplePoints}{{data sample points} \index{data sample!points}\xspace} |
82 |
\newcommand{\numarray}{\module{numarray}\xspace} |
83 |
\newcommand{\Shape}{shape\xspace\index{shape}} |
84 |
\newcommand{\Rank}{rank\xspace\index{shape}} |
85 |
\newcommand{\ExampleDirectory}{example directory\xspace} |
86 |
\newcommand{\ReferenceGuide}{\url{http://www.iservo.edu.au/esys/epydoc/index.html}} |
87 |
|
88 |
|
89 |
% handy commands for pyvisi |
90 |
\newcommand{\Scene}{\class{Scene}\xspace} |
91 |
\newcommand{\Image}{\class{Image}\xspace} |
92 |
\newcommand{\Text}{\class{Text}\xspace} |
93 |
\newcommand{\DataCollector}{\class{DataCollector}\xspace} |
94 |
\newcommand{\Camera}{\class{Camera}\xspace} |
95 |
\newcommand{\Light}{\class{Light}\xspace} |
96 |
\newcommand{\Map}{\class{Map}\xspace} |
97 |
\newcommand{\MapOnPlane}{\class{MapOnPlane}\xspace} |
98 |
\newcommand{\MapOnClip}{\class{MapOnClip}\xspace} |
99 |
\newcommand{\MapOnScalarClip}{\class{MapOnScalarClip}\xspace} |
100 |
\newcommand{\Arrows}{\class{Arrows}\xspace} |
101 |
\newcommand{\ArrowsOnPlane}{\class{ArrowsOnPlane}\xspace} |
102 |
\newcommand{\ArrowsOnClip}{\class{ArrowsOnClip}\xspace} |
103 |
\newcommand{\IsoSurface}{\class{IsoSurface}\xspace} |
104 |
\newcommand{\IsoSurfaceOnPlane}{\class{IsoSurfaceOnPlane}\xspace} |
105 |
\newcommand{\IsoSurfaceOnClip}{\class{IsoSurfaceOnClip}\xspace} |
106 |
\newcommand{\Contour}{\class{Contour}\xspace} |
107 |
\newcommand{\ContourOnPlane}{\class{ContourOnPlane}\xspace} |
108 |
\newcommand{\ContourOnClip}{\class{ContourOnClip}\xspace} |
109 |
\newcommand{\TensorC}{\class{Tensor}\xspace} |
110 |
\newcommand{\TensorOnPlane}{\class{TensorOnPlane}\xspace} |
111 |
\newcommand{\TensorOnClip}{\class{TensorOnClip}\xspace} |
112 |
\newcommand{\StreamLines}{\class{StreamLines}\xspace} |
113 |
\newcommand{\Carpet}{\class{Carpet}\xspace} |
114 |
\newcommand{\Position}{\class{Position}\xspace} |
115 |
\newcommand{\Transform}{\class{Transform}\xspace} |
116 |
\newcommand{\Style}{\class{Style}\xspace} |
117 |
\newcommand{\BlueToRed}{\class{BlueToRed}\xspace} |
118 |
\newcommand{\RedToBlue}{\class{RedToBlue}\xspace} |
119 |
\newcommand{\Plane}{\class{Plane}\xspace} |
120 |
|
121 |
|
122 |
% default width for figures |
123 |
\newcommand{\figwidth}{100mm} |
124 |
% commands useful in cross-referencing |
125 |
\newcommand {\Ref}[1] {Reference~\cite{#1}} |
126 |
\newcommand {\Sec}[1] {Section~\ref{#1}} |
127 |
\newcommand {\App}[1] {Appendix~\ref{#1}} |
128 |
\newcommand {\Chap}[1] {Chapter~\ref{#1}} |
129 |
\newcommand {\etal} {\emph{~et~al.}} |
130 |
\newcommand {\fig}[1] {Figure~\ref{#1}} |
131 |
\newcommand {\eqn}[1] {Equation~(\ref{#1})} |
132 |
\newcommand {\tab}[1] {Table~\ref{#1}} |
133 |
|
134 |
% this stops one figure taking up a whole page and lets more text onto |
135 |
% the one page when a figure exists |
136 |
\renewcommand{\floatpagefraction}{0.8} % Default = 0.5 |
137 |
|
138 |
% improved version of caption handling |
139 |
\usepackage{ccaption} |
140 |
\captionnamefont{\scshape} |
141 |
\captionstyle{} |
142 |
\makeatletter |
143 |
\renewcommand{\fnum@figure}[1]{\quad\small\textsc{\figurename~\thefigure}:} |
144 |
\renewcommand{\@makecaption}[2]{% |
145 |
\vskip\abovecaptionskip |
146 |
\sbox\@tempboxa{#1: #2}% |
147 |
\ifdim \wd\@tempboxa >\hsize |
148 |
\def\baselinestretch{1}\@normalsize |
149 |
#1: #2\par |
150 |
\def\baselinestretch{1.5}\@normalsize |
151 |
\else |
152 |
\global \@minipagefalse |
153 |
\hb@xt@\hsize{\hfil\box\@tempboxa\hfil}% |
154 |
\fi |
155 |
\vskip\belowcaptionskip} |
156 |
\makeatother |
157 |
|
158 |
% \usepackage{fancyvrb} % fancy verbatim stuff. Needed so code below goes |
159 |
%%% this code grabbed from the PyScript docs |
160 |
%%% pyscript.sourceforge.net |
161 |
|
162 |
% -------------------------------------------------------------- |
163 |
% Code format within \Verb |
164 |
% -------------------------------------------------------------- |
165 |
|
166 |
% \definecolor{pycolor}{rgb}{0,0.4,0} |
167 |
|
168 |
%% \DefineVerbatimEnvironment{python}{Verbatim} |
169 |
%% {frame=leftline,framerule=.5mm,rulecolor=\color{pycolor}, |
170 |
%% formatcom=\color{pycolor}\small,fontshape=rm} |
171 |
|
172 |
%\DefineShortVerb[formatcom=\color{dgreen}\small,fontshape=sl]{\|} |
173 |
|
174 |
% \RecustomVerbatimCommand{\Verb}{Verb}{formatcom=\color{pycolor}\small,fontshape=rm} |
175 |
|
176 |
%%% end of grabbed code |
177 |
|
178 |
% this is for when one uses pdflatex and therefore needs to load pdf |
179 |
% figures into \includegraphics |
180 |
\ifpdf |
181 |
\DeclareGraphicsExtensions{.pdf} % this command defined in graphicx |
182 |
\pdfcompresslevel=9 % 0: no compression, 9: highest compression |
183 |
% or, set compress_level 9 in file pdftex.cfg |
184 |
\else |
185 |
\DeclareGraphicsExtensions{.eps} |
186 |
\fi |
187 |
|
188 |
% defines the colour for the background of code examples |
189 |
\definecolor{LightGrey}{gray}{0.9} |
190 |
|
191 |
% add the listings package to pretty print the code output |
192 |
\usepackage{listings} |
193 |
|
194 |
\lstdefinestyle{myC++}{% |
195 |
%\lstset{% |
196 |
language=C++, |
197 |
showstringspaces=false, |
198 |
basicstyle=\small\ttfamily, |
199 |
commentstyle=\color[named]{BrickRed}\ttfamily, |
200 |
keywordstyle=\color[named]{Purple}\ttfamily, |
201 |
%identifierstyle=\color[named]{Blue}\ttfamily, |
202 |
%functionstyle=\color[named]{Blue}\ttfamily, |
203 |
%typestyle=\color[named]{ForestGreen}\ttfamily, |
204 |
stringstyle=\color[named]{Tan}\ttfamily,% |
205 |
morekeywords={,complex,}% |
206 |
frame=none,% |
207 |
backgroundcolor=\color{LightGrey}% |
208 |
} |
209 |
|
210 |
\lstdefinestyle{myMatlab}{% |
211 |
%\lstset{% |
212 |
language=Matlab, |
213 |
showstringspaces=false, |
214 |
basicstyle=\small\ttfamily, |
215 |
commentstyle=\color[named]{BrickRed}\ttfamily, |
216 |
keywordstyle=\color[named]{Purple}\ttfamily, |
217 |
%identifierstyle=\color[named]{Blue}\ttfamily, |
218 |
%functionstyle=\color[named]{Blue}\ttfamily, |
219 |
%typestyle=\color[named]{ForestGreen}\ttfamily, |
220 |
stringstyle=\color[named]{Tan}\ttfamily,% |
221 |
frame=none,% |
222 |
backgroundcolor=\color{LightGrey}% |
223 |
} |
224 |
|
225 |
\lstdefinestyle{myScilab}{% |
226 |
%\lstset{% |
227 |
language=Scilab, |
228 |
showstringspaces=false, |
229 |
basicstyle=\small\ttfamily, |
230 |
commentstyle=\color[named]{BrickRed}\ttfamily, |
231 |
keywordstyle=\color[named]{Purple}\ttfamily, |
232 |
%identifierstyle=\color[named]{Blue}\ttfamily, |
233 |
%functionstyle=\color[named]{Blue}\ttfamily, |
234 |
%typestyle=\color[named]{ForestGreen}\ttfamily, |
235 |
stringstyle=\color[named]{Tan}\ttfamily,% |
236 |
frame=none,% |
237 |
backgroundcolor=\color{LightGrey}% |
238 |
} |
239 |
|
240 |
\lstdefinestyle{myShell}{% |
241 |
%\lstset{% |
242 |
language=ksh, |
243 |
showstringspaces=false, |
244 |
basicstyle=\small\ttfamily, |
245 |
commentstyle=\color[named]{Black}\ttfamily, |
246 |
keywordstyle=\color[named]{Black}\ttfamily, |
247 |
%identifierstyle=\color[named]{Blue}\ttfamily, |
248 |
%functionstyle=\color[named]{Blue}\ttfamily, |
249 |
%typestyle=\color[named]{ForestGreen}\ttfamily, |
250 |
stringstyle=\color[named]{Black}\ttfamily,% |
251 |
frame=none,% |
252 |
backgroundcolor=\color{LightGrey}% |
253 |
} |
254 |
|
255 |
\lstdefinestyle{myPython}{% |
256 |
%\lstset{% |
257 |
language=python, |
258 |
showstringspaces=false, |
259 |
basicstyle=\small\ttfamily, |
260 |
commentstyle=\color[named]{BrickRed}\ttfamily, |
261 |
keywordstyle=\color[named]{Purple}\ttfamily, |
262 |
%identifierstyle=\color[named]{Blue}\ttfamily, |
263 |
%functionstyle=\color[named]{Blue}\ttfamily, |
264 |
%typestyle=\color[named]{ForestGreen}\ttfamily, |
265 |
stringstyle=\color[named]{Tan}\ttfamily,% |
266 |
frame=none,% |
267 |
%backgroundcolor=\color{LightGrey}% |
268 |
} |
269 |
|
270 |
\lstdefinestyle{myhtml}{% |
271 |
%\lstset{% |
272 |
language=xml, |
273 |
showstringspaces=false, |
274 |
basicstyle=\small\ttfamily, |
275 |
commentstyle=\color[named]{BrickRed}\ttfamily, |
276 |
keywordstyle=\color[named]{Purple}\ttfamily, |
277 |
%identifierstyle=\color[named]{Blue}\ttfamily, |
278 |
%functionstyle=\color[named]{Blue}\ttfamily, |
279 |
%typestyle=\color[named]{ForestGreen}\ttfamily, |
280 |
stringstyle=\color[named]{Tan}\ttfamily, |
281 |
morekeywords={,simulation,prop_dim,error_check,stochastic,% |
282 |
globals,field,dimensions,lattice,domains,samples,vector,% |
283 |
components,fourier_space,sequence,integrate,algorithm,% |
284 |
interval,k_operators,constant,operator_names,vectors,% |
285 |
output,filename,group,sampling,moments,benchmark,use_double,% |
286 |
use_wisdom,use_prefs,binary_output,cycles,filter,post_propagation,% |
287 |
default_value,argv,arg,iterations,cross_propagation,% |
288 |
use_mpi,paths,seed,noises,author,description,name,type,% |
289 |
} |
290 |
frame=none,% |
291 |
%framerule=2pt,% |
292 |
backgroundcolor=\color{LightGrey}% |
293 |
} |
294 |
|
295 |
% this implements producing nice code blocks |
296 |
% it also saves time, typing and |
297 |
% *should* reduce errors in the text by removing doubling up of code |
298 |
\lstnewenvironment{xmdsCode}[1][]{\lstset{style=myhtml}\lstset{#1}}{} |
299 |
|
300 |
% this implements nicely formatted shell code |
301 |
\lstnewenvironment{shellCode}[1][]{\lstset{style=myShell}\lstset{#1}}{} |
302 |
|
303 |
% this implements nicely formatted Perl code |
304 |
\lstnewenvironment{perlCode}[1][]{\lstset{style=myPerl}\lstset{#1}}{} |
305 |
|
306 |
% this implements nicely formatted Python code |
307 |
\lstnewenvironment{python}[1][]{\lstset{style=myPython}\lstset{#1}}{} |
308 |
|
309 |
% this implements nicely formatted C++ code |
310 |
\lstnewenvironment{CCode}{\lstset{style=myC++}}{} |
311 |
|
312 |
% this implements nicely formatted matlab code |
313 |
\lstnewenvironment{matlabCode}{\lstset{style=myMatlab}}{} |
314 |
|
315 |
% this implements nicely formatted scilab code |
316 |
\lstnewenvironment{scilabCode}{\lstset{style=myScilab}}{} |
317 |
|