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/OpaqueMaterial.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_OPAQUEMATERIAL_HPP
7 #define MODEL_OPAQUEMATERIAL_HPP
8
9 #include "ModelAPI.hpp"
10 #include "Material.hpp"
11
12 namespace openstudio {
13 namespace model {
14
15 namespace detail {
16 class OpaqueMaterial_Impl;
17 }
18
19 /** OpaqueMaterial is a Material that serves as a base class for all \link LayeredConstruction
20 * LayeredConstructions \endlink for which isOpaque. OpaqueMaterial also defines a number of
21 * virtually implemented attributes. */
22 class MODEL_API OpaqueMaterial : public Material
23 {
24 public:
25 /** @name Constructors and Destructors */
26 //@{
27
28 25343 virtual ~OpaqueMaterial() override = default;
29 // Default the copy and move operators because the virtual dtor is explicit
30 3603 OpaqueMaterial(const OpaqueMaterial& other) = default;
31 9434 OpaqueMaterial(OpaqueMaterial&& other) = default;
32 4 OpaqueMaterial& operator=(const OpaqueMaterial&) = default;
33 ✗ OpaqueMaterial& operator=(OpaqueMaterial&&) = default;
34
35 //@}
36 /** @name Getters */
37 //@{
38
39 /** The conductivity of the material in W/m*K. */
40 double thermalConductivity() const;
41
42 /** The conductance of the material in W/m^2*K. */
43 double thermalConductance() const;
44
45 /** The resistivity of the material in m*K/W. */
46 double thermalResistivity() const;
47
48 /** The resistance of the material in m^2*K/W. */
49 double thermalResistance() const;
50
51 // Thermal absorptance of the Material (dimensionless fraction).
52 double thermalAbsorptance() const;
53
54 // Thermal reflectance of the Material (dimensionless fraction).
55 boost::optional<double> thermalReflectance() const;
56
57 // Solar absorptance of the Material (dimensionless fraction).
58 double solarAbsorptance() const;
59
60 // Solar reflectance of the Material (dimensionless fraction).
61 boost::optional<double> solarReflectance() const;
62
63 // Visible absorptance of the Material (dimensionless fraction).
64 double visibleAbsorptance() const;
65
66 // Visible reflectance of the Material (dimensionless fraction).
67 boost::optional<double> visibleReflectance() const;
68
69 //@}
70 /** @name Setters */
71 //@{
72
73 /** Sets the conductivity of the material in W/m*K, if possible. */
74 bool setThermalConductivity(double value);
75
76 /** Sets the conductance of the material in W/m^2*K, if possible. Sets thickness to achieve conductivity. */
77 bool setThermalConductance(double value);
78
79 /** Sets the resistivity of the material in m*K/W, if possible. */
80 bool setThermalResistivity(double value);
81
82 /** Sets the resistance of the material in m^2*K/W, if possible. Sets thickness to achieve resistivity. */
83 bool setThermalResistance(double value);
84
85 // Set the thermal absorptance (dimensionless fraction).
86 bool setThermalAbsorptance(double value);
87
88 // Set the thermal reflectance (dimensionless fraction).
89 bool setThermalReflectance(boost::optional<double> value);
90
91 // Set the solar absorptance (dimensionless fraction).
92 bool setSolarAbsorptance(boost::optional<double> value);
93
94 // Set the solar reflectance (dimensionless fraction).
95 bool setSolarReflectance(boost::optional<double> value);
96
97 // Set the visible absorptance (dimensionless fraction).
98 bool setVisibleAbsorptance(boost::optional<double> value);
99
100 // Set the visible reflectance (dimensionless fraction).
101 bool setVisibleReflectance(boost::optional<double> value);
102
103 //@}
104 /** @name Queries */
105 //@{
106
107 /** Energy it takes to raise the temperature of this material 1 K (J/m^2*K). Equal to
108 * specificHeat() * density() * thickness(). */
109 boost::optional<double> heatCapacity() const;
110
111 //@}
112 protected:
113 /// @cond
114 using ImplType = detail::OpaqueMaterial_Impl;
115
116 friend class Model;
117 friend class openstudio::IdfObject;
118 friend class detail::OpaqueMaterial_Impl;
119
120 OpaqueMaterial(IddObjectType type, const Model& model);
121
122 explicit OpaqueMaterial(std::shared_ptr<detail::OpaqueMaterial_Impl> impl);
123
124 /// @endcond
125 private:
126 REGISTER_LOGGER("openstudio.model.OpaqueMaterial");
127 };
128
129 /** \relates OpaqueMaterial */
130 using OptionalOpaqueMaterial = boost::optional<OpaqueMaterial>;
131
132 /** \relates OpaqueMaterial */
133 using OpaqueMaterialVector = std::vector<OpaqueMaterial>;
134
135 } // namespace model
136 } // namespace openstudio
137
138 #endif // MODEL_OPAQUEMATERIAL_HPP
139