GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 80.0% 4 / 0 / 5
Functions: 80.0% 4 / 0 / 5
Branches: -% 0 / 0 / 0

src/model/DefaultConstructionSet.hpp
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 #ifndef MODEL_DEFAULTCONSTRUCTIONSET_HPP
7 #define MODEL_DEFAULTCONSTRUCTIONSET_HPP
8
9 #include "ModelAPI.hpp"
10 #include "ResourceObject.hpp"
11
12 namespace openstudio {
13 namespace model {
14
15 class PlanarSurface;
16 class ConstructionBase;
17 class DefaultSubSurfaceConstructions;
18 class DefaultSurfaceConstructions;
19
20 namespace detail {
21
22 class DefaultConstructionSet_Impl;
23
24 } // namespace detail
25
26 /** DefaultConstructionSet is a ResourceObject that wraps the OpenStudio IDD object 'OS_DefaultConstructionSet'. */
27 class MODEL_API DefaultConstructionSet : public ResourceObject
28 {
29 public:
30 /** @name Constructors and Destructors */
31 //@{
32
33 explicit DefaultConstructionSet(const Model& model);
34
35 98792 virtual ~DefaultConstructionSet() override = default;
36 // Default the copy and move operators because the virtual dtor is explicit
37 1211 DefaultConstructionSet(const DefaultConstructionSet& other) = default;
38 72221 DefaultConstructionSet(DefaultConstructionSet&& other) = default;
39 ✗ DefaultConstructionSet& operator=(const DefaultConstructionSet&) = default;
40 280 DefaultConstructionSet& operator=(DefaultConstructionSet&&) = default;
41
42 //@}
43 /** @name Static Methods */
44 //@{
45
46 static IddObjectType iddObjectType();
47
48 //@}
49 /** @name Getters */
50 //@{
51
52 boost::optional<DefaultSurfaceConstructions> defaultExteriorSurfaceConstructions() const;
53
54 boost::optional<DefaultSurfaceConstructions> defaultInteriorSurfaceConstructions() const;
55
56 boost::optional<DefaultSurfaceConstructions> defaultGroundContactSurfaceConstructions() const;
57
58 boost::optional<DefaultSubSurfaceConstructions> defaultExteriorSubSurfaceConstructions() const;
59
60 boost::optional<DefaultSubSurfaceConstructions> defaultInteriorSubSurfaceConstructions() const;
61
62 boost::optional<ConstructionBase> interiorPartitionConstruction() const;
63
64 boost::optional<ConstructionBase> spaceShadingConstruction() const;
65
66 boost::optional<ConstructionBase> buildingShadingConstruction() const;
67
68 boost::optional<ConstructionBase> siteShadingConstruction() const;
69
70 boost::optional<ConstructionBase> adiabaticSurfaceConstruction() const;
71
72 //@}
73 /** @name Setters */
74 //@{
75
76 bool setDefaultExteriorSurfaceConstructions(const DefaultSurfaceConstructions& defaultSurfaceConstructions);
77
78 void resetDefaultExteriorSurfaceConstructions();
79
80 bool setDefaultInteriorSurfaceConstructions(const DefaultSurfaceConstructions& defaultSurfaceConstructions);
81
82 void resetDefaultInteriorSurfaceConstructions();
83
84 bool setDefaultGroundContactSurfaceConstructions(const DefaultSurfaceConstructions& defaultSurfaceConstructions);
85
86 void resetDefaultGroundContactSurfaceConstructions();
87
88 bool setDefaultExteriorSubSurfaceConstructions(const DefaultSubSurfaceConstructions& defaultSubSurfaceConstructions);
89
90 void resetDefaultExteriorSubSurfaceConstructions();
91
92 bool setDefaultInteriorSubSurfaceConstructions(const DefaultSubSurfaceConstructions& defaultSubSurfaceConstructions);
93
94 void resetDefaultInteriorSubSurfaceConstructions();
95
96 bool setInteriorPartitionConstruction(const ConstructionBase& construction);
97
98 void resetInteriorPartitionConstruction();
99
100 bool setSpaceShadingConstruction(const ConstructionBase& construction);
101
102 void resetSpaceShadingConstruction();
103
104 bool setBuildingShadingConstruction(const ConstructionBase& construction);
105
106 void resetBuildingShadingConstruction();
107
108 bool setSiteShadingConstruction(const ConstructionBase& construction);
109
110 void resetSiteShadingConstruction();
111
112 bool setAdiabaticSurfaceConstruction(const ConstructionBase& construction);
113
114 void resetAdiabaticSurfaceConstruction();
115
116 //@}
117
118 /// Returns the default construction for this planar surface if available.
119 boost::optional<ConstructionBase> getDefaultConstruction(const PlanarSurface& planarSurface) const;
120
121 /// Merge this object with other one, keep fields from this object if set otherwise set to value from other.
122 void merge(const DefaultConstructionSet& other);
123
124 /** Collapses the DefaultConstructionSet inheritance (Space, SpaceType, BuildingStory, Building, Building SpaceType) to the
125 * Space and Building levels, the only two that the EnergyPlus ConstructionAssignmentSet supports.
126 *
127 * Space -> SpaceType (explicit only) -> BuildingStory -> Building -> Building SpaceType
128 * \__________________ ___________________________/ \_______________ _____________/
129 * V V
130 * Space Group Building Group
131 *
132 * For the Building, then for each Space, the sets of the levels it inherits from are considered in priority order. A
133 * lower-priority set that fills no slot left empty by the ones above it is ignored. If one set remains, it is assigned as is.
134 * If several remain, they are merged into a new set, created once per combination of owners and shared by all Spaces with
135 * that combination (e.g. "SpaceType Office @ BuildingStory L1").
136 *
137 * If purge is false, SpaceType and BuildingStory sets are left in place: they no longer affect any surface.
138 * If purge is true, they are reset, then the sets that were referenced before the call and are now unused are removed,
139 * along with their DefaultSurfaceConstructions / DefaultSubSurfaceConstructions if those are now unused too. Sets that were
140 * already unused before the call are left alone.
141 *
142 * Every surface resolves to the same construction afterwards, but search distances change, which affects how the
143 * constructions of matched surfaces are resolved: resolve those first if needed.
144 * This modifies the model in place: call it on a clone to keep the original.
145 * Returns the DefaultConstructionSets that were created. */
146 static std::vector<DefaultConstructionSet> collapseToSpaceAndBuilding(Model& model, bool purge = false);
147
148 protected:
149 /// @cond
150 using ImplType = detail::DefaultConstructionSet_Impl;
151
152 friend class Model;
153 friend class openstudio::IdfObject;
154
155 explicit DefaultConstructionSet(std::shared_ptr<detail::DefaultConstructionSet_Impl> impl);
156
157 /// @endcond
158 private:
159 REGISTER_LOGGER("openstudio.model.DefaultConstructionSet");
160 };
161
162 /** \relates DefaultConstructionSet*/
163 using OptionalDefaultConstructionSet = boost::optional<DefaultConstructionSet>;
164
165 /** \relates DefaultConstructionSet*/
166 using DefaultConstructionSetVector = std::vector<DefaultConstructionSet>;
167
168 } // namespace model
169 } // namespace openstudio
170
171 #endif // MODEL_DEFAULTCONSTRUCTIONSET_HPP
172