Data Class

The following table shows binary and unitary operations that can be applied to Data objects:
\begin{tableii}{l\vert l}{textrm}{expression}{Description}
\lineii{+\var{arg0}} ...
...r{arg1}} {raises \var{arg0} to the power of \var{arg1} \index{**}}
\end{tableii}
At least one of the arguments arg0 or arg1 must be a Data object. One of the arguments may be an object that can be converted into a Data object. If arg0 or arg1 are defined on different FunctionSpace an attempt is made to embed arg0 into the FunctionSpace of arg1 or to embed arg1 into the FunctionSpace of arg0. Boths arguments must have the same shape or one of the arguments my be of rank 0. In the latter case it is assumed that the particular argument is of the same shape as the other argument but constant over all components.

The returned Data object has the same shape and is defined on the data sample points as arg0 or arg1.

The following table shows the update operations that can be applied to Data objects:
\begin{tableii}{l\vert l}{textrm}{expression}{Description}
\lineii{\var{arg0}+=\...
...r{arg0}**=\var{arg2}} {raises \var{arg0} by \var{arg2} \index{**}}
\end{tableii}
arg0 must be a Data object. arg1 must be a Data object or an object that can be converted into a Data object. arg1 must have the same shape like arg1 or has rank 0. In the latter case it is assumed that the values of arg1 are constant for all components. arg1 must be defined in the same FunctionSpace as arg0 or it must be possible to interpolate arg1 onto the FunctionSpace of arg1.

The Data class supports getting slices as well as assigning new values to components in an existing Data object. The following expression for getting (expression on the right hand side of the equal sign) and setting slices (expression on the left hand side of the equal sign) are valid:
\begin{tableiii}{l\vert ll}{textrm}{rank of \var{arg}}{slicing expression}{shape...
...-\var{l0},\var{u1}-\var{l1},\var{u2}-\var{l2},\var{u3}-\var{l3})}
\end{tableiii}
where $ 0 \le \var{l0} \le \var{u0} \le \var{s[0]}$, $ 0 \le \var{l1} \le \var{u1} \le \var{s[1]}$, $ 0 \le \var{l2} \le \var{u2} \le \var{s[2]}$, $ 0 \le \var{l3} \le \var{u3} \le \var{s[3]}$ and s the shape if arg. Any of the lower indexes l0, l1, l2 and l3 may not be present in which case 0 is assumed. Any of the upper indexes u0, u1, u2 and u3 may not be present in which case s is assumed. The lower and upper index may be identical, in which case the column and the lower or upper index may be dropped. In the returned or in the object assigned to a slice the corresponding component is dropped, i.e. the rank is reduced by one in comparison to arg. The following examples show slicing usage:
\begin{python}
t=Data(1.,(4,4,6,6),Function(mydomain))
t[1,1,1,0]=9.
s=t[:2,:,2:6,5]  ...



Subsections
esys@esscc.uq.edu.au