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

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

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

revision 155 by jgs, Wed Nov 9 02:02:19 2005 UTC revision 593 by gross, Tue Mar 14 02:50:27 2006 UTC
# Line 110  all components. Line 110  all components.
110    
111  \Data objects can also be created from any \numarray  \Data objects can also be created from any \numarray
112  array or any object, such as a list of floating point numbers,  array or any object, such as a list of floating point numbers,
113  that can be converted into a \numarray array \Ref{NUMARRAY}.  that can be converted into a \numarray.NumArray \Ref{NUMARRAY}.
114  The following two statements  The following two statements
115  create objects which are equivalent to \var{mydat}:  create objects which are equivalent to \var{mydat}:
116  \begin{python}  \begin{python}
# Line 118  mydat1=Data(value=numarray.ones((2,3)),w Line 118  mydat1=Data(value=numarray.ones((2,3)),w
118  mydat2=Data(value=[[1,1],[1,1],[1,1]],what=ContinuousFunction(myDomain))  mydat2=Data(value=[[1,1],[1,1],[1,1]],what=ContinuousFunction(myDomain))
119  \end{python}  \end{python}
120  In the first case the initial value is \var{numarray.ones((2,3))}  In the first case the initial value is \var{numarray.ones((2,3))}
121  which generates a $2 \times 3$ matrix as a \numarray array  which generates a $2 \times 3$ matrix as a \numarray.NumArray
122  filled with ones. The \Shape of the created \Data object  filled with ones. The \Shape of the created \Data object
123  it taken from the \Shape of the array. In the second  it taken from the \Shape of the array. In the second
124  case, the creator converts the initial value, which is a list of lists,  case, the creator converts the initial value, which is a list of lists,
125  and converts it into a \numarray array before creating the actual  and converts it into a \numarray.NumArray before creating the actual
126  \Data object.        \Data object.      
127    
128  For convenience \escript provides creators for the most common types  For convenience \escript provides creators for the most common types
# Line 138  eg. a stress field. Line 138  eg. a stress field.
138  \item \var{Tensor4(0,Function(mydomain))} is the same as \var{Data(0,Function(myDomain),(d,d,d,d))}  \item \var{Tensor4(0,Function(mydomain))} is the same as \var{Data(0,Function(myDomain),(d,d,d,d))}
139  eg. a Hook tensor field.    eg. a Hook tensor field.  
140  \end{itemize}  \end{itemize}
141  Here the initial value is $0$ but any object that can be converted into a \numarray array and whose \Shape  Here the initial value is $0$ but any object that can be converted into a \numarray.NumArray and whose \Shape
142  is consistent with \Shape of the \Data object to be created can be used as the initial value.  is consistent with \Shape of the \Data object to be created can be used as the initial value.
143    
144  \Data objects can be manipulated by applying unitary operations (eg. cos, sin, log)  \Data objects can be manipulated by applying unitary operations (eg. cos, sin, log)
# Line 251  processing the value for each individual Line 251  processing the value for each individual
251    
252    
253  \section{\Domain class}  \section{\Domain class}
   
254  \begin{classdesc}{Domain}{}  \begin{classdesc}{Domain}{}
255  A \Domain object is used to describe a geometrical region together with  A \Domain object is used to describe a geometrical region together with
256  a way of representing functions over this region.  a way of representing functions over this region.
# Line 259  The \Domain class provides an abstract a Line 258  The \Domain class provides an abstract a
258  \Domain itself has no initialization but implementations of \Domain are  \Domain itself has no initialization but implementations of \Domain are
259  instantiated by numerical libraries making use of \Data objects.  instantiated by numerical libraries making use of \Data objects.
260  \end{classdesc}  \end{classdesc}
261    The following methds are available:
262  \begin{methoddesc}[Domain]{getDim}{}  \begin{methoddesc}[Domain]{getDim}{}
263  returns the spatial dimension of the \Domain.  returns the spatial dimension of the \Domain.
264  \end{methoddesc}  \end{methoddesc}
# Line 294  returns \True of the \Domain \var{arg} d Line 293  returns \True of the \Domain \var{arg} d
293  Otherwise \False is returned.  Otherwise \False is returned.
294  \end{methoddesc}  \end{methoddesc}
295    
296    \begin{methoddesc}[Domain]{__str__}{g}
297    returns string represention of the \Domain.
298    \end{methoddesc}
299    
300  \section{\Domain class}  \section{\Domain class}
301  \begin{classdesc}{FunctionSpace}{}  \begin{classdesc}{FunctionSpace}{}
302  \FunctionSpace objects are used to define properties of \Data objects, such as continuity. \FunctionSpace objects  \FunctionSpace objects are used to define properties of \Data objects, such as continuity. \FunctionSpace objects
# Line 301  are instantiated by generator functions. Line 304  are instantiated by generator functions.
304  represented by their values at \DataSamplePoints which are defined by the type and the \Domain of the  represented by their values at \DataSamplePoints which are defined by the type and the \Domain of the
305  \FunctionSpace.  \FunctionSpace.
306  \end{classdesc}  \end{classdesc}
307    The following methds are available:
308  \begin{methoddesc}[FunctionSpace]{getDim}{}  \begin{methoddesc}[FunctionSpace]{getDim}{}
309  returns the spatial dimension of the \Domain of the \FunctionSpace.  returns the spatial dimension of the \Domain of the \FunctionSpace.
310  \end{methoddesc}  \end{methoddesc}
# Line 336  returns \True of the \Domain \var{arg} d Line 339  returns \True of the \Domain \var{arg} d
339  Otherwise \False is returned.  Otherwise \False is returned.
340  \end{methoddesc}  \end{methoddesc}
341    
342    \begin{methoddesc}[Domain]{__str__}{g}
343    returns string represention of the \Domain.
344    \end{methoddesc}
345    
346  The following function provide generators for \FunctionSpace objects:  The following function provide generators for \FunctionSpace objects:
347  \begin{funcdesc}{Function}{domain}  \begin{funcdesc}{Function}{domain}
348  returns the \Function on the \Domain \var{domain}. \Data objects in this type of \Function  returns the \Function on the \Domain \var{domain}. \Data objects in this type of \Function
# Line 448  index may be dropped. In the returned or Line 455  index may be dropped. In the returned or
455  i.e. the rank is reduced by one in comparison to \var{arg}.  i.e. the rank is reduced by one in comparison to \var{arg}.
456  The following examples show slicing usage:    The following examples show slicing usage:  
457  \begin{python}  \begin{python}
458    t=Data(1.,(4,4,6,6),Function(mydomain))
459  t[1,1,1,0]=9.  t[1,1,1,0]=9.
460  s=t[:2,:,2:6,5] # s has rank 3  s=t[:2,:,2:6,5] # s has rank 3
461  s[:,:,1]=1.  s[:,:,1]=1.
462  t[:2,:2,5,5]=s[2:4,1,:2]  t[:2,:2,5,5]=s[2:4,1,:2]
463  \end{python}  \end{python}
464    
465    \subsection{Generation of \Data class objects}
466    \begin{classdesc}{Data}{value=0,shape=(,),what=FunctionSpace(),expand=\False}
 \begin{classdesc}{Data}{value=0,shape=(,),what=FunctionSpace(),expanded=\False}  
467  creates a \Data object with \Shape \var{shape} in the \FunctionSpace \var{what}.  creates a \Data object with \Shape \var{shape} in the \FunctionSpace \var{what}.
468  The values at all \DataSamplePoints are set to the double value \var{value}. If \var{expanded} is \True  The values at all \DataSamplePoints are set to the double value \var{value}. If \var{expanded} is \True
469  the \Data object is represented in expanded from.  the \Data object is represented in expanded from.
470  \end{classdesc}  \end{classdesc}
471    
472  \begin{classdesc}{Data}{value,what=FunctionSpace(),expanded=\False}  \begin{classdesc}{Data}{value,what=FunctionSpace(),expand=\False}
473  creates a \Data object in the \FunctionSpace \var{what}.  creates a \Data object in the \FunctionSpace \var{what}.
474  The value for each \DataSamplePoints is set to \numarray object \var{value}.  The value for each \DataSamplePoints is set to \numarray, \Data object \var{value} or a dictionary of
475    \numarray or floating point numbers. In the latter case the keys muts be integers and are used
476    as tags.
477  The \Shape of the returned object is equal to the \Shape of \var{value}. If \var{expanded} is \True  The \Shape of the returned object is equal to the \Shape of \var{value}. If \var{expanded} is \True
478  the \Data object is represented in expanded from.  the \Data object is represented in expanded from.
479  \end{classdesc}  \end{classdesc}
480    
 \begin{classdesc}{Data}{value,what=FunctionSpace()}  
 creates a \Data object in the \FunctionSpace \var{what} from the \Data object \var{value}.  
 The \Shape of the created \Data object is equal to the \Shape of \var{value}.  
 If the \FunctionSpace of \var{value} is equal to the \var{what}, a shallow copy, i.e.  
 a reference to the representation of \var{value} is greated. Otherwise,  
 \var{value} is interpolated into the \var{what}.  
 \end{classdesc}  
   
481  \begin{classdesc}{Data}{}  \begin{classdesc}{Data}{}
482  creates an \EmptyData object. The \EmptyData object is used to indicate that an argument is not present  creates an \EmptyData object. The \EmptyData object is used to indicate that an argument is not present
483  where a \Data object is required.  where a \Data object is required.
484  \end{classdesc}  \end{classdesc}
485    
486    \begin{funcdesc}{Scalar}{value=0.,what=escript::FunctionSpace(),expand=\False}
487    returns a \Data object of rank 0 in the \FunctionSpace \var{what}.
488    Values are initialed with the double \var{value}. If \var{expanded} is \True
489    the \Data object is represented in expanded from.
490    \end{funcdesc}
491    
492    \begin{funcdesc}{Vector}{value=0.,what=escript::FunctionSpace(),expand=\False}
493    returns a \Data object of \Shape \var{(d,)} in the \FunctionSpace \var{what}
494    where \var{d} is the spatial dimension of the \Domain of \var{what}.
495    Values are initialed with the double \var{value}. If \var{expanded} is \True
496    the \Data object is represented in expanded from.
497    \end{funcdesc}
498    
499    \begin{funcdesc}{Tensor}{value=0.,what=escript::FunctionSpace(),expand=\False}
500    returns a \Data object of \Shape \var{(d,d)} in the \FunctionSpace \var{what}
501    where \var{d} is the spatial dimension of the \Domain of \var{what}.
502    Values are initialed with the double \var{value}. If \var{expanded} is \True
503    the \Data object is represented in expanded from.
504    \end{funcdesc}
505    
506    \begin{funcdesc}{Tensor3}{value=0.,what=escript::FunctionSpace(),expand=\False}
507    returns a \Data object of \Shape \var{(d,d,d)} in the \FunctionSpace \var{what}
508    where \var{d} is the spatial dimension of the \Domain of \var{what}.
509    Values are initialed with the double \var{value}. If \var{expanded} is \True
510    the \Data object is re\var{arg}presented in expanded from.
511    \end{funcdesc}
512    
513    \begin{funcdesc}{Tensor4}{value=0.,what=escript::FunctionSpace(),expand=\False}
514    returns a \Data object of \Shape \var{(d,d,d,d)} in the \FunctionSpace \var{what}
515    where \var{d} is the spatial dimension of the \Domain of \var{what}.
516    Values are initialed with the double \var{value}. If \var{expanded} is \True
517    the \Data object is represented in expanded from.
518    \end{funcdesc}
519    
520    \subsection{\Data class methods}
521    This is a list of frequently used methods of the
522    \Data class. A complete list can be fond on \ReferenceGuide.
523  \begin{methoddesc}[Data]{getFunctionSpace}{}  \begin{methoddesc}[Data]{getFunctionSpace}{}
524  returns the \FunctionSpace of the object.  returns the \FunctionSpace of the object.
525  \end{methoddesc}  \end{methoddesc}
526    
527  \begin{methoddesc}[Data]{getFunctionSpace}{}  \begin{methoddesc}[Data]{getDomain}{}
528  returns the \Domain  of the object.  returns the \Domain  of the object.
529  \end{methoddesc}  \end{methoddesc}
530    
# Line 507  Otherwise \False is returned. Line 545  Otherwise \False is returned.
545  \begin{methoddesc}[Data]{setTaggedValue}{tag,value}  \begin{methoddesc}[Data]{setTaggedValue}{tag,value}
546  assigns the \var{value} to all \DataSamplePoints which have the tag  assigns the \var{value} to all \DataSamplePoints which have the tag
547  \var{tag}. \var{value} must be an object of class  \var{tag}. \var{value} must be an object of class
548  \class{numarray.array} or must be convertable into a  \class{numarray.NumArray} or must be convertible into a
549  \class{numarray.array} object. \var{value} (or the cooresponding  \class{numarray.NumArray} object. \var{value} (or the corresponding
550  \class{numarray.array} object) must be of rank $0$ or must have the  \class{numarray.NumArray} object) must be of rank $0$ or must have the
551  same rank like the object.  same rank like the object.
552  If a value has already be defined for tag \var{tag} within the object  If a value has already be defined for tag \var{tag} within the object
553  it is overwritten by the new \var{value}.  If the object is expanded,  it is overwritten by the new \var{value}.  If the object is expanded,
# Line 517  the value assigned to \DataSamplePoints Line 555  the value assigned to \DataSamplePoints
555  \var{value}.  \var{value}.
556  \end{methoddesc}  \end{methoddesc}
557    
558  \begin{methoddesc}[Data]{wherePositive}{}  \begin{methoddesc}[Data]{__str__}{}
559    returns a string representation of the object.
560    \end{methoddesc}
561    
562    \section{Functions of \Data class objects}
563    This section lists the most important functions for \Data class objects \var{a}.
564    A complete list and a more detailed description of the functionality can be fond on \ReferenceGuide.
565    \begin{funcdesc}{saveVTK}{filename,\optional{domain},**data}
566    writes a
567    \end{funcdesc}
568    \begin{funcdesc}{saveDX}{filename,domain=None,**data}
569    \end{funcdesc}
570    \begin{funcdesc}{kronecker}{d}
571    returns a \RankTwo \Data object \var{o} in \FunctionSpace \var{d} such that
572    \begin{equation}
573    o\left[ i,j\right] = \left\{
574    \begin{array}{cc}
575    1 & \mbox{ if } i=j \\
576    0 & \mbox{ otherwise }
577    \end{array}
578    \right.
579    \end{equation}
580    \end{funcdesc}
581    
582    \begin{funcdesc}{identityTensor}{d}
583    \end{funcdesc}
584    \begin{funcdesc}{identityTensor4}{d}
585    \end{funcdesc}
586    \begin{funcdesc}{unitVector}{i,d}
587    \end{funcdesc}
588    
589    \begin{funcdesc}{Lsup}{a}
590    returns the $L^{sup}$ norm of \var{arg}. This is the maximum of the absolute values
591     over all components and all \DataSamplePoints of \var{a}.
592    \end{funcdesc}
593    
594    \begin{funcdesc}{sup}{a}
595    returns the maximum value over all components and all \DataSamplePoints of \var{a}.
596    \end{funcdesc}
597    
598    \begin{funcdesc}{inf}{a}
599    returns the minimum value over all components and all \DataSamplePoints of \var{a}
600    \end{funcdesc}
601    
602    \begin{funcdesc}{sin}{a}
603    applies sine function to \var{a}.
604    \end{funcdesc}
605    
606    \begin{funcdesc}{cos}{a}
607    applies cosine function to \var{a}.
608    \end{funcdesc}
609    
610    \begin{funcdesc}{tan}{a}
611    applies tangent function to \var{a}.
612    \end{funcdesc}
613    
614    \begin{funcdesc}{asin}{a}
615    applies arc (inverse) sine function to \var{a}.
616    \end{funcdesc}
617    
618    \begin{funcdesc}{acos}{a}
619    applies arc (inverse) cosine function to \var{a}.
620    \end{funcdesc}
621    
622    \begin{funcdesc}{atan}{a}
623    applies arc (inverse) tangent function to \var{a}.
624    \end{funcdesc}
625    
626    \begin{funcdesc}{sinh}{a}
627    applies hyperbolic sine function to \var{a}.
628    \end{funcdesc}
629    
630    \begin{funcdesc}{cosh}{a}
631    applies hyperbolic cosine function to \var{a}.
632    \end{funcdesc}
633    
634    \begin{funcdesc}{tanh}{a}
635    applies hyperbolic tangent function to \var{a}.
636    \end{funcdesc}
637    
638    \begin{funcdesc}{asinh}{a}
639    applies arc (inverse) hyperbolic sine function to \var{a}.
640    \end{funcdesc}
641    
642    \begin{funcdesc}{acosh}{a}
643    applies arc (inverse) hyperbolic cosine function to \var{a}.
644    \end{funcdesc}
645    
646    \begin{funcdesc}{atanh}{a}
647    applies arc (inverse) hyperbolic tangent function to \var{a}.
648    \end{funcdesc}
649    
650    \begin{funcdesc}{exp}{a}
651    applies exponential function to \var{a}.
652    \end{funcdesc}
653    
654    \begin{funcdesc}{sqrt}{a}
655    applies square root function to \var{a}.
656    \end{funcdesc}
657    
658    \begin{funcdesc}{log}{a}
659    \end{funcdesc}
660    
661    \begin{funcdesc}{log10}{a}
662    \end{funcdesc}
663    
664    \begin{funcdesc}{sign}{a}
665    \end{funcdesc}
666    
667    \begin{funcdesc}{wherePositive}{a}
668    \end{funcdesc}
669    \begin{funcdesc}{whereNegative}{a}
670    \end{funcdesc}
671    \begin{funcdesc}{whereNonNegative}{a}
672    \end{funcdesc}
673    \begin{funcdesc}{whereNonPositive}{a}
674    \end{funcdesc}
675    \begin{funcdesc}{whereZero}{a,tol=0.}
676    \end{funcdesc}
677    \begin{funcdesc}{whereNonZero}{a,tol=0.}
678    \end{funcdesc}
679    \begin{funcdesc}{minval}{a}
680    \end{funcdesc}
681    \begin{funcdesc}{maxval}{a}
682    \end{funcdesc}
683    \begin{funcdesc}{length}{a}
684    \end{funcdesc}
685    \begin{funcdesc}{trace}{a,axis_offset=0}
686    \end{funcdesc}
687    \begin{funcdesc}{transpose}{a,axis_offset=None}
688    \end{funcdesc}
689    \begin{funcdesc}{symmetric}{a}
690    \end{funcdesc}
691    \begin{funcdesc}{nonsymmetric}{a}
692    \end{funcdesc}
693    \begin{funcdesc}{inverse}{a}
694    \end{funcdesc}
695    \begin{funcdesc}{eigenvalues}{a}
696    \end{funcdesc}
697    \begin{funcdesc}{eigenvalues_and_eigenvectors}{a}
698    \end{funcdesc}
699    \begin{funcdesc}{maximum}{a}
700    \end{funcdesc}
701    \begin{funcdesc}{minimum}{a}
702    \end{funcdesc}
703    \begin{funcdesc}{clip}{a,minval=0.,maxval=1.}
704    \end{funcdesc}
705    \begin{funcdesc}{inner}{a0,a1}
706    \end{funcdesc}
707    \begin{funcdesc}{matrixmult}{a0,a1}
708    \end{funcdesc}
709    \begin{funcdesc}{outer}{a0,a1}
710    \end{funcdesc}
711    \begin{funcdesc}{tensormult}{a0,a1}
712    \end{funcdesc}
713    \begin{funcdesc}{grad}{a,where=None}
714    \end{funcdesc}
715    \begin{funcdesc}{integrate}{a,where=None}
716    \end{funcdesc}
717    \begin{funcdesc}{interpolate}{a,where}
718    \end{funcdesc}
719    \begin{funcdesc}{div}{a,where=None}
720    \end{funcdesc}
721    \begin{funcdesc}{jump}{a,domain=None}
722    \end{funcdesc}
723    \begin{funcdesc}{L2}{a}
724    \end{funcdesc}
725    
726    ====
727    
728    
729    \begin{funcdesc}{wherePositive}{a}
730  returns \Data object which has the same \Shape and is defined on  returns \Data object which has the same \Shape and is defined on
731  the same \FunctionSpace like the object. The returned values are $1$  the same \FunctionSpace like the object. The returned values are $1$
732  where the object is positive and $0$ elsewhere.  where the object is positive and $0$ elsewhere.
733  \end{methoddesc}  \end{funcdesc}
734    
735  \begin{methoddesc}[Data]{wherePositive}{}  \begin{funcdesc}{wherePositive}{a}
736  returns \Data object which has the same \Shape and is defined on  returns \Data object which has the same \Shape and is defined on
737  the same \FunctionSpace like the object. The returned values are $1$  the same \FunctionSpace like the object. The returned values are $1$
738  where the object is non-positive and $0$ elsewhere.  where the object is non-positive and $0$ elsewhere.
739  \end{methoddesc}  \end{funcdesc}
740    
741  \begin{methoddesc}[Data]{whereNonnegative}{}  \begin{funcdesc}{whereNonnegative}{a}
742  returns \Data object which has the same \Shape and is defined on  returns \Data object which has the same \Shape and is defined on
743  the same \FunctionSpace like the object. The returned values are $1$  the same \FunctionSpace like the object. The returned values are $1$
744  where the object is non-negative and $0$ elsewhere.  where the object is non-negative and $0$ elsewhere.
745  \end{methoddesc}  \end{funcdesc}
746    
747  \begin{methoddesc}[Data]{whereNegative}{}  \begin{funcdesc}{whereNegative}{a}
748  returns \Data object which has the same \Shape and is defined on  returns \Data object which has the same \Shape and is defined on
749  the same \FunctionSpace like the object. The returned values are $1$  the same \FunctionSpace like the object. The returned values are $1$
750  where the object is negative and $0$ elsewhere.  where the object is negative and $0$ elsewhere.
751  \end{methoddesc}  \end{funcdesc}
752    
753  \begin{methoddesc}[Data]{whereZero}{tolerance=1.e-8}  \begin{funcdesc}{whereZero}{a,tol=1.e-8}
754  returns \Data object which has the same \Shape and is defined on  returns \Data object which has the same \Shape and is defined on
755  the same \FunctionSpace like the object. The returned values are $1$  the same \FunctionSpace like the object. The returned values are $1$
756  where the object is nearly zero, i.e. where the absolute value is less  where the object is nearly zero, i.e. where the absolute value is less
757  than \var{tolerance}, and $0$ elsewhere.  than \var{tolerance}, and $0$ elsewhere.
758  \end{methoddesc}  \end{funcdesc}
759    
760  \begin{methoddesc}[Data]{whereNonzero}{tolerance=1.e-8}  \begin{funcdesc}{whereNonzero}{tolerance=1.e-8}
761  returns \Data object which has the same \Shape and is defined on  returns \Data object which has the same \Shape and is defined on
762  the same \FunctionSpace like the object. The returned values are $1$  the same \FunctionSpace like the object. The returned values are $1$
763  where the object is nearly non-zero, i.e. where the absolute value is  where the object is nearly non-zero, i.e. where the absolute value is
764  greater or equal than \var{tolerance}, and $0$ elsewhere.  greater or equal than \var{tolerance}, and $0$ elsewhere.
765  \end{methoddesc}  \end{funcdesc}
766    
767  \begin{methoddesc}[Data]{sign}{}  \begin{funcdesc}{sign}{a}
768  returns \Data object which has the same \Shape and is defined on  returns \Data object which has the same \Shape and is defined on
769  the same \FunctionSpace like the object. The returned values are $1$  the same \FunctionSpace like the object. The returned values are $1$
770  where the object is positive, $-1$ where the value is negative and $0$ elsewhere.  where the object is positive, $-1$ where the value is negative and $0$ elsewhere.
771  \end{methoddesc}  \end{funcdesc}
   
 \begin{methoddesc}[Data]{copyWithMask}{arg,mask}  
 copies the \Data object \var{arg} into the object  
 where the \Data object \var{mask} is positive. \var{arg}  
 and \var{mask} must have the same \Shape  
 and must belong to same \FunctionSpace as  
 the object.  
 \end{methoddesc}  
772    
773  \begin{methoddesc}[Data]{Lsup}{}  \begin{funcdesc}{Lsup}{a}
774  returns the $L^{sup}$-norm of the object. This is maximum absolute values over all components and all \DataSamplePoints. \index{$L^{sup}$-norm}.  returns the $L^{sup}$-norm of the object. This is maximum absolute values over all components and all \DataSamplePoints. \index{$L^{sup}$-norm}.
775  \end{methoddesc}  \end{funcdesc}
776  \begin{methoddesc}[Data]{Linf}{}  \begin{funcdesc}{Linf}{a}
777  returns the minimum absolute value over all components and all \DataSamplePoints. \index{$L^{inf}$-norm}.  returns the minimum absolute value over all components and all \DataSamplePoints. \index{$L^{inf}$-norm}.
778  \end{methoddesc}  \end{funcdesc}
779  \begin{methoddesc}[Data]{inf}{}  \begin{funcdesc}{inf}{a}
780  returns the minimum value (infimum) of the object. The minimum is  returns the minimum value (infimum) of the object. The minimum is
781  taken over all components and all \DataSamplePoints .  \index{infimum}  taken over all components and all \DataSamplePoints .  \index{infimum}
782  \end{methoddesc}  \end{funcdesc}
783    
784  \begin{methoddesc}[Data]{sup}{}  \begin{funcdesc}{sup}{a}
785  returns the maximum value (supremum) of the object. The maximum is  returns the maximum value (supremum) of the object. The maximum is
786  taken over all components and all \DataSamplePoints .  \index{supremum}  taken over all components and all \DataSamplePoints .  \index{supremum}
787  \end{methoddesc}  \end{funcdesc}
788    
789  \begin{methoddesc}[Data]{grad}{\optional{on}}  \begin{funcdesc}{grad}{a,\optional{where}}
790  returns the gradient of the function represented by the object.  returns the gradient of the function represented by the object.
791  \Data object is in \FunctionSpace \var{on} and has rank r+1 where r is the rank of the object.  \Data object is in \FunctionSpace \var{on} and has rank r+1 where r is the rank of the object.
792  If \var{on} is not present, a suitbale \FunctionSpace is used.  If \var{on} is not present, a suitbale \FunctionSpace is used.
793  \index{gradient}  \index{gradient}
794  \end{methoddesc}  \end{funcdesc}
795    
796  \begin{methoddesc}[Data]{integrate}{}  \begin{funcdesc}{integrate}{a,\optional{where}}
797  returns the integral of the function represented by the object. The method returns  returns the integral of the function represented by the object. The method returns
798  a \class{numarray.array} object of the same \Shape like the object.  A  a \class{numarray.NumArray} object of the same \Shape like the object.  A
799  component of the returned object is the integral of the corresponding  component of the returned object is the integral of the corresponding
800  component of the object. \index{integral}  component of the object. \index{integral}
801  \end{methoddesc}  \end{funcdesc}
802    
803  \begin{methoddesc}[Data]{interpolate}{on}  \begin{funcdesc}{interpolate}{a,where}
804  interpolates  interpolates
805  the function represented by the object  the function represented by the object
806  into the \FunctionSpace\var{on}.  into the \FunctionSpace\var{where}.
807  \index{interpolation}  \index{interpolation}
808  \end{methoddesc}  \end{funcdesc}
809    
810  \begin{methoddesc}[Data]{abs}{}  \begin{funcdesc}{abs}{a}
811  applies the absolute value function to the object. The  applies the absolute value function to the object. The
812  return \Data object has the same \Shape and is in the same  return \Data object has the same \Shape and is in the same
813  \FunctionSpace like the object. For all \DataSamplePoints and all  \FunctionSpace like the object. For all \DataSamplePoints and all
814  components the value is calculated by applying the exponential  components the value is calculated by applying the exponential
815  function. \index{function!absolute value}  function. \index{function!absolute value}
816  \end{methoddesc}  \end{funcdesc}
817    
818  \begin{methoddesc}[Data]{exp}{}  \begin{funcdesc}{exp}{a}
819  applies the exponential function to the object. The  applies the exponential function to the object. The
820  return \Data object has the same \Shape and is in the same  return \Data object has the same \Shape and is in the same
821  \FunctionSpace like the object. For all \DataSamplePoints and all  \FunctionSpace like the object. For all \DataSamplePoints and all
822  components the value is calculated by applying the exponential  components the value is calculated by applying the exponential
823  function. \index{function!exponential}  function. \index{function!exponential}
824  \end{methoddesc}  \end{funcdesc}
825    
826  \begin{methoddesc}[Data]{sqrt}{}  \begin{funcdesc}{sqrt}{a}
827  applies the square root function to the object. The  applies the square root function to the object. The
828  return \Data object has the same \Shape and is in the same  return \Data object has the same \Shape and is in the same
829  \FunctionSpace like the object. For all \DataSamplePoints and all  \FunctionSpace like the object. For all \DataSamplePoints and all
830  components the value is calculated by applying the square root function.  components the value is calculated by applying the square root function.
831  An exception is  An exception is
832  raised if the value is negative.  \index{function!square root}  raised if the value is negative.  \index{function!square root}
833  \end{methoddesc}  \end{funcdesc}
834    
835  \begin{methoddesc}[Data]{sin}{}  \begin{funcdesc}{sin}{a}
836  applies the sine function to the object. The  applies the sine function to the object. The
837  return \Data object has the same \Shape and is in the same  return \Data object has the same \Shape and is in the same
838  \FunctionSpace like the object. For all \DataSamplePoints and all  \FunctionSpace like the object. For all \DataSamplePoints and all
839  components the value is calculated by applying the sine function. \index{function!sine}  components the value is calculated by applying the sine function. \index{function!sine}
840  \end{methoddesc}  \end{funcdesc}
841    
842  \begin{methoddesc}[Data]{cos}{}  \begin{funcdesc}{cos}{a}
843  applies the cosine function to the object. The  applies the cosine function to the object. The
844  return \Data object has the same \Shape and is in the same  return \Data object has the same \Shape and is in the same
845  \FunctionSpace like the object. For all \DataSamplePoints and all  \FunctionSpace like the object. For all \DataSamplePoints and all
846  components the value is calculated by applying the cosine function. \index{function!cosine}  components the value is calculated by applying the cosine function. \index{function!cosine}
847  \end{methoddesc}  \end{funcdesc}
848    
849  \begin{methoddesc}[Data]{tan}{}  \begin{funcdesc}{tan}{a}
850  applies the tangent function to the object. The  applies the tangent function to the object. The
851  return \Data object has the same \Shape and is in the same  return \Data object has the same \Shape and is in the same
852  \FunctionSpace like the object. For all \DataSamplePoints and all  \FunctionSpace like the object. For all \DataSamplePoints and all
853  components the value is calculated by applying the tangent function. \index{function!tangent}  components the value is calculated by applying the tangent function. \index{function!tangent}
854  \end{methoddesc}  \end{funcdesc}
855    
856  \begin{methoddesc}[Data]{log}{}  \begin{funcdesc}{log}{a}
857  applies the logarithmic function to the object. The  applies the logarithmic function to the object. The
858  return \Data object has the same \Shape and is in the same  return \Data object has the same \Shape and is in the same
859  \FunctionSpace like the object. For all \DataSamplePoints and all  \FunctionSpace like the object. For all \DataSamplePoints and all
860  components the value is calculated by applying the logarithmic function. An exception is  components the value is calculated by applying the logarithmic function. An exception is
861  raised if the value is negative.\index{function!logarithmic}  raised if the value is negative.\index{function!logarithmic}
862  \end{methoddesc}  \end{funcdesc}
863    
864  \begin{methoddesc}[Data]{maxval}{}  \begin{funcdesc}{maxval}{}
865  returns the maximum value over all components. The  returns the maximum value over all components. The
866  return value is a \Data object of rank 0  return value is a \Data object of rank 0
867  and is in the same  and is in the same
868  \FunctionSpace like the object. For all \DataSamplePoints  \FunctionSpace like the object. For all \DataSamplePoints
869  the value is calculated as the maximum value over all components. \index{function!maximum}  the value is calculated as the maximum value over all components. \index{function!maximum}
870  \end{methoddesc}  \end{funcdesc}
871    
872  \begin{methoddesc}[Data]{minval}{}  \begin{funcdesc}{minval}{}
873  returns the minimum value over all components. The  returns the minimum value over all components. The
874  return value is a \Data object of rank 0  return value is a \Data object of rank 0
875  and is in the same  and is in the same
876  \FunctionSpace like the object. For all \DataSamplePoints  \FunctionSpace like the object. For all \DataSamplePoints
877  the value is calculated as the minimum value over all components. \index{function!minimum}  the value is calculated as the minimum value over all components. \index{function!minimum}
878  \end{methoddesc}  \end{funcdesc}
879    
880  \begin{methoddesc}[Data]{length}{}  \begin{funcdesc}{length}{}
881  returns the Euclidean length at all \DataSamplePoints. The  returns the Euclidean length at all \DataSamplePoints. The
882  return value is a \Data object of rank 0  return value is a \Data object of rank 0
883  and is in the same  and is in the same
884  \FunctionSpace like the object. For all \DataSamplePoints  \FunctionSpace like the object. For all \DataSamplePoints
885  the value is calculated as the square root of the sum of the square over all over all components. \index{function!length}  the value is calculated as the square root of the sum of the square over all over all components. \index{function!length}
886  \end{methoddesc}  \end{funcdesc}
887  \begin{methoddesc}[Data]{transpose}{axis}  \begin{funcdesc}{transpose}{axis}
888  returns the transpose of the object around \var{axis}. \var{axis} is a non-negative integer  returns the transpose of the object around \var{axis}. \var{axis} is a non-negative integer
889  which is less the rank $r$ of the object. Transpose swaps the indexes $0$ to \var{axis}  which is less the rank $r$ of the object. Transpose swaps the indexes $0$ to \var{axis}
890  with the indexes \var{axis}+1 to $r$. If the \var{d} is \RankFour one has  with the indexes \var{axis}+1 to $r$. If the \var{d} is \RankFour one has
# Line 694  d[i,j,k,l]=d.transpose(2)[k,l,i,j] Line 895  d[i,j,k,l]=d.transpose(2)[k,l,i,j]
895  d[i,j,k,l]=d.transpose(3)[l,i,j,k]  d[i,j,k,l]=d.transpose(3)[l,i,j,k]
896  \end{python}  \end{python}
897  \index{function!transpose}  \index{function!transpose}
898  \end{methoddesc}  \end{funcdesc}
899    
900  \begin{methoddesc}[Data]{trace}{}  \begin{funcdesc}{trace}{}
901  returns sum of the components with identical indexes.  returns sum of the components with identical indexes.
902  The  The
903  return value is a \Data object of rank 0  return value is a \Data object of rank 0
904  and is in the same  and is in the same
905  \FunctionSpace like the object.  \FunctionSpace like the object.
906  \index{function!trace}  \index{function!trace}
907  \end{methoddesc}  \end{funcdesc}
908  \begin{methoddesc}[Data]{saveDX}{fileName}  \begin{funcdesc}{saveDX}{fileName}
909  saves the object to an openDX format file of name \var{fileName}, see  saves the object to an openDX format file of name \var{fileName}, see
910  \ulink{www.opendx.org}{\url{www.opendx.org}}.  \index{openDX}  \ulink{www.opendx.org}{\url{www.opendx.org}}.  \index{openDX}
 \end{methoddesc}  
   
   
 For convenience the following factories are provided to created \Data object:  
   
 \begin{funcdesc}{Scalar}{value=0.,what=escript::FunctionSpace(),expand=\False}  
 returns a \Data object of rank 0 in the \FunctionSpace \var{what}.  
 Values are initialed with the double \var{value}. If \var{expanded} is \True  
 the \Data object is represented in expanded from.  
 \end{funcdesc}  
   
 \begin{funcdesc}{Vector}{value=0.,what=escript::FunctionSpace(),expand=\False}  
 returns a \Data object of \Shape \var{(d,)} in the \FunctionSpace \var{what}  
 where \var{d} is the spatial dimension of the \Domain of \var{what}.  
 Values are initialed with the double \var{value}. If \var{expanded} is \True  
 the \Data object is represented in expanded from.  
911  \end{funcdesc}  \end{funcdesc}
912    
 \begin{funcdesc}{Tensor}{value=0.,what=escript::FunctionSpace(),expand=\False}  
 returns a \Data object of \Shape \var{(d,d)} in the \FunctionSpace \var{what}  
 where \var{d} is the spatial dimension of the \Domain of \var{what}.  
 Values are initialed with the double \var{value}. If \var{expanded} is \True  
 the \Data object is represented in expanded from.  
 \end{funcdesc}  
   
 \begin{funcdesc}{Tensor3}{value=0.,what=escript::FunctionSpace(),expand=\False}  
 returns a \Data object of \Shape \var{(d,d,d)} in the \FunctionSpace \var{what}  
 where \var{d} is the spatial dimension of the \Domain of \var{what}.  
 Values are initialed with the double \var{value}. If \var{expanded} is \True  
 the \Data object is re\var{arg}presented in expanded from.  
 \end{funcdesc}  
   
 \begin{funcdesc}{Tensor4}{value=0.,what=escript::FunctionSpace(),expand=\False}  
 returns a \Data object of \Shape \var{(d,d,d,d)} in the \FunctionSpace \var{what}  
 where \var{d} is the spatial dimension of the \Domain of \var{what}.  
 Values are initialed with the double \var{value}. If \var{expanded} is \True  
 the \Data object is represented in expanded from.  
 \end{funcdesc}  
913    
914  \begin{funcdesc}{abs}{arg}  \begin{funcdesc}{abs}{arg}
915  returns the absolute value of \var{arg} where \var{arg}  returns the absolute value of \var{arg} where \var{arg}
# Line 825  returns the mimumum over all components Line 990  returns the mimumum over all components
990  is a \Data object.  is a \Data object.
991  \end{funcdesc}  \end{funcdesc}
992    
   
993  \begin{funcdesc}{L2}{arg}  \begin{funcdesc}{L2}{arg}
994  returns the $L^2$ norm of \var{arg}. This is the square root  returns the $L^2$ norm of \var{arg}. This is the square root
995  of the sum of the squared value over all components and all  of the sum of the squared value over all components and all

Legend:
Removed from v.155  
changed lines
  Added in v.593

  ViewVC Help
Powered by ViewVC 1.1.26