/[escript]/trunk/doc/user/guide_defs.tex
ViewVC logotype

Contents of /trunk/doc/user/guide_defs.tex

Parent Directory Parent Directory | Revision Log Revision Log


Revision 155 - (show annotations)
Wed Nov 9 02:02:19 2005 UTC (13 years, 8 months ago) by jgs
File MIME type: application/x-tex
File size: 9338 byte(s)
move all directories from trunk/esys2 into trunk and remove esys2

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

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26