/[escript]/trunk/doc/cookbook/cookbook_defs.tex
ViewVC logotype

Annotation of /trunk/doc/cookbook/cookbook_defs.tex

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2667 - (hide annotations)
Thu Sep 17 01:49:11 2009 UTC (9 years, 10 months ago) by jfenwick
File MIME type: application/x-tex
File size: 15068 byte(s)
Renamed the main cookbook tex file to match our convention.
Replaced doc/cookbook/figures/heatrefraction002contqu.pdf with
a version which is actually pdf. However it needs to be regnerated since
it it sideways.

The examples have had their copyright notices fixed (dates were too early).
sb2.py has been removed since it uses pyvisi.

scons will now build the cookbook as parts of a docs build.
Also in reposnse to :
scons cookbook_pdf


1 ahallam 2411
2     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3     %
4 jfenwick 2548 % Copyright (c) 2003-2009 by University of Queensland
5 ahallam 2411 % Earth Systems Science Computational Center (ESSCC)
6     % http://www.uq.edu.au/esscc
7     %
8     % Primary Business: Queensland, Australia
9     % Licensed under the Open Software License version 3.0
10     % http://www.opensource.org/licenses/osl-3.0.php
11     %
12     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
13    
14    
15     \usepackage{subfigure}
16     \usepackage{epsfig}
17     \usepackage{graphicx,color}
18     \usepackage{makeidx} % handle the index properly
19     \usepackage{xspace} % handle spaces after commands more nicely
20     % use the ams math stuff, as it makes the maths easier to code, and
21     % nicer output than the standard LaTeX stuff
22 gross 2477 \usepackage{amsmath,amsfonts,amssymb} % this is handy for mathematicians and physici % see http://www.ams.org/tex/amslatex.html
23 ahallam 2411 \usepackage{alltt} % handy verbatim stuff
24 ahallam 2495 \usepackage{textcomp}
25 ahallam 2411
26 jfenwick 2667
27     %Ensures that latex doesn't have an error if we don't specify the version
28     \providecommand{\RepVersion}{Unknown\xspace}
29    
30 ahallam 2411 %Tony's Commands
31     \newcommand{\editor}[1] {\textit{EDITORIAL: {#1}}}
32     %\newcommand{\eqref}[1] {(\ref{#1})}
33     \newcommand{\esc}{\module{escript}\xspace}
34 ahallam 2426 \newcommand{\fileex}[1]{\module{\textbackslash examples\textbackslash {#1}}\xspace}
35 gross 2477 \newcommand{\TODO}[1]{\textbf{TODO}:\xspace\textit{#1} }
36 ahallam 2634 \newcommand{\TBA}[1]{\textbf{TO BE ADDED: \begin{enumerate} {#1} \end{enumerate}}}
37 gross 2477 \newcommand{\ESCRIPT}{\textit{escript}\xspace}
38     \newcommand{\ESYS}{\textit{esys}\xspace}
39 ahallam 2634 \newcommand{\FINLEY}{\textit{finley}\xspac}
40     \newcommand{\exf}{\textit{/doc/examples/cookbook/}\xspace}
41     \newcommand{\mayavi}{\textit{Mayavi2}\xspace}
42 ahallam 2411
43 ahallam 2495 %referencing
44     \newcommand{\reffig}[1]{(Figure \ref{#1})}
45     \newcommand{\refeq}[1]{equation \ref{#1}}
46     \newcommand{\refEq}[1]{Equation \ref{#1}}
47 ahallam 2634 \newcommand{\refCh}[1]{Chapter \ref{#1}}
48 ahallam 2495
49     %modules
50     \newcommand{\modesys}{\module{esys}\xspace}
51     \newcommand{\modescript}{\module{esys.escript}\xspace}
52 ahallam 2634 \newcommand{\modLPDE}{\module{esys.escript.LinearPDEs}\xspace}
53 ahallam 2495 \newcommand{\modfinley}{\module{esys.finley}\xspace}
54     \newcommand{\modpycad}{\module{esys.pycad}\xspace}
55     \newcommand{\modvtk}{\module{vtk}\xspace}
56     \newcommand{\modnumpy}{\module{numpy}\xspace}
57     \newcommand{\modmpl}{\module{matplotlib}\xspace}
58 ahallam 2589 \newcommand{\pycad}{\module{esys.pycad}\xspace}
59     \newcommand{\gmsh}{\module{esys.pycad.gmsh}\xspace}
60 ahallam 2606 \newcommand{\pylab}{\module{pylab}\xspace}
61     \newcommand{\mpl}{\module{matplotlib}\xspace}
62     \newcommand{\numpy}{\module{numpy}\xspace}
63 ahallam 2495
64 ahallam 2658 %list scripts
65     \newcommand{\sslist}[1]{\textit{The scripts referenced in this section are; #1} \newline \newline}
66    
67 ahallam 2411 % % define some handy commands for escript stuff
68     % \newcommand{\LINUX}{{\it Linux}\xspace}
69     % \newcommand{\WINDOWS}{{\it MS Windows}\xspace}
70     % \newcommand{\PYTHON}{{\it python}\xspace}
71     % % \newcommand{\netCDF}{{\it netCDF}\cite{NETCDF}\index{netCDF} \xspace}
72     % \newcommand{\netCDF}{{\it netCDF}\index{netCDF}\xspace}
73     % \newcommand{\escript}{\module{esys.escript}\xspace}
74     % \newcommand{\finley}{\module{esys.finley}\xspace}
75     % \newcommand{\esys}{\module{esys}\xspace}
76     % \newcommand{\pyvisi}{\module{esys.pyvisi}\xspace}
77     % \newcommand{\pycad}{\module{esys.pycad}\xspace}
78     % \newcommand{\gmsh}{\module{esys.pycad.gmsh}\xspace}
79     % \newcommand{\gmshextern}{{\it Gmsh}\cite{GMSH}\index{Gmsh} \xspace}
80     % \newcommand{\env}[1]{\textbf{\mbox{#1}}\index{Environment!#1}}
81     % % \newcommand{\MPI}{{\it MPI}\xspace\index{Message Passing Interface!MPI}\cite{MPI}\xspace}
82     % % \newcommand{\OPENMP}{{\it OpenMP}\xspace\index{OpenMP!threading}\cite{OPENMP}\xspace}
83     % \newcommand{\MPI}{{\it MPI}\xspace\index{Message Passing Interface!MPI}\xspace}
84     % \newcommand{\OPENMP}{{\it OpenMP}\xspace\index{OpenMP!threading}\xspace}
85     % \newcommand{\linearPDEs}{\module{esys.escript.linearPDEs}\xspace}
86     % \newcommand{\LinearPDE}{\class{LinearPDE}\xspace}
87     % \newcommand{\timeseries}{\module{esys.timeseries}\xspace}
88     % \newcommand{\modelframe}{\module{esys.modelframe}\xspace}
89     % \newcommand{\pdetools}{\module{esys.pdetools}\xspace}
90     % \newcommand{\esysxml}{{\it esysxml}}
91     %
92     % \newcommand{\AdvectivePDE}{\class{AdvectivePDE}\xspace}
93     % \newcommand{\Poisson}{\class{Poisson}\xspace}
94     % \newcommand{\Helmholtz}{\class{Helmholtz}\xspace}
95     % \newcommand{\Lame}{\class{Lame}\xspace}
96     % \newcommand{\Data}{\class{Data}\xspace}
97     % \newcommand{\EmptyData}{empty \class{Data}\index{empty Data}\xspace}
98     % \newcommand{\Domain}{\class{Domain}\xspace}
99     % %\newcommand{\VTK}{{\it vtk} \cite{VTK}\index{visualization!vtk} \xspace}
100     % \newcommand{\GnuPlot}{{\it gnuplot} \cite{GNUPLOT}\index{visualization!gnuplot}\index{gnuplot}}
101     % \newcommand{\mayavi}{{\it mayavi}\index{visualization!mayavi}\index{mayavi}}
102     % \newcommand{\OpenDX}{{\it OpenDX} \cite{OPENDX}\xspace}
103     % \newcommand{\finleyelement}[1]{{\it #1}\index{finley!#1}}
104     % \newcommand{\False}{\constant{False}\xspace}
105     % \newcommand{\True}{\constant{True}\xspace}
106     % \newcommand{\PCG}{\constant{LinearPDE.PCG}\xspace\index{linear solver!PCG}\index{PCG}}
107     % \newcommand{\BiCGStab}{\constant{LinearPDE.BICGSTAB}\xspace\index{linear solver!BiCGStab}\index{BiCGStab}}
108     % \newcommand{\Direct}{\constant{LinearPDE.DIRECT}\xspace\index{linear solver!Direct}\index{Direct solver}}
109     % \newcommand{\GMRES}{\constant{LinearPDE.GMRES}\xspace\index{linear solver!GMRES}\index{GMRES}}
110     % \newcommand{\PRESTWENTY}{\constant{LinearPDE.PRES20}\xspace\index{linear solver!PRES20}\index{PRES20}}
111     % \newcommand{\JACOBI}{\constant{LinearPDE.JACOBI}\xspace\index{preconditioner!Jacobi}\index{Jacobi}}
112     % \newcommand{\ILU}{\constant{LinearPDE.ILU0}\xspace\index{preconditioner!ILU0}\index{ILU0}}
113     % \newcommand{\ILUT}{\constant{LinearPDE.ILUT}\xspace\index{preconditioner!ILUT}\index{ILUT}}
114     % \newcommand{\LUMPING}{\constant{LinearPDE.LUMPING}\xspace\index{linear solver!lumping}\index{lumping}}
115     % \newcommand{\NOREORDERING}{\constant{LinearPDE.NO\hackscore REORDERING}\xspace}
116     % \newcommand{\MINIMUMFILLIN}{\constant{LinearPDE.MINIMUM\hackscore FILL\hackscore IN}\xspace\index{linear solver!minimum fill-in ordering}\index{minimum fill-in ordering}}
117     % \newcommand{\NESTEDDESCTION}{\constant{LinearPDE.NESTED\hackscore DISSECTION}\xspace\index{linear solver!nested dissection ordering}\index{nested dissection}}
118     %
119     % \newcommand{\FunctionSpace}{\class{FunctionSpace}\xspace}
120     % \newcommand{\Operator}{\class{Operator}\xspace}
121     % \newcommand{\SolutionFS}{solution \class{FunctionSpace}\index{solution}\xspace}
122     % \newcommand{\ReducedSolutionFS}{reduced solution \class{FunctionSpace}\index{solution!reduced}\xspace}
123     % \newcommand{\FunctionOnBoundary}{boundary \class{FunctionSpace}\xspace}
124     % \newcommand{\Function}{general \class{FunctionSpace}\xspace}
125     % \newcommand{\FunctionOnContactZero}{contact \class{FunctionSpace} on side 0\xspace}
126     % \newcommand{\FunctionOnContactOne}{contact \class{FunctionSpace} on side 1\xspace}
127     % \newcommand{\ContinuousFunction}{continuous \class{FunctionSpace}\xspace}
128     % \newcommand{\RankOne}{{rank-1 \Data object}\xspace}
129     % \newcommand{\RankTwo}{{rank-2 \Data object}\xspace}
130     % \newcommand{\RankThree}{{rank-3 \Data object}\xspace}
131     % \newcommand{\RankFour}{{rank-4 \Data object}\xspace}
132     % \newcommand{\Tensor}{{tensor \Data object}\xspace}
133     % \newcommand{\Vector}{{vector \Data object}\xspace}
134     % \newcommand{\Scalar}{{scalar \Data object}\xspace}
135     % \newcommand{\DataSample}{{data sample}\index{data sample}\xspace}
136     % \newcommand{\DataSamplePoints}{{data sample points}\index{data sample!points}\xspace}
137     % \newcommand{\numarray}{\module{numarray}\xspace}
138     % \newcommand{\numarrayNA}{\module{numarray}.\class{NumArray}\xspace}
139     % \newcommand{\Shape}{shape\xspace\index{shape}}
140     % \newcommand{\Rank}{rank\xspace\index{shape}}
141     % \newcommand{\ExampleDirectory}{example directory\xspace}
142     % \newcommand{\ReferenceGuide}{\url{http://shake200.esscc.uq.edu.au/esys/docs.html}\xspace}
143     % \newcommand{\Point}{\class{Point} \xspace}
144     % \newcommand{\PropertySet}{\class{PropertySet} \xspace}
145     % \newcommand{\Design}{\class{Design} \xspace}
146     % \newcommand{\TagMap}{\class{TagMap} \xspace}
147     % \newcommand{\ManifoldOneD}{\class{Manifold1D} \xspace}
148     % \newcommand{\ManifoldTwoD}{\class{Manifold2D} \xspace}
149     % \newcommand{\ManifoldThreeD}{\class{Manifold3D} \xspace}
150     %
151     % % default width for figures
152     % \newcommand{\figwidth}{100mm}
153     % % commands useful in cross-referencing
154     % \newcommand {\Ref}[1] {Reference~\cite{#1}}
155     % \newcommand {\Sec}[1] {Section~\ref{#1}}
156     % \newcommand {\App}[1] {Appendix~\ref{#1}}
157     % \newcommand {\Chap}[1] {Chapter~\ref{#1}}
158     % \newcommand {\etal} {\emph{~et~al.}}
159     % \newcommand {\fig}[1] {Figure~\ref{#1}}
160     % \newcommand {\eqn}[1] {Equation~(\ref{#1})}
161     % \newcommand {\tab}[1] {Table~\ref{#1}}
162     %
163     % % this stops one figure taking up a whole page and lets more text onto
164     % % the one page when a figure exists
165     % \renewcommand{\floatpagefraction}{0.8} % Default = 0.5
166     %
167     % % improved version of caption handling
168     % \usepackage{ccaption}
169     % \captionnamefont{\scshape}
170     % \captionstyle{}
171     % \makeatletter
172     % \renewcommand{\fnum@figure}[1]{\quad\small\textsc{\figurename~\thefigure}:}
173     % \renewcommand{\@makecaption}[2]{%
174     % \vskip\abovecaptionskip
175     % \sbox\@tempboxa{#1: #2}%
176     % \ifdim \wd\@tempboxa >\hsize
177     % \def\baselinestretch{1}\@normalsize
178     % #1: #2\par
179     % \def\baselinestretch{1.5}\@normalsize
180     % \else
181     % \global \@minipagefalse
182     % \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
183     % \fi
184     % \vskip\belowcaptionskip}
185     % \makeatother
186     %
187     % % \usepackage{fancyvrb} % fancy verbatim stuff. Needed so code below goes
188     % %%% this code grabbed from the PyScript docs
189     % %%% pyscript.sourceforge.net
190 ahallam 2426
191     % --------------------------------------------------------------
192     % Code format within \Verb
193     % --------------------------------------------------------------
194    
195     % \definecolor{pycolor}{rgb}{0,0.4,0}
196    
197     %% \DefineVerbatimEnvironment{python}{Verbatim}
198     %% {frame=leftline,framerule=.5mm,rulecolor=\color{pycolor},
199     %% formatcom=\color{pycolor}\small,fontshape=rm}
200    
201     %\DefineShortVerb[formatcom=\color{dgreen}\small,fontshape=sl]{\|}
202    
203     % \RecustomVerbatimCommand{\Verb}{Verb}{formatcom=\color{pycolor}\small,fontshape=rm}
204    
205     %%% end of grabbed code
206    
207     % this is for when one uses pdflatex and therefore needs to load pdf
208     % figures into \includegraphics
209 ahallam 2411 % \ifpdf
210     % \DeclareGraphicsExtensions{.pdf} % this command defined in graphicx
211     % \pdfcompresslevel=9 % 0: no compression, 9: highest compression
212     % % or, set compress_level 9 in file pdftex.cfg
213     % \else
214     % \DeclareGraphicsExtensions{.eps}
215     % \fi
216     %
217     % % defines the colour for the background of code examples
218     % \definecolor{LightGrey}{gray}{0.9}
219     %
220     % % add the listings package to pretty print the code output
221     % \usepackage{listings}
222     %
223     %
224     % %Some colour definitions added to keep pdflatex happy
225     % %I make no claim that these values are particularly good
226     % \definecolor{Purple}{rgb}{0.7, 0, 0.6}
227     % \definecolor{Tan}{rgb}{0.5,0.5,0.5}
228     % \definecolor{BrickRed}{rgb}{0.7, 0.2, 0.2}
229     %
230     % % All the \color{x} used to be \color[named]{x}
231     % %end color defs
232     %
233     % \lstdefinestyle{myC++}{%
234     % %\lstset{%
235     % language=C++,
236     % showstringspaces=false,
237     % basicstyle=\small\ttfamily,
238     % commentstyle=\color{BrickRed}\ttfamily,
239     % keywordstyle=\color{Purple}\ttfamily,
240     % %identifierstyle=\color{Blue}\ttfamily,
241     % %functionstyle=\color{Blue}\ttfamily,
242     % %typestyle=\color{ForestGreen}\ttfamily,
243     % stringstyle=\color{Tan}\ttfamily,%
244     % morekeywords={,complex,}%
245     % frame=none,%
246     % backgroundcolor=\color{LightGrey}%
247     % }
248     %
249     % \lstdefinestyle{myMatlab}{%
250     % %\lstset{%
251     % language=Matlab,
252     % showstringspaces=false,
253     % basicstyle=\small\ttfamily,
254     % commentstyle=\color{BrickRed}\ttfamily,
255     % keywordstyle=\color{Purple}\ttfamily,
256     % %identifierstyle=\color{Blue}\ttfamily,
257     % %functionstyle=\color{Blue}\ttfamily,
258     % %typestyle=\color{ForestGreen}\ttfamily,
259     % stringstyle=\color{Tan}\ttfamily,%
260     % frame=none,%
261     % backgroundcolor=\color{LightGrey}%
262     % }
263     %
264     % \lstdefinestyle{myScilab}{%
265     % %\lstset{%
266     % language=Scilab,
267     % showstringspaces=false,
268     % basicstyle=\small\ttfamily,
269     % commentstyle=\color{BrickRed}\ttfamily,
270     % keywordstyle=\color{Purple}\ttfamily,
271     % %identifierstyle=\color{Blue}\ttfamily,
272     % %functionstyle=\color{Blue}\ttfamily,
273     % %typestyle=\color{ForestGreen}\ttfamily,
274     % stringstyle=\color{Tan}\ttfamily,%
275     % frame=none,%
276     % backgroundcolor=\color{LightGrey}%
277     % }
278     %
279     % \lstdefinestyle{myShell}{%
280     % %\lstset{%
281     % language=ksh,
282     % showstringspaces=false,
283     % basicstyle=\small\ttfamily,
284     % commentstyle=\color{Black}\ttfamily,
285     % keywordstyle=\color{Black}\ttfamily,
286     % %identifierstyle=\color{Blue}\ttfamily,
287     % %functionstyle=\color{Blue}\ttfamily,
288     % %typestyle=\color{ForestGreen}\ttfamily,
289     % stringstyle=\color{Black}\ttfamily,%
290     % frame=none,%
291     % backgroundcolor=\color{LightGrey}%
292     % }
293     %
294     % \lstdefinestyle{myPython}{%
295     % %\lstset{%
296     % language=python,
297     % showstringspaces=false,
298     % basicstyle=\small\ttfamily,
299     % commentstyle=\color{BrickRed}\ttfamily,
300     % keywordstyle=\color{Purple}\ttfamily,
301     % %identifierstyle=\color{Blue}\ttfamily,
302     % %functionstyle=\color{Blue}\ttfamily,
303     % %typestyle=\color{ForestGreen}\ttfamily,
304     % stringstyle=\color{Tan}\ttfamily,%
305     % frame=none,%
306     % %backgroundcolor=\color{LightGrey}%
307     % }
308     %
309     % \lstdefinestyle{myhtml}{%
310     % %\lstset{%
311     % language=xml,
312     % showstringspaces=false,
313     % basicstyle=\small\ttfamily,
314     % commentstyle=\color{BrickRed}\ttfamily,
315     % keywordstyle=\color{Purple}\ttfamily,
316     % %identifierstyle=\color{Blue}\ttfamily,
317     % %functionstyle=\color{Blue}\ttfamily,
318     % %typestyle=\color{ForestGreen}\ttfamily,
319     % stringstyle=\color{Tan}\ttfamily,
320     % morekeywords={,simulation,prop_dim,error_check,stochastic,%
321     % globals,field,dimensions,lattice,domains,samples,vector,%
322     % components,fourier_space,sequence,integrate,algorithm,%
323     % interval,k_operators,constant,operator_names,vectors,%
324     % output,filename,group,sampling,moments,benchmark,use_double,%
325     % use_wisdom,use_prefs,binary_output,cycles,filter,post_propagation,%
326     % default_value,argv,arg,iterations,cross_propagation,%
327     % use_mpi,paths,seed,noises,author,description,name,type,%
328     % }
329     % frame=none,%
330     % %framerule=2pt,%
331     % backgroundcolor=\color{LightGrey}%
332     % }
333     %
334     % % this implements producing nice code blocks
335     % % it also saves time, typing and
336     % % *should* reduce errors in the text by removing doubling up of code
337     % \lstnewenvironment{xmdsCode}[1][]{\lstset{style=myhtml}\lstset{#1}}{}
338     %
339     % % this implements nicely formatted shell code
340     % \lstnewenvironment{shellCode}[1][]{\lstset{style=myShell}\lstset{#1}}{}
341     %
342     % % this implements nicely formatted Perl code
343     % \lstnewenvironment{perlCode}[1][]{\lstset{style=myPerl}\lstset{#1}}{}
344     %
345     % % this implements nicely formatted Python code
346     % \lstnewenvironment{python}[1][]{\lstset{style=myPython}\lstset{#1}}{}
347     %
348     % % this implements nicely formatted C++ code
349     % \lstnewenvironment{CCode}{\lstset{style=myC++}}{}
350     %
351     % % this implements nicely formatted matlab code
352     % \lstnewenvironment{matlabCode}{\lstset{style=myMatlab}}{}
353     %
354     % % this implements nicely formatted scilab code
355     % \lstnewenvironment{scilabCode}{\lstset{style=myScilab}}{}
356     %
357     % %Ensures that latex doesn't have an error if we don't specify the version
358     % \providecommand{\RepVersion}{Unknown\xspace}
359 ahallam 2426 % to set this value use:
360     % (pdf)latex '\newcommand{\RepVersion}{version\xspace}\input{guide.tex}'
361     % as your command-line

  ViewVC Help
Powered by ViewVC 1.1.26