← Back to team overview

dolfin team mailing list archive

Re: Distance to boundary

 

On Thursday August 11 2011 02:44:09 Mikael Mortensen wrote:
> Cool stuff!

:)
 
> How does it work exactly? What is the algorithm behind the computation?

I just used the same CGAL structure the IntersectionOperator use, but instead 
of feeding it the whole mesh I just give then BoundaryMesh, or a SubMesh of 
the BoundaryMesh. Then CGAL finds the closest point in the mesh from an 
arbitrary point, and returns the distance between them. 

It does not work in parallel yet. 

The closest point does not care about other boundaries. So when one want the 
distance to a far boundary with other boundaries in between it will give the 
straight-line distance. The same distance measured with the signed distance 
function will give the distance following the inside of the domain.

Johan


> Mikael
> 
> On 10 August 2011 23:02, Johan Hake <johan.hake@xxxxxxxxx> wrote:
> > Hello!
> > 
> > I have created a class, DistanceToBoundaryComputation, similar to
> > IntersectionOperator, which takes a Mesh or a FacetFunction and compute
> > distances between any point and the closest point to the Boundary or a
> > subset
> > of the boundary given by the FacetFunction.
> > 
> > I have published it together with two demos, cpp and python to illustrate
> > some
> > of its functions.
> > 
> >   lp:~johan-hake/dolfin/distance-to-boundary
> > 
> > If the distances from each vertex is computed, will the result be similar
> > (not
> > always equal) to the signed distance function, or the eikonal equation,
> > but it
> > computes faster.
> > 
> > I am not sure how this best can be integrated into the present dolfin. It
> > generates some data, like a BoundaryMesh, which it need to store, so it
> > might
> > not be something we want to put into the Mesh class? If I use the same
> > lazy initialization that Andre used it might be possible.
> > 
> > Please feel free to have alook at one of the demos to see it in action.
> > 
> > Johan
> > 
> > _______________________________________________
> > Mailing list: https://launchpad.net/~dolfin
> > Post to     : dolfin@xxxxxxxxxxxxxxxxxxx
> > Unsubscribe : https://launchpad.net/~dolfin
> > More help   : https://help.launchpad.net/ListHelp


References