next up previous contents index
Next: Solver Options Up: The Module esys.escript.linearPDEs Previous: The Lame Class   Contents   Index

Projection

extensionesys.escript.pdetools

Using the LinearPDE class provides an option to change the FunctionSpace attribute in addition to the standard interpolation mechanism as discussed on in Chapter 3. If one looks the stripped down version

$\displaystyle u = Y$ (100)

of the general scalar PDE 4.1 (boundary conditions are irrelevant) one can see the solution $ u$ of this PDE as a project of the input function $ Y$ which has the general FunctionSpace attribute to a function with the solution FunctionSpace or reduced solution FunctionSpace attribute. In fact, the solution maps values defined at element centers representing a possibly discontinuous function onto a continuous function represented by its values at the nodes of the FEM mesh. This mapping is called a projection. Projection can be a useful tool but needs to be applied with some care due to the fact that a potentially discontinuous function is projected onto a continuous function but it can also be a desirable effect for instance to smooth a function. The projection of the gradient of a function typically calculated on the element center to the nodes of a FEM mesh can be evaluated on the domain boundary and so projection provides a tool to extrapolate the gradient from the internal to the boundary. This is only a reasonable procedure in the absence of singularities at the boundary.

As projection is used often in simulations esys.escript provides an easy to use class Projector which is part of the esys.escript.pdetools module. The following script demonstrates the usage of the class to project the piecewise constant function ($ =1$ for $ x\hackscore{0}\ge 0.5$ and $ =-1$ for $ x\hackscore{0}<0.5$ ) to a function with the reduced solution FunctionSpace attribute (default target)
\begin{python}
from esys.escript.pdetools import Projector
proj=Projector(domain...
...sitive(x0-0.5)
u=proj.getValue(jmp)
...
By default the class uses lumping to solve the PDE 4.26. This technique is faster then using the standard solver techniques of PDEs. In essence it leads to using the average of neighbor element values to calculate the value at each FEM node.

The following script illustrate how to evaluate the normal stress on the boundary from a given displacement field u:
\begin{python}
from esys.escript.pdetools import Projector
u=...
proj=Projector(...
...in())
normal_stress = inner(u.getDomin().getNormal(), proj(stress))
\end{python}


\begin{classdesc}
% latex2html id marker 7266
{Projector}{domain\optional{, redu...
...ignificant less
compute time and memory. The class is callable.
\end{classdesc}


\begin{methoddesc}
% latex2html id marker 7274
[Projector]{getSolverOptions}{}
r...
...econditioner, see Section~\ref{SEC Solver Options} for details.
\end{methoddesc}


\begin{methoddesc}[Projector]{getValue}{input_data}
projects the \var{input_data...
... an instance
of the class with argument \var{input_data}:
\par
\end{methoddesc}


next up previous contents index
Next: Solver Options Up: The Module esys.escript.linearPDEs Previous: The Lame Class   Contents   Index
esys@esscc.uq.edu.au