PeriDEM 0.2.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
Loading...
Searching...
No Matches
rw::writer::LegacyVtkWriter Class Reference

A vtk writer for simple point data and complex fem mesh data. More...

#include <legacyVtkWriter.h>

Collaboration diagram for rw::writer::LegacyVtkWriter:

Public Member Functions

 LegacyVtkWriter (const std::string &filename, const std::string &compress_type="")
 Constructor.
 
void close ()
 Closes the file and store it to the hard disk.
 
Mesh data
void appendNodes (const std::vector< util::Point > *nodes)
 Writes the nodes to the file.
 
void appendNodes (const std::vector< util::Point > *nodes, const std::vector< util::Point > *u)
 Writes the nodes to the file.
 
void appendMesh (const std::vector< util::Point > *nodes, const size_t &element_type, const std::vector< size_t > *en_con, const std::vector< util::Point > *u=nullptr)
 Writes the mesh data to file.
 
Point data
void appendPointData (const std::string &name, const std::vector< uint8_t > *data)
 Writes the scalar point data to the file.
 
void appendPointData (const std::string &name, const std::vector< size_t > *data)
 Writes the scalar point data to the file.
 
void appendPointData (const std::string &name, const std::vector< int > *data)
 Writes the scalar point data to the file.
 
void appendPointData (const std::string &name, const std::vector< float > *data)
 Writes the scalar point data to the file.
 
void appendPointData (const std::string &name, const std::vector< double > *data)
 Writes the scalar point data to the file.
 
void appendPointData (const std::string &name, const std::vector< util::Point > *data)
 Writes the vector point data to the file.
 
void appendPointData (const std::string &name, const std::vector< util::SymMatrix3 > *data)
 Writes the symmetric matrix data associated to nodes to the file.
 
Cell data
void appendCellData (const std::string &name, const std::vector< float > *data)
 Writes the float data associated to cells to the file.
 
void appendCellData (const std::string &name, const std::vector< util::SymMatrix3 > *data)
 Writes the symmetric matrix data associated to cells to the file.
 
Field data
void appendFieldData (const std::string &name, const double &data)
 Writes the scalar field data to the file.
 
void appendFieldData (const std::string &name, const float &data)
 Writes the scalar field data to the file.
 
void addTimeStep (const double &timestep)
 Writes the time step to the file.
 

Private Attributes

std::string d_filename
 filename
 
std::string d_compressType
 compression_type Specify the compressor (if any)
 
std::ofstream d_file
 vtk/vtu file
 

Detailed Description

A vtk writer for simple point data and complex fem mesh data.

Definition at line 26 of file legacyVtkWriter.h.

Constructor & Destructor Documentation

◆ LegacyVtkWriter()

rw::writer::LegacyVtkWriter::LegacyVtkWriter ( const std::string &  filename,
const std::string &  compress_type = "" 
)
explicit

Constructor.

Creates and opens .vtu file of name given by filename. The file remains open till the close() function is invoked.

Parameters
filenameName of file which will be created
compress_typeCompression method (optional)

Definition at line 8 of file legacyVtkWriter.cpp.

10 : d_filename(filename), d_compressType(compress_type) {}
std::string d_filename
filename
std::string d_compressType
compression_type Specify the compressor (if any)

Member Function Documentation

◆ addTimeStep()

void rw::writer::LegacyVtkWriter::addTimeStep ( const double &  timestep)

Writes the time step to the file.

Parameters
timestepCurrent time step of the simulation

Definition at line 50 of file legacyVtkWriter.cpp.

50{}

◆ appendCellData() [1/2]

void rw::writer::LegacyVtkWriter::appendCellData ( const std::string &  name,
const std::vector< float > *  data 
)

Writes the float data associated to cells to the file.

Parameters
nameName of the data
dataVector containing the data

Definition at line 44 of file legacyVtkWriter.cpp.

45 {}

◆ appendCellData() [2/2]

void rw::writer::LegacyVtkWriter::appendCellData ( const std::string &  name,
const std::vector< util::SymMatrix3 > *  data 
)

Writes the symmetric matrix data associated to cells to the file.

Parameters
nameName of the data
dataVector containing the data

Definition at line 47 of file legacyVtkWriter.cpp.

48 {}

◆ appendFieldData() [1/2]

void rw::writer::LegacyVtkWriter::appendFieldData ( const std::string &  name,
const double &  data 
)

Writes the scalar field data to the file.

Parameters
nameName of the data
dataValue

Definition at line 54 of file legacyVtkWriter.cpp.

55 {}

◆ appendFieldData() [2/2]

void rw::writer::LegacyVtkWriter::appendFieldData ( const std::string &  name,
const float &  data 
)

Writes the scalar field data to the file.

Parameters
nameName of the data
dataValue

Definition at line 57 of file legacyVtkWriter.cpp.

58 {}

◆ appendMesh()

void rw::writer::LegacyVtkWriter::appendMesh ( const std::vector< util::Point > *  nodes,
const size_t &  element_type,
const std::vector< size_t > *  en_con,
const std::vector< util::Point > *  u = nullptr 
)

Writes the mesh data to file.

Parameters
nodesVector of nodal coordinates
element_typeType of element
en_conVector of element-node connectivity
uVector of nodal displacement

Definition at line 18 of file legacyVtkWriter.cpp.

21 {}

◆ appendNodes() [1/2]

void rw::writer::LegacyVtkWriter::appendNodes ( const std::vector< util::Point > *  nodes)

Writes the nodes to the file.

Parameters
nodesCurrent positions of the nodes

Definition at line 12 of file legacyVtkWriter.cpp.

13 {}

◆ appendNodes() [2/2]

void rw::writer::LegacyVtkWriter::appendNodes ( const std::vector< util::Point > *  nodes,
const std::vector< util::Point > *  u 
)

Writes the nodes to the file.

Parameters
nodesReference positions of the nodes
uNodal displacements

Definition at line 15 of file legacyVtkWriter.cpp.

16 {}

◆ appendPointData() [1/7]

void rw::writer::LegacyVtkWriter::appendPointData ( const std::string &  name,
const std::vector< double > *  data 
)

Writes the scalar point data to the file.

Parameters
nameName of the data
dataVector containing the data

Definition at line 35 of file legacyVtkWriter.cpp.

36 {}

◆ appendPointData() [2/7]

void rw::writer::LegacyVtkWriter::appendPointData ( const std::string &  name,
const std::vector< float > *  data 
)

Writes the scalar point data to the file.

Parameters
nameName of the data
dataVector containing the data

Definition at line 32 of file legacyVtkWriter.cpp.

33 {}

◆ appendPointData() [3/7]

void rw::writer::LegacyVtkWriter::appendPointData ( const std::string &  name,
const std::vector< int > *  data 
)

Writes the scalar point data to the file.

Parameters
nameName of the data
dataVector containing the data

Definition at line 29 of file legacyVtkWriter.cpp.

30 {}

◆ appendPointData() [4/7]

void rw::writer::LegacyVtkWriter::appendPointData ( const std::string &  name,
const std::vector< size_t > *  data 
)

Writes the scalar point data to the file.

Parameters
nameName of the data
dataVector containing the data

Definition at line 26 of file legacyVtkWriter.cpp.

27 {}

◆ appendPointData() [5/7]

void rw::writer::LegacyVtkWriter::appendPointData ( const std::string &  name,
const std::vector< uint8_t > *  data 
)

Writes the scalar point data to the file.

Parameters
nameName of the data
dataVector containing the data

Definition at line 23 of file legacyVtkWriter.cpp.

24 {}

◆ appendPointData() [6/7]

void rw::writer::LegacyVtkWriter::appendPointData ( const std::string &  name,
const std::vector< util::Point > *  data 
)

Writes the vector point data to the file.

Parameters
nameName of the data
dataVector containing the data

Definition at line 38 of file legacyVtkWriter.cpp.

39 {}

◆ appendPointData() [7/7]

void rw::writer::LegacyVtkWriter::appendPointData ( const std::string &  name,
const std::vector< util::SymMatrix3 > *  data 
)

Writes the symmetric matrix data associated to nodes to the file.

Parameters
nameName of the data
dataVector containing the data

Definition at line 41 of file legacyVtkWriter.cpp.

42 {}

◆ close()

void rw::writer::LegacyVtkWriter::close ( )

Closes the file and store it to the hard disk.

Definition at line 52 of file legacyVtkWriter.cpp.

52{}

Field Documentation

◆ d_compressType

std::string rw::writer::LegacyVtkWriter::d_compressType
private

compression_type Specify the compressor (if any)

Definition at line 195 of file legacyVtkWriter.h.

◆ d_file

std::ofstream rw::writer::LegacyVtkWriter::d_file
private

vtk/vtu file

Definition at line 198 of file legacyVtkWriter.h.

◆ d_filename

std::string rw::writer::LegacyVtkWriter::d_filename
private

filename

Definition at line 192 of file legacyVtkWriter.h.


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