The Delaunay data structure. Gets a set of points and constructs the Delaunay tessellation. More...
#include <Delaunay.hpp>
Public Member Functions | |
int | GetOrgIndex (int index) const |
Retrieves the original index of a point (in case a point was duplicated) More... | |
void | ChangeOlength (int n) |
Changes the cor olength. More... | |
void | Changelength (int n) |
Changes the cor length. More... | |
vector< Vector2D > & | ChangeCor (void) |
Allows to change the cor. More... | |
const vector< Vector2D > & | getCor (void) const |
Access to coordinates. More... | |
Delaunay (void) | |
Class constructor. | |
Delaunay (Delaunay const &other) | |
Copy constructor. More... | |
~Delaunay (void) | |
Default destructor. | |
void | build_delaunay (vector< Vector2D >const &vp, std::vector< std::pair< Vector2D, Vector2D > >const &cpoints) |
Builds the Delaunay tessellation. More... | |
void | output (void) |
Dumps the Delaunay tessellation into a binary file. | |
const facet & | get_facet (int index) const |
Returns a facet. More... | |
double | get_facet_coordinate (int Facet, int vertice, int dim) |
Returns a coordinate of a vertice. More... | |
Vector2D | get_point (size_t index) const |
Returns a point. More... | |
double | get_cor (int index, int dim) const |
Returns a coordinate. More... | |
int | get_num_facet (void) const |
Returns the number of facets. More... | |
int | get_length (void) const |
Returns the number of points. More... | |
int | get_last_loc (void) const |
Returns the last location, a number used to identify the fact that the neighbor of a facet is empty. More... | |
void | set_point (int index, Vector2D p) |
Change Mesh point. More... | |
double | triangle_area (int index) |
Returns the area of the triangle. Negative result means the triangle isn't right handed. More... | |
void | update (const vector< Vector2D > &points, std::vector< std::pair< Vector2D, Vector2D > >const &cpoints) |
Updates the triangulation. More... | |
int | GetOriginalIndex (int NewPoint) const |
Returns the original index of the duplicated point in Periodic Boundary conditions. More... | |
int | GetOriginalLength (void) const |
Returns the original length of the points (without duplicated points) More... | |
vector< Vector2D > & | GetMeshPoints (void) |
Returns a refrence to the points. More... | |
int | GetTotalLength (void) |
Returns the length of all the points (included duplicated) More... | |
double | GetFacetRadius (int facet) const |
return the facet's radius More... | |
void | AddAditionalPoint (Vector2D const &vec) |
Adds a point to the cor vector. Used in periodic boundaries with AMR. More... | |
int | GetCorSize (void) const |
Gets the size of the cor vector. More... | |
Vector2D | GetCircleCenter (int index, double &R) const |
Returns the center of the circumscribed circle of a facet. More... | |
void | BuildBoundary (OuterBoundary const *obc, vector< Edge > const &edges) |
Builds the boundary points. More... | |
pair< vector< vector< int > >, vector< int > > | BuildBoundary (OuterBoundary const *obc, Tessellation const &tproc, vector< vector< int > > &Nghost) |
Builds the boundary points for parallel runs. More... | |
void | AddBoundaryPoints (vector< Vector2D > const &points) |
Adds the points to the tessellation, used for boundary points. More... | |
bool | CheckCorrect (void) |
Public Attributes | |
delaunay_loggers::DelaunayLogger * | logger |
Diagnostics. | |
The Delaunay data structure. Gets a set of points and constructs the Delaunay tessellation.
Definition at line 30 of file Delaunay.hpp.
Delaunay::Delaunay | ( | Delaunay const & | other | ) |
Copy constructor.
other | The Triangulation to copy |
Definition at line 161 of file Delaunay.cpp.
void Delaunay::AddAditionalPoint | ( | Vector2D const & | vec | ) |
Adds a point to the cor vector. Used in periodic boundaries with AMR.
vec | The point to add. |
Definition at line 767 of file Delaunay.cpp.
void Delaunay::AddBoundaryPoints | ( | vector< Vector2D > const & | points | ) |
Adds the points to the tessellation, used for boundary points.
points | The points to add |
Definition at line 754 of file Delaunay.cpp.
void Delaunay::build_delaunay | ( | vector< Vector2D >const & | vp, |
std::vector< std::pair< Vector2D, Vector2D > >const & | cpoints | ||
) |
Builds the Delaunay tessellation.
vp | A refrence to a vector of points to be added. |
cpoints | The edges of the processor cell. |
Definition at line 376 of file Delaunay.cpp.
void Delaunay::BuildBoundary | ( | OuterBoundary const * | obc, |
vector< Edge > const & | edges | ||
) |
Builds the boundary points.
obc | The geometrical boundary conditions |
edges | The edges of the domain returns the indeces of the boundary points for each edge, can be larger than the number of edges since it include corners at the end |
Definition at line 1167 of file Delaunay.cpp.
std::pair< vector< vector< int > >, vector< int > > Delaunay::BuildBoundary | ( | OuterBoundary const * | obc, |
Tessellation const & | tproc, | ||
vector< vector< int > > & | Nghost | ||
) |
Builds the boundary points for parallel runs.
obc | The geometrical boundary conditions |
tproc | The tessellation of the processors |
Nghost | The indeces of the ghost cells (order by cpu) in the cor vector. Given as output. |
Definition at line 1919 of file Delaunay.cpp.
vector< Vector2D > & Delaunay::ChangeCor | ( | void | ) |
Allows to change the cor.
Definition at line 681 of file Delaunay.cpp.
void Delaunay::Changelength | ( | int | n | ) |
Changes the cor length.
n | The new length |
Definition at line 676 of file Delaunay.cpp.
void Delaunay::ChangeOlength | ( | int | n | ) |
double Delaunay::get_cor | ( | int | index, |
int | dim | ||
) | const |
Returns a coordinate.
index | The index of the point. |
dim | If dim=0 returns the x-coordinate else returns the y-coordinate. |
Definition at line 709 of file Delaunay.cpp.
const facet & Delaunay::get_facet | ( | int | index | ) | const |
Returns a facet.
index | Facet index |
Definition at line 691 of file Delaunay.cpp.
double Delaunay::get_facet_coordinate | ( | int | Facet, |
int | vertice, | ||
int | dim | ||
) |
Returns a coordinate of a vertice.
Facet | The index of the facet to check. |
vertice | The index of the vertice in the facet. |
dim | If dim=0 returns the x-coordinate else returns the y-coordinate. |
Definition at line 696 of file Delaunay.cpp.
int Delaunay::get_last_loc | ( | void | ) | const |
Returns the last location, a number used to identify the fact that the neighbor of a facet is empty.
Definition at line 729 of file Delaunay.cpp.
int Delaunay::get_length | ( | void | ) | const |
Returns the number of points.
Definition at line 724 of file Delaunay.cpp.
int Delaunay::get_num_facet | ( | void | ) | const |
Returns the number of facets.
Definition at line 719 of file Delaunay.cpp.
Vector2D Delaunay::get_point | ( | size_t | index | ) | const |
Returns a point.
index | The index of the point. |
Definition at line 704 of file Delaunay.cpp.
Vector2D Delaunay::GetCircleCenter | ( | int | index, |
double & | R | ||
) | const |
Returns the center of the circumscribed circle of a facet.
index | The index of the facet |
R | The radius given as output |
Definition at line 1202 of file Delaunay.cpp.
const vector< Vector2D > & Delaunay::getCor | ( | void | ) | const |
Access to coordinates.
Definition at line 686 of file Delaunay.cpp.
int Delaunay::GetCorSize | ( | void | ) | const |
Gets the size of the cor vector.
Definition at line 772 of file Delaunay.cpp.
double Delaunay::GetFacetRadius | ( | int | facet | ) | const |
return the facet's radius
facet | The facet to check |
Definition at line 666 of file Delaunay.cpp.
vector< Vector2D > & Delaunay::GetMeshPoints | ( | void | ) |
Returns a refrence to the points.
Definition at line 744 of file Delaunay.cpp.
int Delaunay::GetOrgIndex | ( | int | index | ) | const |
Retrieves the original index of a point (in case a point was duplicated)
index | Index of a point |
Definition at line 1963 of file Delaunay.cpp.
int Delaunay::GetOriginalIndex | ( | int | NewPoint | ) | const |
Returns the original index of the duplicated point in Periodic Boundary conditions.
NewPoint | The index of the duplicated point |
Definition at line 661 of file Delaunay.cpp.
int Delaunay::GetOriginalLength | ( | void | ) | const |
Returns the original length of the points (without duplicated points)
Definition at line 739 of file Delaunay.cpp.
int Delaunay::GetTotalLength | ( | void | ) |
Returns the length of all the points (included duplicated)
Definition at line 749 of file Delaunay.cpp.
void Delaunay::set_point | ( | int | index, |
Vector2D | p | ||
) |
Change Mesh point.
index | The index of the point to change. |
p | The new point to set. |
Definition at line 734 of file Delaunay.cpp.
double Delaunay::triangle_area | ( | int | index | ) |
Returns the area of the triangle. Negative result means the triangle isn't right handed.
index | The index to the facet |
Definition at line 491 of file Delaunay.cpp.
void Delaunay::update | ( | const vector< Vector2D > & | points, |
std::vector< std::pair< Vector2D, Vector2D > >const & | cpoints | ||
) |
Updates the triangulation.
points | The new set of points |
cpoints | The points of the processor cell |
Definition at line 504 of file Delaunay.cpp.