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

Diff of /trunk/doc/user/firststep.tex

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2574 by gross, Mon Aug 3 09:09:20 2009 UTC revision 2575 by jfenwick, Mon Aug 3 23:38:33 2009 UTC
# Line 314  to hand over the solution. The first opt Line 314  to hand over the solution. The first opt
314  designed for large scale and 3D problem and which can be read by a variety of software packages such as \mayavi \cite{mayavi}, \VisIt~\cite{VisIt}.  designed for large scale and 3D problem and which can be read by a variety of software packages such as \mayavi \cite{mayavi}, \VisIt~\cite{VisIt}.
315    
316  \subsection{Plotting Using \MATPLOTLIB}  \subsection{Plotting Using \MATPLOTLIB}
317    
318    Users of Debian 5(Lenny) please note: this example makes use of the griddata method in \module{matplotlib.mlab}.
319    This method is not part of version 0.98.1 which is available with Lenny.
320    If you wish to use \MATPLOTLIB, you may need to install a later version.
321    Users of Ubuntu 8.10 or later and people should be fine.
322    
323  The \MATPLOTLIB module provides a simple and easy to use way to visualize PDE solutions (or other \Data objects).  The \MATPLOTLIB module provides a simple and easy to use way to visualize PDE solutions (or other \Data objects).
324  To hand over data from \escript to \MATPLOTLIB the values need to mapped onto a rectangular grid. We will make use  To hand over data from \escript to \MATPLOTLIB the values need to mapped onto a rectangular grid. We will make use
325  of the \numpy module.  of the \numpy module.
# Line 328  y_grid = numpy.linspace(0.,1.,50) Line 334  y_grid = numpy.linspace(0.,1.,50)
334  \var{y_grid} defines the y coordinates of the grid. In this case we use $50$ points over the interval $[0,1]$  \var{y_grid} defines the y coordinates of the grid. In this case we use $50$ points over the interval $[0,1]$
335  in both directions.  in both directions.
336    
337  Now created by \escript need to be interpolated to this grid. We will use the \MATPLOTLIB  Now the values created by \escript need to be interpolated to this grid. We will use the \MATPLOTLIB
338  \function{mlab.griddata} function to do this. We can easily extract spatial coordinates as a \var{list} by  \function{mlab.griddata} function to do this. We can easily extract spatial coordinates as a \var{list} by
339  \begin{python}  \begin{python}
340  x=mydomain.getX()[0].toListOfTuples()  x=mydomain.getX()[0].toListOfTuples()
# Line 404  For details on the usage of the \MATPLOT Line 410  For details on the usage of the \MATPLOT
410    
411  As pointed out, \MATPLOTLIB is restricted to the two-dimensional case and  As pointed out, \MATPLOTLIB is restricted to the two-dimensional case and
412  should be used for small problems only. It can not be used under \MPI as the \member{toListOfTuples} method is  should be used for small problems only. It can not be used under \MPI as the \member{toListOfTuples} method is
413  not safe under \MPI\footnote{The term 'safe under \MPI' means that a program will produce correct results when run on more than one processors under \MPI.}.  not safe under \MPI\footnote{The phrase 'safe under \MPI' means that a program will produce correct results when run on more than one processor under \MPI.}.
414    
415  \subsection{Visualization using \VTK}  \subsection{Visualization using \VTK}
416    

Legend:
Removed from v.2574  
changed lines
  Added in v.2575

  ViewVC Help
Powered by ViewVC 1.1.26