Hello --

This looks like a good addition to the grid checking.  Yong/Dave, can you test this out and see if it works with other features in the code?

Thank you very much for your fix and help with APBS!

-- Nathan

On Mon, Dec 21, 2009 at 8:58 AM, matteo.rotter wrote:
Dear all,

We are using apbs/1.2.1) for calculate the elec and apolar forces
acting on a molecule in solvent through the Poisson Boltzmann equation.
We use the mg-manual option to calulate first the results for a coarse
grid and then the results for a fine grid, smaller than the coarse one.
Center of the fine grid is  different form the center of the coarse grid.

What we find is that the fine grid didn't work due to the error:
Vpmg_dbForce:  Atom 7 off grid!
VASSERT: ASSERTION FAILURE!  filename routines.c, line 1205,
(Vpmg_dbForce(pmg, (*atomForce)[j].dbForce, j, pbeparm->srfm))
Increasing  glen little for the fine grid would bring to an error for
another atom, (now atom 7 is in the grid) but in my mind that wasn't a
good way to solve the problem..
Looking in the apbs-1.2.1-source/src/mg/vpmg.c we suppose that the
problem is that the atom involved is in the grid, but his radius for
calculation goes out of it.
So we tried to find a way to solve the problem:

Vpmg_dbForce:
line 5542:  original:
/* Make sure we're on the grid */
if ((apos[0]<=xmin) || (apos[0]>=xmax)  || \
(apos[1]<=ymin) || (apos[1]>=ymax)  || \
(apos[2]<=zmin) || (apos[2]>=zmax)) {

seems that would be better to calculate position < (xmin + rtot) and >
(xmax - rtot) to include also the dimensions of splineWin in the
calculation.

/* Make sure we're on the grid */
if ((apos[0]<=xmin + rtot) || (apos[0]>=xmax - rtot)  || \
(apos[1]<=ymin + rtot) || (apos[1]>=ymax - rtot)  || \
(apos[2]<=zmin + rtot) || (apos[2]>=zmax - rtot)) {

Would also be better to include the radius of solvent in the calculation
of rtot:

Now the calulation works without errors.
What do you think about our changes?

Regards,

Matteo.

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
apbs-users mailing list
apbs-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/apbs-users

--
Nathan Baker (http://bakergroup.wustl.edu)
Associate Professor, Dept. of Biochemistry and Molecular Biophysics
Director, Computational and Molecular Biophysics Graduate Program
Center for Computational Biology, Washington University in St. Louis