From armin@nrcgeb.ac.ir  Sat Jul 26 05:13:32 1997
Received: from genetic.nrcgeb.ac.ir  for armin@nrcgeb.ac.ir
	by www.ccl.net (8.8.3/950822.1) id EAA06932; Sat, 26 Jul 1997 04:18:16 -0400 (EDT)
Received: from AMS ([194.225.65.221]) by genetic.nrcgeb.ac.ir (4.1/SMI-4.1)
	id AA15187; Sat, 26 Jul 97 12:50:52 EDT
Date: Sat, 26 Jul 97 12:50:52 EDT
Message-Id: <9707261650.AA15187@genetic.nrcgeb.ac.ir>
X-Sender: armin@genetic
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
To: chemistry@www.ccl.net
From: armin@nrcgeb.ac.ir (Armin M. Sobhani)
Subject: Re: CCL:Object-oriented means for computational chemist
X-Mailer: <Windows Eudora Version 2.0.2>


Dear Ping,

For a good example on doing Object-Oriented programming (including
inheritance) in conventional C (OOPC), please refer to the article below:

Linowes J.S. "It's an Attitude: There's a lot of extra coding, but you can
do object-oriented programming in conventional C", Byte Magazine, Vol.13
No.8 August 1988, pp. 219-224

Ping Du wrote:
 
>there is a point that I would like to bring up.  That is, is it 
>possible to implement an OO design using a non-OO language?  The main 
>design features of OOD are abstraction, encapsulation, and 
>inheritance.  One may achieve abstraction and encapsulation in a 
>non-OO language by forcing discipline.  For example, use struct in C 
>as if there were classes and access data members through "interface" 
>functions.  However, implementing inheritance is impossible without 
>an OO language.  Inheritance is pobably the most important feature of 

Regards,

Armin

+----------------------------------------------------------------+
|   __()__ NRCGEB:         | Armin M. Sobhani                    |
|  //\\//\\  National      | Email: armin@nrcgeb.ac.ir           |
| // (()) \\  Research     |        madadkar@pars.ipm.ac.ir      |
|((  (())  ))  Center for  | URL  : http://www.nrcgeb.ac.ir/armin|
| \\ (()) //  Genetic      | Tel  : +98 21 6418310               |
|  \\_/\_//  Engineering & | Fax  : +98 21 6419834               |
|  (NRCGEB) Biotechnology  | P.O.Box: 14155-6343, Tehran, IRAN   |
+----------------------------------------------------------------+
|      Once you understand the universe at the atomic level      |
|      everything else is easy.         -Richard P. Feynman      |
+----------------------------------------------------------------+


From gmercier@mail.med.upenn.edu  Sat Jul 26 11:13:34 1997
Received: from mail.med.upenn.edu  for gmercier@mail.med.upenn.edu
	by www.ccl.net (8.8.3/950822.1) id KAA07836; Sat, 26 Jul 1997 10:56:24 -0400 (EDT)
Received: (from gmercier@localhost)
	by mail.med.upenn.edu (8.8.5/8.8.5) id KAA00230
	for chemistry@www.ccl.net; Sat, 26 Jul 1997 10:56:27 -0400 (EDT)
From: "Gustavo A. Mercier Jr" <gmercier@mail.med.upenn.edu>
Message-Id: <199707261456.KAA00230@mail.med.upenn.edu>
Subject: Finite Diff.: Mapping Grid->XYZ How?
To: chemistry@www.ccl.net
Date: Sat, 26 Jul 1997 10:56:27 -0400 (EDT)
X-Mailer: ELM [version 2.4 PL23-upenn3.1]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit


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.                  gmercier@mail.med.upenn.edu
Philadelphia, PA 19104         215-662-3069/3091 fax: 215-349-5843



