Public Member Functions | Public Attributes | Static Public Attributes | List of all members
LineParser Class Reference

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.
 

Detailed Description

Interprets thin-wall meshes structured in the ".msh" format.

Constructor & Destructor Documentation

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.

Parameters
fileNameis the fileName of the .msh file.
elementsis a list of element pointers found in LineMesh
nodesis a list of node pointers found in LineMesh

Member Function Documentation

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.


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