[aspect-devel] muparser and Floating point exception from divide by zero.
Bob Myhill
myhill.bob at gmail.com
Sat Jun 30 09:43:04 PDT 2018
Mea culpa. Thanks for the info, Timo!
Bob
On Sat, 30 Jun 2018, 16:57 Timo Heister, <heister at clemson.edu> wrote:
> Bob,
>
> > You're using a muParser if syntax that was deprecated a few years ago.
>
> This is not quite correct. "if(expression, A, B)" is actually an a
> function we register with function parser inside deal.II. The problem
> is of course that A and B are evaluated before the expression is
> checked and divisions by zero would generate an error. This never
> occurred to me before. Oops. :-)
>
> > The new syntax uses lazy evaluation to evaluate only the required branch
> of the if-statement. Try this:
> >
> > x>0 ? TS+(TM-TS)*(1-erfc((YMAX-y)/(2*sqrt(K*x/VSUB)))) : TM
>
> I checked and this does work (my example would be "(expression) ? (A)
> : (B)") . Great!
> _______________________________________________
> Aspect-devel mailing list
> Aspect-devel at geodynamics.org
> http://lists.geodynamics.org/cgi-bin/mailman/listinfo/aspect-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geodynamics.org/pipermail/aspect-devel/attachments/20180630/f618cb14/attachment.html>
More information about the Aspect-devel
mailing list