Public Member Functions | Public Attributes | List of all members
VoronoiMesh Class Reference

Voronoi tessellation class. More...

#include <VoronoiMesh.hpp>

Inheritance diagram for VoronoiMesh:
Inheritance graph
[legend]
Collaboration diagram for VoronoiMesh:
Collaboration graph
[legend]

Public Member Functions

Vector2D CalcFaceVelocity (Vector2D wl, Vector2D wr, Vector2D rL, Vector2D rR, Vector2D f) const
 Calculates the velocity of a single edge. More...
 
VoronoiMeshclone (void) const
 Cloning function. More...
 
vector< int > GetNeighbors (int index) const
 Returns the indeces of the neighbors. More...
 
void GetNeighbors (int index, vector< int > &neigh) const
 Returns the indeces of the neighbors. More...
 
vector< int > GetLiteralNeighbors (int index) const
 Returns the list of neighbors including ghost points. More...
 
int GetOriginalIndex (int point) const
 Returns the original index of the duplicated point. More...
 
void Initialise (vector< Vector2D > const &points, Tessellation const &vproc, OuterBoundary const *outer, bool reorder=true)
 Initialise the tessellation. More...
 
void Initialise (vector< Vector2D > const &points, OuterBoundary const *bc, bool reorder=true)
 Initialises the tessellation. More...
 
 VoronoiMesh (void)
 Class default constructor.
 
 VoronoiMesh (vector< Vector2D > const &points, OuterBoundary const &bc, bool HOrder=true)
 Class constructor. More...
 
 VoronoiMesh (Tessellation const &proctess, vector< Vector2D > const &points, OuterBoundary const &bc, bool HOrder=true)
 Class constructor for MPI. More...
 
 VoronoiMesh (VoronoiMesh const &other)
 Copy constructor. More...
 
vector< int > Update (const vector< Vector2D > &points, const Tessellation &vproc, bool reorder=false)
 Updates the tessellation. More...
 
vector< int > Update (const vector< Vector2D > &points, bool reorder=false)
 Update the tessellation. More...
 
int GetPointNo (void) const
 Get Total number of mesh generating points. More...
 
void SetPointNo (int N)
 Set the number of points. More...
 
Vector2D GetMeshPoint (int index) const
 Returns Position of mesh generating point. More...
 
int GetTotalSidesNumber (void) const
 Returns the total number of faces. More...
 
Edge const & GetEdge (int index) const
 Returns edge (interface between cells) More...
 
double GetWidth (int index) const
 Returns the effective width of a cell. More...
 
double GetVolume (int index) const
 Returns the volume of a cell. More...
 
vector< int > const & GetCellEdges (int index) const
 Returns a reference to a vector<int> containing the indexes of the edges related to a cell. More...
 
Vector2D const & GetCellCM (int index) const
 Returns Position of Cell's CM. More...
 
vector< Vector2D > & GetMeshPoints (void)
 Returns a reference to the point vector. More...
 
void output (string filename)
 Outputs the grid data. More...
 
bool NearBoundary (int index) const
 Returns if the cell is adjacent to a boundary. More...
 
vector< Edge > & GetAllEdges (void)
 Returns a reference to a list of all edges. More...
 
void FindBoundaryRemoveSend (vector< int > const &ToRemove, vector< vector< int > > &BoundaryRemove, vector< vector< vector< int > > > &BoundaryNeigh)
 Calculates and send the ghost points that are needed for AMR with MPI. More...
 
vector< vector< int > > & GetDuplicatedPoints (void)
 Returns the indeces of the points that where sent to other processors as ghost points. More...
 
vector< vector< int > > const & GetDuplicatedPoints (void) const
 Returns the indeces of the points that where sent to other processors as ghost points. More...
 
vector< int > GetDuplicatedProcs (void) const
 Returns the indeces of the processors with whom ghost points where exchanged. More...
 
vector< vector< int > > const & GetSentPoints (void) const
 Returns the indeces of the points that where sent to other processors. More...
 
vector< int > GetSentProcs (void) const
 Returns the indeces of the processors with whom points where exchanged. More...
 
vector< vector< int > > & GetGhostIndeces (void)
 Returns the indeces of each ghost point in the vector of points that the tessellation holds. More...
 
vector< vector< int > > const & GetGhostIndeces (void) const
 Returns the indeces of each ghost point in the vector of points that the tessellation holds. More...
 
vector< size_t > GetSelfPoint (void) const
 Returns the indeces of the points that remain with the processor after the ne processor mesh is built. More...
 
int GetTotalPointNumber (void) const
 Returns the total number of points (including ghost) More...
 
const vector< Edge > & getAllEdges (void) const
 Returns reference to the list of all edges. More...
 
vector< Vector2D > & GetAllCM (void)
 Returns the center of masses of the cells. More...
 
void GetNeighborNeighbors (vector< int > &result, int point) const
 Retrieves vicarious neighbors. More...
 
vector< Vector2DUpdateMPIPoints (Tessellation const &vproc, int rank, vector< Vector2D > &points, OuterBoundary const *obc, vector< size_t > &selfindex, vector< int > &sentproc, vector< vector< int > > &sentpoints)
 Communicate position of mesh generating points between processes. More...
 

Public Attributes

voronoi_loggers::VoronoiLoggerlogger
 Diagnostics method.
 

Detailed Description

Voronoi tessellation class.

Definition at line 29 of file VoronoiMesh.hpp.

Constructor & Destructor Documentation

◆ VoronoiMesh() [1/3]

VoronoiMesh::VoronoiMesh ( vector< Vector2D > const &  points,
OuterBoundary const &  bc,
bool  HOrder = true 
)

Class constructor.

Parameters
pointsThe points to build for
bcThe geometric boundary conditions
HOrderShould the points be rearranged with Hilbert ordering

Definition at line 85 of file VoronoiMesh.cpp.

Here is the call graph for this function:

◆ VoronoiMesh() [2/3]

VoronoiMesh::VoronoiMesh ( Tessellation const &  proctess,
vector< Vector2D > const &  points,
OuterBoundary const &  bc,
bool  HOrder = true 
)

Class constructor for MPI.

Parameters
pointsThe points to build for
proctessThe tessellation of the processors
bcThe geometric boundary conditions
HOrderShould the points be rearranged with Hilbert ordering

Definition at line 109 of file VoronoiMesh.cpp.

Here is the call graph for this function:

◆ VoronoiMesh() [3/3]

VoronoiMesh::VoronoiMesh ( VoronoiMesh const &  other)

Copy constructor.

Parameters
otherThe Voronoi to copy

Definition at line 205 of file VoronoiMesh.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ CalcFaceVelocity()

Vector2D VoronoiMesh::CalcFaceVelocity ( Vector2D  wl,
Vector2D  wr,
Vector2D  rL,
Vector2D  rR,
Vector2D  f 
) const
virtual

Calculates the velocity of a single edge.

Parameters
wlThe velocity of the left mesh point
wrThe velocity of the right mesh point
rLThe location of the left mesh point
rRThe location of the right mesh point
fThe centroid of the edge
Returns
The edge's velocity

Implements Tessellation.

Definition at line 150 of file VoronoiMesh.cpp.

Here is the call graph for this function:

◆ clone()

VoronoiMesh * VoronoiMesh::clone ( void  ) const
virtual

Cloning function.

Returns
Pointer to clone

Implements Tessellation.

Definition at line 632 of file VoronoiMesh.cpp.

Here is the call graph for this function:

◆ FindBoundaryRemoveSend()

void VoronoiMesh::FindBoundaryRemoveSend ( vector< int > const &  ToRemove,
vector< vector< int > > &  BoundaryRemove,
vector< vector< vector< int > > > &  BoundaryNeigh 
)

Calculates and send the ghost points that are needed for AMR with MPI.

Parameters
ToRemoveThe local list of points to remove
BoundaryRemoveThe list of points that are border points per proc that are removed
BoundaryNeighThe indeces in the Nghost list for each neighbor of the points in BoundaryRemove

◆ GetAllCM()

vector< Vector2D > & VoronoiMesh::GetAllCM ( void  )
virtual

Returns the center of masses of the cells.

Returns
The CM's

Implements Tessellation.

Definition at line 673 of file VoronoiMesh.cpp.

Here is the call graph for this function:

◆ GetAllEdges()

vector< Edge > & VoronoiMesh::GetAllEdges ( void  )

Returns a reference to a list of all edges.

Returns
List of all edges

Definition at line 1168 of file VoronoiMesh.cpp.

◆ getAllEdges()

const vector< Edge > & VoronoiMesh::getAllEdges ( void  ) const
virtual

Returns reference to the list of all edges.

Returns
Reference to the list of all edges

Implements Tessellation.

Definition at line 658 of file VoronoiMesh.cpp.

◆ GetCellCM()

Vector2D const & VoronoiMesh::GetCellCM ( int  index) const
virtual

Returns Position of Cell's CM.

Parameters
indexMesh generating point index (the cell's index)
Returns
Position of CM

Implements Tessellation.

Definition at line 668 of file VoronoiMesh.cpp.

◆ GetCellEdges()

vector< int > const & VoronoiMesh::GetCellEdges ( int  index) const
virtual

Returns a reference to a vector<int> containing the indexes of the edges related to a cell.

Parameters
indexThe index of the cell.
Returns
The reference to vector<int>

Implements Tessellation.

Definition at line 447 of file VoronoiMesh.cpp.

Here is the caller graph for this function:

◆ GetDuplicatedPoints() [1/2]

vector< vector< int > > & VoronoiMesh::GetDuplicatedPoints ( void  )
virtual

Returns the indeces of the points that where sent to other processors as ghost points.

Returns
The sent points

Implements Tessellation.

Definition at line 1173 of file VoronoiMesh.cpp.

◆ GetDuplicatedPoints() [2/2]

vector< vector< int > > const & VoronoiMesh::GetDuplicatedPoints ( void  ) const
virtual

Returns the indeces of the points that where sent to other processors as ghost points.

Returns
The sent points

Implements Tessellation.

Definition at line 1178 of file VoronoiMesh.cpp.

◆ GetDuplicatedProcs()

vector< int > VoronoiMesh::GetDuplicatedProcs ( void  ) const
virtual

Returns the indeces of the processors with whom ghost points where exchanged.

Returns
The list of processors

Implements Tessellation.

Definition at line 1198 of file VoronoiMesh.cpp.

◆ GetEdge()

Edge const & VoronoiMesh::GetEdge ( int  index) const
virtual

Returns edge (interface between cells)

Parameters
indexFace index
Returns
Interface between cells

Implements Tessellation.

Definition at line 663 of file VoronoiMesh.cpp.

Here is the caller graph for this function:

◆ GetGhostIndeces() [1/2]

vector< vector< int > > & VoronoiMesh::GetGhostIndeces ( void  )
virtual

Returns the indeces of each ghost point in the vector of points that the tessellation holds.

Returns
The indeces where the outer index is the index of the sent processor

Implements Tessellation.

Definition at line 1183 of file VoronoiMesh.cpp.

◆ GetGhostIndeces() [2/2]

vector< vector< int > > const & VoronoiMesh::GetGhostIndeces ( void  ) const
virtual

Returns the indeces of each ghost point in the vector of points that the tessellation holds.

Returns
The indeces where the outer index is the index of the sent processor

Implements Tessellation.

Definition at line 1188 of file VoronoiMesh.cpp.

◆ GetLiteralNeighbors()

vector< int > VoronoiMesh::GetLiteralNeighbors ( int  index) const

Returns the list of neighbors including ghost points.

Returns
The neighbors
Parameters
indexThe cell whose neighbors are returned

Definition at line 609 of file VoronoiMesh.cpp.

◆ GetMeshPoint()

Vector2D VoronoiMesh::GetMeshPoint ( int  index) const
virtual

Returns Position of mesh generating point.

Parameters
indexMesh generating point index
Returns
Position of mesh generating point

Implements Tessellation.

Definition at line 648 of file VoronoiMesh.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetMeshPoints()

vector< Vector2D > & VoronoiMesh::GetMeshPoints ( void  )
virtual

Returns a reference to the point vector.

Returns
The reference

Implements Tessellation.

Definition at line 485 of file VoronoiMesh.cpp.

Here is the call graph for this function:

◆ GetNeighborNeighbors()

void VoronoiMesh::GetNeighborNeighbors ( vector< int > &  result,
int  point 
) const
virtual

Retrieves vicarious neighbors.

Parameters
resultOutput
pointMesh generating point index

Implements Tessellation.

Definition at line 925 of file VoronoiMesh.cpp.

Here is the call graph for this function:

◆ GetNeighbors() [1/2]

vector< int > VoronoiMesh::GetNeighbors ( int  index) const
virtual

Returns the indeces of the neighbors.

Parameters
indexThe cell to check
Returns
The neighbors

Implements Tessellation.

Definition at line 588 of file VoronoiMesh.cpp.

Here is the caller graph for this function:

◆ GetNeighbors() [2/2]

void VoronoiMesh::GetNeighbors ( int  index,
vector< int > &  neigh 
) const
virtual

Returns the indeces of the neighbors.

Parameters
indexThe cell to check
neighthe indeces of the neighbors given as output

Implements Tessellation.

Definition at line 598 of file VoronoiMesh.cpp.

◆ GetOriginalIndex()

int VoronoiMesh::GetOriginalIndex ( int  point) const
virtual

Returns the original index of the duplicated point.

Parameters
pointThe index of the duplicated point
Returns
The original point index

Reimplemented from Tessellation.

Definition at line 173 of file VoronoiMesh.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetPointNo()

int VoronoiMesh::GetPointNo ( void  ) const
virtual

Get Total number of mesh generating points.

Returns
Number of mesh generating points

Implements Tessellation.

Definition at line 637 of file VoronoiMesh.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetSelfPoint()

vector< size_t > VoronoiMesh::GetSelfPoint ( void  ) const
virtual

Returns the indeces of the points that remain with the processor after the ne processor mesh is built.

Returns
The indeces of the points

Implements Tessellation.

Definition at line 182 of file VoronoiMesh.cpp.

◆ GetSentPoints()

vector< vector< int > > const & VoronoiMesh::GetSentPoints ( void  ) const
virtual

Returns the indeces of the points that where sent to other processors.

Returns
The sent points

Implements Tessellation.

Definition at line 1208 of file VoronoiMesh.cpp.

◆ GetSentProcs()

vector< int > VoronoiMesh::GetSentProcs ( void  ) const
virtual

Returns the indeces of the processors with whom points where exchanged.

Returns
The list of processors

Implements Tessellation.

Definition at line 1203 of file VoronoiMesh.cpp.

◆ GetTotalPointNumber()

int VoronoiMesh::GetTotalPointNumber ( void  ) const
virtual

Returns the total number of points (including ghost)

Returns
The total number of points

Implements Tessellation.

Definition at line 1193 of file VoronoiMesh.cpp.

Here is the call graph for this function:

◆ GetTotalSidesNumber()

int VoronoiMesh::GetTotalSidesNumber ( void  ) const
virtual

Returns the total number of faces.

Returns
Total number of faces

Implements Tessellation.

Definition at line 653 of file VoronoiMesh.cpp.

Here is the caller graph for this function:

◆ GetVolume()

double VoronoiMesh::GetVolume ( int  index) const
virtual

Returns the volume of a cell.

Parameters
indexCell index
Returns
Cell volume

Implements Tessellation.

Definition at line 452 of file VoronoiMesh.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetWidth()

double VoronoiMesh::GetWidth ( int  index) const
virtual

Returns the effective width of a cell.

Parameters
indexCell index
Returns
Effective cell width

Implements Tessellation.

Definition at line 442 of file VoronoiMesh.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Initialise() [1/2]

void VoronoiMesh::Initialise ( vector< Vector2D > const &  points,
Tessellation const &  vproc,
OuterBoundary const *  outer,
bool  reorder = true 
)
virtual

Initialise the tessellation.

Parameters
pointsList of mesh generating points
vprocTessellation of processors
outerOuter boundary condition
reorderDetermines whether to apply Hilbert order

Implements Tessellation.

Definition at line 1404 of file VoronoiMesh.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Initialise() [2/2]

void VoronoiMesh::Initialise ( vector< Vector2D > const &  points,
OuterBoundary const *  bc,
bool  HilbertOrder = true 
)
virtual

Initialises the tessellation.

Parameters
pointsInitial position of mesh generating points
bcBoundary conditions of the computational domain
HilbertOrderShould the points be rearranged before insertion

Implements Tessellation.

Definition at line 312 of file VoronoiMesh.cpp.

Here is the call graph for this function:

◆ NearBoundary()

bool VoronoiMesh::NearBoundary ( int  index) const
virtual

Returns if the cell is adjacent to a boundary.

Parameters
indexThe cell to check
Returns
If near boundary

Implements Tessellation.

Definition at line 157 of file VoronoiMesh.cpp.

Here is the call graph for this function:

◆ output()

void VoronoiMesh::output ( string  filename)

Outputs the grid data.

Parameters
filenameThe path to the output file

◆ SetPointNo()

void VoronoiMesh::SetPointNo ( int  N)

Set the number of points.

Parameters
NNumber of points

Definition at line 642 of file VoronoiMesh.cpp.

Here is the call graph for this function:

◆ Update() [1/2]

vector< int > VoronoiMesh::Update ( const vector< Vector2D > &  points,
const Tessellation vproc,
bool  reorder = false 
)
virtual

Updates the tessellation.

Parameters
pointsList of points
vprocTessellation of processors
reorderWhether to apply hilbert order
Returns
List of hilbert order indices

Implements Tessellation.

Definition at line 1267 of file VoronoiMesh.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Update() [2/2]

vector< int > VoronoiMesh::Update ( const vector< Vector2D > &  points,
bool  HilbertOrder = false 
)
virtual

Update the tessellation.

Parameters
pointsThe new positions of the mesh generating points
HilbertOrderShould the points be rearranged before insertion
Returns
The indeces of sort (if done, else empty)

Implements Tessellation.

Definition at line 490 of file VoronoiMesh.cpp.

Here is the call graph for this function:

◆ UpdateMPIPoints()

vector< Vector2D > VoronoiMesh::UpdateMPIPoints ( Tessellation const &  vproc,
int  rank,
vector< Vector2D > &  points,
OuterBoundary const *  obc,
vector< size_t > &  selfindex,
vector< int > &  sentproc,
vector< vector< int > > &  sentpoints 
)

Communicate position of mesh generating points between processes.

Parameters
vprocMeta tessellation
rankCurrent process rank
pointsList of mesh generating points
obcOuter boundary conditions
selfindexLocal indices
sentprocProcesses to which points should be sentpoints
sentpointsPoints to be sent
Returns
Received points

Definition at line 1540 of file VoronoiMesh.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: