CGAL 6.1.1 - 3D Periodic Mesh Generation

Loading...
Searching...
No Matches
Functions
Mesh Generation Functions
Reference Manual

##

The two main functions to generate a periodic mesh are `make_periodic_3_mesh_3()` and `refine_periodic_3_mesh_3()`.

Other functions are provided to optimize an existing periodic mesh.

## Functions
template<typename C3T3 , typename MeshDomain , typename MeshCriteria , typename NamedParameters = CGAL::parameters::Default_named_parameters>
C3T3 | CGAL::make_periodic_3_mesh_3 (const MeshDomain &domain, const MeshCriteria &criteria, const NamedParameters &np=parameters::default_values())
| The function `make_periodic_3_mesh_3()` is a 3D periodic mesh generator.
template<typename C3T3 , typename MeshDomain , typename MeshCriteria , typename NamedParameters = CGAL::parameters::Default_named_parameters>
void | CGAL::refine_periodic_3_mesh_3 (C3T3 &c3t3, const MeshDomain &domain, const MeshCriteria &criteria, const NamedParameters &np=parameters::default_values())
| The function `refine_periodic_3_mesh_3()` is a 3D periodic mesh generator.
template<typename C3T3 , typename MeshDomain , typename NamedParameters = CGAL::parameters::Default_named_parameters>
Mesh_optimization_return_code | CGAL::perturb_periodic_3_mesh_3 (C3T3 &c3t3, const MeshDomain &domain, const NamedParameters &np=parameters::default_values())
| The function `perturb_periodic_3_mesh_3()` is a mesh optimizer that improves the quality of a Delaunay mesh by changing the positions of some vertices of the mesh.
template<typename C3T3 , typename NamedParameters = CGAL::parameters::Default_named_parameters>
Mesh_optimization_return_code | CGAL::exude_periodic_3_mesh_3 (C3T3 &c3t3, const NamedParameters &np=parameters::default_values())
| The function `exude_periodic_3_mesh_3()` performs a sliver exudation process on a periodic Delaunay mesh.
template<typename C3T3 , typename MeshDomain , typename NamedParameters = CGAL::parameters::Default_named_parameters>
Mesh_optimization_return_code | CGAL::odt_optimize_periodic_3_mesh_3 (C3T3 &c3t3, const MeshDomain &domain, const NamedParameters &np=parameters::default_values())
| The function `odt_optimize_periodic_3_mesh_3()` is a periodic mesh optimization process based on the minimization of a global energy function.
template<typename C3T3 , typename MeshDomain , typename NamedParameters = CGAL::parameters::Default_named_parameters>
Mesh_optimization_return_code | CGAL::lloyd_optimize_periodic_3_mesh_3 (C3T3 &c3t3, const MeshDomain &domain, const NamedParameters &np=parameters::default_values())
| The function `lloyd_optimize_periodic_3_mesh_3()` is a periodic mesh optimization process based on the minimization of a global energy function.

## Function Documentation

## ◆ exude_periodic_3_mesh_3()

template<typename C3T3 , typename NamedParameters = CGAL::parameters::Default_named_parameters>

Mesh_optimization_return_code CGAL::exude_periodic_3_mesh_3 | ( | C3T3 & | c3t3,
|  | const NamedParameters & | np = `parameters::default_values()`
| ) |  |

`#include <CGAL/optimize_periodic_3_mesh_3.h>`

The function `exude_periodic_3_mesh_3()` performs a sliver exudation process on a periodic Delaunay mesh.

The sliver exudation process consists in optimizing the weights of vertices of the periodic weighted Delaunay triangulation in such a way that slivers disappear and the quality of the mesh improves.

Warning
  This optimizer modifies the weight of vertices of the periodic triangulation and, if called, must be the last optimizer to be called. If the mesh is refined after this optimization has been performed, all improvements will be lost.

This function directly calls `exude_mesh_3()`, but is provided for convenience. Further information can be found in the documentation of the function `exude_mesh_3()`.

Examples
  Periodic_3_mesh_3/mesh_implicit_shape_with_optimizers.cpp.

## ◆ lloyd_optimize_periodic_3_mesh_3()

template<typename C3T3 , typename MeshDomain , typename NamedParameters = CGAL::parameters::Default_named_parameters>

Mesh_optimization_return_code CGAL::lloyd_optimize_periodic_3_mesh_3 | ( | C3T3 & | c3t3,
|  | const MeshDomain & | domain,
|  | const NamedParameters & | np = `parameters::default_values()`
| ) |  |

`#include <CGAL/optimize_periodic_3_mesh_3.h>`

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

This function directly calls `lloyd_optimize_mesh_3()`, but is provided for convenience. Further information can be found in the documentation of the function `lloyd_optimize_mesh_3()`.

Note
  This function requires the Eigen library.

Examples
  Periodic_3_mesh_3/mesh_implicit_shape_with_optimizers.cpp.

## ◆ make_periodic_3_mesh_3()

template<typename C3T3 , typename MeshDomain , typename MeshCriteria , typename NamedParameters = CGAL::parameters::Default_named_parameters>

C3T3 CGAL::make_periodic_3_mesh_3 | ( | const MeshDomain & | domain,
|  | const MeshCriteria & | criteria,
|  | const NamedParameters & | np = `parameters::default_values()`
| ) |  |

`#include <CGAL/make_periodic_3_mesh_3.h>`

The function `make_periodic_3_mesh_3()` is a 3D periodic mesh generator.

It produces simplicial meshes which discretize 3D periodic domains. The periodic mesh generation algorithm is a Delaunay refinement process followed by an optimization phase. The criteria driving the Delaunay refinement process may be tuned to achieve the user needs with respect to the size of mesh elements, the accuracy of boundaries approximation, etc. The optimization phase is a sequence of optimization processes, amongst the following available optimizers: an ODT-smoothing, a Lloyd smoothing, a sliver perturber, and a sliver exuder. Each optimization process can be activated or not, according to the user requirements and available time. By default, only the perturber and the exuder are activated. Note that the benefits of the exuder will be lost if the mesh is further refined afterward, and that ODT-smoothing, Lloyd-smoothing, and sliver perturber should never be called after the sliver exuder. In the case of further refinement, only the sliver exuder can be used. The function outputs the mesh to an object which provides iterators to traverse the resulting mesh data structure or can be written to a file (see Examples ).

Template Parameters

  C3T3 | is required to be a model of the concept `MeshComplex_3InTriangulation_3`. This is the return type. The type `C3T3` is in particular required to provide a nested type `C3T3::Triangulation` for the 3D triangulation embedding the mesh. The vertex and cell base classes of the triangulation `C3T3::Triangulation` are required to be models of the concepts `MeshVertexBase_3` and `MeshCellBase_3` respectively.
  MD | is required to be a model of the concept `MeshDomain_3`, or of the refined concept `MeshDomainWithFeatures_3` if the domain has corners and curves that need to be accurately represented in the mesh. The argument `domain` is the sole link through which the domain to be discretized is known by the mesh generation algorithm.
  MC | has to be a model of the concept `MeshCriteria_3`, or a model of the refined concept `MeshCriteriaWithFeatures_3` if the domain has exposed features. The argument `criteria` of type `MC` specifies the size and shape requirements for mesh tetrahedra and surface facets. These criteria form the rules which drive the refinement process. All mesh elements satisfy those criteria at the end of the refinement process. In addition, if the domain has features, the argument `criteria` provides a sizing field to guide the discretization of 1-dimensional exposed features.
  NamedParameters | a sequence of Named Parameters

Parameters

  domain | the domain to be discretized
  criteria | the criteria
  np | an optional sequence of Named Parameters among the ones listed below:

Optional Named Parameters

  If the domain is a model of `MeshDomainWithFeatures_3`, 0 and 1-dimensional features can be taken into account while generating the mesh. The following two named parameters control this option: `parameters::features(domain)` `parameters::no_features()` Default: `parameters::features(domain)` |
  In order to drive the meshing algorithm and ensure that the output mesh follows a desired topological criterion, three named parameters control this option: `parameters::manifold()` `parameters::manifold_with_boundary()` `parameters::non_manifold()` Note that the meshing algorithm cannot generate a manifold surface if the input surface is not manifold. Default: `parameters::non_manifold()` |
  `lloyd_optimize_mesh_3()` can optionally be called after the meshing process. Two named parameters control this behavior: `parameters::no_lloyd()` `parameters::lloyd_optimize_mesh_3()` Default: `parameters::no_lloyd()` |
  `odt_optimize_mesh_3()` can optionally be called after the meshing process. Two named parameters control this behavior: `parameters::no_odt()` `parameters::odt()` Default: `parameters::no_odt()` |
  `perturb_mesh_3()` can optionally be called after the meshing process. Two named parameters control this behavior: `parameters::no_perturb()` `parameters::perturb()` Default: `parameters::perturb()` |
  `exude_mesh_3()` can optionally be called after the meshing process. Two named parameters control this behavior: `parameters::exude()` `parameters::no_exude()` Default: `parameters::exude()` |

The optimization parameters can be passed in an arbitrary order. If one parameter is not passed, its default value is used. The default values are `no_lloyd()`, `no_odt()`, `perturb()` and `exude()`.

Note that regardless of which optimization processes are activated, they are always launched in the order that is a suborder of the following (see user manual for further details): ODT-smoother, Lloyd-smoother, perturber, and exuder.

Beware that optimization of the mesh is obtained by perturbing mesh vertices and modifying the mesh connectivity and that this has an impact on the strict compliance to the refinement criteria. Though a strict compliance to mesh criteria is guaranteed at the end of the Delaunay refinement, this may no longer be true after some optimization processes. Also beware that the default behavior does involve some optimization processes.

See also
  `refine_periodic_3_mesh_3()`
  `make_mesh_3()`
  `exude_mesh_3()`
  `perturb_mesh_3()`
  `lloyd_optimize_mesh_3()`
  `odt_optimize_mesh_3()`

## ◆ odt_optimize_periodic_3_mesh_3()

template<typename C3T3 , typename MeshDomain , typename NamedParameters = CGAL::parameters::Default_named_parameters>

Mesh_optimization_return_code CGAL::odt_optimize_periodic_3_mesh_3 | ( | C3T3 & | c3t3,
|  | const MeshDomain & | domain,
|  | const NamedParameters & | np = `parameters::default_values()`
| ) |  |

`#include <CGAL/optimize_periodic_3_mesh_3.h>`

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

This function directly calls `odt_optimize_mesh_3()`, but is provided for convenience. Further information can be found in the documentation of the function `odt_optimize_mesh_3()`.

Examples
  Periodic_3_mesh_3/mesh_implicit_shape_with_optimizers.cpp.

## ◆ perturb_periodic_3_mesh_3()

template<typename C3T3 , typename MeshDomain , typename NamedParameters = CGAL::parameters::Default_named_parameters>

Mesh_optimization_return_code CGAL::perturb_periodic_3_mesh_3 | ( | C3T3 & | c3t3,
|  | const MeshDomain & | domain,
|  | const NamedParameters & | np = `parameters::default_values()`
| ) |  |

`#include <CGAL/optimize_periodic_3_mesh_3.h>`

The function `perturb_periodic_3_mesh_3()` is a mesh optimizer that improves the quality of a Delaunay mesh by changing the positions of some vertices of the mesh.

This function directly calls `perturb_mesh_3()`, but is provided for convenience. Further information can be found in the documentation of the function `perturb_mesh_3()`.

Examples
  Periodic_3_mesh_3/mesh_implicit_shape_with_optimizers.cpp.

## ◆ refine_periodic_3_mesh_3()

template<typename C3T3 , typename MeshDomain , typename MeshCriteria , typename NamedParameters = CGAL::parameters::Default_named_parameters>

void CGAL::refine_periodic_3_mesh_3 | ( | C3T3 & | c3t3,
|  | const MeshDomain & | domain,
|  | const MeshCriteria & | criteria,
|  | const NamedParameters & | np = `parameters::default_values()`
| ) |  |

`#include <CGAL/refine_periodic_3_mesh_3.h>`

The function `refine_periodic_3_mesh_3()` is a 3D periodic mesh generator.

It produces periodic simplicial meshes which discretize 3D periodic domains.

The periodic mesh generation algorithm is a Delaunay refinement process followed by an optimization phase. The criteria driving the Delaunay refinement process may be tuned to achieve the user needs with respect to the size of mesh elements, the accuracy of boundaries approximation, etc.

The optimization phase is a sequence of optimization processes, amongst the following available optimizers: an ODT-smoothing, a Lloyd smoothing, a sliver perturber, and a sliver exuder. Each optimization process can be activated or not, according to the user requirements and available time. By default, only the perturber and the exuder are activated. Note that the benefits of the exuder will be lost if the mesh is further refined afterward.

Attention
  The function template `refine_periodic_3_mesh_3()` may be used to refine a previously computed mesh, e.g.:
  C3T3 c3t3 = CGAL::make_periodic_3_mesh_3<C3T3>(domain,criteria);
  CGAL::refine_periodic_3_mesh_3(c3t3, domain, new_criteria);
  CGAL::refine_periodic_3_mesh_3
  void refine_periodic_3_mesh_3(C3T3 &c3t3, const MeshDomain &domain, const MeshCriteria &criteria, const NamedParameters &np=parameters::default_values())
  The function refine_periodic_3_mesh_3() is a 3D periodic mesh generator.
  Definition: refine_periodic_3_mesh_3.h:363
  Note that the triangulation must form at all times a simplicial complex within a single copy of the domain (see Sections The Flat Torus and Representation of the manual of 3D periodic triangulations). It is the responsibility of the user to provide a triangulation that satisfies this condition when calling the refinement function `refine_periodic_3_mesh_3`. The underlying triangulation of a mesh complex obtained through `make_periodic_3_mesh_3()` or `refine_periodic_3_mesh_3()` will always satisfy this condition.

Template Parameters

  C3T3 | is required to be a model of the concept `MeshComplex_3InTriangulation_3`. The argument `c3t3` is passed by reference as this object is modified by the refinement process. As the refinement process only adds points to the triangulation, all vertices of the triangulation of `c3t3` remain in the mesh during the refinement process. Object `c3t3` can be used to insert specific points in the domain to ensure that they will be contained in the final triangulation. The type `C3T3` is in particular required to provide a nested type `C3T3::Triangulation` for the 3D triangulation embedding the mesh. The vertex and cell base classes of the triangulation `C3T3::Triangulation` are required to be models of the concepts `MeshVertexBase_3` and `MeshCellBase_3` respectively.
  MD | is required to be a model of the concept `Periodic_3MeshDomain_3` or of the refined concept `Periodic_3MeshDomainWithFeatures_3` if 0 and 1-dimensional features of the input complex have to be accurately represented in the mesh. The argument `domain` is the sole link through which the domain to be discretized is known by the mesh generation algorithm.
  MC | is required to be a model of the concept `MeshCriteria_3`, or a model of the refined concept `MeshCriteriaWithFeatures_3` if the domain has exposed features. The argument `criteria` of type `MC` specifies the size and shape requirements for mesh tetrahedra and surface facets. These criteria form the rules which drive the refinement process. All mesh elements satisfy those criteria at the end of the refinement process. In addition, if the domain has features, the argument `criteria` provides a sizing field to guide the discretization of 1-dimensional exposed features.
  NamedParameters | a sequence of Named Parameters

Parameters

  c3t3 | the mesh to be refined.
  domain | the domain to be discretized
  criteria | the criteria
  np | an optional sequence of Named Parameters among the ones listed below:

The following four parameters are optional optimization parameters. They control which optimization processes are performed and allow the user to tune the parameters of the optimization processes. Individual optimization parameters are not described here as they are internal types (see instead the documentation page of each optimizer). For each optimization algorithm, there exist two global functions that allow to enable or disable the optimizer:

Optional Named Parameters

  In order to drive the meshing algorithm and ensure that the output mesh follows a desired topological criterion, three named parameters control this option: `parameters::manifold()` `parameters::manifold_with_boundary()` `parameters::non_manifold()` Note that the meshing algorithm cannot generate a manifold surface if the input surface is not manifold. Default: `parameters::non_manifold()` |
  `lloyd_optimize_mesh_3()` can optionally be called after the meshing process. Two named parameters control this behavior: `parameters::no_lloyd()` `parameters::lloyd_optimize_mesh_3()` Default: `parameters::no_lloyd()` |
  `odt_optimize_mesh_3()` can optionally be called after the meshing process. Two named parameters control this behavior: `parameters::no_odt()` `parameters::odt()` Default: `parameters::no_odt()` |
  `perturb_mesh_3()` can optionally be called after the meshing process. Two named parameters control this behavior: `parameters::no_perturb()` `parameters::perturb()` Default: `parameters::perturb()` |
  `exude_mesh_3()` can optionally be called after the meshing process. Two named parameters control this behavior: `parameters::exude()` `parameters::no_exude()` Default: `parameters::exude()` |

The optimization parameters can be passed in arbitrary order. If one parameter is not passed, its default value is used. The default values are `no_lloyd()`, `no_odt()`, `perturb()` and `exude()`. Note that whatever may be the optimization processes activated, they are always launched in the order that is a suborder of the following (see user manual for further details): ODT-smoother, Lloyd-smoother, perturber, and exuder.

Beware that optimization of the mesh is obtained by perturbing mesh vertices and modifying the mesh connectivity and that this has an impact on the strict compliance to the refinement criteria. Though a strict compliance to mesh criteria is guaranteed at the end of the Delaunay refinement, this may no longer be true after some optimization processes. Also beware that the default behavior does involve some optimization processes.

See also
  `make_periodic_3_mesh_3()`
  `refine_mesh_3()`
  `exude_periodic_3_mesh_3()`
  `perturb_periodic_3_mesh_3()`
  `lloyd_optimize_periodic_3_mesh_3()`
  `odt_optimize_periodic_3_mesh_3()`