/[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 3025 by ahallam, Thu May 6 01:20:46 2010 UTC revision 3054 by ahallam, Wed Jun 30 02:22:25 2010 UTC
# Line 30  The Laplacian opperator which can be wri Line 30  The Laplacian opperator which can be wri
30  calculated via the divergence of the gradient of the object, which is in this  calculated via the divergence of the gradient of the object, which is in this
31  example $p$. Thus we can write;  example $p$. Thus we can write;
32  \begin{equation}  \begin{equation}
33   \nabla^2 p = \nabla \cdot \nabla p = \frac{\partial^2 p}{\partial   \nabla^2 p = \nabla \cdot \nabla p =
34  x^2\hackscore{i}}      \sum\hackscore{i}^n
35        \frac{\partial^2 p}{\partial x^2\hackscore{i}}
36   \label{eqn:laplacian}   \label{eqn:laplacian}
37  \end{equation}  \end{equation}
38  For the two dimensional case in Cartesian coordinates \refEq{eqn:laplacian}  For the two dimensional case in Cartesian coordinates \refEq{eqn:laplacian}
# Line 66  pressure field which acts in the directi Line 67  pressure field which acts in the directi
67  \end{equation}  \end{equation}
68    
69  \refEq{eqn:grad} corresponds to the Linear PDE general form value  \refEq{eqn:grad} corresponds to the Linear PDE general form value
70  $X$. Notice however that the gernal form contains the term $X \hackscore{i,j}$,  $X$. Notice however that the general form contains the term $X
71    \hackscore{i,j}$\footnote{This is the first derivative in the $j^{th}$
72    direction for the $i^{th}$ component of the solution.},
73  hence for a rank 0 object there is no need to do more than calculate the  hence for a rank 0 object there is no need to do more than calculate the
74  gradient and submit it to the solver. In the case of the rank 1 or greater  gradient and submit it to the solver. In the case of the rank 1 or greater
75  object, it is nesscary to calculate the trace also. This is the sum of the  object, it is nesscary to calculate the trace also. This is the sum of the
# Line 134  problems. Line 137  problems.
137  This requirement makes the wave equation arduous to  This requirement makes the wave equation arduous to
138  solve numerically due to the large number of time iterations required in each  solve numerically due to the large number of time iterations required in each
139  solution. Models with very high velocities and frequencies will be the worst  solution. Models with very high velocities and frequencies will be the worst
140  effected by this problem.  affected by this problem.
141    
142  \section{Displacement Solution}  \section{Displacement Solution}
143  \sslist{example07a.py}  \sslist{example07a.py}
# Line 232  pl.axis([xc[0]-src_radius*3,xc[0]+src_ra Line 235  pl.axis([xc[0]-src_radius*3,xc[0]+src_ra
235  pl.savefig(os.path.join(savepath,"source_line.png"))  pl.savefig(os.path.join(savepath,"source_line.png"))
236  \end{python}  \end{python}
237  \begin{figure}[h]  \begin{figure}[h]
238   \includegraphics[width=5in]{figures/sourceline.png}   \centering
239    FIXME PLEASE!
240    % \includegraphics[width=6in]{figures/sourceline.png}
241   \caption{Cross section of the source function.}   \caption{Cross section of the source function.}
242   \label{fig:cxsource}   \label{fig:cxsource}
243  \end{figure}  \end{figure}
# Line 245  function. Line 250  function.
250  \begin{python}  \begin{python}
251   rec=Locator(mydomain,[250.,250.])   rec=Locator(mydomain,[250.,250.])
252  \end{python}  \end{python}
253   When the solution \verb u  is update we can extract the value at that point   When the solution \verb u  is updated we can extract the value at that point
254  via;  via;
255  \begin{python}  \begin{python}
256   u_rec=rec.getValue(u)   u_rec=rec.getValue(u)
# Line 265  the \verb Locator  function. Line 270  the \verb Locator  function.
270  \sslist{example07b.py}  \sslist{example07b.py}
271    
272  An alternative method is to solve for the acceleration $\frac{\partial ^2  An alternative method is to solve for the acceleration $\frac{\partial ^2
273  p}{\partial t^2}$ directly, and derive the the displacement solution from the  p}{\partial t^2}$ directly, and derive the displacement solution from the
274  PDE solution. \refEq{eqn:waveu} is thus modified;  PDE solution. \refEq{eqn:waveu} is thus modified;
275  \begin{equation}  \begin{equation}
276    \nabla ^2 p - \frac{1}{c^2} a = 0    \nabla ^2 p - \frac{1}{c^2} a = 0
# Line 277  After each iteration the displacement is Line 282  After each iteration the displacement is
282   p\hackscore{(t+1)}=2p\hackscore{(t)} - p\hackscore{(t-1)} + h^2a   p\hackscore{(t+1)}=2p\hackscore{(t)} - p\hackscore{(t-1)} + h^2a
283  \end{equation}  \end{equation}
284    
285    \subsection{Lumping}
286  For \esc, the acceleration solution is prefered as it allows the use of matrix  For \esc, the acceleration solution is prefered as it allows the use of matrix
287  lumping. Lumping or mass lumping as it is sometimes known, is the process of  lumping. Lumping or mass lumping as it is sometimes known, is the process of
288  aggressively approximating the density elements of a mass matrix into the main  aggressively approximating the density elements of a mass matrix into the main
289  diagonal. The use of Lumping is motivaed by the simplicity of diagonal matrix  diagonal. The use of Lumping is motivaed by the simplicity of diagonal matrix
290   inversion. As a result, Lumping can significantly reduce the computational   inversion. As a result, Lumping can significantly reduce the computational
291  requirements of a problem.  requirements of a problem. Care should be taken however, as this
292    function can only be used when the $A$, $B$ and $C$ coefficients of the
293    general form are zero.
294    
295  To turn lumping on in \esc one can use the command;  To turn lumping on in \esc one can use the command;
296  \begin{python}  \begin{python}

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

  ViewVC Help
Powered by ViewVC 1.1.26