NANDRAD Data Model Library  Version 2.0
NANDRAD
NANDRAD_Project.h
1 /* The NANDRAD data model library.
2 
3  Copyright (c) 2012-today, Institut für Bauklimatik, TU Dresden, Germany
4 
5  Primary authors:
6  Andreas Nicolai <andreas.nicolai -[at]- tu-dresden.de>
7  Anne Paepcke <anne.paepcke -[at]- tu-dresden.de>
8 
9  This library is part of SIM-VICUS (https://github.com/ghorwin/SIM-VICUS)
10 
11  This library is free software: you can redistribute it and/or modify
12  it under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  This library is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  GNU General Public License for more details.
20 */
21 
22 #ifndef NANDRAD_ProjectH
23 #define NANDRAD_ProjectH
24 
25 #include <string>
26 #include <vector>
27 #include <map>
28 
29 #include "NANDRAD_Zone.h"
30 #include "NANDRAD_ConstructionInstance.h"
31 #include "NANDRAD_ProjectInfo.h"
32 #include "NANDRAD_SimulationParameter.h"
33 #include "NANDRAD_SolverParameter.h"
34 #include "NANDRAD_Schedules.h"
35 #include "NANDRAD_Outputs.h"
36 #include "NANDRAD_Location.h"
37 #include "NANDRAD_ConstructionType.h"
38 #include "NANDRAD_Material.h"
39 #include "NANDRAD_ObjectList.h"
40 #include "NANDRAD_Models.h"
41 #include "NANDRAD_WindowGlazingSystem.h"
42 #include "NANDRAD_HydraulicNetwork.h"
43 #include "NANDRAD_HydraulicNetworkComponent.h"
44 #include "NANDRAD_KeywordList.h"
45 #include "NANDRAD_FMIDescription.h"
46 
47 /*! The namespace NANDRAD contains the data model classes that make up
48  the NANDRAD solver input data. The main class is NANDRAD::Project.
49 */
50 namespace NANDRAD {
51 
52 /*! Contains all input data that describes a room with walls, floor, ceiling, usage, HVAC etc.
53  The room description references constructions, window and shading types from the database.
54 */
55 class Project {
56  NANDRAD_READWRITE_PRIVATE
57 public:
58 
59  // *** PUBLIC MEMBER FUNCTIONS ***
60 
61  /*! Reads the project data from an XML file.
62  \param filename The full path to the project file.
63  */
64  void readXML(const IBK::Path & filename);
65 
66  /*! Writes the project file to an XML file.
67  \param filename The full path to the project file.
68  */
69  void writeXML(const IBK::Path & filename) const;
70 
71  /*! Initializes project defaults.
72  This function is called during solver run before readXML(). Hence, default values can be overwritten during
73  project file reading.
74  */
75  void initDefaults();
76 
77  /*! All constructions with same boundary conditions and construction type are merged into one
78  since the results will be the same for all constructions.
79  For each merged construction, a new construction is added to the end of the construction list.
80  All merged constructions are removed (this ensured, that any remaining reference to a merged
81  construction will trigger an error).
82  The cross sections of all constructions are summed together to make up the final cross section of
83  the merged construction.
84 
85  A data table is created with information on merged constructions:
86  - new merged construction ID
87  - vector of merged construction IDs and their areas
88 
89  \warning This algorithmus may not be suitable for calculations that involve view factors and
90  long wave radiation exchange. Hence, do not call this function for such models!
91 
92  Embedded objects that reference one of the merge constructions will be modified to reference
93  the merge construction instead. A mapping table is created that lists those changes:
94  - embedded object ID
95  - old construction instance ID
96  - new merged construction instance ID
97  */
99 
100 
101 
102  /*! Comments about the project. */
104 
105  /*! Contains mapping of directory placeholders and absolute directory paths. */
106  std::map<std::string, IBK::Path> m_placeholders;
107 
108  /*! Location of the building and climate data. */
110 
111  /*! Simulation settings: all global parameters.*/
113 
114  /*! Solver settings: error tolerances and convergence coefficients*/
116 
117  /*! All active and constant thermal zones.*/
118  std::vector<Zone> m_zones; // XML:E
119 
120  /*! All construction instances refernce a construction and a thermal zone. */
121  std::vector<ConstructionInstance> m_constructionInstances; // XML:E
122 
123  /*! All hydraulic networks defined for this project. */
124  std::vector<HydraulicNetwork> m_hydraulicNetworks; // XML:E
125 
126  /*! All construction types reference construction parameters. */
127  std::vector<ConstructionType> m_constructionTypes; // XML:E
128 
129  /*! All material types. */
130  std::vector<Material> m_materials; // XML:E
131 
132  /*! All glazing types. */
133  std::vector<WindowGlazingSystem> m_windowGlazingSystems; // XML:E
134 
135  /*! References to all schedules.*/
137 
138  /*! Container for various model parametrization blocks. */
139  Models m_models; // XML:E
140 
141  /*! References to Output specifications.*/
142  Outputs m_outputs; // XML:E
143 
144  /*! References to object lists.*/
145  std::vector<ObjectList> m_objectLists; // XML:E
146 
147  /*! Definitions for exporting an FMU from the model. */
149 
150 private:
151 
152  /*! Reads the section with directory placeholders.
153  \param element The directory placeholders element tag.
154  */
155  void readDirectoryPlaceholdersXML(const TiXmlElement * element);
156  /*! Writes the section with directory placeholders, but only, if the map isn't empty.
157  \param parent The parent tag.
158  */
159  void writeDirectoryPlaceholdersXML(TiXmlElement * parent) const;
160 
161 };
162 
163 
164 } // namespace NANDRAD
165 
166 #endif // NANDRAD_ProjectH
Contains all input data that describes a room with walls, floor, ceiling, usage, HVAC etc...
Schedules m_schedules
References to all schedules.
Simulation parameters define global model settings.
SimulationParameter m_simulationParameter
Simulation settings: all global parameters.
void writeDirectoryPlaceholdersXML(TiXmlElement *parent) const
Writes the section with directory placeholders, but only, if the map isn&#39;t empty. ...
std::vector< ConstructionType > m_constructionTypes
All construction types reference construction parameters.
Models m_models
Container for various model parametrization blocks.
std::vector< WindowGlazingSystem > m_windowGlazingSystems
All glazing types.
std::vector< HydraulicNetwork > m_hydraulicNetworks
All hydraulic networks defined for this project.
void mergeSameConstructions()
All constructions with same boundary conditions and construction type are merged into one since the r...
Location m_location
Location of the building and climate data.
Contains the declaration of class KeywordList.
Schedules define purely time-dependent properties.
void readDirectoryPlaceholdersXML(const TiXmlElement *element)
Reads the section with directory placeholders.
FMIDescription m_fmiDescription
Definitions for exporting an FMU from the model.
Class Location specifies climate and climatic loads of the whole building.
std::vector< Material > m_materials
All material types.
void initDefaults()
Initializes project defaults.
std::vector< ConstructionInstance > m_constructionInstances
All construction instances refernce a construction and a thermal zone.
Stores vectors with OutputGrid and OutputDefinition data.
void writeXML(const IBK::Path &filename) const
Writes the project file to an XML file.
std::vector< Zone > m_zones
All active and constant thermal zones.
std::map< std::string, IBK::Path > m_placeholders
Contains mapping of directory placeholders and absolute directory paths.
Outputs m_outputs
References to Output specifications.
Contains all data to generate a modelDescription.xml and configure the NANDRAD FMI Slave...
A container class for all models.
Solver parameters define options/flags related to the numerical engine, and are typically independent...
The namespace NANDRAD contains the data model classes that make up the NANDRAD solver input data...
void readXML(const IBK::Path &filename)
Reads the project data from an XML file.
ProjectInfo m_projectInfo
Comments about the project.
Contains meta-information about the project.
SolverParameter m_solverParameter
Solver settings: error tolerances and convergence coefficients.
std::vector< ObjectList > m_objectLists
References to object lists.