The function lloyd_optimize_mesh_2() is a mesh optimization process based on the minimization of a global energy function.

In lloyd_optimize_mesh_2(), the minimized global energy may be interpreted as the \( L^1\)-norm of the error achieved when the function \( x^2\) is interpolated on the mesh domain using a piecewise linear function which is linear in each cell of the Voronoi diagram of the mesh vertices.

The optimizer lloyd_optimize_mesh_2() works in iterative steps. At each iteration, mesh vertices are moved into positions that bring to zero the energy gradient and the Delaunay triangulation is updated. Vertices on the mesh boundaries are not moved.

the initial mesh that will be modified by the algorithm to represent the final optimized mesh.

np

an optional sequence of Named Parameters among the ones listed below:

Optional Named Parameters

2D points used to define the domain to mesh. If seeds_are_in_domain==true, the mesh domain is the union of the bounded connected components including at least one seed. If seeds_are_in_domain==false, the domain is the union of the bounded components including no seed.

Type: a class model of ConstRange whose iterator is a model of InputIterator with CDT::Point_2 as value type.

Default: No seed.

specified if seeds indicate bounded connected components inside or outside of the domain.

Type: bool

Default: false

limit on the number of performed iterations. 0 means that there is no limit on the number of performed iterations.

Precondition: max_iteration_number >=0

Type: int

Default: 0

CPU time limit (in seconds) after which the optimization process is stopped. This time is measured using CGAL::Real_timer. 0 means that there is no time limit.

Type: double

Precondition: time_limit \( \geq\) 0

Default: 0

designed to reduce running time of each optimization iteration. Any vertex that has a displacement less than a given fraction of the length of its shortest incident edge, is frozen (i.e. is not relocated). The parameter freeze_bound gives the threshold ratio. If it is set to 0, freezing of vertices is disabled.

Precondition: 0<= freeze_bound <=1

Type: double

Default: 0.001

threshold ratio of stopping criterion based on convergence: the optimization process is stopped when at the last iteration the displacement of any vertex is less than a given fraction of the length of the shortest edge incident to that vertex.

Precondition: 0 <=convergence <= 1

Type: double

Default: 0.001

Returns

an enum value providing some information about the outcome of the algorithm.

Refines the constrained Delaunay triangulation t into a conforming Gabriel triangulation.

After a call to this function, all constrained edges of t have the Gabriel property: the circle that has \( e\) as diameter does not contain any vertex from the triangulation.

refines the default domain defined by a constrained Delaunay triangulation without seeds into a mesh satisfying the criteria defined by the traits criteria. The domain of the mesh covers all the connected components of the plane defined by the constrained edges of t, except for the unbounded component.

Template Parameters

CDT

must be a 2D constrained Delaunay triangulation and its geometric traits class must be a model of DelaunayMeshTraits_2. The face of the constrained Delaunay triangulation must be a model of the concept DelaunayMeshFaceBase_2.

Criteria

must be a model of the concept MeshingCriteria_2. Criteria::Face_handle must be the same as CDT::Face_handle.

refines the domain defined by a constrained Delaunay triangulation into a mesh satisfying the criteria defined by the traits criteria.

Note that the unbounded component of the plane is never meshed.

Template Parameters

CDT

must be a 2D constrained Delaunay triangulation and its geometric traits class must be a model of DelaunayMeshTraits_2. The face of the constrained Delaunay triangulation must be a model of the concept DelaunayMeshFaceBase_2.

the constrained Delaunay triangulation that will be refined

np

an optional sequence of Named Parameters among the ones listed below

Optional Named Parameters

2D points used to define the domain to mesh. If seeds_are_in_domain==true, the mesh domain is the union of the bounded connected components including at least one seed. If seeds_are_in_domain==false, the domain is the union of the bounded components including no seed.

Type: a class model of ConstRange with iterator being a model of InputIterator with CDT::Point as value type.

Default: No seed.

The meshing criteria

Type: a class model of a model of the concept MeshingCriteria_2 with Criteria::Face_handle being the same as CDT::Face_handle.

If true the domain is considered as already initialized (see DelaunayMeshFaceBase_2::is_in_domain()). If false and no seeds are provided, the domain of the mesh covers all the connected components of the plane defined by the constrained edges of t, except for the unbounded component.

Type: bool

Default: false

specified if seeds indicates bounded connected components inside or outside of the domain.

refines the default domain defined by a constrained Delaunay triangulation into a mesh satisfying the criteria defined by the traits criteria.The sequence [begin, end) gives a set of seeds points, that defines the domain to be meshed as follows. The constrained edges of t partition the plane into connected components. If mark==true, the mesh domain is the union of the bounded connected components including at least one seed. If mark==false, the domain is the union of the bounded components including no seed. Note that the unbounded component of the plane is never meshed.

Template Parameters

CDT

must be 2D constrained Delaunay triangulation and its geometric traits class must be a model of DelaunayMeshTraits_2. The face of the constrained Delaunay triangulation must be a model of the concept DelaunayMeshFaceBase_2.

Criteria

must be a model of the concept MeshingCriteria_2. Criteria::Face_handle must be the same as CDT::Face_handle.