Dear Adrian,
Thanks for the email and glad to hear you calculations are working
out. For acknowledgment please mention that you are using Python and
scikit-fmm.
Regarding the gradient of the signed distance function:
As points are updated the gradient is locally estimated via
second-order upwind derivatives. This gradient is not retained. As I
understand it, if you also want a second-order accurate gradient
additional work is required during the point update. The augmented
fast marching method was developed for this purpose. This method
marches out the signed distance function and its derivatives. See
http://arxiv.org/abs/0905.3409 and
http://arxiv.org/abs/1111.6903
You could try using the numpy.gradient function to calculate the
gradient of the returned SDF but I think this will also be noisy.
Calculating the gradient from the scalar field is amplifying the
error.
In the current scikit-fmm implementation the calculation of the
distance to the points adjacent to the zero contour is only
first-order accurate. These first order errors are then propagated.
The first step in implementing the augmented method is to make this
initialization step second order. I started on a branch here:
https://github.com/scikit-fmm/scikit-fmm/tree/bicubic-init
to use cubic interpolation to reconstruct the zero contour and get a
second-order accurate distance to the initially frozen points. (This
was originally described by Chopp, 2001 "Some Improvements of the Fast
Marching Method")
I have this working in two-dimensions as a proof-of-concept but more
testing is needed. Have a look at the file skt.py in this branch for
an example. Currently, the bi-cubic interpolation is not correct for
cells on the outer boundary of the array. If the zero contour does not
intersect the edge of the domain this should not be problem. I have
the same thing partially working in 3D.
You could try this branch and see if the results are any better, give
the initorder=2 keyword argument to the distance function. If you have
an example of what you are trying to do I would be happy to have a
look. I am tied up this week but may have some time next week to have
another crack at the augmented method.
Thanks,
Jason
> --
> You received this message because you are subscribed to the Google Groups
> "scikit-fmm" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
scikit-fmm+...@googlegroups.com.
> To post to this group, send email to
sciki...@googlegroups.com.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/scikit-fmm/CABPx5hE_EGnDCx0T5TNQ_b2ZxABLAXT%3Dyc4GD%3Dc6_D6OWfwzRA%40mail.gmail.com.
> For more options, visit
https://groups.google.com/d/optout.