Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
bitpit::DGFObj Class Reference

Interface to DGF I/O function. More...

Collaboration diagram for bitpit::DGFObj:
Collaboration graph
[legend]

Public Member Functions

 DGFObj (const std::string &)
 
 DGFObj (void)
 
template<typename T , typename ... T2>
void appendSData (const std::string &data_name, int &n, std::vector< T > &data, T2 &... others)
 
template<typename T , typename ... T2>
void appendSData (const std::string &data_name, int &n, std::vector< T > &data, T2 &... others)
 
template<typename T , typename ... T2>
void appendVData (const std::string &data_name, int &n, std::vector< T > &data, T2 &... others)
 
template<typename T , typename ... T2>
void appendVData (const std::string &data_name, int &n, std::vector< T > &data, T2 &... others)
 
void check (void)
 
void clear (void)
 
void close (const std::string &a="inout")
 
void display (std::ostream &)
 
void load (int &, int &, std::vector< std::array< double, 3 > > &, std::vector< std::vector< int > > &)
 
void load (int &, int &, std::vector< std::array< double, 3 > > &, std::vector< std::vector< int > > &, std::vector< int > &, const std::string &pidName="PID")
 
void load (int &, int &, std::vector< std::vector< double > > &, std::vector< std::vector< int > > &)
 
template<typename T , typename ... T2>
void loadSData (const std::string &data_name, int &n, std::vector< T > &data, T2 &... others)
 
template<typename T , typename ... T2>
void loadSData (const std::string &data_name, int &n, std::vector< T > &data, T2 &... others)
 
template<typename T , typename ... T2>
void loadVData (const std::string &data_name, int &n, std::vector< T > &data, T2 &... others)
 
template<typename T , typename ... T2>
void loadVData (const std::string &data_name, int &n, std::vector< T > &data, T2 &... others)
 
void open (const std::string &)
 
void save (int &, int &, std::vector< std::array< double, 3 > > &, std::vector< std::vector< int > > &)
 
void save (int &, int &, std::vector< std::vector< double > > &, std::vector< std::vector< int > > &)
 
void scan (void)
 

Public Attributes

DGFData data
 
std::string dgf_name
 
unsigned int err
 

Detailed Description

Interface to DGF I/O function.

This class has been designed to allow an easy interface between end-user and DGF I/O functions.

Definition at line 78 of file DGF.hpp.

Constructor & Destructor Documentation

◆ DGFObj() [1/2]

bitpit::DGFObj::DGFObj ( void )

Default constructor for class DGF obj.

Initialize an empty interface.

Definition at line 70 of file DGF.cpp.

◆ DGFObj() [2/2]

bitpit::DGFObj::DGFObj ( const std::string & filename)

Constructor #1 for class DGFObj.

Initialize an interface associated to a dgf file with specified name.

Parameters
[in]filenamedgf file name

Definition at line 109 of file DGF.cpp.

Member Function Documentation

◆ appendSData()

template<typename T , typename ... T2>
void bitpit::DGFObj::appendSData ( const std::string & data_name,
int & n,
std::vector< T > & data,
T2 &... others )

Append cell data to dgf file.

Parameters
[in]data_namename of cell data block to be appended.
[in]nnumber data entries to be exported to the dgf file.
[in]datacontainer storing the data to be written into the dgf file.
[in]othersother data to be exported.

Definition at line 193 of file DGF.tpp.

◆ appendVData()

template<typename T , typename ... T2>
void bitpit::DGFObj::appendVData ( const std::string & data_name,
int & n,
std::vector< T > & data,
T2 &... others )

Append vertex data to dgf file.

Parameters
[in]data_namename of vertex data block to be appended.
[in]nnumber data entries to be exported to the dgf file.
[in]datacontainer storing the data to be written into the dgf file.
[in]othersother data to be exported.

Definition at line 149 of file DGF.tpp.

◆ check()

void bitpit::DGFObj::check ( void )

Scan dgf file associated with the interface and perform check on format error(s).

Definition at line 463 of file DGF.cpp.

◆ clear()

void bitpit::DGFObj::clear ( void )

Clear info gathered from the associated dgf file,

Definition at line 263 of file DGF.cpp.

◆ close()

void bitpit::DGFObj::close ( const std::string & mode = "inout")

Close stream from/to the dgf file associated with the interface.

Parameters
[in]modeopening mode used for the stream ("in": input, "out": output, "app": append mode)

Definition at line 214 of file DGF.cpp.

◆ display()

void bitpit::DGFObj::display ( std::ostream & out)

Display content and info to output stream

Parameters
[in,out]outoutput stream

Definition at line 304 of file DGF.cpp.

◆ load() [1/3]

void bitpit::DGFObj::load ( int & nV,
int & nS,
std::vector< std::array< double, 3 > > & V,
std::vector< std::vector< int > > & S )

Load mesh data from DGF file. Overloading of member function DGFObj::load() for container vector<array<double,3>>

Parameters
[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.

Definition at line 568 of file DGF.cpp.

◆ load() [2/3]

void bitpit::DGFObj::load ( int & nV,
int & nS,
std::vector< std::array< double, 3 > > & V,
std::vector< std::vector< int > > & S,
std::vector< int > & PID,
const std::string & pidName = "PID" )

Load mesh data from DGF file. Overloading of member function DGFObj::load() for container vector<array<double,3>>

Parameters
[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.
[out]PIDpart identifier list for each simplex.
[in]pidNamename of the SIMPLEXDATA to be used as PID.

Definition at line 622 of file DGF.cpp.

◆ load() [3/3]

void bitpit::DGFObj::load ( int & nV,
int & nS,
std::vector< std::vector< double > > & V,
std::vector< std::vector< int > > & S )

Load mesh data from DGF file.

Parameters
[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.

Definition at line 516 of file DGF.cpp.

◆ loadSData()

template<typename T , typename ... T2>
void bitpit::DGFObj::loadSData ( const std::string & data_name,
int & n,
std::vector< T > & data,
T2 &... others )

Load cell data from dgf file.

Parameters
[in]data_namename of cell data block to be loaded. If no name is specified (i.e. data_name = "") the first cell data block found in the dgf file is returned. If no cell datablock is found with the specified name no data is loaded.
[in,out]nnumber data entries loaded from the data set
[in,out]dataon output stores the data loaded from the data block
[in]othersother data to be loaded.

Definition at line 105 of file DGF.tpp.

◆ loadVData()

template<typename T , typename ... T2>
void bitpit::DGFObj::loadVData ( const std::string & data_name,
int & n,
std::vector< T > & data,
T2 &... others )

Load vertex data from dgf file.

Parameters
[in]data_namename of vertex data block to be loaded. If no name is specified (i.e. data_name = "") the first vertex data block found in the dgf file is returned. If no vertex datablock is found with the specified name no data is loaded.
[in,out]nnumber data entries loaded from the data set
[in,out]dataon output stores the data loaded from the data block
[in]othersother data to be loaded.

Definition at line 58 of file DGF.tpp.

◆ open()

void bitpit::DGFObj::open ( const std::string & mode)

Open stream to dgf file associated with the interface.

Parameters
[in]modeopening mode ("in": input, "out": output, "app": append mode)

Definition at line 151 of file DGF.cpp.

◆ save() [1/2]

void bitpit::DGFObj::save ( int & nV,
int & nS,
std::vector< std::array< double, 3 > > & V,
std::vector< std::vector< int > > & S )

Save mesh data from DGF file. Overloading of member function DGFObj::save() for container vector<array<double,3>>

Parameters
[in]nVnumber of vertices in the mesh
[in]nSnumber of cells in the mesh
[in]Vvertex coordinate list.
[in]Scell->vertex connectivity data.

Definition at line 743 of file DGF.cpp.

◆ save() [2/2]

void bitpit::DGFObj::save ( int & nV,
int & nS,
std::vector< std::vector< double > > & V,
std::vector< std::vector< int > > & S )

Save mesh data from DGF file.

Parameters
[in]nVnumber of vertices in the mesh
[in]nSnumber of cells in the mesh
[in]Vvertex coordinate list.
[in]Scell->vertex connectivity data.

Definition at line 676 of file DGF.cpp.

◆ scan()

void bitpit::DGFObj::scan ( void )

Scan dgf file associated to the interface and gather infos.

Definition at line 421 of file DGF.cpp.

Member Data Documentation

◆ data

DGFData bitpit::DGFObj::data

dgf file content

Definition at line 86 of file DGF.hpp.

◆ dgf_name

std::string bitpit::DGFObj::dgf_name

dgf file name

Definition at line 84 of file DGF.hpp.

◆ err

unsigned int bitpit::DGFObj::err

general error flag

Definition at line 85 of file DGF.hpp.


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