next up previous contents index
Next: When to use it Up: Lazy Evaluation Previous: Lazy Evaluation   Contents   Index

How to use it

To have lazy evaluation applied automatically, put the following command in your script after the imports.


\begin{python}
from esys.escript import setEscriptParamInt
setEscriptParamInt('AUTOLAZY',1)
\end{python}

To get greater benefit, some fine tuning may be required. If your simulation involves iterating for a number of timesteps, you will probably have some state variables which are updated in each iteration based on their value in the previous iteration. For example:


\begin{python}
x=f(x_previous)
y=g(x)
z=h(y,x, ...)
\end{python}

Could be modified to:


\begin{python}
x=f(x_previous)
resolve(x)
y=g(x)
z=h(y,x, ...)
\end{python}

The resolve command forces x to be evaluated immediately.


next up previous contents index
Next: When to use it Up: Lazy Evaluation Previous: Lazy Evaluation   Contents   Index
esys@esscc.uq.edu.au