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

Barry Smith bsmith at petsc.dev
Sun May 9 13:53:45 CDT 2021


  I saw it when running src/dm/impls/plex/tests ex5 without setting the -displacement_petscspace_degree 1 and using -fp_trap 



./ex5 -fp_trap -dim 2 -faulttraction_petscspace_degree 1  -orig_dm_plex_check_all -dm_plex_check_all -displacement_petscspace_degree 1 -faulttraction_petscspace_degree 1 -petscds_view -local_section_view -local_solution_view -local_residual_view -local_jacobian_view 


It looks like the degree may be defaulting to 0?? which then results in bogus information passed to the geometry routines; without the -fp_trap it keeps running but presumably generating nonsense.

  Barry


> On May 9, 2021, at 12:12 PM, Matthew Knepley <knepley at gmail.com> wrote:
> 
> On Sun, May 9, 2021 at 12:06 PM Barry Smith <bsmith at petsc.dev <mailto: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/83d52136/attachment.html>


More information about the petsc-dev mailing list