GCC Code Coverage Report


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

src/model/ConstructionBase.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_CONSTRUCTIONBASE_HPP
7 #define MODEL_CONSTRUCTIONBASE_HPP
8
9 #include "ModelAPI.hpp"
10 #include "ResourceObject.hpp"
11
12 namespace openstudio {
13 namespace model {
14
15 class StandardsInformationConstruction;
16 class RenderingColor;
17
18 namespace detail {
19 class ConstructionBase_Impl;
20 }
21
22 /** ConstructionBase is a ResourceObject that serves as a base class for several objects that can
23 * be used to specify a construction for a PlanarSurface. */
24 class MODEL_API ConstructionBase : public ResourceObject
25 {
26 public:
27 /** @name Constructors and Destructors */
28 //@{
29
30 388960 virtual ~ConstructionBase() override = default;
31 // Default the copy and move operators because the virtual dtor is explicit
32 83515 ConstructionBase(const ConstructionBase& other) = default;
33 238413 ConstructionBase(ConstructionBase&& other) = default;
34 7 ConstructionBase& operator=(const ConstructionBase&) = default;
35 424 ConstructionBase& operator=(ConstructionBase&&) = default;
36
37 //@}
38 /** @name Getters */
39 //@{
40
41 /** Returns this construction's standards information, constructing a new object if necessary. */
42 StandardsInformationConstruction standardsInformation() const;
43
44 //@}
45
46 /** Returns the sum of the surface area of all planar surfaces that use this construction (m^2).
47 * If this construction is used by a Surface that contains one or more \link SubSurface
48 * SubSurfaces \endlink, than the SubSurface areas are subtracted out of the total.
49 * If two adjacent surfaces both reference the same construction then only the area of the largest
50 * adjacent surface will be counted. If two adjacent surfaces reference different constructions then
51 * the net area of each adjacent surface will be included in the net area for their respective constructions.*/
52 double getNetArea() const;
53
54 /** Set the u-factor of this surface in W/m^2*K, if possible. Value should already include
55 * appropriate standard film coefficients, assuming still air indoors and 15 mph outdoor air speed.
56 * Does not consider any custom SurfacePropertyConvectionCoefficients. */
57 bool setUFactor(double value);
58
59 /** Set the u-factor of this surface in W/m^2*K, if possible. filmResistance (m^2*K/W) may be
60 * used to convert value to a conductance. */
61 bool setUFactor(double value, double filmResistance);
62
63 /** Set the conductance of this surface in W/m^2*K, if possible. value should not include any film
64 * coefficients. */
65 bool setConductance(double value);
66
67 /** Set the conductance of this surface in W/m^2*K, if possible. filmResistance (m^2*K/W) may be
68 * used to convert value to a u-factor. */
69 bool setConductance(double value, double filmResistance);
70
71 bool isOpaque() const;
72
73 bool isFenestration() const;
74
75 /** Returns true if isFenestration and any material layers are solar diffusing. */
76 bool isSolarDiffusing() const;
77
78 bool isModelPartition() const;
79
80 /** Returns true if the construction has RoofVegetation as the outer layer. */
81 bool isGreenRoof() const;
82
83 /** Get the u-factor of this construction (W/m^2*K).
84 * Includes standard film coefficients, does not consider any custom SurfacePropertyConvectionCoefficients. */
85 boost::optional<double> uFactor() const;
86
87 /** Get the u-factor of this construction (W/m^2*K). Includes filmResistance. */
88 boost::optional<double> uFactor(double filmResistance) const;
89
90 /** Get the thermal conductance of this construction (W/m^2*K). Does not include film coefficients. */
91 boost::optional<double> thermalConductance() const;
92
93 /** Get the thermal conductance of this construction (W/m^2*K). filmResistance is subtracted out
94 * of the thermalResistance if necessary. */
95 boost::optional<double> thermalConductance(double filmResistance) const;
96
97 /** Get the heat capacity of this construction (J/m^2*K). Only works for
98 * \link LayeredConstruction LayeredConstructions \endlink of \link StandardOpaqueMaterial
99 * StandardOpaqueMaterials \endlink. */
100 boost::optional<double> heatCapacity() const;
101
102 /** Get the visible absorptance of the interior side of this construction (dimensionless). May
103 * require simulation ('EnvelopeSummary' table). */
104 boost::optional<double> interiorVisibleAbsorptance() const;
105
106 /** Get the visible absorptance of the exterior side of this construction (dimensionless). May
107 * require simulation ('EnvelopeSummary' table). */
108 boost::optional<double> exteriorVisibleAbsorptance() const;
109
110 /** Get the visible transmittance of this construction (dimensionless). May require simulation
111 * ('EnvelopeSummary' table). */
112 boost::optional<double> visibleTransmittance() const;
113
114 /// Returns the rendering color.
115 boost::optional<RenderingColor> renderingColor() const;
116
117 /// Sets the rendering color.
118 bool setRenderingColor(const RenderingColor& renderingColor);
119
120 /// Resets the rendering color.
121 void resetRenderingColor();
122
123 protected:
124 /// @cond
125 using ImplType = detail::ConstructionBase_Impl;
126
127 friend class Model;
128 friend class openstudio::IdfObject;
129 friend class openstudio::detail::IdfObject_Impl;
130 friend class detail::ConstructionBase_Impl;
131
132 ConstructionBase(IddObjectType type, const Model& model);
133
134 explicit ConstructionBase(std::shared_ptr<detail::ConstructionBase_Impl> impl);
135
136 /// @endcond
137 private:
138 REGISTER_LOGGER("openstudio.model.ConstructionBase");
139 };
140
141 /** \relates ConstructionBase */
142 using OptionalConstructionBase = boost::optional<ConstructionBase>;
143
144 /** \relates ConstructionBase */
145 using ConstructionBaseVector = std::vector<ConstructionBase>;
146
147 } // namespace model
148 } // namespace openstudio
149
150 #endif // MODEL_CONSTRUCTIONBASE_HPP
151