Computes an objective function and its gradient over a restricted Voronoi diagram.
More...
#include <geogram/voronoi/integration_simplex.h>
|
| ~IntegrationSimplex () override |
| IntegrationSimplex destructor.
|
|
virtual double | eval (index_t center_vertex_index, const GEOGen::Vertex &v0, const GEOGen::Vertex &v1, const GEOGen::Vertex &v2, index_t t, index_t t_adj=index_t(-1), index_t v_adj=index_t(-1))=0 |
| Computes the contribution of a given integration simplex to the function and its gradient. An integration simplex is obtained as the intersection between a Voronoi cell and a triangle or tetrahedron of a background mesh. More...
|
|
void | set_points_and_gradient (coord_index_t dimension, index_t nb_points, const double *points, double *g, Process::SpinLockArray *spinlocks=nullptr) |
| Sets the input points and the location where the computed gradient will be stored. More...
|
|
bool | volumetric () const |
| Tests whether this IntegrationSimplex is volumetric. More...
|
|
bool | background_mesh_has_varying_attribute () const |
| Specifies whether the background mesh has varying attributes used in the computation. More...
|
|
virtual void | reset_thread_local_storage () |
| Before starting computation, resets thread local storage variables. More...
|
|
void | ref () const |
| Increments the reference count. More...
|
|
void | unref () const |
| Decrements the reference count. More...
|
|
bool | is_shared () const |
| Check if the object is shared. More...
|
|
int | nb_refs () const |
| Gets the number of references that point to this object. More...
|
|
Computes an objective function and its gradient over a restricted Voronoi diagram.
This function can be used by CentroidalVoronoiTesselation and its variants to optimize the placement of points by minimizing an objective function. Sub-classing this class makes it possible to define new objective functions.
Definition at line 72 of file integration_simplex.h.
◆ IntegrationSimplex()
GEO::IntegrationSimplex::IntegrationSimplex |
( |
const Mesh & |
mesh, |
|
|
bool |
volumetric, |
|
|
index_t |
nb_frames, |
|
|
index_t |
nb_comp_per_frame, |
|
|
const double * |
frames |
|
) |
| |
|
protected |
Constructs a new IntegrationSimplex.
- Parameters
-
[in] | mesh | the mesh |
[in] | volumetric | true if volumetric, false if surfacic |
[in] | nb_frames | number of frames, typically number of elements of the background mesh |
[in] | nb_comp_per_frame | number of components per frame, 3 for 3-axis anisotropy, 1 for vector anisotropy. |
[in] | frames | a const pointer to the array of 3*nb_frames*nb_comp_per_frame of frame coordinates. |
◆ background_mesh_has_varying_attribute()
bool GEO::IntegrationSimplex::background_mesh_has_varying_attribute |
( |
| ) |
const |
|
inline |
Specifies whether the background mesh has varying attributes used in the computation.
The RestrictedVoronoiDiagram class computes the intersection between a Voronoi diagram and a background mesh. If the triangles or tetrahedra of this background mesh have a property that varies on each triangle / tetrahedron, then the intersection between the Voronoi cells and each individual triangle / tetrahedron is computed. Default mode is constant, subclasses may override.
- Return values
-
true | if the background mesh has varying attributes |
false | otherwise |
Definition at line 173 of file integration_simplex.h.
◆ eval()
Computes the contribution of a given integration simplex to the function and its gradient. An integration simplex is obtained as the intersection between a Voronoi cell and a triangle or tetrahedron of a background mesh.
- Parameters
-
[in] | center_vertex_index | index of the first vertex of the integration simplex, that corresponds to one of the vertices of the Delaunay triangulation |
[in] | v0 | second vertex of the integration simplex, in both geometric and symbolic forms |
[in] | v1 | third vertex of the integration simplex, in both geometric and symbolic forms |
[in] | v2 | fourth vertex of the integration simplex, in both geometric and symbolic forms |
[in] | t | the triangle or tetrahedron of the background mesh |
[in] | t_adj | the background mesh tetrahedron adjacent to this integration simplex accros (v0 , v1 , v2 ) or index_t(-1) if no such tetrahedron exists. |
[in] | v_adj | if (v0 , v1 , v2 ) is supported by a bisector, the index of the other extremity of the bisector, else index_t(-1) |
◆ frame()
const double* GEO::IntegrationSimplex::frame |
( |
index_t |
i | ) |
const |
|
inlineprotected |
Gets a frame by index.
- Parameters
-
- Returns
- a const pointer to the nb_components_per_frame coordinates of the frame
Definition at line 224 of file integration_simplex.h.
◆ point()
const double* GEO::IntegrationSimplex::point |
( |
index_t |
i | ) |
const |
|
inlineprotected |
Gets a point by index.
- Parameters
-
- Returns
- a const pointer to the coordinates of the point
Definition at line 213 of file integration_simplex.h.
◆ reset_thread_local_storage()
virtual void GEO::IntegrationSimplex::reset_thread_local_storage |
( |
| ) |
|
|
virtual |
Before starting computation, resets thread local storage variables.
RestrictedVoronoiDiagram can operate in multi-threading mode. Some derived classes may need to reset some thread local storage variables before starting each thread.
◆ set_points_and_gradient()
Sets the input points and the location where the computed gradient will be stored.
This function needs to be called once per evaluation of the objective function, before evaluating the contribution of the simplices with eval().
- Parameters
-
[in] | dimension | number of coordinates of the points, or number of doubles between two consecutive points |
[in] | nb_points | number of points |
[in] | points | a const pointer to the contiguous array of coordinates of the points |
[out] | g | a pointer to the components of the gradient of the objective function |
[in] | spinlocks | a pointer to the spinlocks array to be used in multithreading mode, or nullptr in single-threaded mode |
Definition at line 130 of file integration_simplex.h.
◆ volumetric()
bool GEO::IntegrationSimplex::volumetric |
( |
| ) |
const |
|
inline |
Tests whether this IntegrationSimplex is volumetric.
A volumetric IntegrationSimplex is meant to be computed over the Voronoi cells restricted to the tetrahedra of the mesh. A surfacic one is meant to be computed over the Voronoi cells restricted to the facets of the mesh.
- Return values
-
Definition at line 153 of file integration_simplex.h.
The documentation for this class was generated from the following file: