Subject: Finite Diff.: Mapping Grid->XYZ How?

From: "Gustavo A. Mercier Jr" <[email-masked]>
Date: Sat, 26 Jul 1997 10:56:27 -0400 (EDT)

Hi!

I am a bit confused about the way that finite
difference methods map a grid onto a coordinate
system.

I am particularly interested in the way
that the Univ. of Houston Brownian Dyn. package does it.
This package uses a finite difference method to solve
the Linearized Poisson Boltzman Eq.
(I believe it is the same implementation in Delphi.)

For simplicity let me talk about a 1D grid.

In the input you specify the grid size.
You also specify the X coordinate for the center
of the grid, and the grid step. This is simple enough. 

My question is what are the values for X?

Case: grid size 6, center 0.0, and step size 0.5

One way:

      grid indices:  1      2     3     4     5     6
      center:                        0
      X values:    -1.25  -0.75 -0.25  0.25  0.75  1.25
 
Another way:

 grid indices: 0     1      2     3     4     5     6
      center:                     0
   X values: -1.5  -1.0   -0.5    0    0.5   1.0   1.5 

And the value at index 0 is just a dummy.

The situation seems clearer (or easier) with odd grid sizes.

Case: grid size 7, center 0.0, step size 0.5

 grid indices: 1     2     3     4     5     6      7 
      center:                    0
   X values: -1.5  -1.5 -0.5    0.0   0.5   1.0    1.5

but it can also get muddled!

grid
indices:0     1      2     3     4     5     6      7
 center:                      0
X #: -1.75  -1.25  -0.75 -0.25  0.25  0.75  1.25   1.75 

With the value at index 0 just a dummy point.

The UHBD output prints the left most X coordinate,
but calls it a  "nonexistent point". Is that the dummy above?

Could anyone shed some light on this, or even better
provide "accepted" formulas to get the ranges/values of X
at the grid vertices (points), if there are standard
ways of doing the mapping?

Thanks!

-- 
                                      ("`-/")_.-'"``-._
Gustavo A. Mercier,Jr.,MD,PhD         (. . `) -._    )-;-,_() 
Division of Nuclear Medicine          (v_,)'  _  )`-.\  ``-
Dept. of Radiology                    _;- _,-_/ / ((,'
University of Pennsylvania           ((,.-'  ((,/
3400 Spruce St.                  [email-masked]
Philadelphia, PA 19104         215-662-3069/3091 fax: 215-349-5843