GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 1 / 1 / 2
Functions: 100.0% 1 / 1 / 2
Branches: -% 0 / 1 / 1

src/model/LayeredConstruction_Impl.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_LAYEREDCONSTRUCTION_IMPL_HPP
7 #define MODEL_LAYEREDCONSTRUCTION_IMPL_HPP
8
9 #include "ConstructionBase_Impl.hpp"
10
11 namespace openstudio {
12
13 class ValidityReport;
14
15 namespace model {
16
17 // forward declarations
18 class LayeredConstruction;
19 class Construction;
20 class ConstructionWithInternalSource;
21 class Material;
22 class OpaqueMaterial;
23 class FenestrationMaterial;
24 class ModelPartitionMaterial;
25
26 namespace detail {
27
28 class MODEL_API LayeredConstruction_Impl : public ConstructionBase_Impl
29 {
30
31 public:
32 /** @name Constructors and Destructors */
33 //@{
34
35 // Construct completely new object.
36 LayeredConstruction_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle);
37
38 // Construct from existing workspace object (typically when Model is being constructed
39 // from Workspace).
40 LayeredConstruction_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle);
41
42 // Clone copy constructor.
43 LayeredConstruction_Impl(const LayeredConstruction_Impl& other, Model_Impl* model, bool keepHandle);
44
45 5299 virtual ~LayeredConstruction_Impl() override = default;
46
47 //@}
48 /** @name Getters */
49 //@{
50
51 /** Returns the material layers that make up this construction. Listed in order from outside in,
52 * that is, the Material at index 0 faces out, from the point of view of the Zone, should this
53 * LayeredConstruction be associated with a PlanarSurface. */
54 std::vector<Material> layers() const;
55
56 Material getLayer(unsigned layerIndex) const;
57
58 //@}
59 /** @name Setters */
60 //@{
61
62 virtual bool eraseLayer(unsigned layerIndex);
63
64 virtual bool insertLayer(unsigned layerIndex, const Material& material);
65
66 virtual bool setLayer(unsigned layerIndex, const Material& material);
67
68 virtual bool setLayers(const std::vector<Material>& materials);
69
70 virtual bool setLayer(const ModelPartitionMaterial& modelPartitionMaterial);
71
72 /** Set the u-factor of this surface in W/m^2*K, if possible. value should already include
73 * appropriate film coefficients. By default, assumes still air indoors and 15 mph outdoor air
74 * speed. */
75 virtual bool setUFactor(double value) override;
76
77 /** Set the u-factor of this surface in W/m^2*K, if possible. filmResistance (m^2*K/W) may be
78 * used to convert value to a conductance. */
79 virtual bool setUFactor(double value, double filmResistance) override;
80
81 /** Set the conductance of this surface in W/m^2*K, if possible. value should not include any film
82 * coefficients. */
83 virtual bool setThermalConductance(double value);
84
85 /** Set the conductance of this surface in W/m^2*K, if possible. filmResistance (m^2*K/W) may be
86 * used to convert value to a u-factor. */
87 virtual bool setThermalConductance(double value, double filmResistance);
88
89 /** Same as setThermalConductance. Just adding to support current interface of ConstructionBase.
90 * One of these sets of methods should be deprecated. */
91 virtual bool setConductance(double value) override;
92
93 /** Same as setThermalConductance. Just adding to support current interface of ConstructionBase.
94 * One of these sets of methods should be deprecated. */
95 virtual bool setConductance(double value, double filmResistance) override;
96
97 //@}
98 /** @name Queries */
99 //@{
100
101 bool isOpaque() const override;
102
103 bool isFenestration() const override;
104
105 bool isSolarDiffusing() const override;
106
107 bool isModelPartition() const override;
108
109 /** Returns true if the construction has RoofVegetation as the outer layer. */
110 virtual bool isGreenRoof() const override;
111
112 /** Returns true if this is a symmetric layered construction. */
113 bool isSymmetric() const;
114
115 /** Returns true if this construction has the same layers as other one. */
116 bool equalLayers(const LayeredConstruction& other) const;
117
118 /** Returns true if this construction has the same layers but in reverse order as other one. */
119 bool reverseEqualLayers(const LayeredConstruction& other) const;
120
121 /** Returns layer indices that do not actually point to a Material. Before simulation, the
122 * returned vector should be empty. */
123 std::vector<unsigned> nullLayers() const;
124
125 /** Returns the number of non-null layers in this construction. */
126 unsigned numLayers() const;
127
128 std::vector<unsigned> getLayerIndices(const Material& material) const;
129
130 /** Get the u-factor of this construction. Includes film coefficients. */
131 virtual boost::optional<double> uFactor() const override;
132
133 /** Get the u-factor of this construction. Includes filmResistance. */
134 virtual boost::optional<double> uFactor(double filmResistance) const override;
135
136 /** Get the thermal conductance of this construction. Does not include film coefficients. */
137 virtual boost::optional<double> thermalConductance() const override;
138
139 /** Get the thermal conductance of this construction. filmResistance is subtracted out of the
140 * thermalResistance if necessary. */
141 virtual boost::optional<double> thermalConductance(double filmResistance) const override;
142
143 /** Get the heat capacity of this construction (J/m^2*K). Only works for
144 * \link LayeredConstruction LayeredConstructions \endlink of \link StandardOpaqueMaterial
145 * StandardOpaqueMaterials \endlink. */
146 virtual boost::optional<double> heatCapacity() const override;
147
148 /// get interior visible absorptance (unitless)
149 virtual boost::optional<double> interiorVisibleAbsorptance() const override;
150
151 /// get exterior visible absorptance (unitless)
152 virtual boost::optional<double> exteriorVisibleAbsorptance() const override;
153
154 /// get visible transmittance (unitless)
155 virtual boost::optional<double> visibleTransmittance() const override;
156
157 //@}
158 /** @name Standards Methods */
159 //@{
160
161 /** Returns the layer designated as insulation, if such a designation has been made. */
162 boost::optional<OpaqueMaterial> insulation() const;
163
164 /** Notes that insulationLayer is the perturbable insulation layer. Only works if
165 * insulationLayer is already in this construction. */
166 bool setInsulation(const OpaqueMaterial& insulationLayer);
167
168 /** Removes any existing insulation layer designations. Does not touch the actual composition
169 * of the construction. */
170 void resetInsulation();
171
172 void ensureUniqueLayers();
173
174 //@}
175
176 protected:
177 friend class LayeredConstruction;
178
179 // Erase all nullLayers, and return the new value for layerIndex, if it is affected by erasures.
180 // If layerIndex was originally pointing to a nullLayer, upon return it will point to the first
181 // non-null layer after its original position.
182 unsigned mf_clearNullLayers(unsigned layerIndex = 0);
183
184 private:
185 − REGISTER_LOGGER("openstudio.model.LayeredConstruction");
186
187 boost::optional<ModelObject> insulationAsModelObject() const;
188
189 bool setInsulationAsModelObject(const boost::optional<ModelObject>& modelObject);
190 };
191
192 } // namespace detail
193
194 } // namespace model
195 } // namespace openstudio
196
197 #endif // MODEL_LAYEREDCONSTRUCTION_IMPL_HPP
198