PeriDEM 0.2.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
|
A .msh writer for simple point data and complex fem mesh data. More...
#include <mshWriter.h>
Public Member Functions | |
MshWriter (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, const std::vector< util::Point > *u=nullptr) |
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 ×tep) |
Writes the time step to the file. | |
Private Member Functions | |
void | writeMshDataHeader (const std::string &name, int field_type, size_t num_data, bool is_node_data=true) |
utility function | |
Private Attributes | |
std::string | d_filename |
filename | |
std::string | d_compressType |
compression_type Specify the compressor (if any) | |
FILE * | d_file |
msh file | |
A .msh writer for simple point data and complex fem mesh data.
We are using Gmsh 2.0 format.
Definition at line 24 of file mshWriter.h.
|
explicit |
Constructor.
Writes mesh data in .msh format
filename | Name of file which will be created |
compress_type | Compression method (optional) |
Definition at line 16 of file mshWriter.cpp.
References util::io::checkAndCreateNewFilename(), and d_filename.
void rw::writer::MshWriter::addTimeStep | ( | const double & | timestep | ) |
Writes the time step to the file.
timestep | Current time step of the simulation |
Definition at line 221 of file mshWriter.cpp.
void rw::writer::MshWriter::appendCellData | ( | const std::string & | name, |
const std::vector< float > * | data | ||
) |
Writes the float data associated to cells to the file.
name | Name of the data |
data | Vector containing the data |
Definition at line 198 of file mshWriter.cpp.
void rw::writer::MshWriter::appendCellData | ( | const std::string & | name, |
const std::vector< util::SymMatrix3 > * | data | ||
) |
Writes the symmetric matrix data associated to cells to the file.
name | Name of the data |
data | Vector containing the data |
Definition at line 209 of file mshWriter.cpp.
void rw::writer::MshWriter::appendFieldData | ( | const std::string & | name, |
const double & | data | ||
) |
Writes the scalar field data to the file.
name | Name of the data |
data | Value |
Definition at line 237 of file mshWriter.cpp.
void rw::writer::MshWriter::appendFieldData | ( | const std::string & | name, |
const float & | data | ||
) |
Writes the scalar field data to the file.
name | Name of the data |
data | Value |
Definition at line 247 of file mshWriter.cpp.
void rw::writer::MshWriter::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.
nodes | Vector of nodal coordinates |
element_type | Type of element |
en_con | Vector of element-node connectivity |
u | Vector of nodal displacement |
Definition at line 87 of file mshWriter.cpp.
References util::vtk_map_element_to_num_nodes, and util::vtk_to_msh_element_type_map.
void rw::writer::MshWriter::appendNodes | ( | const std::vector< util::Point > * | nodes, |
const std::vector< util::Point > * | u = nullptr |
||
) |
Writes the nodes to the file.
nodes | Reference positions of the nodes |
u | Nodal displacements |
Definition at line 54 of file mshWriter.cpp.
void rw::writer::MshWriter::appendPointData | ( | const std::string & | name, |
const std::vector< double > * | data | ||
) |
Writes the scalar point data to the file.
name | Name of the data |
data | Vector containing the data |
Definition at line 164 of file mshWriter.cpp.
void rw::writer::MshWriter::appendPointData | ( | const std::string & | name, |
const std::vector< float > * | data | ||
) |
Writes the scalar point data to the file.
name | Name of the data |
data | Vector containing the data |
Definition at line 153 of file mshWriter.cpp.
void rw::writer::MshWriter::appendPointData | ( | const std::string & | name, |
const std::vector< int > * | data | ||
) |
Writes the scalar point data to the file.
name | Name of the data |
data | Vector containing the data |
Definition at line 142 of file mshWriter.cpp.
void rw::writer::MshWriter::appendPointData | ( | const std::string & | name, |
const std::vector< size_t > * | data | ||
) |
Writes the scalar point data to the file.
name | Name of the data |
data | Vector containing the data |
Definition at line 130 of file mshWriter.cpp.
void rw::writer::MshWriter::appendPointData | ( | const std::string & | name, |
const std::vector< uint8_t > * | data | ||
) |
Writes the scalar point data to the file.
name | Name of the data |
data | Vector containing the data |
Definition at line 118 of file mshWriter.cpp.
void rw::writer::MshWriter::appendPointData | ( | const std::string & | name, |
const std::vector< util::Point > * | data | ||
) |
Writes the vector point data to the file.
name | Name of the data |
data | Vector containing the data |
Definition at line 175 of file mshWriter.cpp.
void rw::writer::MshWriter::appendPointData | ( | const std::string & | name, |
const std::vector< util::SymMatrix3 > * | data | ||
) |
Writes the symmetric matrix data associated to nodes to the file.
name | Name of the data |
data | Vector containing the data |
Definition at line 186 of file mshWriter.cpp.
void rw::writer::MshWriter::close | ( | ) |
Closes the file and store it to the hard disk.
Definition at line 230 of file mshWriter.cpp.
|
private |
utility function
field_type:
name | Name of data |
field_type | Field type (see above) |
num_data | Number of data |
is_node_data | Indicate if this is Node or Element data |
Definition at line 22 of file mshWriter.cpp.
|
private |
compression_type Specify the compressor (if any)
Definition at line 202 of file mshWriter.h.
|
private |
msh file
Definition at line 205 of file mshWriter.h.
|
private |