YAMLParser
Structure.h
Go to the documentation of this file.
1 
9 #pragma once
10 #include "yaml-cpp/yaml.h"
11 #include "FETypes.h"
12 #include <vector>
13 #include <map>
14 #include <iostream>
15 
16 class Structure
17 {
18 public:
20  ~Structure();
21 
22 
23  //---------- Functions -----------
24  //---- Check object existence ----
26  bool checkElementExistence(int id, std::string type);
28  bool checkCoordSysExistence(int id);
30  bool checkCrossSectionExistence(int id, std::string& type);
32  bool checkCompSectionExistence(int id);
34  bool checkMaterialExistence(int id);
36  bool checkNodeExistence(int id);
38  bool checkNodeLoadExistence(int id);
40  bool checkLoadCombExistence(int id);
41 
42 
43  //----- Fetch data objects -----
45  FECoordSys * fetchCoordSys(int id);
47  GenericFE* fetchObject(int id, std::string type);
55  FENode* fetchNode(int id);
57  FENodeLoad* fetchNodeLoad(int id);
59  FELoadComb* fetchLoadComb(int id);
60 
61  //------ Add data objects ------
63  bool addNode(FENode* node);
65  bool addElement(GenericFE* element);
67  bool addCoordSys(FECoordSys * coordSys);
69  bool addCrossSection(GenericCrossSection * crossSection);
71  bool addCompSection(GenericCompSection * section);
73  bool addMaterial(GenericMaterial * material);
75  bool addNodeLoad(FENodeLoad * nodeLoad);
77  bool addLoadComb(FELoadComb* loadComb);
78 
79 
80  //---------- Data fields ----------
82 
83  //-- Containers for instantiated data objects --
84  std::vector<FECoordSys*> coordSysList;
85  std::map<int, FECoordSys*> coordSysMap;
86 
87  std::vector<GenericCrossSection*> crossSectionList;
88  std::map<int, GenericCrossSection*> crossSectionMap;
89 
90  std::vector<GenericCompSection*> compSectionList;
91  std::map<int, GenericCompSection*> compSectionMap;
92 
93  std::vector<GenericMaterial*> materialList;
94  std::map<int, GenericMaterial*> materialMap;
95 
96  std::vector<FENode*> nodeList;
97  std::map<int, FENode*> nodeMap;
98 
99  std::vector<GenericFE*> elementList;
100  std::map<int, GenericFE*> elementMap;
101 
102  std::vector<FENodeLoad*> nodeLoadList;
103  std::map<int, FENodeLoad*> nodeLoadMap;
104 
105  std::vector<FELoadComb*> loadCombList;
106  std::map<int, FELoadComb*> loadCombMap;
107 
108  //Print content data elements to console
109  void printData();
110 };
This is the base class for all materials classes.
Definition: GenericMaterial.h:13
std::map< int, FENode * > nodeMap
Map from ID to corresponding node instance ptr.
Definition: Structure.h:97
bool checkNodeExistence(int id)
Definition: Structure.cpp:82
FECoordSys * fetchCoordSys(int id)
Definition: Structure.cpp:109
void printData()
Definition: Structure.cpp:239
bool checkCrossSectionExistence(int id, std::string &type)
Definition: Structure.cpp:60
std::vector< FECoordSys * > coordSysList
List of ptrs to coordSys instances.
Definition: Structure.h:84
std::map< int, FELoadComb * > loadCombMap
Map from ID to corresponding load combination instance ptr.
Definition: Structure.h:106
bool addElement(GenericFE *element)
Definition: Structure.cpp:220
This class represents the entire FE structure in which the FE data instances are members....
Definition: Structure.h:16
FENodeLoad * fetchNodeLoad(int id)
Definition: Structure.cpp:167
bool addCrossSection(GenericCrossSection *crossSection)
Definition: Structure.cpp:196
Definition: FENode.h:15
GenericFE * fetchObject(int id, std::string type)
Definition: Structure.cpp:117
This class represents a coordinate system.
Definition: FECoordSys.h:11
bool addNode(FENode *node)
Definition: Structure.cpp:214
bool checkNodeLoadExistence(int id)
Definition: Structure.cpp:89
GenericCrossSection * fetchCrossSection(int id)
Definition: Structure.cpp:135
bool checkCoordSysExistence(int id)
Definition: Structure.cpp:32
std::map< int, FENodeLoad * > nodeLoadMap
Map from ID to corresponding node load instance ptr.
Definition: Structure.h:103
This class represents a load combination.
Definition: FELoadComb.h:12
std::map< int, GenericCompSection * > compSectionMap
Map from ID to corresponding composite section instance.
Definition: Structure.h:91
bool addMaterial(GenericMaterial *material)
Definition: Structure.cpp:208
bool addLoadComb(FELoadComb *loadComb)
Definition: Structure.cpp:232
std::vector< FENodeLoad * > nodeLoadList
List of ptrs to node load instances.
Definition: Structure.h:102
Structure(int structureID)
Definition: Structure.cpp:6
FELoadComb * fetchLoadComb(int id)
Definition: Structure.cpp:175
std::vector< GenericCrossSection * > crossSectionList
List of ptrs to cross-section instances.
Definition: Structure.h:87
bool addNodeLoad(FENodeLoad *nodeLoad)
Definition: Structure.cpp:226
~Structure()
Definition: Structure.cpp:24
bool checkMaterialExistence(int id)
Definition: Structure.cpp:75
std::map< int, FECoordSys * > coordSysMap
Map from ID to corresponding coordSys instance ptr.
Definition: Structure.h:85
int structureID
Identifier for the structure.
Definition: Structure.h:81
GenericMaterial * fetchMaterial(int id)
Definition: Structure.cpp:151
std::vector< FENode * > nodeList
List of ptrs to nodes.
Definition: Structure.h:96
bool addCoordSys(FECoordSys *coordSys)
Definition: Structure.cpp:190
bool checkLoadCombExistence(int id)
Definition: Structure.cpp:96
FENode * fetchNode(int id)
Definition: Structure.cpp:159
std::map< int, GenericMaterial * > materialMap
Map from ID to corresponding material instance ptr.
Definition: Structure.h:94
bool addCompSection(GenericCompSection *section)
Definition: Structure.cpp:202
bool checkCompSectionExistence(int id)
Definition: Structure.cpp:68
This class represents a FE node load element.
Definition: FENodeLoad.h:11
std::vector< GenericFE * > elementList
List of ptrs to Identifiables (used to generalize FE elements)
Definition: Structure.h:99
std::vector< FELoadComb * > loadCombList
List of ptrs to load combination instances.
Definition: Structure.h:105
This is the base class for all element classes.
Definition: GenericFE.h:13
std::vector< GenericMaterial * > materialList
List of ptrs to material instances.
Definition: Structure.h:93
bool checkElementExistence(int id, std::string type)
Definition: Structure.cpp:39
This is the base class for all composite section classes (NB: Not to be interchanged with GenericCros...
Definition: GenericCompSection.h:12
std::vector< GenericCompSection * > compSectionList
List of ptrs to composite section instances.
Definition: Structure.h:90
std::map< int, GenericCrossSection * > crossSectionMap
Map from ID to corresponding cross-section instance.
Definition: Structure.h:88
This is the base class for all cross-section classes.
Definition: GenericCrossSection.h:13
GenericCompSection * fetchCompSection(int id)
Definition: Structure.cpp:143
std::map< int, GenericFE * > elementMap
Map from ID to corresponding Identifiable ptr for a specific FE element.
Definition: Structure.h:100