![]() |
SemiDiscreteOT 1.0
Semi-Discrete Optimal Transport Library
|
A class for computing power diagrams using deal.II. More...
#include <PowerDiagram.h>
Public Member Functions | |
DealIIPowerDiagram (const Triangulation< dim, spacedim > &source_mesh) | |
Constructor for the DealIIPowerDiagram class. | |
void | set_generators (const std::vector< Point< spacedim > > &points, const Vector< double > &potentials) override |
Sets the generator points and their potentials. | |
void | set_distance_function (const std::function< double(const Point< spacedim > &, const Point< spacedim > &)> &dist) |
Sets the distance function to be used. | |
double | power_distance (const Point< spacedim > &point, const unsigned int generator_idx) const |
Computes the power distance between a point and a generator. | |
void | compute_power_diagram () override |
Computes the power diagram. | |
void | output_vtu (const std::string &filename) const override |
Outputs the power diagram to a VTU file. | |
unsigned int | get_cell_assignment (const unsigned int cell_index) const |
Returns the assignment of a cell to a generator. | |
const std::vector< unsigned int > & | get_cell_assignments () const |
Returns the assignments of all cells to generators. | |
void | compute_cell_centroids () override |
Computes the centroids of the power cells. | |
void | save_centroids_to_file (const std::string &filename) const override |
Saves the centroids of the power cells to a file. | |
const std::vector< Point< spacedim > > & | get_cell_centroids () const override |
Returns the centroids of the power cells. | |
![]() | |
virtual | ~PowerDiagramBase ()=default |
Private Attributes | |
const Triangulation< dim, spacedim > * | source_triangulation |
The source triangulation. | |
std::vector< unsigned int > | cell_assignments |
The assignments of cells to generators. | |
std::function< double(const Point< spacedim > &, const Point< spacedim > &)> | distance_function |
The distance function. | |
Additional Inherited Members | |
![]() | |
std::vector< Point< spacedim > > | generator_points |
The generator points. | |
std::vector< double > | generator_potentials |
The potentials of the generator points. | |
std::vector< Point< spacedim > > | cell_centroids |
The centroids of the power cells. | |
A class for computing power diagrams using deal.II.
dim | The dimension of the mesh. |
spacedim | The dimension of the space the mesh is embedded in. |
Definition at line 90 of file PowerDiagram.h.
PowerDiagramSpace::DealIIPowerDiagram< dim, spacedim >::DealIIPowerDiagram | ( | const Triangulation< dim, spacedim > & | source_mesh | ) |
Constructor for the DealIIPowerDiagram class.
source_mesh | The source mesh. |
Definition at line 8 of file PowerDiagramDealII.cc.
|
overridevirtual |
Sets the generator points and their potentials.
points | The generator points. |
potentials | The potentials of the generator points. |
Implements PowerDiagramSpace::PowerDiagramBase< dim, spacedim >.
Definition at line 14 of file PowerDiagramDealII.cc.
|
inline |
Sets the distance function to be used.
dist | The distance function. |
Definition at line 110 of file PowerDiagram.h.
double PowerDiagramSpace::DealIIPowerDiagram< dim, spacedim >::power_distance | ( | const Point< spacedim > & | point, |
const unsigned int | generator_idx | ||
) | const |
Computes the power distance between a point and a generator.
point | The point. |
generator_idx | The index of the generator. |
Definition at line 26 of file PowerDiagramDealII.cc.
|
overridevirtual |
Computes the power diagram.
Implements PowerDiagramSpace::PowerDiagramBase< dim, spacedim >.
Definition at line 37 of file PowerDiagramDealII.cc.
|
overridevirtual |
Outputs the power diagram to a VTU file.
filename | The name of the output file. |
Implements PowerDiagramSpace::PowerDiagramBase< dim, spacedim >.
Definition at line 63 of file PowerDiagramDealII.cc.
unsigned int PowerDiagramSpace::DealIIPowerDiagram< dim, spacedim >::get_cell_assignment | ( | const unsigned int | cell_index | ) | const |
Returns the assignment of a cell to a generator.
cell_index | The index of the cell. |
Definition at line 77 of file PowerDiagramDealII.cc.
const std::vector< unsigned int > & PowerDiagramSpace::DealIIPowerDiagram< dim, spacedim >::get_cell_assignments | ( | ) | const |
Returns the assignments of all cells to generators.
Definition at line 85 of file PowerDiagramDealII.cc.
|
overridevirtual |
Computes the centroids of the power cells.
Implements PowerDiagramSpace::PowerDiagramBase< dim, spacedim >.
Definition at line 91 of file PowerDiagramDealII.cc.
|
overridevirtual |
Saves the centroids of the power cells to a file.
filename | The name of the output file. |
Implements PowerDiagramSpace::PowerDiagramBase< dim, spacedim >.
Definition at line 129 of file PowerDiagramDealII.cc.
|
overridevirtual |
Returns the centroids of the power cells.
Implements PowerDiagramSpace::PowerDiagramBase< dim, spacedim >.
Definition at line 139 of file PowerDiagramDealII.cc.
|
private |
The source triangulation.
Definition at line 162 of file PowerDiagram.h.
|
private |
The assignments of cells to generators.
Definition at line 163 of file PowerDiagram.h.
|
private |
The distance function.
Definition at line 164 of file PowerDiagram.h.