Utility fuctions for DGF IO. More...
Functions | |
unsigned int | check (std::ifstream &, std::vector< std::vector< int > > &) |
unsigned int | checkData (std::ifstream &, int &) |
template<typename T > | |
unsigned int | readData (std::ifstream &file_handle, int &N, std::vector< T > &Data) |
unsigned int | readMesh (std::ifstream &, int &, int &, std::vector< std::array< double, 3 > > &, std::vector< std::vector< int > > &) |
unsigned int | readMesh (std::ifstream &, int &, int &, std::vector< std::vector< double > > &, std::vector< std::vector< int > > &) |
template<typename T > | |
unsigned int | readSimplexData (std::ifstream &file_handle, int &n, std::vector< T > &data, const std::string &data_name="") |
template<typename T > | |
unsigned int | readVertexData (std::ifstream &file_handle, int &n, std::vector< T > &data, const std::string &data_name="") |
unsigned int | scan (std::ifstream &, int &, int &, std::vector< std::string > &, std::vector< std::string > &, std::vector< int > &, std::vector< int > &) |
unsigned int | scanData (std::ifstream &, int &) |
template<typename T > | |
unsigned int | writeData (std::ofstream &, int &, std::vector< T > &) |
unsigned int | writeMesh (std::ofstream &, int &, int &, std::vector< std::array< double, 3 > > &, std::vector< std::vector< int > > &) |
unsigned int | writeMesh (std::ofstream &, int &, int &, std::vector< std::vector< double > > &, std::vector< std::vector< int > > &) |
template<typename T > | |
unsigned int | writeSimplexData (std::ofstream &file_handle, int &N, std::vector< T > &Data, const std::string &Data_name="") |
template<typename T > | |
unsigned int | writeVertexData (std::ofstream &file_handle, int &N, std::vector< T > &Data, const std::string &Data_name="") |
Utility fuctions for DGF IO.
unsigned int bitpit::dgf::check | ( | std::ifstream & | file_handle, |
std::vector< std::vector< int > > & | err_code ) |
Scan dgf file and check for format error(s) within the file.
[in,out] | file_handle | input stream from dgf file. |
[in,out] | err_code | on output stores the error code for format error(s) found in each data section: err_code[0][0] stores the list of error codes found in the vertex section err_code[1][0] stores the list of error codes found in the cell section err_code[2][i] stores the list of error codes found in the i-th vertex data section err_code[3][i] stores the list of error codes found in the i-th cell data section Error codes are listed below: err_code[i][j] = 0: no error(s) found err_code[i][j] = 1: unterminated data block err_code[i][j] = 2: unreadable data |
unsigned int bitpit::dgf::checkData | ( | std::ifstream & | file_handle, |
int & | err_code ) |
Scan dgf data block and check for format errors.
[in,out] | file_handle | input stream from dgf file. |
[in,out] | err_code | error code for format error founds in the data block err_code = 0: no error(s) found err_code = 1: unterminated data block err_code = 2: unreadable data |
unsigned int bitpit::dgf::readMesh | ( | std::ifstream & | file_handle, |
int & | nV, | ||
int & | nS, | ||
std::vector< std::array< double, 3 > > & | V, | ||
std::vector< std::vector< int > > & | S ) |
Load mesh from dgf file. Overloading of function dgf::readMesh() for container vector<array<double,3>>
[in] | file_handle | input file stream |
[in,out] | nV | on input stores the number of vertices already acquired from the dgf file. On output stores the input value incremented by the number of mesh vertices loaded from the dgf file. |
[in,out] | nS | on input stores the number of cells already acquired from the dgf file. On output stores the input value incremented by the number of mesh cells loaded from the dgf file. |
[in,out] | V | vertex coordinate list. On output stores the coordinates of the vertices already acquired from the dgf file. New coordinates are appended at the end of V. |
[in,out] | S | cell->vertex connectivity data. On output stores the connectivity entries for cells acquired from the dgf file. New connectivity entries are appended at the and of S. |
unsigned int bitpit::dgf::readMesh | ( | std::ifstream & | file_handle, |
int & | nV, | ||
int & | nS, | ||
std::vector< std::vector< double > > & | V, | ||
std::vector< std::vector< int > > & | S ) |
Load mesh from dgf file.
[in] | file_handle | input file stream |
[in,out] | nV | on input stores the number of vertices already acquired from the dgf file. On output stores the input value incremented by the number of mesh vertices loaded from the dgf file. |
[in,out] | nS | on input stores the number of cells already acquired from the dgf file. On output stores the input value incremented by the number of mesh cells loaded from the dgf file. |
[in,out] | V | vertex coordinate list. On output stores the coordinates of the vertices already acquired from the dgf file. New coordinates are appended at the end of V. |
[in,out] | S | cell->vertex connectivity data. On output stores the connectivity entries for cells acquired from the dgf file. New connectivity entries are appended at the and of S. |
unsigned int bitpit::dgf::scan | ( | std::ifstream & | file_handle, |
int & | nV, | ||
int & | nS, | ||
std::vector< std::string > & | sV_data, | ||
std::vector< std::string > & | sS_data, | ||
std::vector< int > & | nV_data, | ||
std::vector< int > & | nS_data ) |
Scan dgf file and gather infos
[in,out] | file_handle | input stream from dgf file. |
[in,out] | nV | on output stores the number of mesh vertices |
[in,out] | nS | on output stores the number of mesh cells |
[in,out] | sV_data | name associated to each vertex data block |
[in,out] | sS_data | name associated to each cell data block |
[in,out] | nV_data | number of data entries for each vertex data block |
[in,out] | nS_data | number of data entries for each cell data block |
unsigned int bitpit::dgf::scanData | ( | std::ifstream & | file_handle, |
int & | n ) |
Scan dgf data block and returns the number of entries in the block.
[in,out] | file_handle | input stream from dgf file |
[in,out] | n | on output stores the number of entries found in the data block |
unsigned int bitpit::dgf::writeMesh | ( | std::ofstream & | file_handle, |
int & | nV, | ||
int & | nS, | ||
std::vector< std::array< double, 3 > > & | V, | ||
std::vector< std::vector< int > > & | S ) |
Export mesh to dgf file. Overloading of function dgf::writeMesh() for container vector<array<double,3> >
[in,out] | file_handle | output stream to dgf file. |
[in] | nV | number of mesh vertices |
[in] | nS | number of mesh cells |
[in] | V | vertex coordinate list |
[in] | S | cell->vertex connectivity |
unsigned int bitpit::dgf::writeMesh | ( | std::ofstream & | file_handle, |
int & | nV, | ||
int & | nS, | ||
std::vector< std::vector< double > > & | V, | ||
std::vector< std::vector< int > > & | S ) |
Export mesh to dgf file.
[in,out] | file_handle | output stream to dgf file. |
[in] | nV | number of mesh vertices |
[in] | nS | number of mesh cells |
[in] | V | vertex coordinate list |
[in] | S | cell->vertex connectivity |