YAMLParser
Parser.h
Go to the documentation of this file.
1 
7 #pragma once
8 #include <string>
9 #include "yaml-cpp/yaml.h"
10 #include "Structure.h"
11 #include "FETypes.h"
12 
13 class Parser
14 {
15 public:
16  Parser(std::string filename);
17  ~Parser();
18 
19  YAML::Node root;
20  YAML::Node structureNode;
21  YAML::Node nextNode;
23 
24  //---------- Functions -----------
26  void logErrorMsg(std::runtime_error e);
27 
28  /*The following functions are parse functions for the FEM
29  * data types supported by the parser.
30  */
31  //----- Nodal data -----
32  void parseCoordSys(YAML::Node & yamlNode, std::string type);
33  void parseNode(YAML::Node& yamlNode, std::string type);
34 
35  //----- Element data -----
36  void parseVector(YAML::Node & yamlNode, std::string type);
37  void parseBeam(YAML::Node& yamlNode, std::string type);
38  void parseTrishell(YAML::Node& yamlNode, std::string type);
39  void parseQuadshell(YAML::Node & yamlNode, std::string type);
40  void ParseGenericFEMElement(YAML::Node& yamlNode);
41  void parseEccentricity(YAML::Node & yamlNode, std::string type);
42 
43  //----- Material data -----
44  void ParseIsoMaterial(YAML::Node & yamlNode, std::string type);
45 
46  //----- Cross-sectional data -----
47  void ParsePipe(YAML::Node & yamlNode, std::string type);
48  void parseTsection(YAML::Node & yamlNode, std::string type);
49  void parsePLThick(YAML::Node & yamlNode, std::string type);
50  void parsePLComp(YAML::Node & yamlNode, std::string type);
51 
52  //----- Load data -----
53  void parseNodeLoad(YAML::Node & yamlNode);
54  void parseLoadComb(YAML::Node & yamlNode);
55 
56  /*Execute the data type parsing methods in order
57  * according to their level of dependency.
58  */
65 
70  void parse();
71 };
72 
void ParseIsoMaterial(YAML::Node &yamlNode, std::string type)
Instantiate a FEIsoMaterial object from the YAML::Node.
Definition: Parser.cpp:385
void parseBeam(YAML::Node &yamlNode, std::string type)
Instantiate a FEBeam object from the YAML::Node.
Definition: Parser.cpp:110
This class represents the entire FE structure in which the FE data instances are members....
Definition: Structure.h:16
void parseQuadshell(YAML::Node &yamlNode, std::string type)
Instantiate a FEQuadshell object from the YAML::Node.
Definition: Parser.cpp:255
void parseTrishell(YAML::Node &yamlNode, std::string type)
Instantiate a FETrishell object from the YAML::Node.
Definition: Parser.cpp:174
YAML::Node structureNode
FEA format structure node.
Definition: Parser.h:20
void parseDepenencyLevelNull()
Definition: Parser.cpp:550
void parseDepenencyLevelTwo()
Definition: Parser.cpp:606
This is the top-level parser class.
Definition: Parser.h:13
Structure * structure
Ptr to Structure object to which the data types are added.
Definition: Parser.h:22
void ParsePipe(YAML::Node &yamlNode, std::string type)
Instantiate a cross-sectional FEPipe object from the YAML::Node.
Definition: Parser.cpp:404
void parsePLThick(YAML::Node &yamlNode, std::string type)
Instantiate a PLThick object from the YAML::Node.
Definition: Parser.cpp:442
Parser(std::string filename)
Definition: Parser.cpp:11
void parseCoordSys(YAML::Node &yamlNode, std::string type)
Instantiate a FECoordSys object from the YAML::Node.
Definition: Parser.cpp:35
void logErrorMsg(std::runtime_error e)
Definition: Parser.cpp:29
void parse()
Definition: Parser.cpp:634
~Parser()
Definition: Parser.cpp:26
void parsePLComp(YAML::Node &yamlNode, std::string type)
Instantiate a PLComp object from the YAML::Node.
Definition: Parser.cpp:460
void parseVector(YAML::Node &yamlNode, std::string type)
Instantiate a FEVector object from the YAML::Node.
Definition: Parser.cpp:89
void parseDepenencyLevelOne()
Definition: Parser.cpp:586
void parseLoadComb(YAML::Node &yamlNode)
Instantiate a FELoadComb object from the YAML::Node.
Definition: Parser.cpp:518
YAML::Node nextNode
Next node to parse.
Definition: Parser.h:21
void parseTsection(YAML::Node &yamlNode, std::string type)
Instantiate a cross-sectional FETsection object from the YAML::Node.
Definition: Parser.cpp:423
void parseEccentricity(YAML::Node &yamlNode, std::string type)
Instantiate a FEEccentricity object from the YAML::Node.
Definition: Parser.cpp:366
void ParseGenericFEMElement(YAML::Node &yamlNode)
A classifier. Parses a generic FEM element, identified by the literal string FEMElement in the YAML::...
Definition: Parser.cpp:343
void parseNodeLoad(YAML::Node &yamlNode)
Instantiate a FENodeLoad object from the YAML::Node.
Definition: Parser.cpp:482
void parseNode(YAML::Node &yamlNode, std::string type)
Instantiate a FENode object from the YAML::Node.
Definition: Parser.cpp:54
YAML::Node root
YAML root node.
Definition: Parser.h:19