# Diff of /trunk/doc/user/wave.tex

revision 3378 by caltinay, Mon Nov 1 05:21:18 2010 UTC revision 3379 by gross, Wed Nov 24 04:48:49 2010 UTC
# Line 1  Line 1
1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Copyright (c) 2003-2010 by University of Queensland
% Earth Systems Science Computational Center (ESSCC)
% http://www.uq.edu.au/esscc
%
% Primary Business: Queensland, Australia
% Licensed under the Open Software License version 3.0
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section{3-D Wave Propagation}
\label{WAVE CHAP}
2
3  In this next example we want to calculate the displacement field $u_{i}$ for any time $t>0$ by solving the wave equation:\index{wave equation}  In this next example we want to calculate the displacement field $u_{i}$ for any time $t>0$ by solving the wave equation:\index{wave equation}
4  \begin{eqnarray}\label{WAVE general problem}  \begin{eqnarray}\label{WAVE general problem}
# Line 144  of the problem. Line 129  of the problem.
129       x=domain.getX()       x=domain.getX()
130       # ... open new PDE ...       # ... open new PDE ...
131       mypde=LinearPDE(domain)       mypde=LinearPDE(domain)
132       mypde.getSolverOptions().setSolverMethod(mypde.getSolverOptions().LUMPING)       mypde.getSolverOptions().setSolverMethod(mypde.getSolverOptions().HRZ_LUMPING)
133       kronecker=identity(mypde.getDim())       kronecker=identity(mypde.getDim())
134       dunit=numpy.array([1., 0., 0.]) # defines direction of point source       dunit=numpy.array([1., 0., 0.]) # defines direction of point source
# Line 205  information as much as possible when ite Line 190  information as much as possible when ite
190
191  The statement  The statement
192  \begin{python}  \begin{python}
193    mypde.getSolverOptions().setSolverMethod(mypde.getSolverOptions().LUMPING)    mypde.getSolverOptions().setSolverMethod(mypde.getSolverOptions().HRZ_LUMPING)
194  \end{python}  \end{python}
195  switches on the use of an aggressive approximation of the PDE operator as a  switches on the use of an aggressive approximation of the PDE operator as a
196  diagonal matrix formed from the coefficient \var{D}.  diagonal matrix formed from the coefficient \var{D}.
197  The approximation allows, at the cost of additional error, very fast solution  The approximation allows, at the cost of additional error, very fast solution
198  of the PDE.  of the PDE, see also Section~\ref{REMARKS ON LUMPING}.
199  When using lumping the presence of \var{A}, \var{B} or \var{C} will produce
wrong results.

200  There are a few new \escript functions in this example:  There are a few new \escript functions in this example:
201  \code{grad(u)} returns the gradient $u_{i,j}$ of $u$ (in fact \var{grad(g)[i,j]}$==u_{i,j}$).  \code{grad(u)} returns the gradient $u_{i,j}$ of $u$ (in fact \var{grad(g)[i,j]}$==u_{i,j}$).
202  There are restrictions on the argument of the \function{grad} function, for  There are restrictions on the argument of the \function{grad} function, for
# Line 261  suffer from stability problems. Line 244  suffer from stability problems.
244  Therefore they require a very careful selection of the time step size $h$.  Therefore they require a very careful selection of the time step size $h$.
245
246  An easy, heuristic way of choosing an appropriate time step size is the  An easy, heuristic way of choosing an appropriate time step size is the
247  Courant condition\index{Courant condition}\index{explicit scheme!Courant condition}  Courantâ€“Friedrichsâ€“Lewy condition (CFL condition)\index{Courant condition}\index{explicit scheme!Courant condition}
248  which says that within a time step information should not travel further than  which says that within a time step information should not travel further than
249  a cell used in the discretization scheme.  a cell used in the discretization scheme.
250  In the case of the wave equation the velocity of a (p-) wave is given as  In the case of the wave equation the velocity of a (p-) wave is given as
# Line 321  elements over the brick $[0,l_0] \times Line 304 elements over the brick$[0,l_0] \times
304            wavePropagation(mydomain, h, tend, lam, mu, rho, xc, src_radius, U0)            wavePropagation(mydomain, h, tend, lam, mu, rho, xc, src_radius, U0)
305  \end{python}  \end{python}
306  The \function{domain.getSize()} function returns the local element size $\Delta x$.  The \function{domain.getSize()} function returns the local element size $\Delta x$.
307  Using \function{inf} ensures that the Courant condition~\ref{WAVE dyn 66} holds  Using \function{inf} ensures that the CFL condition~\ref{WAVE dyn 66} \index{Courant number}\index{CFL condition} holds
308  everywhere in the domain.  everywhere in the domain.
309
310  The script is available as \file{wave.py} in the \ExampleDirectory\index{scripts!\file{wave.py}}.  The script is available as \file{wave.py} in the \ExampleDirectory\index{scripts!\file{wave.py}}.

Legend:
 Removed from v.3378 changed lines Added in v.3379