/[escript]/trunk/doc/user/diffusion.tex
ViewVC logotype

Diff of /trunk/doc/user/diffusion.tex

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

revision 624 by gross, Fri Mar 17 05:48:59 2006 UTC revision 625 by gross, Thu Mar 23 00:41:25 2006 UTC
# Line 1  Line 1 
1  % $Id$  % $Id$
2    %
3    %           Copyright © 2006 by ACcESS MNRF
4    %               \url{http://www.access.edu.au
5    %         Primary Business: Queensland, Australia.
6    %   Licensed under the Open Software License version 3.0
7    %      http://www.opensource.org/licenses/osl-3.0.php
8    %
9    
10  \section{The Diffusion Problem}  \section{The Diffusion Problem}
11  \label{DIFFUSION CHAP}  \label{DIFFUSION CHAP}
12    
# Line 121  is called the Helmholtz equation \index{ Line 129  is called the Helmholtz equation \index{
129    
130  We want to use the \LinearPDE class provided by \escript to define and solve a general linear,steady, second order PDE such as the  We want to use the \LinearPDE class provided by \escript to define and solve a general linear,steady, second order PDE such as the
131  Helmholtz equation. For a single PDE the \LinearPDE class supports the following form:  Helmholtz equation. For a single PDE the \LinearPDE class supports the following form:
132  \begin{equation}\label{LINEARPDE.SINGLE.1}  \begin{equation}\label{LINEARPDE.SINGLE.1 TUTORIAL}
133  -(A\hackscore{jl} u\hackscore{,l})\hackscore{,j}+(B\hackscore{j} u)\hackscore{,j}+C\hackscore{l} u\hackscore{,l}+D u =-X\hackscore{j,j}+Y \; .  -(A\hackscore{jl} u\hackscore{,l})\hackscore{,j}+D u = Y \; .
134  \end{equation}  \end{equation}
135  The coefficients $A$, $B$, $C$, $D$, $X$ and $Y$ have to be specified through \Data objects in the  where we show only the coefficients relevant for the problem discussed here. For the general form of
136    single PDE see \eqn{LINEARPDE.SINGLE.1}.
137    The coefficients $A$, and $Y$ have to be specified through \Data objects in the
138  \Function on the PDE or objects that can be converted into such \Data objects.  \Function on the PDE or objects that can be converted into such \Data objects.
139  $A$ is a \RankTwo, $B$, $C$ and $X$ are \RankOne and $D$ and $Y$ are scalar.  $A$ is a \RankTwo and $D$ and $Y$ are scalar.
140  The following natural  The following natural
141  boundary conditions are considered \index{boundary condition!natural} on $\Gamma$:  boundary conditions are considered \index{boundary condition!natural} on $\Gamma$:
142  \begin{equation}\label{LINEARPDE.SINGLE.2}  \begin{equation}\label{LINEARPDE.SINGLE.2 TUTORIAL}
143  n\hackscore{j}(A\hackscore{jl} u\hackscore{,l}+B\hackscore{j} u)+d u=n\hackscore{j}X\hackscore{j} + y  \;.  n\hackscore{j}A\hackscore{jl} u\hackscore{,l}+d u= y  \;.
144  \end{equation}  \end{equation}
145  Notice that the coefficients $A$, $B$ and $X$ are the same like in the PDE~\eqn{LINEARPDE.SINGLE.1}. The coefficients $d$ and $y$ are    Notice that the coefficient $A$ is the same like in the PDE~\eqn{LINEARPDE.SINGLE.1 TUTORIAL}.
146    The coefficients $d$ and $y$ are  
147  each a \Scalar in the \FunctionOnBoundary.  Constraints \index{constraint} for the solution prescribing the value of the  each a \Scalar in the \FunctionOnBoundary.  Constraints \index{constraint} for the solution prescribing the value of the
148  solution at certain locations in the domain. They have the form  solution at certain locations in the domain. They have the form
149  \begin{equation}\label{LINEARPDE.SINGLE.3}  \begin{equation}\label{LINEARPDE.SINGLE.3 TUTORIAL}
150  u=r \mbox{ where } q>0  u=r \mbox{ where } q>0
151  \end{equation}  \end{equation}
152  $r$ and $q$ are each \Scalar where $q$ is the characteristic function  $r$ and $q$ are each \Scalar where $q$ is the characteristic function
153  \index{characteristic function} defining where the constraint is applied.  \index{characteristic function} defining where the constraint is applied.
154  The constraints defined by \eqn{LINEARPDE.SINGLE.3} override any other condition set by \eqn{LINEARPDE.SINGLE.1}  The constraints defined by \eqn{LINEARPDE.SINGLE.3  TUTORIAL} override any other condition set by
155  or \eqn{LINEARPDE.SINGLE.2}.  \eqn{LINEARPDE.SINGLE.1 TUTORIAL} or \eqn{LINEARPDE.SINGLE.2 TUTORIAL}.
156  The \Poisson class of the \linearPDEs module,  The \Poisson class of the \linearPDEs module,
157  which we have already used in \Chap{FirstSteps}, is in fact a subclass of the more general  which we have already used in \Chap{FirstSteps}, is in fact a subclass of the more general
158  \LinearPDE class. The \linearPDEs module provides a \Helmholtz class but  \LinearPDE class. The \linearPDEs module provides a \Helmholtz class but
# Line 164  in \escript of being not present and set Line 175  in \escript of being not present and set
175  it is more efficient to leave a coefficient undefined instead of assigning zero to it.}  it is more efficient to leave a coefficient undefined instead of assigning zero to it.}
176  In this diffusion example we do not need to define a characteristic function $q$ because the  In this diffusion example we do not need to define a characteristic function $q$ because the
177  boundary conditions we consider in \eqn{DIFFUSION HELM EQ 2} are just the natural boundary  boundary conditions we consider in \eqn{DIFFUSION HELM EQ 2} are just the natural boundary
178  conditions which are already defined in the \LinearPDE class (shown in \eqn{LINEARPDE.SINGLE.2}).  conditions which are already defined in the \LinearPDE class (shown in \eqn{LINEARPDE.SINGLE.2 TUTORIAL}).
179    
180  Defining and solving the Helmholtz equation is very easy now:  Defining and solving the Helmholtz equation is very easy now:
181  \begin{python}  \begin{python}
# Line 193  u=mypde.getSolution() Line 204  u=mypde.getSolution()
204  \end{python}  \end{python}
205  In some cases the solver of the PDE can make use of the fact that the PDE is symmetric\index{symmetric PDE} where the  In some cases the solver of the PDE can make use of the fact that the PDE is symmetric\index{symmetric PDE} where the
206  PDE is called symmetric if  PDE is called symmetric if
207  \begin{equation}\label{LINEARPDE.SINGLE.4}  \begin{equation}\label{LINEARPDE.SINGLE.4  TUTORIAL}
208  A\hackscore{jl}=A\hackscore{lj} \mbox{ and } B\hackscore{j}=C\hackscore{j} \;.  A\hackscore{jl}=A\hackscore{lj}\;.
209  \end{equation}  \end{equation}
210  Note that $D$ and $d$ may have any value and the right hand side $X$, $Y$, $y$ as well as the constraints  Note that $D$ and $d$ may have any value and the right hand sides $Y$, $y$ as well as the constraints
211  are not relevant. The Helmholtz problem is symmetric.  are not relevant. The Helmholtz problem is symmetric.
212  The \LinearPDE class provides the method \method{checkSymmetry} method to check if the given PDE is symmetric.  The \LinearPDE class provides the method \method{checkSymmetry} method to check if the given PDE is symmetric.
213  \begin{python}  \begin{python}

Legend:
Removed from v.624  
changed lines
  Added in v.625

  ViewVC Help
Powered by ViewVC 1.1.26