[petsc-dev] should plexgeometry.c check for divide by zero?

Matthew Knepley knepley at gmail.com
Sun May 9 12:12:08 CDT 2021


On Sun, May 9, 2021 at 12:06 PM Barry Smith <bsmith at petsc.dev> wrote:

>
>   Matt,
>
>
>   if (centroid) for (d = 0; d < dim; ++d) centroid[d] /= (vsum*4);
>    csum[d] /= (tdim+1)*vsum;
>
>   Also
>
>   for (d = 0; d < dim; d++) n[d] /= norm;
>   etc
>
>   Would adding (some/all) tests detect errors in the geometry information
> earlier then later strange behavior that happens because of the infinities
> in the arrays?
>

We could perhaps benefit from earlier checks. Here however all points would
have to be the same in order for vsum == 0. which is a generacy I have
never seen.

  Thanks,

     Matt

-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20210509/d82eba2f/attachment.html>


More information about the petsc-dev mailing list