d03eef

d03eef © Numerical Algorithms Group, 2002.

Purpose

D03EEF Discretize a 2nd order elliptic PDE on a rectangle

Synopsis

[a,rhs,ifail] = d03eef(xmin,xmax,ymin,ymax,pdef,bndy,ngx,ngy<,scheme,ifail>)

Description

 
 D03EEF discretizes a second order linear elliptic partial 
 differential equation of the form
 
 
                2                 2                  2 
              dd U              dd U               dd U
 (alpha)(x,y) ----+(beta)(x,y) ------+(gamma)(x,y) ----
                2              ddxddy                2 
              dd x                                 dd y
                                                             
               ddU                ddU                        
 +(delta)(x,y) ---+(epsilon)(x,y) ---+(phi)(x,y)U=(psi)(x,y)   (1)
               ddx                ddy                        
                                                             
 
 on a rectangular region
 
                             x <=x<=x 
                              A      B
 
                             y <=y<=y 
                              A      B
 
 subject to boundary conditions of the form
 
                                    ddU
                     a(x,y)U+b(x,y) ---=c(x,y)
                                    ddn
 
        ddU                                                      
 where  --- denotes the outward pointing normal derivative on the 
        ddn                                                      
 boundary. Equation (1) is said to be elliptic if
 
                                                     2
             4(alpha)(x,y)(gamma)(x,y)>=((beta)(x,y)) 
 
 for all points in the rectangular region. The linear equations 
 produced are in a form suitable for passing directly to the 
 multigrid routine D03EDF.
 
 The equation is discretized on a rectangular grid, with n  grid 
                                                          x     
 points in the x-direction and n  grid points in the y-direction. 
                                y                                
 At each grid point (x ,y ) six neighbouring grid points are used 
                      i  j                                       
 to approximate the partial differential equation.

 Two possible schemes may be used to approximate the first 
 derivatives.
 
 Central differences are more accurate than upwind differences, 
 but upwind differences may lead to a more diagonally dominant 
 matrix for those problems where the coefficients of the first 
 derivatives are significantly larger than the coefficients of the
 second derivatives.
 
 At all points in the rectangular domain, including the boundary, 
 the coefficients in the partial differential equation are 
 evaluated by calling the user-supplied subroutine PDEF, and 
 applying the approximations. 

 These equations then have to be modified to take account of the 
 boundary conditions. These may be Dirichlet (where the solution 
 is given), Neumann (where the derivative of the solution is 
 given), or mixed (where a linear combination of solution and 
 derivative is given).
 

Parameters

d03eef

Required Input Arguments:

xmin                                  real
xmax                                  real
ymin                                  real
ymax                                  real
pdef                                  function (User-Supplied)
bndy                                  function (User-Supplied)
ngx                                   integer
ngy                                   integer

Optional Input Arguments:                       <Default>

scheme (1)                            string   'c'
ifail                                 integer  -1

Output Arguments:

a (:,7)                               real
rhs (:)                               real
ifail                                 integer