tessellation.hpp
Go to the documentation of this file.
1 
6 #ifndef TESSELLATION_HPP
7 #define TESSELLATION_HPP 1
8 
9 #include <vector>
10 #include "geometry.hpp"
11 
12 #include "Edge.hpp"
13 
14 using std::vector;
15 
16 class OuterBoundary;
17 
22 {
23 public:
34  Vector2D rR,Vector2D f) const=0;
35 
41  virtual void Initialise(vector<Vector2D> const& points, OuterBoundary const* bc, bool HilbertOrder = true) = 0;
42 
43 #ifdef RICH_MPI
44 
50  virtual void Initialise(vector<Vector2D> const& points,Tessellation const& tess,
51  OuterBoundary const* outer, bool HilbertOrder = true) = 0;
52 #endif
53 
60  virtual vector<int> Update(const vector<Vector2D>& points,bool HilbertOrder=false) = 0;
61 
62 #ifdef RICH_MPI
63 
70  virtual vector<int> Update(const vector<Vector2D>& points, const Tessellation& tess, bool HOrder = false) = 0;
71 #endif // RICH_MPI
72 
76  virtual int GetPointNo(void) const = 0;
77 
82  virtual Vector2D GetMeshPoint(int index) const = 0;
83 
88  virtual Vector2D const& GetCellCM(int index) const = 0;
89 
93  virtual int GetTotalSidesNumber(void) const = 0;
94 
98  virtual const vector<Edge>& getAllEdges(void) const = 0;
99 
104  virtual Edge const& GetEdge(int index) const= 0;
105 
110  virtual double GetWidth(int index) const = 0;
111 
116  virtual double GetVolume(int index) const = 0;
117 
122  virtual vector<int>const& GetCellEdges(int index) const =0;
123 
129 virtual int GetOriginalIndex(int point) const;
130 
135 virtual vector<Vector2D>& GetMeshPoints(void)=0;
136 
142 virtual vector<int> GetNeighbors(int index)const=0;
143 
149 virtual void GetNeighbors(int index,vector<int> &neigh)const = 0;
150 
155 virtual Tessellation* clone(void) const=0;
156 
157 virtual ~Tessellation(void)=0;
158 
163 virtual bool NearBoundary(int index) const = 0;
164 
169  virtual vector<vector<int> >& GetDuplicatedPoints(void)=0;
174  virtual vector<vector<int> >const& GetDuplicatedPoints(void)const=0;
179  virtual vector<int> GetDuplicatedProcs(void)const=0;
184  virtual vector<vector<int> >const& GetSentPoints(void)const=0;
189  virtual vector<int> GetSentProcs(void)const=0;
190 
195  virtual vector<size_t> GetSelfPoint(void)const=0;
196 
201  virtual vector<vector<int> >& GetGhostIndeces(void)=0;
206  virtual vector<vector<int> >const& GetGhostIndeces(void)const=0;
211  virtual int GetTotalPointNumber(void)const=0;
212 
217  virtual vector<Vector2D>& GetAllCM(void)=0;
218 
223  virtual void GetNeighborNeighbors(vector<int> &result, int point)const=0;
224 };
225 #endif // TESSELLATION_HPP
Geometrical calculations.
virtual vector< int > GetDuplicatedProcs(void) const =0
Returns the indeces of the processors with whom ghost points where exchanged.
virtual vector< int > Update(const vector< Vector2D > &points, bool HilbertOrder=false)=0
Update the tessellation.
virtual vector< size_t > GetSelfPoint(void) const =0
Returns the indeces of the points that remain with the processor after the ne processor mesh is built...
virtual void GetNeighborNeighbors(vector< int > &result, int point) const =0
Retrieves vicarious neighbors.
Abstract class for tessellation.
virtual int GetPointNo(void) const =0
Get Total number of mesh generating points.
virtual Vector2D const & GetCellCM(int index) const =0
Returns Position of Cell&#39;s CM.
virtual int GetOriginalIndex(int point) const
Returns the original index of the duplicated point.
Definition: tessellation.cpp:5
Edge between cells.
virtual vector< Vector2D > & GetAllCM(void)=0
Returns the center of masses of the cells.
Interface between two cells.
Definition: Edge.hpp:13
virtual Vector2D GetMeshPoint(int index) const =0
Returns Position of mesh generating point.
virtual vector< vector< int > > const & GetSentPoints(void) const =0
Returns the indeces of the points that where sent to other processors.
virtual Edge const & GetEdge(int index) const =0
Returns edge (interface between cells)
virtual bool NearBoundary(int index) const =0
Returns if the cell is adjacent to a boundary.
virtual vector< Vector2D > & GetMeshPoints(void)=0
Returns a reference to the point vector.
virtual const vector< Edge > & getAllEdges(void) const =0
Returns reference to the list of all edges.
virtual int GetTotalPointNumber(void) const =0
Returns the total number of points (including ghost)
virtual double GetWidth(int index) const =0
Returns the effective width of a cell.
virtual double GetVolume(int index) const =0
Returns the volume of a cell.
vector< int > HilbertOrder(vector< Vector2D > const &cor, int num, int innernum=0)
Returns the Hilber curve ordering.
virtual int GetTotalSidesNumber(void) const =0
Returns the total number of faces.
virtual Tessellation * clone(void) const =0
Cloning function.
virtual Vector2D CalcFaceVelocity(Vector2D wl, Vector2D wr, Vector2D rL, Vector2D rR, Vector2D f) const =0
Calculates the velocity of a single edge.
virtual vector< vector< int > > & GetDuplicatedPoints(void)=0
Returns the indeces of the points that where sent to other processors as ghost points.
virtual vector< int > const & GetCellEdges(int index) const =0
Returns the indexes of a cell&#39;s edges.
Abstract class for geometric boundary conditions for the tessellation.
virtual vector< vector< int > > & GetGhostIndeces(void)=0
Returns the indeces of each ghost point in the vector of points that the tessellation holds...
2D Mathematical vector
Definition: geometry.hpp:15
virtual vector< int > GetNeighbors(int index) const =0
Returns the indeces of the neighbors.
virtual void Initialise(vector< Vector2D > const &points, OuterBoundary const *bc, bool HilbertOrder=true)=0
Initialises the tessellation.
virtual vector< int > GetSentProcs(void) const =0
Returns the indeces of the processors with whom points where exchanged.