![]() |
Interprets thin-wall meshes structured in the ".msh" format. More...
#include <LineParser.h>
Public Member Functions | |
bool | readMeshFormat (std::ifstream &, double *) |
Verifies the mesh format of the file. | |
bool | readNodes (std::ifstream &in, std::vector< Node > *nodes) |
Reads the nodes from the .msh file. | |
void | readInt (std::ifstream &in, int *number) |
Assigns an integer value from the .msh file to the number argument. | |
void | readDouble (std::ifstream &in, double *number) |
Assigns a double value from the .msh file to the number argument. | |
bool | filePosEqualsLine (std::ifstream &, std::string) |
Verifies that the line from the file matches with .msh format version. | |
void | createTwoNodeLineElement (std::ifstream &in, std::vector< LineElement * > *elements, int type, std::vector< Node > &nodes) |
Creates a two-node LineElement with material properties according to base material. Default thickness is 5. | |
void | createTwoNodeSpecificLineElement (std::ifstream &in, std::vector< LineElement * > *elements, int type, std::vector< Node > &nodes) |
Creates a two-node LineElement with specific material properties as defined by .msh file. | |
LineParser (std::string fileName, std::vector< LineElement * > &elements, std::vector< Node > &nodes, Material mat) | |
Constructor. More... | |
void | load_msh (std::ifstream &, std::vector< LineElement * > &elements, std::vector< Node > &nodes) |
Loads the .msh file data into the elements and nodes vectors. More... | |
bool | readElements (std::ifstream &, std::vector< LineElement * > *, std::vector< Node > &nodes) |
Reads the elements from .msh file. More... | |
Public Attributes | |
Material | mat |
Base material, passed from LineMesh. Regular elements properties is set according to the base material. | |
int | regularCount |
Counter for regular elements (no material properties specified in mesh file. Base material is used) | |
int | specificCount |
Counter for specific elements (uses material properties specific in mesh file) | |
std::string | line |
Data on line in current position in file. | |
Static Public Attributes | |
static const int | TWO_NODED_LINE_REGULAR = 1 |
Integer for regular two-node line element, with material properties identical to base material. Default thickness is 5. Elm-type key is 1. | |
static const int | TWO_NODED_LINE_SPECIFIC = 4 |
Integer for "custom" two-node line element, with material properties set according to .msh file. Elm-type key is 4. | |
Interprets thin-wall meshes structured in the ".msh" format.
LineParser::LineParser | ( | std::string | fileName, |
std::vector< LineElement * > & | elements, | ||
std::vector< Node > & | nodes, | ||
Material | mat | ||
) |
Constructor.
The constructor takes the filename, and the elements vector and nodes vector from LineMesh as arguments. It opens the .msh file and loads the elements and nodes into the respective vector.
void LineParser::load_msh | ( | std::ifstream & | file, |
std::vector< LineElement * > & | elements, | ||
std::vector< Node > & | nodes | ||
) |
Loads the .msh file data into the elements and nodes vectors.
Interprets the mesh data in the datastream and creates two vectors, containing nodes and elements respectively.
bool LineParser::readElements | ( | std::ifstream & | in, |
std::vector< LineElement * > * | elements, | ||
std::vector< Node > & | nodes | ||
) |
Reads the elements from .msh file.
Reads the section of file containg element definitions, and creates a vector containing all supported elements.
Two node line elements with or without material definitions (elm-type 1 and 4 respectively) are supported.