AMBER Archive (2008)

Subject: Re: AMBER: note on the molsurf and "Assertion `sarg1 >= 0.0' failed" error

From: David A. Case (case_at_scripps.edu)
Date: Wed May 28 2008 - 12:27:31 CDT


On Wed, May 28, 2008, Kateryna Miroshnychenko wrote:

> *** 1052,1059 ****
> sarg1 = (ai->rad + aj->rad + probe_diam) * (ai->rad + aj->rad +
> probe_diam) - d_ij * d_ij;
> sarg2 = d_ij * d_ij - (ai->rad - aj->rad) * (ai->rad - aj->rad);
> ! assert( sarg1 >= 0.0 );
> ! assert( sarg2 >= 0.0 );
> t_rad = 0.5 * sqrt (sarg1) * sqrt (sarg2) / d_ij;
>
> t_fact1 = ((ai->rad + probe_rad) * (ai->rad + probe_rad) -
> --- 1052,1059 ----
> sarg1 = (ai->rad + aj->rad + probe_diam) * (ai->rad + aj->rad +
> probe_diam) - d_ij * d_ij;
> sarg2 = d_ij * d_ij - (ai->rad - aj->rad) * (ai->rad - aj->rad);
> ! assert( sarg1 > 0.0 - eps);
> ! assert( sarg2 > 0.0 - eps);
> t_rad = 0.5 * sqrt (sarg1) * sqrt (sarg2) / d_ij;
>
> t_fact1 = ((ai->rad + probe_rad) * (ai->rad + probe_rad) -
>

Thanks for your detailed analysis, but I really don't understand why this
would work. In your case, you are allowing sarg1 to be (slightly) negative,
and then immediately computing sqrt(sarg1). The square root will fail unless
sarg >=0 (as in the original assert).

It is possible that we should allow for very slightly negative values, but
then the "solution" would have to involve setting these to zero before
proceeding to the sqrt() code (at least as far as I can see).

Can you post the structure that is giving the problem?

...thx...dac

-----------------------------------------------------------------------
The AMBER Mail Reflector
To post, send mail to amber_at_scripps.edu
To unsubscribe, send "unsubscribe amber" (in the *body* of the email)
      to majordomo_at_scripps.edu