Loading...
Searching...
No Matches
Functions
bitpit::dgf Namespace Reference

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="")
 

Detailed Description

Utility fuctions for DGF IO.

Function Documentation

◆ check()

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.

Parameters
[in,out]file_handleinput stream from dgf file.
[in,out]err_codeon 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
Returns
error flag for I/O errors: err = 0: no error(s) encountered err = 1: failed to scan dgf file.

Definition at line 1169 of file DGF.cpp.

◆ checkData()

unsigned int bitpit::dgf::checkData ( std::ifstream & file_handle,
int & err_code )

Scan dgf data block and check for format errors.

Parameters
[in,out]file_handleinput stream from dgf file.
[in,out]err_codeerror 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
Returns
error flag for I/O errors: err = 0: no error(s) encountered err = 1: failed to scan dgf file.

Definition at line 1090 of file DGF.cpp.

◆ readMesh() [1/2]

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>>

Parameters
[in]file_handleinput file stream
[in,out]nVon 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]nSon 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]Vvertex 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]Scell->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.
Returns
error flag for I/O errors. err = 0: no error(s) occurred err = 1: failed to import mesh data from dgf file.

Definition at line 1358 of file DGF.cpp.

◆ readMesh() [2/2]

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.

Parameters
[in]file_handleinput file stream
[in,out]nVon 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]nSon 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]Vvertex 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]Scell->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.
Returns
error flag for I/O errors. err = 0: no error(s) occurred err = 1: failed to import mesh data from dgf file.

Definition at line 1270 of file DGF.cpp.

◆ scan()

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

Parameters
[in,out]file_handleinput stream from dgf file.
[in,out]nVon output stores the number of mesh vertices
[in,out]nSon output stores the number of mesh cells
[in,out]sV_dataname associated to each vertex data block
[in,out]sS_dataname associated to each cell data block
[in,out]nV_datanumber of data entries for each vertex data block
[in,out]nS_datanumber of data entries for each cell data block
Returns
error flag for I/O errors: err = 0: no error(s) encountered err = 1: failed to scan dgf file.

Definition at line 972 of file DGF.cpp.

◆ scanData()

unsigned int bitpit::dgf::scanData ( std::ifstream & file_handle,
int & n )

Scan dgf data block and returns the number of entries in the block.

Parameters
[in,out]file_handleinput stream from dgf file
[in,out]non output stores the number of entries found in the data block
Returns
error flag for I/O errors: err = 0: no error(s) encountered err = 1: failed to scan dgf file.

Definition at line 893 of file DGF.cpp.

◆ writeMesh() [1/2]

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> >

Parameters
[in,out]file_handleoutput stream to dgf file.
[in]nVnumber of mesh vertices
[in]nSnumber of mesh cells
[in]Vvertex coordinate list
[in]Scell->vertex connectivity
Returns
error flag for I/O errors: err = 0: no error(s) encountered err = 1: failed to write data to dgf file.

Definition at line 1491 of file DGF.cpp.

◆ writeMesh() [2/2]

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.

Parameters
[in,out]file_handleoutput stream to dgf file.
[in]nVnumber of mesh vertices
[in]nSnumber of mesh cells
[in]Vvertex coordinate list
[in]Scell->vertex connectivity
Returns
error flag for I/O errors: err = 0: no error(s) encountered err = 1: failed to write data to dgf file.

Definition at line 1439 of file DGF.cpp.

--- layout: doxygen_footer ---