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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2606 - (show annotations)
Thu Aug 13 04:32:23 2009 UTC (10 years, 1 month ago) by ahallam
Original Path: trunk/doc/cookbook/TEXT/cookbook_defs.tex
File MIME type: application/x-tex
File size: 14542 byte(s)
Updates to first chapter in cookbook -> approaching completion.
New figures added for model descriptions.
Scripts updated to use pylab/matplotlib and movie making scripts added for *.avi creation.
Still to finalise in chapter 1
- twodheatdiff model of intrusion
	-contouring

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

  ViewVC Help
Powered by ViewVC 1.1.26