/[escript]/trunk/doc/cookbook/example07.tex
ViewVC logotype

Diff of /trunk/doc/cookbook/example07.tex

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

revision 3054 by ahallam, Wed Jun 30 02:22:25 2010 UTC revision 3063 by ahallam, Thu Jul 15 02:57:46 2010 UTC
# Line 76  object, it is nesscary to calculate the Line 76  object, it is nesscary to calculate the
76  diagonal in \refeq{eqn:gradrank1}.  diagonal in \refeq{eqn:gradrank1}.
77    
78  Thus when solving for equations containing the Laplacian one of two things must  Thus when solving for equations containing the Laplacian one of two things must
79  be completed. If the object \verb p   is less than rank 1 the gradient is  be completed. If the object \verb!p! is less than rank 1 the gradient is
80  calculated via;  calculated via;
81  \begin{python}  \begin{python}
82   gradient=grad(p)  gradient=grad(p)
83  \end{python}  \end{python}
84  and if the object is greater thank or equal to a rank 1 tensor, the trace of  and if the object is greater thank or equal to a rank 1 tensor, the trace of
85  the gradient is calculated.  the gradient is calculated.
# Line 206  initial conditions of the model to VTK, Line 206  initial conditions of the model to VTK,
206  suface in mayavi. The second is to take a cross section of the model.  suface in mayavi. The second is to take a cross section of the model.
207    
208  For the later, we will require the \textit{Locator} function.  For the later, we will require the \textit{Locator} function.
209  First \verb Locator  must be imported;  First \verb!Locator! must be imported;
210  \begin{python}  \begin{python}
211   from esys.escript.pdetools import Locator   from esys.escript.pdetools import Locator
212  \end{python}  \end{python}
# Line 222  for i in range(ndx/2-ndx/10,ndx/2+ndx/10 Line 222  for i in range(ndx/2-ndx/10,ndx/2+ndx/10
222      cut_loc.append(xstep*i)      cut_loc.append(xstep*i)
223      src_cut.append([xstep*i,xc[1]])      src_cut.append([xstep*i,xc[1]])
224  \end{python}  \end{python}
225  We then submit the output to \verb Locator  and finally return the appropriate  We then submit the output to \verb!Locator! and finally return the appropriate
226  values using the \verb getValue  function.  values using the \verb!getValue! function.
227  \begin{python}  \begin{python}
228   src=Locator(mydomain,src_cut)   src=Locator(mydomain,src_cut)
229  src_cut=src.getValue(u)  src_cut=src.getValue(u)
# Line 236  pl.savefig(os.path.join(savepath,"source Line 236  pl.savefig(os.path.join(savepath,"source
236  \end{python}  \end{python}
237  \begin{figure}[h]  \begin{figure}[h]
238   \centering   \centering
239  FIXME PLEASE!      \includegraphics[width=6in]{figures/sourceline.png}
 % \includegraphics[width=6in]{figures/sourceline.png}  
240   \caption{Cross section of the source function.}   \caption{Cross section of the source function.}
241   \label{fig:cxsource}   \label{fig:cxsource}
242  \end{figure}  \end{figure}
# Line 255  via; Line 254  via;
254  \begin{python}  \begin{python}
255   u_rec=rec.getValue(u)   u_rec=rec.getValue(u)
256  \end{python}  \end{python}
257  For consecutive time steps one can record the values from \verb u_rec  in an  For consecutive time steps one can record the values from \verb!u_rec! in an
258  array initialised as \verb u_rec0=[]  with;  array initialised as \verb!u_rec0=[]! with;
259  \begin{python}  \begin{python}
260    u_rec0.append(rec.getValue(u))    u_rec0.append(rec.getValue(u))
261  \end{python}  \end{python}
262    
263  It can be useful to monitor the value at a single or multiple individual points  It can be useful to monitor the value at a single or multiple individual points
264  in the model during the modelling process. This is done using  in the model during the modelling process. This is done using
265  the \verb Locator  function.  the \verb!Locator! function.
266    
267    
268  \section{Acceleration Solution}  \section{Acceleration Solution}

Legend:
Removed from v.3054  
changed lines
  Added in v.3063

  ViewVC Help
Powered by ViewVC 1.1.26