GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 56.5% 471 / 0 / 833
Functions: 64.0% 119 / 0 / 186
Branches: 39.8% 414 / 0 / 1040

src/model/Building.cpp
Line Branch Exec Source
1 /***********************************************************************************************************************
2 * OpenStudio(R), Copyright (c) Alliance for Energy Innovation, LLC.
3 * See also https://openstudio.net/license
4 ***********************************************************************************************************************/
5
6 #include "Building.hpp"
7 #include "Building_Impl.hpp"
8
9 #include "Model.hpp"
10 #include "Model_Impl.hpp"
11 #include "BuildingStory.hpp"
12 #include "BuildingStory_Impl.hpp"
13 #include "Facility.hpp"
14 #include "Facility_Impl.hpp"
15 #include "Space.hpp"
16 #include "Space_Impl.hpp"
17 #include "SpaceType.hpp"
18 #include "SpaceType_Impl.hpp"
19 #include "DefaultConstructionSet.hpp"
20 #include "DefaultConstructionSet_Impl.hpp"
21 #include "DefaultScheduleSet.hpp"
22 #include "DefaultScheduleSet_Impl.hpp"
23 #include "Schedule.hpp"
24 #include "Schedule_Impl.hpp"
25 #include "ThermalZone.hpp"
26 #include "ThermalZone_Impl.hpp"
27 #include "ShadingSurface.hpp"
28 #include "ShadingSurface_Impl.hpp"
29 #include "ShadingSurfaceGroup.hpp"
30 #include "ShadingSurfaceGroup_Impl.hpp"
31 #include "OutputMeter.hpp"
32 #include "OutputMeter_Impl.hpp"
33 #include "Surface.hpp"
34 #include "Surface_Impl.hpp"
35 #include "SubSurface.hpp"
36 #include "SubSurface_Impl.hpp"
37
38 #include <string>
39 #include <utilities/idd/IddFactory.hxx>
40
41 #include <utilities/idd/OS_Building_FieldEnums.hxx>
42 #include <utilities/idd/IddEnums.hxx>
43 #include <utilities/idd/OS_ThermalZone_FieldEnums.hxx>
44
45 #include "../utilities/math/FloatCompare.hpp"
46 #include "../utilities/data/DataEnums.hpp"
47 #include "../utilities/geometry/Geometry.hpp"
48 #include "../utilities/geometry/Transformation.hpp"
49 #include "../utilities/core/Compare.hpp"
50 #include "../utilities/core/Assert.hpp"
51 #include "../utilities/core/ContainersMove.hpp"
52 #include "../utilities/geometry/Intersection.hpp"
53
54 #include <boost/optional.hpp>
55 #include <boost/algorithm/string.hpp>
56
57 #include <algorithm>
58
59 namespace openstudio {
60 namespace model {
61
62 namespace detail {
63
64 1303 Building_Impl::Building_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle) : ParentObject_Impl(idfObject, model, keepHandle) {
65
4/6
✓ Branch 1 taken 1303 times.
✓ Branch 4 taken 1303 times.
✓ Branch 7 taken 1303 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 1303 times.
✗ Branch 13 not taken.
1303 OS_ASSERT(idfObject.iddObject().type() == Building::iddObjectType());
66 1303 }
67
68 66 Building_Impl::Building_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle)
69 66 : ParentObject_Impl(other, model, keepHandle) {
70
4/6
✓ Branch 1 taken 66 times.
✓ Branch 4 taken 66 times.
✓ Branch 7 taken 66 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 66 times.
✗ Branch 13 not taken.
66 OS_ASSERT(other.iddObject().type() == Building::iddObjectType());
71 66 }
72
73 240 Building_Impl::Building_Impl(const Building_Impl& other, Model_Impl* model, bool keepHandle) : ParentObject_Impl(other, model, keepHandle) {}
74
75 5 boost::optional<ParentObject> Building_Impl::parent() const {
76
2/2
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
5 return boost::optional<ParentObject>(this->facility());
77 }
78
79 877 std::vector<ModelObject> Building_Impl::children() const {
80 // TODO: JM 2019-05-13: handle HVAC (#2449)
81 // AirLoopHVACs should be considered de facto part of the building
82 // PlantLoops may merit more attention:
83 // if a PlantLoop doesn't serve an AirLoopHVAC or a ThermalZone, should it be considered part of the Building?
84 // eg: a PlantLoop serving only a LoadProfile:Plant?
85
86
6/6
✓ Branch 1 taken 877 times.
✓ Branch 4 taken 877 times.
✓ Branch 7 taken 877 times.
✓ Branch 10 taken 877 times.
✓ Branch 13 taken 877 times.
✓ Branch 16 taken 877 times.
877 return concat<ModelObject>(this->meters(), this->buildingStories(), this->shadingSurfaceGroups(), this->thermalZones(), this->spaces());
87 }
88
89 // TODO: this is far from perfect, currently this is just trying to address a known issue #3524
90 // Ideally all corner cases would be handled correctly, and HVAC too
91 5 std::vector<IdfObject> Building_Impl::remove() {
92
93 // A result vector, and a temporary vector to insert into the result one
94 5 std::vector<IdfObject> result;
95 5 std::vector<IdfObject> tmp;
96
97 // Spaces
98
3/3
✓ Branch 1 taken 5 times.
✓ Branch 7 taken 4 times.
✓ Branch 8 taken 5 times.
9 for (auto& s : this->spaces()) {
99
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 openstudio::detail::concat_helper(result, s.remove());
100 5 }
101
102 // thermal zones
103
3/3
✓ Branch 1 taken 5 times.
✓ Branch 7 taken 2 times.
✓ Branch 8 taken 5 times.
7 for (auto& z : this->thermalZones()) {
104
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 openstudio::detail::concat_helper(result, z.remove());
105 5 }
106
107 // exterior shading groups
108
3/3
✓ Branch 1 taken 5 times.
✓ Branch 7 taken 1 time.
✓ Branch 8 taken 5 times.
6 for (auto& sg : this->shadingSurfaceGroups()) {
109
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 openstudio::detail::concat_helper(result, sg.remove());
110 5 }
111
112 // building stories
113
3/3
✓ Branch 1 taken 5 times.
✓ Branch 7 taken 1 time.
✓ Branch 8 taken 5 times.
6 for (auto& bs : this->buildingStories()) {
114
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 openstudio::detail::concat_helper(result, bs.remove());
115 5 }
116
117 // meters
118
3/3
✓ Branch 1 taken 5 times.
✓ Branch 7 taken 1 time.
✓ Branch 8 taken 5 times.
6 for (auto& m : this->meters()) {
119
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 openstudio::detail::concat_helper(result, m.remove());
120 5 }
121
122
2/2
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
5 openstudio::detail::concat_helper(result, ParentObject_Impl::remove());
123
124 10 return result;
125 5 }
126
127 7 ModelObject Building_Impl::clone(Model t_model) const {
128 7 boost::optional<Building> result;
129
130
4/4
✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
✓ Branch 7 taken 2 times.
✓ Branch 8 taken 5 times.
7 if (t_model == model()) {
131 // Clone attempted into same Model - return the existing instance
132
3/3
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
2 result = getObject<ModelObject>().cast<Building>();
133 } else {
134
135
1/1
✓ Branch 1 taken 5 times.
5 auto otherBuilding = t_model.building();
136
2/2
✓ Branch 0 taken 1 time.
✓ Branch 1 taken 4 times.
5 if (otherBuilding) {
137
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 otherBuilding->remove();
138 }
139
140 //auto buildings = t_model.getConcreteModelObjects<Building>();
141 //if( ! buildings.empty() ) {
142 // // If Destination model already has a building then first remove it
143 // buildings.front().remove();
144 //}
145
146 // Clone Building and child objects.
147
148 // This call clones only the building and it's resources
149
4/4
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 7 taken 5 times.
✓ Branch 10 taken 5 times.
5 result = ModelObject_Impl::clone(t_model).cast<Building>();
150
151 // DLM: why did the ParentObject::clone not work?
152 // DLM: ParentObject::clone only preserves links between child and parent objects, it does not preserve links between levels of the hierarchy
153 // we could potentially add ThermalZone as a resource of Space (or vice versa or both) but I am not sure what the implications of that are
154
155 // Clone children since we are not relying on the implementation provided by ParentObject::clone
156
157 // Meter instances
158
1/1
✓ Branch 1 taken 5 times.
5 auto t_meters = meters();
159
1/2
✗ Branch 4 not taken.
✓ Branch 5 taken 5 times.
5 for (const auto& meter : t_meters) {
160 ✗ meter.clone(t_model);
161 }
162
163 // BuildingStory instances
164
1/1
✓ Branch 1 taken 5 times.
5 auto t_stories = buildingStories();
165 // Map of the source model story handle to the target model story "cloned" ModelObject
166 5 std::map<Handle, BuildingStory> m_storyMap;
167
168
2/2
✓ Branch 5 taken 3 times.
✓ Branch 6 taken 5 times.
8 for (const auto& story : t_stories) {
169
3/3
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
3 auto clone = story.clone(t_model).cast<BuildingStory>();
170
3/3
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
3 m_storyMap.insert(std::pair<Handle, BuildingStory>(story.handle(), clone));
171 3 }
172
173 // ShadingSurfaceGroup
174
1/1
✓ Branch 1 taken 5 times.
5 auto t_shadingSurfaceGroups = shadingSurfaceGroups();
175
2/2
✓ Branch 4 taken 1 time.
✓ Branch 5 taken 5 times.
6 for (const auto& surfaceGroup : t_shadingSurfaceGroups) {
176
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 surfaceGroup.clone(t_model);
177 }
178
179 // ThermalZone instances
180
1/1
✓ Branch 1 taken 5 times.
5 auto t_zones = thermalZones();
181 // Map of the source model zone handle to the target model zone "cloned" ModelObject
182 5 std::map<Handle, ThermalZone> m_zoneMap;
183
184
2/2
✓ Branch 5 taken 3 times.
✓ Branch 6 taken 5 times.
8 for (const auto& zone : t_zones) {
185
3/3
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
3 auto clone = zone.clone(t_model).cast<ThermalZone>();
186
3/3
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
3 m_zoneMap.insert(std::pair<Handle, ThermalZone>(zone.handle(), clone));
187 3 }
188
189 // This is crude, but since:
190 // 1. Surfaces all are in the name group, so name unicity is enforced
191 // 2. We are cloning the entire building, removing anything that was there prior: names aren't modified
192 // As a result, we do that on name... the alternative is to avoid calling Space::clone, clone surfaces first,
193 // reimplement a version of Space::clone, etc. Too much trouble
194 5 std::map<std::string, std::string> surfaceToAdjacentMap;
195
4/4
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 12 taken 24 times.
✓ Branch 13 taken 5 times.
29 for (const auto& s : model().getConcreteModelObjects<Surface>()) {
196
3/3
✓ Branch 1 taken 24 times.
✓ Branch 3 taken 8 times.
✓ Branch 4 taken 16 times.
48 if (auto adjS = s.adjacentSurface()) {
197
4/4
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
✓ Branch 7 taken 8 times.
✓ Branch 10 taken 8 times.
8 surfaceToAdjacentMap.emplace(s.nameString(), adjS->nameString());
198 24 }
199 5 }
200
201 5 std::map<std::string, std::string> subSurfaceToAdjacentMap;
202
4/4
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 12 taken 2 times.
✓ Branch 13 taken 5 times.
7 for (const auto& s : model().getConcreteModelObjects<SubSurface>()) {
203
2/3
✓ Branch 1 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 2 times.
4 if (auto adjS = s.adjacentSubSurface()) {
204 ✗ subSurfaceToAdjacentMap.emplace(s.nameString(), adjS->nameString());
205 2 }
206 5 }
207
208 // Space Instances
209
1/1
✓ Branch 1 taken 5 times.
5 auto t_spaces = spaces();
210
211
2/2
✓ Branch 5 taken 8 times.
✓ Branch 6 taken 5 times.
13 for (const auto& space : t_spaces) {
212
3/3
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
✓ Branch 7 taken 8 times.
8 auto clone = space.clone(t_model).cast<Space>();
213
214
2/3
✓ Branch 1 taken 8 times.
✓ Branch 3 taken 8 times.
✗ Branch 4 not taken.
16 if (auto zone = space.thermalZone()) {
215
4/4
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
✓ Branch 7 taken 8 times.
✓ Branch 10 taken 8 times.
8 auto zoneClone = m_zoneMap.at(zone->handle());
216
1/1
✓ Branch 1 taken 8 times.
8 clone.setThermalZone(zoneClone);
217 16 }
218
219
2/3
✓ Branch 1 taken 8 times.
✓ Branch 3 taken 8 times.
✗ Branch 4 not taken.
16 if (auto story = space.buildingStory()) {
220
4/4
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
✓ Branch 7 taken 8 times.
✓ Branch 10 taken 8 times.
8 auto storyClone = m_storyMap.at(story->handle());
221
1/1
✓ Branch 1 taken 8 times.
8 clone.setBuildingStory(storyClone);
222 16 }
223 8 }
224
225 // Now resolve matching of adjacent surfaces
226
3/3
✓ Branch 1 taken 5 times.
✓ Branch 8 taken 24 times.
✓ Branch 9 taken 5 times.
29 for (auto& s : t_model.getConcreteModelObjects<Surface>()) {
227
3/3
✓ Branch 1 taken 24 times.
✓ Branch 5 taken 20 times.
✓ Branch 6 taken 4 times.
24 if (!s.adjacentSurface()) {
228
4/4
✓ Branch 1 taken 20 times.
✓ Branch 4 taken 20 times.
✓ Branch 9 taken 4 times.
✓ Branch 10 taken 16 times.
20 if (auto it = surfaceToAdjacentMap.find(s.nameString()); it != surfaceToAdjacentMap.end()) {
229
1/1
✓ Branch 2 taken 4 times.
4 auto adjacentSurface = t_model.getConcreteModelObjectByName<Surface>(it->second);
230
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
✗ Branch 4 not taken.
4 OS_ASSERT(adjacentSurface);
231
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 s.setAdjacentSurface(adjacentSurface.get());
232 4 }
233 }
234 5 }
235
3/3
✓ Branch 1 taken 5 times.
✓ Branch 8 taken 2 times.
✓ Branch 9 taken 5 times.
7 for (auto& s : t_model.getConcreteModelObjects<SubSurface>()) {
236
2/3
✓ Branch 1 taken 2 times.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
2 if (!s.adjacentSubSurface()) {
237
3/4
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✗ Branch 9 not taken.
✓ Branch 10 taken 2 times.
2 if (auto it = subSurfaceToAdjacentMap.find(s.nameString()); it != subSurfaceToAdjacentMap.end()) {
238 ✗ auto adjacentSubSurface = t_model.getConcreteModelObjectByName<SubSurface>(it->second);
239 ✗ OS_ASSERT(adjacentSubSurface);
240 ✗ s.setAdjacentSubSurface(adjacentSubSurface.get());
241 ✗ }
242 }
243 5 }
244 5 }
245
246
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 7 times.
✗ Branch 4 not taken.
7 OS_ASSERT(result);
247
2/2
✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
14 return result.get();
248 7 }
249
250 ✗ bool Building_Impl::setParent(ParentObject& newParent) {
251 ✗ if (newParent.optionalCast<Facility>()) {
252 ✗ return true;
253 }
254 ✗ return false;
255 }
256
257 ✗ std::vector<IddObjectType> Building_Impl::allowableChildTypes() const {
258 ✗ return std::vector<IddObjectType>{IddObjectType::OS_Space, IddObjectType::OS_ShadingSurfaceGroup, IddObjectType::OS_ThermalZone};
259 }
260
261 1 const std::vector<std::string>& Building_Impl::outputVariableNames() const {
262
2/4
✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
1 static const std::vector<std::string> result;
263 1 return result;
264 }
265
266 7 IddObjectType Building_Impl::iddObjectType() const {
267 7 return Building::iddObjectType();
268 }
269
270 1836 double Building_Impl::northAxis() const {
271
1/1
✓ Branch 1 taken 1836 times.
1836 boost::optional<double> value = getDouble(OS_BuildingFields::NorthAxis, true);
272
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 1836 times.
✗ Branch 4 not taken.
1836 OS_ASSERT(value);
273
1/1
✓ Branch 1 taken 1836 times.
3672 return value.get();
274 }
275
276 885 bool Building_Impl::isNorthAxisDefaulted() const {
277 885 return isEmpty(OS_BuildingFields::NorthAxis);
278 }
279
280 24 boost::optional<double> Building_Impl::nominalFloortoFloorHeight() const {
281
1/1
✓ Branch 1 taken 24 times.
24 boost::optional<double> value = getDouble(OS_BuildingFields::NominalFloortoFloorHeight, true);
282 24 return value;
283 }
284
285 16 boost::optional<int> Building_Impl::standardsNumberOfStories() const {
286
1/1
✓ Branch 1 taken 16 times.
16 boost::optional<int> value = getInt(OS_BuildingFields::StandardsNumberofStories, false);
287 16 return value;
288 }
289
290 13 boost::optional<int> Building_Impl::standardsNumberOfAboveGroundStories() const {
291
1/1
✓ Branch 1 taken 13 times.
13 boost::optional<int> value = getInt(OS_BuildingFields::StandardsNumberofAboveGroundStories, false);
292 13 return value;
293 }
294
295 13 boost::optional<int> Building_Impl::standardsNumberOfLivingUnits() const {
296
1/1
✓ Branch 1 taken 13 times.
13 boost::optional<int> value = getInt(OS_BuildingFields::StandardsNumberofLivingUnits, false);
297 13 return value;
298 }
299
300 13 boost::optional<double> Building_Impl::nominalFloortoCeilingHeight() const {
301
1/1
✓ Branch 1 taken 13 times.
13 boost::optional<double> value = getDouble(OS_BuildingFields::NominalFloortoCeilingHeight, true);
302 13 return value;
303 }
304
305 13 boost::optional<std::string> Building_Impl::standardsTemplate() const {
306 13 return getString(OS_BuildingFields::StandardsTemplate, false, true);
307 }
308
309 ✗ std::vector<std::string> Building_Impl::suggestedStandardsTemplates() const {
310
311 ✗ boost::optional<std::string> standardsTemplate = this->standardsTemplate();
312
313 // Make a dummy model and a dummy space Type,
314 // and call suggestedStandardsTemplates from it, so we don't have to repeat code here
315 ✗ Model tempModel;
316 ✗ SpaceType tempSpaceType(tempModel);
317 ✗ std::vector<std::string> result = tempSpaceType.suggestedStandardsTemplates();
318
319 // include values from model
320 ✗ for (const SpaceType& other : this->model().getConcreteModelObjects<SpaceType>()) {
321 ✗ if (boost::optional<std::string> otherTemplate = other.standardsTemplate()) {
322 ✗ result.push_back(*otherTemplate);
323 ✗ }
324 ✗ }
325
326 // remove standardsTemplate
327 ✗ IstringFind finder;
328 ✗ if (standardsTemplate) {
329 ✗ finder.addTarget(*standardsTemplate);
330 }
331 ✗ auto it = std::remove_if(result.begin(), result.end(), finder);
332 ✗ result.resize(std::distance(result.begin(), it));
333
334 // sort
335 ✗ std::sort(result.begin(), result.end(), IstringCompare());
336
337 // make unique
338 // DLM: have to sort before calling unique, unique only works on consecutive elements
339 ✗ it = std::unique(result.begin(), result.end(), IstringEqual());
340 ✗ result.resize(std::distance(result.begin(), it));
341
342 // add current to front
343 ✗ if (standardsTemplate) {
344 ✗ result.insert(result.begin(), *standardsTemplate);
345 }
346
347 ✗ return result;
348 ✗ }
349
350 ✗ bool Building_Impl::setStandardsTemplate(const std::string& standardsTemplate) {
351 ✗ bool result = setString(OS_BuildingFields::StandardsTemplate, standardsTemplate);
352 ✗ OS_ASSERT(result);
353 ✗ return result;
354 }
355
356 ✗ void Building_Impl::resetStandardsTemplate() {
357 ✗ bool test = setString(OS_BuildingFields::StandardsTemplate, "");
358 ✗ OS_ASSERT(test);
359 ✗ }
360
361 44 boost::optional<std::string> Building_Impl::standardsBuildingType() const {
362 44 return getString(OS_BuildingFields::StandardsBuildingType, false, true);
363 }
364
365 ✗ std::vector<std::string> Building_Impl::suggestedStandardsBuildingTypes() const {
366 // If standardsTemplate isn't set, return empty
367 ✗ boost::optional<std::string> standardsTemplate = this->standardsTemplate();
368 ✗ if (!standardsTemplate) {
369 ✗ return {};
370 } else {
371
372 ✗ boost::optional<std::string> standardsBuildingType = this->standardsBuildingType();
373
374 // Make a dummy Model and a dummy space Type,
375 // and call suggestedStandardsTemplates from it, so we don't have to repeat code here
376 ✗ Model tempModel;
377 ✗ SpaceType tempSpaceType(tempModel);
378 // We set the standards template to the value
379 ✗ tempSpaceType.setStandardsTemplate(standardsTemplate.get());
380 ✗ std::vector<std::string> result = tempSpaceType.suggestedStandardsBuildingTypes();
381
382 // include values from model
383 ✗ for (const SpaceType& other : this->model().getConcreteModelObjects<SpaceType>()) {
384 ✗ if (boost::optional<std::string> otherBuildingType = other.standardsBuildingType()) {
385 ✗ result.push_back(*otherBuildingType);
386 ✗ }
387 ✗ }
388
389 // remove standardsBuildingType
390 ✗ IstringFind finder;
391 ✗ if (standardsBuildingType) {
392 ✗ finder.addTarget(*standardsBuildingType);
393 }
394 ✗ auto it = std::remove_if(result.begin(), result.end(), finder);
395 ✗ result.resize(std::distance(result.begin(), it));
396
397 // sort, unique only works on consecutive elements
398 ✗ std::sort(result.begin(), result.end(), IstringCompare());
399 // make unique
400 ✗ it = std::unique(result.begin(), result.end(), IstringEqual());
401 ✗ result.resize(std::distance(result.begin(), it));
402
403 // add current to front
404 ✗ if (standardsBuildingType) {
405 ✗ result.insert(result.begin(), *standardsBuildingType);
406 }
407 ✗ return result;
408 ✗ }
409 ✗ }
410
411 ✗ bool Building_Impl::setStandardsBuildingType(const std::string& standardsBuildingType) {
412 ✗ bool result = setString(OS_BuildingFields::StandardsBuildingType, standardsBuildingType);
413 ✗ OS_ASSERT(result);
414 ✗ return result;
415 }
416
417 ✗ void Building_Impl::resetStandardsBuildingType() {
418 ✗ bool test = setString(OS_BuildingFields::StandardsBuildingType, "");
419 ✗ OS_ASSERT(test);
420 ✗ }
421
422 ✗ bool Building_Impl::relocatable() const {
423 ✗ boost::optional<std::string> value = getString(OS_BuildingFields::Relocatable, true, true);
424 ✗ OS_ASSERT(value);
425 ✗ return openstudio::istringEqual(value.get(), "True");
426 ✗ }
427
428 13 bool Building_Impl::isRelocatableDefaulted() const {
429 13 return isEmpty(OS_BuildingFields::Relocatable);
430 }
431
432 104 bool Building_Impl::setNorthAxis(double northAxis) {
433 104 bool result = setDouble(OS_BuildingFields::NorthAxis, northAxis);
434
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 104 times.
104 OS_ASSERT(result);
435 104 return result;
436 }
437
438 ✗ void Building_Impl::resetNorthAxis() {
439 ✗ bool result = setString(OS_BuildingFields::NorthAxis, "");
440 ✗ OS_ASSERT(result);
441 ✗ }
442
443 3 bool Building_Impl::setNominalFloortoFloorHeight(double nominalFloortoFloorHeight) {
444 3 bool result = setDouble(OS_BuildingFields::NominalFloortoFloorHeight, nominalFloortoFloorHeight);
445 3 return result;
446 }
447
448 ✗ void Building_Impl::resetNominalFloortoFloorHeight() {
449 ✗ bool result = setString(OS_BuildingFields::NominalFloortoFloorHeight, "");
450 ✗ OS_ASSERT(result);
451 ✗ }
452
453 1 bool Building_Impl::setStandardsNumberOfStories(int value) {
454 1 bool test = setInt(OS_BuildingFields::StandardsNumberofStories, value);
455 1 return test;
456 }
457
458 ✗ void Building_Impl::resetStandardsNumberOfStories() {
459 ✗ bool test = setString(OS_BuildingFields::StandardsNumberofStories, "");
460 ✗ OS_ASSERT(test);
461 ✗ }
462
463 ✗ bool Building_Impl::setStandardsNumberOfAboveGroundStories(int value) {
464 ✗ bool test = setInt(OS_BuildingFields::StandardsNumberofAboveGroundStories, value);
465 ✗ return test;
466 }
467
468 ✗ void Building_Impl::resetStandardsNumberOfAboveGroundStories() {
469 ✗ bool test = setString(OS_BuildingFields::StandardsNumberofAboveGroundStories, "");
470 ✗ OS_ASSERT(test);
471 ✗ }
472
473 ✗ bool Building_Impl::setStandardsNumberOfLivingUnits(int value) {
474 ✗ bool test = setInt(OS_BuildingFields::StandardsNumberofLivingUnits, value);
475 ✗ return test;
476 }
477
478 ✗ void Building_Impl::resetStandardsNumberOfLivingUnits() {
479 ✗ bool test = setString(OS_BuildingFields::StandardsNumberofLivingUnits, "");
480 ✗ OS_ASSERT(test);
481 ✗ }
482
483 ✗ bool Building_Impl::setNominalFloortoCeilingHeight(double nominalFloortoCeilingHeight) {
484 ✗ bool result = setDouble(OS_BuildingFields::NominalFloortoCeilingHeight, nominalFloortoCeilingHeight);
485 ✗ return result;
486 }
487
488 ✗ void Building_Impl::resetNominalFloortoCeilingHeight() {
489 ✗ bool result = setString(OS_BuildingFields::NominalFloortoCeilingHeight, "");
490 ✗ OS_ASSERT(result);
491 ✗ }
492
493 ✗ bool Building_Impl::setRelocatable(bool relocatable) {
494 ✗ bool result = false;
495 ✗ if (relocatable) {
496 ✗ result = setString(OS_BuildingFields::Relocatable, "True");
497 } else {
498 ✗ result = setString(OS_BuildingFields::Relocatable, "False");
499 }
500 ✗ OS_ASSERT(result);
501 ✗ return result;
502 }
503
504 ✗ void Building_Impl::resetRelocatable() {
505 ✗ bool result = setString(OS_BuildingFields::Relocatable, "");
506 ✗ OS_ASSERT(result);
507 ✗ }
508
509 66295 boost::optional<SpaceType> Building_Impl::spaceType() const {
510
2/2
✓ Branch 1 taken 66295 times.
✓ Branch 4 taken 66295 times.
66295 return getObject<ModelObject>().getModelObjectTarget<SpaceType>(OS_BuildingFields::SpaceTypeName);
511 }
512
513 209 bool Building_Impl::setSpaceType(const SpaceType& spaceType) {
514
2/2
✓ Branch 1 taken 209 times.
✓ Branch 4 taken 209 times.
209 return setPointer(OS_BuildingFields::SpaceTypeName, spaceType.handle());
515 }
516
517 1 void Building_Impl::resetSpaceType() {
518
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
2 bool test = setString(OS_BuildingFields::SpaceTypeName, "");
519
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
1 OS_ASSERT(test);
520 1 }
521
522 44289 boost::optional<DefaultConstructionSet> Building_Impl::defaultConstructionSet() const {
523
2/2
✓ Branch 1 taken 44289 times.
✓ Branch 4 taken 44289 times.
44289 return getObject<ModelObject>().getModelObjectTarget<DefaultConstructionSet>(OS_BuildingFields::DefaultConstructionSetName);
524 }
525
526 287 bool Building_Impl::setDefaultConstructionSet(const DefaultConstructionSet& defaultConstructionSet) {
527
2/2
✓ Branch 1 taken 287 times.
✓ Branch 4 taken 287 times.
287 return setPointer(OS_BuildingFields::DefaultConstructionSetName, defaultConstructionSet.handle());
528 }
529
530 109 void Building_Impl::resetDefaultConstructionSet() {
531
2/2
✓ Branch 1 taken 109 times.
✓ Branch 4 taken 109 times.
218 setString(OS_BuildingFields::DefaultConstructionSetName, "");
532 109 }
533
534 657 boost::optional<DefaultScheduleSet> Building_Impl::defaultScheduleSet() const {
535
2/2
✓ Branch 1 taken 657 times.
✓ Branch 4 taken 657 times.
657 return getObject<ModelObject>().getModelObjectTarget<DefaultScheduleSet>(OS_BuildingFields::DefaultScheduleSetName);
536 }
537
538 4 boost::optional<Schedule> Building_Impl::getDefaultSchedule(const DefaultScheduleType& defaultScheduleType) const {
539 4 boost::optional<Schedule> result;
540 4 boost::optional<DefaultScheduleSet> defaultScheduleSet;
541 4 boost::optional<SpaceType> spaceType;
542
543 // first check this object (building)
544
1/1
✓ Branch 1 taken 4 times.
4 defaultScheduleSet = this->defaultScheduleSet();
545
1/2
✓ Branch 0 taken 4 times.
✗ Branch 1 not taken.
4 if (defaultScheduleSet) {
546
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 result = defaultScheduleSet->getDefaultSchedule(defaultScheduleType);
547
2/2
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 2 times.
4 if (result) {
548 2 return result;
549 }
550 }
551
552 // then check building's space type
553
2/3
✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
4 if (boost::optional<SpaceType> spaceType = this->spaceType()) {
554
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 defaultScheduleSet = spaceType->defaultScheduleSet();
555
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
2 if (defaultScheduleSet) {
556
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 result = defaultScheduleSet->getDefaultSchedule(defaultScheduleType);
557
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
2 if (result) {
558 2 return result;
559 }
560 }
561 2 }
562
563 ✗ return boost::none;
564 4 }
565
566 171 bool Building_Impl::setDefaultScheduleSet(const DefaultScheduleSet& defaultScheduleSet) {
567
2/2
✓ Branch 1 taken 171 times.
✓ Branch 4 taken 171 times.
171 return setPointer(OS_BuildingFields::DefaultScheduleSetName, defaultScheduleSet.handle());
568 }
569
570 ✗ void Building_Impl::resetDefaultScheduleSet() {
571 ✗ setString(OS_BuildingFields::DefaultScheduleSetName, "");
572 ✗ }
573
574 887 OutputMeterVector Building_Impl::meters() const {
575 377 auto filterOutMeter = [](const auto& meter) {
576
1/1
✓ Branch 1 taken 377 times.
377 auto instalLocType_ = meter.installLocationType();
577
6/6
✓ Branch 0 taken 294 times.
✓ Branch 1 taken 83 times.
✓ Branch 3 taken 294 times.
✓ Branch 6 taken 294 times.
✓ Branch 8 taken 291 times.
✓ Branch 9 taken 3 times.
754 return instalLocType_ && (InstallLocationType::Building != instalLocType_.get().value());
578 377 };
579
580
2/2
✓ Branch 1 taken 887 times.
✓ Branch 4 taken 887 times.
887 OutputMeterVector result = this->model().getConcreteModelObjects<OutputMeter>();
581
2/2
✓ Branch 5 taken 887 times.
✓ Branch 9 taken 887 times.
887 result.erase(std::remove_if(result.begin(), result.end(), filterOutMeter), result.end());
582 1774 return result;
583 ✗ }
584
585 887 BuildingStoryVector Building_Impl::buildingStories() const {
586 // all Building Stories in workspace implicitly belong to building
587
2/2
✓ Branch 1 taken 887 times.
✓ Branch 4 taken 887 times.
887 return this->model().getConcreteModelObjects<BuildingStory>();
588 }
589
590 5 OptionalFacility Building_Impl::facility() const {
591
2/2
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
5 return this->model().getOptionalUniqueModelObject<Facility>();
592 }
593
594 1036 std::vector<Space> Building_Impl::spaces() const {
595 // all spaces in workspace implicitly belong to building
596
2/2
✓ Branch 1 taken 1036 times.
✓ Branch 4 taken 1036 times.
1036 return this->model().getConcreteModelObjects<Space>();
597 }
598
599 2313 ShadingSurfaceGroupVector Building_Impl::shadingSurfaceGroups() const {
600 2313 ShadingSurfaceGroupVector result;
601
4/4
✓ Branch 1 taken 2313 times.
✓ Branch 4 taken 2313 times.
✓ Branch 12 taken 866 times.
✓ Branch 13 taken 2313 times.
3179 for (const ShadingSurfaceGroup& shadingGroup : this->model().getConcreteModelObjects<ShadingSurfaceGroup>()) {
602
5/5
✓ Branch 1 taken 866 times.
✓ Branch 4 taken 866 times.
✓ Branch 7 taken 866 times.
✓ Branch 11 taken 624 times.
✓ Branch 12 taken 242 times.
1732 if (istringEqual(shadingGroup.shadingSurfaceType(), "Building")) {
603
1/1
✓ Branch 1 taken 624 times.
624 result.push_back(shadingGroup);
604 }
605 2313 }
606 2313 return result;
607 ✗ }
608
609 899 std::vector<ThermalZone> Building_Impl::thermalZones() const {
610 // all thermal zones in workspace implicitly belong to building
611
2/2
✓ Branch 1 taken 899 times.
✓ Branch 4 taken 899 times.
899 return this->model().getConcreteModelObjects<ThermalZone>();
612 }
613
614 1 std::vector<Surface> Building_Impl::exteriorWalls() const {
615
616 6 auto isNotExtWall = [](const Surface& s) -> bool {
617
18/34
✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
✓ Branch 7 taken 6 times.
✓ Branch 9 taken 4 times.
✓ Branch 10 taken 2 times.
✓ Branch 12 taken 4 times.
✓ Branch 15 taken 4 times.
✓ Branch 18 taken 4 times.
✗ Branch 20 not taken.
✓ Branch 21 taken 4 times.
✓ Branch 22 taken 4 times.
✓ Branch 23 taken 2 times.
✓ Branch 25 taken 4 times.
✓ Branch 26 taken 2 times.
✓ Branch 28 taken 4 times.
✓ Branch 29 taken 2 times.
✓ Branch 30 taken 6 times.
✗ Branch 31 not taken.
✓ Branch 33 taken 6 times.
✗ Branch 34 not taken.
✓ Branch 36 taken 6 times.
✗ Branch 37 not taken.
✗ Branch 38 not taken.
✗ Branch 39 not taken.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✗ Branch 44 not taken.
✗ Branch 45 not taken.
✗ Branch 46 not taken.
✗ Branch 47 not taken.
✗ Branch 49 not taken.
✗ Branch 50 not taken.
✗ Branch 52 not taken.
✗ Branch 53 not taken.
26 return !openstudio::istringEqual(s.surfaceType(), "Wall") || !openstudio::istringEqual(s.outsideBoundaryCondition(), "Outdoors");
618 };
619
620
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 SurfaceVector result = model().getConcreteModelObjects<Surface>();
621
2/2
✓ Branch 5 taken 1 time.
✓ Branch 9 taken 1 time.
1 result.erase(std::remove_if(result.begin(), result.end(), isNotExtWall), result.end());
622
623 2 return result;
624 ✗ }
625
626 ✗ std::vector<Surface> Building_Impl::roofs() const {
627 ✗ auto isNotExtRoof = [](const Surface& s) -> bool {
628 ✗ return !openstudio::istringEqual(s.surfaceType(), "RoofCeiling") || !openstudio::istringEqual(s.outsideBoundaryCondition(), "Outdoors");
629 };
630
631 ✗ SurfaceVector result = model().getConcreteModelObjects<Surface>();
632 ✗ result.erase(std::remove_if(result.begin(), result.end(), isNotExtRoof), result.end());
633
634 ✗ return result;
635 ✗ }
636
637 60 double Building_Impl::floorArea() const {
638 60 double result = 0;
639
3/3
✓ Branch 1 taken 60 times.
✓ Branch 8 taken 103 times.
✓ Branch 9 taken 60 times.
163 for (const Space& space : spaces()) {
640
2/3
✓ Branch 1 taken 103 times.
✓ Branch 3 taken 103 times.
✗ Branch 4 not taken.
103 if (space.partofTotalFloorArea()) {
641
2/2
✓ Branch 1 taken 103 times.
✓ Branch 4 taken 103 times.
103 result += space.multiplier() * space.floorArea();
642 }
643 60 }
644 60 return result;
645 }
646
647 11 boost::optional<double> Building_Impl::conditionedFloorArea() const {
648 11 boost::optional<double> result;
649
650
3/3
✓ Branch 1 taken 11 times.
✓ Branch 8 taken 3 times.
✓ Branch 9 taken 11 times.
14 for (const ThermalZone& thermalZone : thermalZones()) {
651
1/1
✓ Branch 1 taken 3 times.
3 boost::optional<std::string> isConditioned = thermalZone.isConditioned();
652
653
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
3 if (isConditioned) {
654
655 ✗ if (!result) {
656 ✗ result = 0;
657 }
658
659 ✗ if (istringEqual("Yes", *isConditioned)) {
660 ✗ for (const Space& space : thermalZone.spaces()) {
661 ✗ bool partofTotalFloorArea = space.partofTotalFloorArea();
662 ✗ if (partofTotalFloorArea) {
663 ✗ result = *result + space.multiplier() * space.floorArea();
664 }
665 ✗ }
666 }
667 }
668 14 }
669
670 11 return result;
671 }
672
673 1 double Building_Impl::exteriorSurfaceArea() const {
674 1 double result(0.0);
675
4/4
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 12 taken 6 times.
✓ Branch 13 taken 1 time.
7 for (const Surface& surface : model().getConcreteModelObjects<Surface>()) {
676
1/1
✓ Branch 1 taken 6 times.
6 OptionalSpace space = surface.space();
677
1/1
✓ Branch 1 taken 6 times.
6 std::string outsideBoundaryCondition = surface.outsideBoundaryCondition();
678
9/16
✓ Branch 1 taken 6 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 6 times.
✓ Branch 7 taken 6 times.
✓ Branch 9 taken 5 times.
✓ Branch 10 taken 1 time.
✓ Branch 11 taken 6 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 6 times.
✗ Branch 15 not taken.
✓ Branch 16 taken 5 times.
✓ Branch 17 taken 1 time.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
24 if (space && openstudio::istringEqual(outsideBoundaryCondition, "Outdoors")) {
679
3/3
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 7 taken 5 times.
5 result += surface.grossArea() * space->multiplier();
680 }
681 7 }
682 1 return result;
683 }
684
685 1 double Building_Impl::exteriorWallArea() const {
686 1 double result(0.0);
687
3/3
✓ Branch 1 taken 1 time.
✓ Branch 8 taken 4 times.
✓ Branch 9 taken 1 time.
5 for (const Surface& exteriorWall : exteriorWalls()) {
688
2/3
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 4 times.
✗ Branch 4 not taken.
8 if (OptionalSpace space = exteriorWall.space()) {
689
3/3
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
4 result += exteriorWall.grossArea() * space->multiplier();
690 4 }
691 1 }
692 1 return result;
693 }
694
695 1 double Building_Impl::airVolume() const {
696 1 double result(0.0);
697
3/3
✓ Branch 1 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 8 taken 1 time.
2 for (const Space& space : spaces()) {
698
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 result += space.volume() * space.multiplier();
699 1 }
700 1 return result;
701 }
702
703 20 double Building_Impl::numberOfPeople() const {
704 20 double result(0.0);
705
3/3
✓ Branch 1 taken 20 times.
✓ Branch 7 taken 49 times.
✓ Branch 8 taken 20 times.
69 for (const Space& space : spaces()) {
706
2/2
✓ Branch 1 taken 49 times.
✓ Branch 4 taken 49 times.
49 result += space.numberOfPeople() * space.multiplier();
707 20 }
708 20 return result;
709 }
710
711 10 double Building_Impl::peoplePerFloorArea() const {
712 10 double area = floorArea();
713 10 double np = numberOfPeople();
714
2/2
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 8 times.
10 if (equal(area, 0.0)) {
715
1/2
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
2 if (equal(np, 0.0)) {
716 2 return 0.0;
717 }
718 ✗ if (spaces().size() == 1u) {
719 ✗ return spaces()[0].peoplePerFloorArea();
720 }
721 ✗ LOG_AND_THROW("Calculation would require division by 0.");
722 }
723 8 return np / area;
724 }
725
726 ✗ double Building_Impl::floorAreaPerPerson() const {
727 ✗ double area = floorArea();
728 ✗ double np = numberOfPeople();
729 ✗ if (equal(np, 0.0)) {
730 ✗ LOG_AND_THROW("Calculation would require division by 0.");
731 }
732 ✗ return area / np;
733 }
734
735 23 double Building_Impl::lightingPower() const {
736 23 double result(0.0);
737
3/3
✓ Branch 1 taken 23 times.
✓ Branch 7 taken 30 times.
✓ Branch 8 taken 23 times.
53 for (const Space& space : spaces()) {
738
2/2
✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
30 result += space.multiplier() * space.lightingPower();
739 23 }
740 23 return result;
741 }
742
743 11 double Building_Impl::lightingPowerPerFloorArea() const {
744 11 double area = floorArea();
745 11 double lp = lightingPower();
746
2/2
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 9 times.
11 if (equal(area, 0.0)) {
747
1/2
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
2 if (equal(lp, 0.0)) {
748 2 return 0.0;
749 ✗ } else if (spaces().size() == 1u) {
750 ✗ return spaces()[0].lightingPowerPerFloorArea();
751 }
752 ✗ LOG_AND_THROW("Calculation would require division by 0.");
753 }
754 9 return lp / area;
755 }
756
757 1 double Building_Impl::lightingPowerPerPerson() const {
758 1 double np = numberOfPeople();
759 1 double lp = lightingPower();
760
1/2
✗ Branch 2 not taken.
✓ Branch 3 taken 1 time.
1 if (equal(np, 0.0)) {
761 ✗ if (equal(lp, 0.0)) {
762 ✗ return 0.0;
763 }
764 ✗ if (spaces().size() == 1u) {
765 ✗ return spaces()[0].lightingPowerPerPerson();
766 }
767 ✗ LOG_AND_THROW("Calculation would require division by 0.");
768 }
769 1 return lp / np;
770 }
771
772 9 double Building_Impl::electricEquipmentPower() const {
773 9 double result(0.0);
774
3/3
✓ Branch 1 taken 9 times.
✓ Branch 7 taken 24 times.
✓ Branch 8 taken 9 times.
33 for (const Space& space : spaces()) {
775
2/2
✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
24 result += space.multiplier() * space.electricEquipmentPower();
776 9 }
777 9 return result;
778 }
779
780 1 double Building_Impl::electricEquipmentPowerPerFloorArea() const {
781 1 double area = floorArea();
782 1 double ep = electricEquipmentPower();
783
1/2
✗ Branch 2 not taken.
✓ Branch 3 taken 1 time.
1 if (equal(area, 0.0)) {
784 ✗ if (equal(ep, 0.0)) {
785 ✗ return 0.0;
786 }
787 ✗ if (spaces().size() == 1u) {
788 ✗ return spaces()[0].electricEquipmentPowerPerFloorArea();
789 }
790 ✗ LOG_AND_THROW("Calculation would require division by 0.");
791 }
792 1 return ep / area;
793 }
794
795 1 double Building_Impl::electricEquipmentPowerPerPerson() const {
796 1 double np = numberOfPeople();
797 1 double ep = electricEquipmentPower();
798
1/2
✗ Branch 2 not taken.
✓ Branch 3 taken 1 time.
1 if (equal(np, 0.0)) {
799 ✗ if (equal(ep, 0.0)) {
800 ✗ return 0.0;
801 }
802 ✗ if (spaces().size() == 1u) {
803 ✗ return spaces()[0].electricEquipmentPowerPerPerson();
804 }
805 ✗ LOG_AND_THROW("Calculation would require division by 0.");
806 }
807 1 return ep / np;
808 }
809
810 3 double Building_Impl::gasEquipmentPower() const {
811 3 double result(0.0);
812
3/3
✓ Branch 1 taken 3 times.
✓ Branch 7 taken 12 times.
✓ Branch 8 taken 3 times.
15 for (const Space& space : spaces()) {
813
2/2
✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
12 result += space.multiplier() * space.gasEquipmentPower();
814 3 }
815 3 return result;
816 }
817
818 1 double Building_Impl::gasEquipmentPowerPerFloorArea() const {
819 1 double area = floorArea();
820 1 double ep = gasEquipmentPower();
821
1/2
✗ Branch 2 not taken.
✓ Branch 3 taken 1 time.
1 if (equal(area, 0.0)) {
822 ✗ if (equal(ep, 0.0)) {
823 ✗ return 0.0;
824 }
825 ✗ if (spaces().size() == 1u) {
826 ✗ return spaces()[0].gasEquipmentPowerPerFloorArea();
827 }
828 ✗ LOG_AND_THROW("Calculation would require division by 0.");
829 }
830 1 return ep / area;
831 }
832
833 1 double Building_Impl::gasEquipmentPowerPerPerson() const {
834 1 double np = numberOfPeople();
835 1 double ep = gasEquipmentPower();
836
1/2
✗ Branch 2 not taken.
✓ Branch 3 taken 1 time.
1 if (equal(np, 0.0)) {
837 ✗ if (equal(ep, 0.0)) {
838 ✗ return 0.0;
839 }
840 ✗ if (spaces().size() == 1u) {
841 ✗ return spaces()[0].gasEquipmentPowerPerPerson();
842 }
843 ✗ LOG_AND_THROW("Calculation would require division by 0.");
844 }
845 1 return ep / np;
846 }
847
848 3 double Building_Impl::hotWaterEquipmentPower() const {
849 3 double result(0.0);
850
3/3
✓ Branch 1 taken 3 times.
✓ Branch 7 taken 12 times.
✓ Branch 8 taken 3 times.
15 for (const Space& space : spaces()) {
851
2/2
✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
12 result += space.multiplier() * space.hotWaterEquipmentPower();
852 3 }
853 3 return result;
854 }
855
856 1 double Building_Impl::hotWaterEquipmentPowerPerFloorArea() const {
857 1 double area = floorArea();
858 1 double ep = hotWaterEquipmentPower();
859
1/2
✗ Branch 2 not taken.
✓ Branch 3 taken 1 time.
1 if (equal(area, 0.0)) {
860 ✗ if (equal(ep, 0.0)) {
861 ✗ return 0.0;
862 }
863 ✗ if (spaces().size() == 1u) {
864 ✗ return spaces()[0].hotWaterEquipmentPowerPerFloorArea();
865 }
866 ✗ LOG_AND_THROW("Calculation would require division by 0.");
867 }
868 1 return ep / area;
869 }
870
871 1 double Building_Impl::hotWaterEquipmentPowerPerPerson() const {
872 1 double np = numberOfPeople();
873 1 double ep = hotWaterEquipmentPower();
874
1/2
✗ Branch 2 not taken.
✓ Branch 3 taken 1 time.
1 if (equal(np, 0.0)) {
875 ✗ if (equal(ep, 0.0)) {
876 ✗ return 0.0;
877 }
878 ✗ if (spaces().size() == 1u) {
879 ✗ return spaces()[0].hotWaterEquipmentPowerPerPerson();
880 }
881 ✗ LOG_AND_THROW("Calculation would require division by 0.");
882 }
883 1 return ep / np;
884 }
885
886 5 double Building_Impl::infiltrationDesignFlowRate() const {
887 5 double result(0.0);
888
3/3
✓ Branch 1 taken 5 times.
✓ Branch 7 taken 5 times.
✓ Branch 8 taken 5 times.
10 for (const Space& space : spaces()) {
889
2/2
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
5 result += space.multiplier() * space.infiltrationDesignFlowRate();
890 5 }
891 5 return result;
892 }
893
894 1 double Building_Impl::infiltrationDesignFlowPerSpaceFloorArea() const {
895 1 double area = floorArea();
896 1 double idfr = infiltrationDesignFlowRate();
897
1/2
✗ Branch 2 not taken.
✓ Branch 3 taken 1 time.
1 if (equal(area, 0.0)) {
898 ✗ if (equal(idfr, 0.0)) {
899 ✗ return 0.0;
900 }
901 ✗ if (spaces().size() == 1u) {
902 ✗ return spaces()[0].infiltrationDesignFlowPerSpaceFloorArea();
903 }
904 ✗ LOG_AND_THROW("Calculation would require division by 0.");
905 }
906 1 return idfr / area;
907 }
908
909 1 double Building_Impl::infiltrationDesignFlowPerExteriorSurfaceArea() const {
910 1 double area = exteriorSurfaceArea();
911 1 double idfr = infiltrationDesignFlowRate();
912
1/2
✗ Branch 2 not taken.
✓ Branch 3 taken 1 time.
1 if (equal(area, 0.0)) {
913 ✗ if (equal(idfr, 0.0)) {
914 ✗ return 0.0;
915 }
916 ✗ if (spaces().size() == 1u) {
917 ✗ return spaces()[0].infiltrationDesignFlowPerExteriorSurfaceArea();
918 }
919 ✗ LOG_AND_THROW("Calculation would require division by 0.");
920 }
921 1 return idfr / area;
922 }
923
924 1 double Building_Impl::infiltrationDesignFlowPerExteriorWallArea() const {
925 1 double area = exteriorWallArea();
926 1 double idfr = infiltrationDesignFlowRate();
927
1/2
✗ Branch 2 not taken.
✓ Branch 3 taken 1 time.
1 if (equal(area, 0.0)) {
928 ✗ if (equal(idfr, 0.0)) {
929 ✗ return 0.0;
930 }
931 ✗ if (spaces().size() == 1u) {
932 ✗ return spaces()[0].infiltrationDesignFlowPerExteriorWallArea();
933 }
934 ✗ LOG_AND_THROW("Calculation would require division by 0.");
935 }
936 1 return idfr / area;
937 }
938
939 1 double Building_Impl::infiltrationDesignAirChangesPerHour() const {
940 1 double volume = airVolume();
941 1 double idfr = infiltrationDesignFlowRate();
942
1/2
✗ Branch 2 not taken.
✓ Branch 3 taken 1 time.
1 if (equal(volume, 0.0)) {
943 ✗ if (equal(idfr, 0.0)) {
944 ✗ return 0.0;
945 }
946 ✗ if (spaces().size() == 1u) {
947 ✗ return spaces()[0].infiltrationDesignAirChangesPerHour();
948 }
949 ✗ LOG_AND_THROW("Calculation would require division by 0.");
950 }
951 1 return (idfr / volume) * 3600.0;
952 }
953
954 1756 Transformation Building_Impl::transformation() const {
955 // rotate negative amount around the z axis, EnergyPlus defines rotation clockwise
956
2/2
✓ Branch 3 taken 1756 times.
✓ Branch 6 taken 1756 times.
1756 return Transformation::rotation(Vector3d(0, 0, 1), -degToRad(this->northAxis()));
957 }
958
959 2 double Building_Impl::exteriorPerimeter() const {
960
961 2 Point3dVectorVector polygons;
962
963
4/4
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 12 taken 40 times.
✓ Branch 13 taken 2 times.
42 for (const auto& space : model().getConcreteModelObjects<Space>()) {
964
1/1
✓ Branch 1 taken 40 times.
40 Transformation spaceTransformation = space.transformation();
965
3/3
✓ Branch 1 taken 40 times.
✓ Branch 8 taken 274 times.
✓ Branch 9 taken 40 times.
314 for (const auto& surface : space.surfaces()) {
966
12/18
✓ Branch 1 taken 274 times.
✓ Branch 4 taken 274 times.
✓ Branch 6 taken 234 times.
✓ Branch 7 taken 40 times.
✓ Branch 9 taken 234 times.
✓ Branch 12 taken 234 times.
✗ Branch 14 not taken.
✓ Branch 15 taken 234 times.
✓ Branch 16 taken 234 times.
✓ Branch 17 taken 40 times.
✓ Branch 19 taken 274 times.
✗ Branch 20 not taken.
✓ Branch 22 taken 40 times.
✓ Branch 23 taken 234 times.
✗ Branch 24 not taken.
✗ Branch 25 not taken.
✗ Branch 27 not taken.
✗ Branch 28 not taken.
274 if (surface.outsideBoundaryCondition() == "Ground" || surface.surfaceType() == "Floor") {
967
2/2
✓ Branch 1 taken 40 times.
✓ Branch 4 taken 40 times.
40 Point3dVector points = spaceTransformation * surface.vertices();
968
4/7
✓ Branch 1 taken 40 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 40 times.
✓ Branch 7 taken 40 times.
✗ Branch 8 not taken.
✓ Branch 9 taken 40 times.
✗ Branch 10 not taken.
40 if (!points.empty() && points[0].z() == 0.0) {
969
1/1
✓ Branch 1 taken 40 times.
40 polygons.push_back(points);
970 }
971 40 }
972 40 }
973 42 }
974
975
1/1
✓ Branch 1 taken 2 times.
2 auto result2 = openstudio::joinAllPolygons(polygons, 0.01);
976
1/2
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
2 if (result2.size() == 1) {
977
1/1
✓ Branch 2 taken 2 times.
2 return result2[0].perimeter();
978 } else {
979 ✗ return 0.0;
980 }
981 2 }
982
983 20 std::vector<std::vector<Point3d>> Building_Impl::generateSkylightPattern(double skylightToProjectedFloorRatio, double desiredWidth,
984 double desiredHeight) const {
985
2/2
✓ Branch 1 taken 20 times.
✓ Branch 4 taken 20 times.
20 return openstudio::model::generateSkylightPattern(this->spaces(), 0.0, skylightToProjectedFloorRatio, desiredWidth, desiredHeight);
986 }
987
988 ✗ boost::optional<ModelObject> Building_Impl::spaceTypeAsModelObject() const {
989 ✗ OptionalModelObject result;
990 ✗ OptionalSpaceType intermediate = spaceType();
991 ✗ if (intermediate) {
992 ✗ result = *intermediate;
993 }
994 ✗ return result;
995 ✗ }
996
997 ✗ boost::optional<ModelObject> Building_Impl::defaultConstructionSetAsModelObject() const {
998 ✗ OptionalModelObject result;
999 ✗ OptionalDefaultConstructionSet intermediate = defaultConstructionSet();
1000 ✗ if (intermediate) {
1001 ✗ result = *intermediate;
1002 }
1003 ✗ return result;
1004 ✗ }
1005
1006 ✗ boost::optional<ModelObject> Building_Impl::defaultScheduleSetAsModelObject() const {
1007 ✗ OptionalModelObject result;
1008 ✗ OptionalDefaultScheduleSet intermediate = defaultScheduleSet();
1009 ✗ if (intermediate) {
1010 ✗ result = *intermediate;
1011 }
1012 ✗ return result;
1013 ✗ }
1014
1015 ✗ std::vector<ModelObject> Building_Impl::metersAsModelObjects() const {
1016 ✗ ModelObjectVector result = castVector<ModelObject>(meters());
1017 ✗ return result;
1018 }
1019
1020 ✗ std::vector<ModelObject> Building_Impl::buildingStoriesAsModelObjects() const {
1021 ✗ ModelObjectVector result = castVector<ModelObject>(buildingStories());
1022 ✗ return result;
1023 }
1024
1025 ✗ boost::optional<ModelObject> Building_Impl::facilityAsModelObject() const {
1026 ✗ OptionalModelObject result;
1027 ✗ OptionalFacility intermediate = facility();
1028 ✗ if (intermediate) {
1029 ✗ result = *intermediate;
1030 }
1031 ✗ return result;
1032 ✗ }
1033
1034 ✗ std::vector<ModelObject> Building_Impl::spacesAsModelObjects() const {
1035 ✗ ModelObjectVector result = castVector<ModelObject>(spaces());
1036 ✗ return result;
1037 }
1038
1039 ✗ std::vector<ModelObject> Building_Impl::shadingSurfaceGroupsAsModelObjects() const {
1040 ✗ ModelObjectVector result = castVector<ModelObject>(shadingSurfaceGroups());
1041 ✗ return result;
1042 }
1043
1044 ✗ std::vector<ModelObject> Building_Impl::thermalZonesAsModelObjects() const {
1045 ✗ ModelObjectVector result = castVector<ModelObject>(thermalZones());
1046 ✗ return result;
1047 }
1048
1049 ✗ std::vector<ModelObject> Building_Impl::exteriorWallsAsModelObjects() const {
1050 ✗ ModelObjectVector result = castVector<ModelObject>(exteriorWalls());
1051 ✗ return result;
1052 }
1053
1054 ✗ std::vector<ModelObject> Building_Impl::roofsAsModelObjects() const {
1055 ✗ ModelObjectVector result = castVector<ModelObject>(roofs());
1056 ✗ return result;
1057 }
1058
1059 ✗ bool Building_Impl::setSpaceTypeAsModelObject(const boost::optional<ModelObject>& modelObject) {
1060 ✗ if (modelObject) {
1061 ✗ OptionalSpaceType intermediate = modelObject->optionalCast<SpaceType>();
1062 ✗ if (intermediate) {
1063 ✗ return setSpaceType(*intermediate);
1064 } else {
1065 ✗ return false;
1066 }
1067 ✗ } else {
1068 ✗ resetSpaceType();
1069 }
1070 ✗ return true;
1071 }
1072
1073 ✗ bool Building_Impl::setDefaultConstructionSetAsModelObject(const boost::optional<ModelObject>& modelObject) {
1074 ✗ if (modelObject) {
1075 ✗ OptionalDefaultConstructionSet intermediate = modelObject->optionalCast<DefaultConstructionSet>();
1076 ✗ if (intermediate) {
1077 ✗ return setDefaultConstructionSet(*intermediate);
1078 } else {
1079 ✗ return false;
1080 }
1081 ✗ } else {
1082 ✗ resetDefaultConstructionSet();
1083 }
1084 ✗ return true;
1085 }
1086
1087 ✗ bool Building_Impl::setDefaultScheduleSetAsModelObject(const boost::optional<ModelObject>& modelObject) {
1088 ✗ if (modelObject) {
1089 ✗ OptionalDefaultScheduleSet intermediate = modelObject->optionalCast<DefaultScheduleSet>();
1090 ✗ if (intermediate) {
1091 ✗ return setDefaultScheduleSet(*intermediate);
1092 } else {
1093 ✗ return false;
1094 }
1095 ✗ } else {
1096 ✗ resetDefaultScheduleSet();
1097 }
1098 ✗ return true;
1099 }
1100
1101 } // namespace detail
1102
1103 17142 IddObjectType Building::iddObjectType() {
1104
1/1
✓ Branch 1 taken 17142 times.
17142 IddObjectType result(IddObjectType::OS_Building);
1105 17142 return result;
1106 }
1107
1108 80 double Building::northAxis() const {
1109
1/1
✓ Branch 3 taken 80 times.
80 return getImpl<detail::Building_Impl>()->northAxis();
1110 }
1111
1112 885 bool Building::isNorthAxisDefaulted() const {
1113
1/1
✓ Branch 3 taken 885 times.
885 return getImpl<detail::Building_Impl>()->isNorthAxisDefaulted();
1114 }
1115
1116 24 boost::optional<double> Building::nominalFloortoFloorHeight() const {
1117
1/1
✓ Branch 3 taken 24 times.
24 return getImpl<detail::Building_Impl>()->nominalFloortoFloorHeight();
1118 }
1119
1120 16 boost::optional<int> Building::standardsNumberOfStories() const {
1121
1/1
✓ Branch 3 taken 16 times.
16 return getImpl<detail::Building_Impl>()->standardsNumberOfStories();
1122 }
1123
1124 13 boost::optional<int> Building::standardsNumberOfAboveGroundStories() const {
1125
1/1
✓ Branch 3 taken 13 times.
13 return getImpl<detail::Building_Impl>()->standardsNumberOfAboveGroundStories();
1126 }
1127
1128 13 boost::optional<int> Building::standardsNumberOfLivingUnits() const {
1129
1/1
✓ Branch 3 taken 13 times.
13 return getImpl<detail::Building_Impl>()->standardsNumberOfLivingUnits();
1130 }
1131
1132 13 boost::optional<double> Building::nominalFloortoCeilingHeight() const {
1133
1/1
✓ Branch 3 taken 13 times.
13 return getImpl<detail::Building_Impl>()->nominalFloortoCeilingHeight();
1134 }
1135
1136 13 boost::optional<std::string> Building::standardsTemplate() const {
1137
1/1
✓ Branch 3 taken 13 times.
13 return getImpl<detail::Building_Impl>()->standardsTemplate();
1138 }
1139
1140 ✗ std::vector<std::string> Building::suggestedStandardsTemplates() const {
1141 ✗ return getImpl<detail::Building_Impl>()->suggestedStandardsTemplates();
1142 }
1143
1144 ✗ bool Building::setStandardsTemplate(const std::string& standardsTemplate) {
1145 ✗ return getImpl<detail::Building_Impl>()->setStandardsTemplate(standardsTemplate);
1146 }
1147
1148 ✗ void Building::resetStandardsTemplate() {
1149 ✗ getImpl<detail::Building_Impl>()->resetStandardsTemplate();
1150 ✗ }
1151
1152 44 boost::optional<std::string> Building::standardsBuildingType() const {
1153
1/1
✓ Branch 3 taken 44 times.
44 return getImpl<detail::Building_Impl>()->standardsBuildingType();
1154 }
1155
1156 ✗ std::vector<std::string> Building::suggestedStandardsBuildingTypes() const {
1157 ✗ return getImpl<detail::Building_Impl>()->suggestedStandardsBuildingTypes();
1158 }
1159
1160 ✗ bool Building::setStandardsBuildingType(const std::string& standardsBuildingType) {
1161 ✗ return getImpl<detail::Building_Impl>()->setStandardsBuildingType(standardsBuildingType);
1162 }
1163
1164 ✗ void Building::resetStandardsBuildingType() {
1165 ✗ getImpl<detail::Building_Impl>()->resetStandardsBuildingType();
1166 ✗ }
1167
1168 ✗ bool Building::relocatable() const {
1169 ✗ return getImpl<detail::Building_Impl>()->relocatable();
1170 }
1171
1172 13 bool Building::isRelocatableDefaulted() const {
1173
1/1
✓ Branch 3 taken 13 times.
13 return getImpl<detail::Building_Impl>()->isRelocatableDefaulted();
1174 }
1175
1176 104 bool Building::setNorthAxis(double northAxis) {
1177
1/1
✓ Branch 3 taken 104 times.
104 return getImpl<detail::Building_Impl>()->setNorthAxis(northAxis);
1178 }
1179
1180 ✗ void Building::resetNorthAxis() {
1181 ✗ getImpl<detail::Building_Impl>()->resetNorthAxis();
1182 ✗ }
1183
1184 3 bool Building::setNominalFloortoFloorHeight(double nominalFloortoFloorHeight) {
1185
1/1
✓ Branch 3 taken 3 times.
3 return getImpl<detail::Building_Impl>()->setNominalFloortoFloorHeight(nominalFloortoFloorHeight);
1186 }
1187
1188 ✗ void Building::resetNominalFloortoFloorHeight() {
1189 ✗ getImpl<detail::Building_Impl>()->resetNominalFloortoFloorHeight();
1190 ✗ }
1191
1192 1 bool Building::setStandardsNumberOfStories(int value) {
1193
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::Building_Impl>()->setStandardsNumberOfStories(value);
1194 }
1195
1196 ✗ void Building::resetStandardsNumberOfStories() {
1197 ✗ getImpl<detail::Building_Impl>()->resetStandardsNumberOfStories();
1198 ✗ }
1199
1200 ✗ bool Building::setStandardsNumberOfAboveGroundStories(int value) {
1201 ✗ return getImpl<detail::Building_Impl>()->setStandardsNumberOfAboveGroundStories(value);
1202 }
1203
1204 ✗ void Building::resetStandardsNumberOfAboveGroundStories() {
1205 ✗ getImpl<detail::Building_Impl>()->resetStandardsNumberOfAboveGroundStories();
1206 ✗ }
1207
1208 ✗ bool Building::setStandardsNumberOfLivingUnits(int value) {
1209 ✗ return getImpl<detail::Building_Impl>()->setStandardsNumberOfLivingUnits(value);
1210 }
1211
1212 ✗ void Building::resetStandardsNumberOfLivingUnits() {
1213 ✗ getImpl<detail::Building_Impl>()->resetStandardsNumberOfLivingUnits();
1214 ✗ }
1215
1216 ✗ bool Building::setNominalFloortoCeilingHeight(double nominalFloortoCeilingHeight) {
1217 ✗ return getImpl<detail::Building_Impl>()->setNominalFloortoCeilingHeight(nominalFloortoCeilingHeight);
1218 }
1219
1220 ✗ void Building::resetNominalFloortoCeilingHeight() {
1221 ✗ getImpl<detail::Building_Impl>()->resetNominalFloortoCeilingHeight();
1222 ✗ }
1223
1224 ✗ bool Building::setRelocatable(bool isRelocatable) {
1225 ✗ return getImpl<detail::Building_Impl>()->setRelocatable(isRelocatable);
1226 }
1227
1228 ✗ void Building::setRelocatableNoFail(bool isRelocatable) {
1229 ✗ bool result = getImpl<detail::Building_Impl>()->setRelocatable(isRelocatable);
1230 ✗ OS_ASSERT(result);
1231 ✗ }
1232
1233 ✗ void Building::resetRelocatable() {
1234 ✗ getImpl<detail::Building_Impl>()->resetRelocatable();
1235 ✗ }
1236
1237 66293 boost::optional<SpaceType> Building::spaceType() const {
1238
1/1
✓ Branch 3 taken 66293 times.
66293 return getImpl<detail::Building_Impl>()->spaceType();
1239 }
1240
1241 209 bool Building::setSpaceType(const SpaceType& spaceType) {
1242
1/1
✓ Branch 3 taken 209 times.
209 return getImpl<detail::Building_Impl>()->setSpaceType(spaceType);
1243 }
1244
1245 1 void Building::resetSpaceType() {
1246
1/1
✓ Branch 3 taken 1 time.
1 getImpl<detail::Building_Impl>()->resetSpaceType();
1247 1 }
1248
1249 44289 boost::optional<DefaultConstructionSet> Building::defaultConstructionSet() const {
1250
1/1
✓ Branch 3 taken 44289 times.
44289 return getImpl<detail::Building_Impl>()->defaultConstructionSet();
1251 }
1252
1253 287 bool Building::setDefaultConstructionSet(const DefaultConstructionSet& defaultConstructionSet) {
1254
1/1
✓ Branch 3 taken 287 times.
287 return getImpl<detail::Building_Impl>()->setDefaultConstructionSet(defaultConstructionSet);
1255 }
1256
1257 109 void Building::resetDefaultConstructionSet() {
1258
1/1
✓ Branch 3 taken 109 times.
109 getImpl<detail::Building_Impl>()->resetDefaultConstructionSet();
1259 109 }
1260
1261 653 boost::optional<DefaultScheduleSet> Building::defaultScheduleSet() const {
1262
1/1
✓ Branch 3 taken 653 times.
653 return getImpl<detail::Building_Impl>()->defaultScheduleSet();
1263 }
1264
1265 4 boost::optional<Schedule> Building::getDefaultSchedule(const DefaultScheduleType& defaultScheduleType) const {
1266
1/1
✓ Branch 3 taken 4 times.
4 return getImpl<detail::Building_Impl>()->getDefaultSchedule(defaultScheduleType);
1267 }
1268
1269 171 bool Building::setDefaultScheduleSet(const DefaultScheduleSet& defaultScheduleSet) {
1270
1/1
✓ Branch 3 taken 171 times.
171 return getImpl<detail::Building_Impl>()->setDefaultScheduleSet(defaultScheduleSet);
1271 }
1272
1273 ✗ void Building::resetDefaultScheduleSet() {
1274 ✗ getImpl<detail::Building_Impl>()->resetDefaultScheduleSet();
1275 ✗ }
1276
1277 ✗ OutputMeterVector Building::meters() const {
1278 ✗ return getImpl<detail::Building_Impl>()->meters();
1279 }
1280
1281 ✗ BuildingStoryVector Building::buildingStories() const {
1282 ✗ return getImpl<detail::Building_Impl>()->buildingStories();
1283 }
1284
1285 ✗ OptionalFacility Building::facility() const {
1286 ✗ return getImpl<detail::Building_Impl>()->facility();
1287 }
1288
1289 5 SpaceVector Building::spaces() const {
1290
1/1
✓ Branch 3 taken 5 times.
5 return getImpl<detail::Building_Impl>()->spaces();
1291 }
1292
1293 1426 ShadingSurfaceGroupVector Building::shadingSurfaceGroups() const {
1294
1/1
✓ Branch 3 taken 1426 times.
1426 return getImpl<detail::Building_Impl>()->shadingSurfaceGroups();
1295 }
1296
1297 1 std::vector<ThermalZone> Building::thermalZones() const {
1298
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::Building_Impl>()->thermalZones();
1299 }
1300
1301 ✗ std::vector<Surface> Building::exteriorWalls() const {
1302 ✗ return getImpl<detail::Building_Impl>()->exteriorWalls();
1303 }
1304
1305 ✗ std::vector<Surface> Building::roofs() const {
1306 ✗ return getImpl<detail::Building_Impl>()->roofs();
1307 }
1308
1309 35 double Building::floorArea() const {
1310
1/1
✓ Branch 3 taken 35 times.
35 return getImpl<detail::Building_Impl>()->floorArea();
1311 }
1312
1313 11 boost::optional<double> Building::conditionedFloorArea() const {
1314
1/1
✓ Branch 3 taken 11 times.
11 return getImpl<detail::Building_Impl>()->conditionedFloorArea();
1315 }
1316
1317 ✗ double Building::exteriorSurfaceArea() const {
1318 ✗ return getImpl<detail::Building_Impl>()->exteriorSurfaceArea();
1319 }
1320
1321 ✗ double Building::exteriorWallArea() const {
1322 ✗ return getImpl<detail::Building_Impl>()->exteriorWallArea();
1323 }
1324
1325 ✗ double Building::airVolume() const {
1326 ✗ return getImpl<detail::Building_Impl>()->airVolume();
1327 }
1328
1329 6 double Building::numberOfPeople() const {
1330
1/1
✓ Branch 3 taken 6 times.
6 return getImpl<detail::Building_Impl>()->numberOfPeople();
1331 }
1332
1333 10 double Building::peoplePerFloorArea() const {
1334
1/1
✓ Branch 3 taken 10 times.
10 return getImpl<detail::Building_Impl>()->peoplePerFloorArea();
1335 }
1336
1337 ✗ double Building::floorAreaPerPerson() const {
1338 ✗ return getImpl<detail::Building_Impl>()->floorAreaPerPerson();
1339 }
1340
1341 11 double Building::lightingPower() const {
1342
1/1
✓ Branch 3 taken 11 times.
11 return getImpl<detail::Building_Impl>()->lightingPower();
1343 }
1344
1345 11 double Building::lightingPowerPerFloorArea() const {
1346
1/1
✓ Branch 3 taken 11 times.
11 return getImpl<detail::Building_Impl>()->lightingPowerPerFloorArea();
1347 }
1348
1349 1 double Building::lightingPowerPerPerson() const {
1350
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::Building_Impl>()->lightingPowerPerPerson();
1351 }
1352
1353 7 double Building::electricEquipmentPower() const {
1354
1/1
✓ Branch 3 taken 7 times.
7 return getImpl<detail::Building_Impl>()->electricEquipmentPower();
1355 }
1356
1357 1 double Building::electricEquipmentPowerPerFloorArea() const {
1358
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::Building_Impl>()->electricEquipmentPowerPerFloorArea();
1359 }
1360
1361 1 double Building::electricEquipmentPowerPerPerson() const {
1362
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::Building_Impl>()->electricEquipmentPowerPerPerson();
1363 }
1364
1365 1 double Building::gasEquipmentPower() const {
1366
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::Building_Impl>()->gasEquipmentPower();
1367 }
1368
1369 1 double Building::gasEquipmentPowerPerFloorArea() const {
1370
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::Building_Impl>()->gasEquipmentPowerPerFloorArea();
1371 }
1372
1373 1 double Building::gasEquipmentPowerPerPerson() const {
1374
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::Building_Impl>()->gasEquipmentPowerPerPerson();
1375 }
1376
1377 1 double Building::hotWaterEquipmentPower() const {
1378
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::Building_Impl>()->hotWaterEquipmentPower();
1379 }
1380
1381 1 double Building::hotWaterEquipmentPowerPerFloorArea() const {
1382
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::Building_Impl>()->hotWaterEquipmentPowerPerFloorArea();
1383 }
1384
1385 1 double Building::hotWaterEquipmentPowerPerPerson() const {
1386
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::Building_Impl>()->hotWaterEquipmentPowerPerPerson();
1387 }
1388
1389 1 double Building::infiltrationDesignFlowRate() const {
1390
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::Building_Impl>()->infiltrationDesignFlowRate();
1391 }
1392
1393 1 double Building::infiltrationDesignFlowPerSpaceFloorArea() const {
1394
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::Building_Impl>()->infiltrationDesignFlowPerSpaceFloorArea();
1395 }
1396
1397 1 double Building::infiltrationDesignFlowPerExteriorSurfaceArea() const {
1398
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::Building_Impl>()->infiltrationDesignFlowPerExteriorSurfaceArea();
1399 }
1400
1401 1 double Building::infiltrationDesignFlowPerExteriorWallArea() const {
1402
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::Building_Impl>()->infiltrationDesignFlowPerExteriorWallArea();
1403 }
1404
1405 1 double Building::infiltrationDesignAirChangesPerHour() const {
1406
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::Building_Impl>()->infiltrationDesignAirChangesPerHour();
1407 }
1408
1409 1756 Transformation Building::transformation() const {
1410
1/1
✓ Branch 3 taken 1756 times.
1756 return getImpl<detail::Building_Impl>()->transformation();
1411 }
1412
1413 2 double Building::exteriorPerimeter() const {
1414
1/1
✓ Branch 3 taken 2 times.
2 return getImpl<detail::Building_Impl>()->exteriorPerimeter();
1415 }
1416
1417 20 std::vector<std::vector<Point3d>> Building::generateSkylightPattern(double skylightToProjectedFloorRatio, double desiredWidth,
1418 double desiredHeight) const {
1419
1/1
✓ Branch 3 taken 20 times.
20 return getImpl<detail::Building_Impl>()->generateSkylightPattern(skylightToProjectedFloorRatio, desiredWidth, desiredHeight);
1420 }
1421
1422 /// @cond
1423
1/1
✓ Branch 3 taken 1915 times.
1915 Building::Building(std::shared_ptr<detail::Building_Impl> impl) : ParentObject(std::move(impl)) {}
1424
1425 1235 Building::Building(Model& model) : ParentObject(Building::iddObjectType(), model) {}
1426
1427 /// @endcond
1428
1429 } // namespace model
1430 } // namespace openstudio
1431