# Diff of /trunk/doc/user/escript.tex

revision 1315 by gross, Tue Mar 20 01:30:58 2007 UTC revision 1316 by ksteube, Tue Sep 25 03:18:30 2007 UTC
# Line 1  Line 1
1    %
2  % $Id$  % $Id$
3  %  %
4  %           Copyright © 2006 by ACcESS MNRF  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5  %               http://www.access.edu.au  %
6  %         Primary Business: Queensland, Australia.  %           Copyright 2003-2007 by ACceSS MNRF
7  %   Licensed under the Open Software License version 3.0  %       Copyright 2007 by University of Queensland
8  %      http://www.opensource.org/licenses/osl-3.0.php  %
9    %                http://esscc.uq.edu.au
10    %        Primary Business: Queensland, Australia
11    %  Licensed under the Open Software License version 3.0
13    %
14    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
15  %  %

16
17  \chapter{The module \escript}  \chapter{The module \escript}
18  \label{ESCRIPT CHAP}  \label{ESCRIPT CHAP}
# Line 70  the discontinuity cannot be seen as a ge Line 76  the discontinuity cannot be seen as a ge
76  defined for the interior. For most PDE solver libraries  defined for the interior. For most PDE solver libraries
77  the space of the solution and continuous functions is identical, however in some cases, eg.  the space of the solution and continuous functions is identical, however in some cases, eg.
78  when periodic boundary conditions are used in \finley, a solution  when periodic boundary conditions are used in \finley, a solution
79  fulfils periodic boundary conditions while a continuous function does not have to be periodic.  fulfills periodic boundary conditions while a continuous function does not have to be periodic.
80
81  The concept of function spaces describes the properties of  The concept of function spaces describes the properties of
82  functions and allows abstraction from the actual representation  functions and allows abstraction from the actual representation
# Line 102  The values of the function have a rank w Line 108  The values of the function have a rank w
108  number of indices, and a \Shape defining the range of each index.  number of indices, and a \Shape defining the range of each index.
109  The rank in \escript is limited to the range $0$ through $4$ and  The rank in \escript is limited to the range $0$ through $4$ and
110  it is assumed that the rank and \Shape is the same for all \DataSamplePoints.  it is assumed that the rank and \Shape is the same for all \DataSamplePoints.
111  The \Shape of a \Data object is a tuple \var{s} of integers. The length  The \Shape of a \Data object is a tuple (list) \var{s} of integers. The length
112  of \var{s} is the rank of the \Data object and \var{s[i]} is the maximum  of \var{s} is the rank of the \Data object and \var{s[i]} is the maximum
113  value for the \var{i}-th index.  value for the \var{i}-th index.
114  For instance, a stress field has rank $2$ and  For instance, a stress field has rank $2$ and
# Line 258  held in a dictionary. Operations on tagg Line 264  held in a dictionary. Operations on tagg
264  processing the value for each individual sample point.  processing the value for each individual sample point.
265  \escript allows use of constant, tagged and expanded data in a single expression.  \escript allows use of constant, tagged and expanded data in a single expression.
266
267  The \var{dump} method provides a possibility to save \Data objects to a file, for instance to restart a simuation  The \var{dump} method provides a possibility to save \Data objects to a file, for instance to restart a simulation
268  or to save data for visualization. The file format uses \netCDF which commonly is using the file extension  or to save data for visualization. The file format uses \netCDF which commonly is using the file extension
269  {\tt nc}. For instance to save the coordinates of the data points of the \FunctionSpace  {\tt nc}. For instance to save the coordinates of the data points of the \FunctionSpace
270  \ContinuousFunction to the file {\tt x.nc} one uses:  \ContinuousFunction to the file {\tt x.nc} one uses:
# Line 267  x=ContinuousFunction(mydomain).getX() Line 273  x=ContinuousFunction(mydomain).getX()
273  x.dump("x.nc")  x.dump("x.nc")
274  \end{python}  \end{python}
275  In order to keep the dump files small {\tt x.nc} does not contain a representation of the \Domain. It has to be saved using  In order to keep the dump files small {\tt x.nc} does not contain a representation of the \Domain. It has to be saved using
276  apropriated methods of \var{mydomain} to be loaded before \var{x}. Alternatively, the \Domain can be reconstructed.  appropriate methods of \var{mydomain} to be loaded before \var{x}. Alternatively, the \Domain can be reconstructed.
277  To recover the object \var{x} one uses  To recover the object \var{x} one uses
278  \begin{python}  \begin{python}
# Line 291  The \Domain class provides an abstract a Line 297  The \Domain class provides an abstract a
297  \Domain itself has no initialization but implementations of \Domain are  \Domain itself has no initialization but implementations of \Domain are
298  instantiated by numerical libraries making use of \Data objects.  instantiated by numerical libraries making use of \Data objects.
299  \end{classdesc}  \end{classdesc}
300  The following methds are available:  The following methods are available:
301  \begin{methoddesc}[Domain]{getDim}{}  \begin{methoddesc}[Domain]{getDim}{}
302  returns the spatial dimension of the \Domain.  returns the spatial dimension of the \Domain.
303  \end{methoddesc}  \end{methoddesc}
# Line 337  Otherwise \False is returned. Line 343  Otherwise \False is returned.
343  \end{methoddesc}  \end{methoddesc}
344
345  \begin{methoddesc}[Domain]{__str__}{g}  \begin{methoddesc}[Domain]{__str__}{g}
346  returns string represention of the \Domain.  returns string representation of the \Domain.
347  \end{methoddesc}  \end{methoddesc}
348
349  \subsection{\FunctionSpace class}  \subsection{\FunctionSpace class}
# Line 378  returns the \Domain of the \FunctionSpac Line 384  returns the \Domain of the \FunctionSpac
384  assigns a new tag \var{new_tag} to all data sample  assigns a new tag \var{new_tag} to all data sample
385  where \var{mask} is positive for a least one data point.  where \var{mask} is positive for a least one data point.
386  \var{mask} must be defined on the this \FunctionSpace.  \var{mask} must be defined on the this \FunctionSpace.
387  Use the \var{setTagMap} to assign a tage name to \var{new_tag}.  Use the \var{setTagMap} to assign a tag name to \var{new_tag}.
388  \end{methoddesc}  \end{methoddesc}
389
390  \begin{methoddesc}[FunctionSpace]{__eq__}{arg}  \begin{methoddesc}[FunctionSpace]{__eq__}{arg}
# Line 392  Otherwise \False is returned. Line 398  Otherwise \False is returned.
398  \end{methoddesc}  \end{methoddesc}
399
400  \begin{methoddesc}[Domain]{__str__}{g}  \begin{methoddesc}[Domain]{__str__}{g}
401  returns string represention of the \Domain.  returns string representation of the \Domain.
402  \end{methoddesc}  \end{methoddesc}
403
404  The following function provide generators for \FunctionSpace objects:  The following function provide generators for \FunctionSpace objects:
# Line 414  are defined on the boundary of the geome Line 420  are defined on the boundary of the geome
420
421  \begin{funcdesc}{FunctionOnContactZero}{domain}  \begin{funcdesc}{FunctionOnContactZero}{domain}
422  returns the \FunctionOnContactZero the \Domain domain. \Data objects in this type of \Function  returns the \FunctionOnContactZero the \Domain domain. \Data objects in this type of \Function
423  are defined on side 0 of a discontinutiy  within the geometrical region defined by \var{domain}.  are defined on side 0 of a discontinuity  within the geometrical region defined by \var{domain}.
424  The discontinutiy is defined when \var{domain} is instantiated.  The discontinuity is defined when \var{domain} is instantiated.
425  \end{funcdesc}  \end{funcdesc}
426
427  \begin{funcdesc}{FunctionOnContactOne}{domain}  \begin{funcdesc}{FunctionOnContactOne}{domain}
428  returns the \FunctionOnContactOne on the \Domain domain.  returns the \FunctionOnContactOne on the \Domain domain.
429  \Data objects in this type of \Function  \Data objects in this type of \Function
430  are defined on side 1 of a discontinutiy  within the geometrical region defined by \var{domain}.  are defined on side 1 of a discontinuity  within the geometrical region defined by \var{domain}.
431  The discontinutiy is defined when \var{domain} is instantiated.  The discontinuity is defined when \var{domain} is instantiated.
432  \end{funcdesc}  \end{funcdesc}
433
434  \begin{funcdesc}{Solution}{domain}  \begin{funcdesc}{Solution}{domain}
# Line 457  At least one of the arguments \var{arg0} Line 463  At least one of the arguments \var{arg0}
463  converted into a \Data object. If \var{arg0} or \var{arg1} are  converted into a \Data object. If \var{arg0} or \var{arg1} are
464  defined on different \FunctionSpace an attempt is made to embed \var{arg0}  defined on different \FunctionSpace an attempt is made to embed \var{arg0}
465  into the \FunctionSpace of \var{arg1} or to embed \var{arg1} into  into the \FunctionSpace of \var{arg1} or to embed \var{arg1} into
466  the \FunctionSpace of \var{arg0}. Boths arguments must have the same  the \FunctionSpace of \var{arg0}. Both arguments must have the same
467  \Shape or one of the arguments my be of rank 0. In the  \Shape or one of the arguments may be of rank 0. In the
468  latter case it is assumed that the particular argument is of the same  latter case it is assumed that the particular argument is of the same
469  \Shape as the other argument but constant over all components.  \Shape as the other argument but constant over all components.
470
# Line 614  the value assigned to \DataSamplePoints Line 620  the value assigned to \DataSamplePoints
620
621  \begin{methoddesc}[Data]{dump}{filename}  \begin{methoddesc}[Data]{dump}{filename}
622  dumps the \Data object to the file \var{filename}. The file stores the  dumps the \Data object to the file \var{filename}. The file stores the
623  function space but not the \Domain. It is in the responsibilty of the user to  function space but not the \Domain. It is in the responsibility of the user to
624  save the \Domain.  save the \Domain.
625  \end{methoddesc}  \end{methoddesc}
626
# Line 800  returns a function which is $1$ where \v Line 806  returns a function which is $1$ where \v
806  \end{funcdesc}  \end{funcdesc}
807
808  \begin{funcdesc}{minval}{a}  \begin{funcdesc}{minval}{a}
809  returns at each \DataSamplePoints the minumum value over all components.  returns at each \DataSamplePoints the minimum value over all components.
810  \end{funcdesc}  \end{funcdesc}
811
812  \begin{funcdesc}{maxval}{a}  \begin{funcdesc}{maxval}{a}
# Line 840  and for a \RankFour function and  \code{ Line 846  and for a \RankFour function and  \code{
846  \end{funcdesc}  \end{funcdesc}
847
848  \begin{funcdesc}{swap_axes}{a\optional{, axis0=0 \optional{, axis1=1 }}}  \begin{funcdesc}{swap_axes}{a\optional{, axis0=0 \optional{, axis1=1 }}}
849  returns \var{a} but with swapped componets \var{axis0} and  \var{axis1}. The argument \var{a} must be  returns \var{a} but with swapped components \var{axis0} and  \var{axis1}. The argument \var{a} must be
850  at least of \RankTwo. For instance in the  at least of \RankTwo. For instance in the
851  for a \RankFour argument, \code{axis0=1} and \code{axis1=2} this is  for a \RankFour argument, \code{axis0=1} and \code{axis1=2} this is
852
# Line 1068  returns \True is the object is empty. Ot Line 1074  returns \True is the object is empty. Ot
1074  \end{methoddesc}  \end{methoddesc}
1075
1076  \begin{methoddesc}[Operator]{setValue}{value}  \begin{methoddesc}[Operator]{setValue}{value}
1077  resets all entires in the obeject representation to \var{value}  resets all entries in the object representation to \var{value}
1078  \end{methoddesc}  \end{methoddesc}
1079
1080  \begin{methoddesc}[Operator]{solves}{rhs}  \begin{methoddesc}[Operator]{solves}{rhs}

Legend:
 Removed from v.1315 changed lines Added in v.1316