3 #include "../misc/simple_io.hpp" 14 VoronoiLogger::~VoronoiLogger(
void) {}
17 file_name_(file_name) {}
21 ofstream file_handle(file_name_.c_str(),ios::binary);
48 for(
int i=0;i<static_cast<int>(v.
GetPointNo());++i)
54 for(
int i=0;i<static_cast<int>(v.
GetPointNo());++i)
58 for(
int j=0;j<static_cast<int>(indices.size());++j)
66 ofstream file_handle(file_name_.c_str(),ios::binary);
93 for(
int i=0;i<static_cast<int>(v.
GetPointNo());++i)
99 for(
int i=0;i<static_cast<int>(v.
GetPointNo());++i)
103 for(
int j=0;j<static_cast<int>(indices.size());++j)
111 fstream myFile (location.c_str(),ios::in | ios::binary);
115 myFile.read(reinterpret_cast<char*>(&N),
sizeof (
int));
117 for(
int i=0;i<N*4;++i)
118 myFile.read(reinterpret_cast<char*>(&temp),
sizeof(
double));
119 for (
int i = 0; i<N *2; ++i)
120 myFile.read(reinterpret_cast<char*>(&itemp),
sizeof(
int));
121 myFile.read(reinterpret_cast<char*>(&N),
sizeof (
int));
122 vector<Vector2D> res(static_cast<size_t>(N));
123 for(
size_t i=0;i<static_cast<size_t>(N);++i)
125 myFile.read(reinterpret_cast<char*>(&res[i].x),
sizeof(
double));
126 myFile.read(reinterpret_cast<char*>(&res[i].y),
sizeof(
double));
Voronoi tessellation class.
Edge const & GetEdge(int index) const
Returns edge (interface between cells)
vector< Vector2D > read(string location)
Reads the output information from the Voronoi tessellation.
Abstract class for tessellation.
virtual int GetPointNo(void) const =0
Get Total number of mesh generating points.
Container for error reports.
void binary_write_single_double(double d, ofstream &fh)
Writes a double to a binary file.
Interface between two cells.
virtual Vector2D GetMeshPoint(int index) const =0
Returns Position of mesh generating point.
virtual void output(const VoronoiMesh &v)
Outputs information from the Voronoi tessellation.
void output(const VoronoiMesh &v)
Outputs information from the Voronoi tessellation.
double y
Component in the y direction.
A debugging function for the Voronoi tessellation.
virtual Edge const & GetEdge(int index) const =0
Returns edge (interface between cells)
int GetPointNo(void) const
Get Total number of mesh generating points.
std::pair< Vector2D, Vector2D > vertices
Points at the ends of the edge.
vector< int > const & GetCellEdges(int index) const
Returns a reference to a vector<int> containing the indexes of the edges related to a cell...
void binary_write_single_int(int n, ofstream &fh)
Writes a single integer to a binary file.
int GetTotalSidesNumber(void) const
Returns the total number of faces.
virtual int GetTotalSidesNumber(void) const =0
Returns the total number of faces.
std::pair< int, int > neighbors
Neighboring cells.
Voronoi tessellation with MPI option.
virtual vector< int > const & GetCellEdges(int index) const =0
Returns the indexes of a cell's edges.
BinLogger(const std::string &file_name)
Class constructor.
Diagnostic functions for Voronoi tessellation.
Vector2D GetMeshPoint(int index) const
Returns Position of mesh generating point.
double x
Component in the x direction.
VoronoiLogger(void)
Class constructor.