src/model/InternalMassDefinition.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_INTERNALMASSDEFINITION_HPP | ||
| 7 | #define MODEL_INTERNALMASSDEFINITION_HPP | ||
| 8 | |||
| 9 | #include "ModelAPI.hpp" | ||
| 10 | #include "SpaceLoadDefinition.hpp" | ||
| 11 | |||
| 12 | namespace openstudio { | ||
| 13 | namespace model { | ||
| 14 | |||
| 15 | class ConstructionBase; | ||
| 16 | |||
| 17 | namespace detail { | ||
| 18 | |||
| 19 | class InternalMassDefinition_Impl; | ||
| 20 | |||
| 21 | } // namespace detail | ||
| 22 | |||
| 23 | /** InternalMassDefinition is a SpaceLoadDefinition that wraps the OpenStudio IDD object | ||
| 24 | * 'OS_InternalMass_Definition'. Its fields are derived from the EnergyPlus IDD object | ||
| 25 | * 'InternalMass'. \sa InternalMass | ||
| 26 | */ | ||
| 27 | class MODEL_API InternalMassDefinition : public SpaceLoadDefinition | ||
| 28 | { | ||
| 29 | |||
| 30 | public: | ||
| 31 | /** @name Constructors and Destructors */ | ||
| 32 | //@{ | ||
| 33 | |||
| 34 | explicit InternalMassDefinition(const Model& model); | ||
| 35 | |||
| 36 | 53 | virtual ~InternalMassDefinition() override = default; | |
| 37 | // Default the copy and move operators because the virtual dtor is explicit | ||
| 38 | ✗ | InternalMassDefinition(const InternalMassDefinition& other) = default; | |
| 39 | ✗ | InternalMassDefinition(InternalMassDefinition&& other) = default; | |
| 40 | ✗ | InternalMassDefinition& operator=(const InternalMassDefinition&) = default; | |
| 41 | ✗ | InternalMassDefinition& operator=(InternalMassDefinition&&) = default; | |
| 42 | |||
| 43 | //@} | ||
| 44 | |||
| 45 | static IddObjectType iddObjectType(); | ||
| 46 | |||
| 47 | static std::vector<std::string> validDesignLevelCalculationMethodValues(); | ||
| 48 | |||
| 49 | /** @name Getters */ | ||
| 50 | //@{ | ||
| 51 | |||
| 52 | /// Returns the construction object, if this object does not directly specify construction the hierarchy is searched. | ||
| 53 | boost::optional<ConstructionBase> construction() const; | ||
| 54 | |||
| 55 | /// Returns true if the construction is not directly referenced by this surface . | ||
| 56 | bool isConstructionDefaulted() const; | ||
| 57 | |||
| 58 | std::string designLevelCalculationMethod() const; | ||
| 59 | boost::optional<double> surfaceArea() const; | ||
| 60 | boost::optional<double> surfaceAreaperSpaceFloorArea() const; | ||
| 61 | boost::optional<double> surfaceAreaperPerson() const; | ||
| 62 | |||
| 63 | //@} | ||
| 64 | /** @name Setters */ | ||
| 65 | //@{ | ||
| 66 | |||
| 67 | /// Sets the construction object. | ||
| 68 | bool setConstruction(const ConstructionBase& construction); | ||
| 69 | |||
| 70 | /// Resets the construction object. | ||
| 71 | void resetConstruction(); | ||
| 72 | |||
| 73 | /// Sets designLevelCalculationMethod to 'SurfaceArea', clears surfaceAreaperSpaceFloorArea | ||
| 74 | /// and surfaceAreaperPerson, and sets surfaceArea. | ||
| 75 | bool setSurfaceArea(double surfaceArea); | ||
| 76 | |||
| 77 | /// Sets designLevelCalculationMethod to 'SurfaceArea/Area', clears surfaceArea | ||
| 78 | /// and surfaceAreaperPerson, and sets surfaceAreaperSpaceFloorArea. | ||
| 79 | bool setSurfaceAreaperSpaceFloorArea(double surfaceAreaperSpaceFloorArea); | ||
| 80 | |||
| 81 | /// Sets designLevelCalculationMethod to 'SurfaceArea/Person', clears surfaceArea | ||
| 82 | /// and surfaceAreaperSpaceFloorArea, and sets surfaceAreaperPerson. | ||
| 83 | bool setSurfaceAreaperPerson(double surfaceAreaperPerson); | ||
| 84 | |||
| 85 | //@} | ||
| 86 | /** @name Other */ | ||
| 87 | //@{ | ||
| 88 | |||
| 89 | /** Returns the construction surface area represented by this definition, assuming floorArea (m^2) | ||
| 90 | * and numPeople. */ | ||
| 91 | double getSurfaceArea(double floorArea, double numPeople) const; | ||
| 92 | |||
| 93 | /** Returns the m^2/m^2 of construction surface area per floor area represented by this | ||
| 94 | * definition, assuming floorArea (m^2) and numPeople. */ | ||
| 95 | double getSurfaceAreaPerFloorArea(double floorArea, double numPeople) const; | ||
| 96 | |||
| 97 | /** Returns the m^2/person of construction surface area represented by this definition, assuming | ||
| 98 | * floorArea (m^2) and numPeople. */ | ||
| 99 | double getSurfaceAreaPerPerson(double floorArea, double numPeople) const; | ||
| 100 | |||
| 101 | /** If method is a \link validDesignLevelCalculationMethodValues valid design level calculation | ||
| 102 | * method \endlink, changes this definition to an equivalent construction surface area, under the | ||
| 103 | * assumptions of floorArea (m^2) and numPeople. */ | ||
| 104 | bool setDesignLevelCalculationMethod(const std::string& method, double floorArea, double numPeople); | ||
| 105 | |||
| 106 | //@} | ||
| 107 | protected: | ||
| 108 | /// @cond | ||
| 109 | using ImplType = detail::InternalMassDefinition_Impl; | ||
| 110 | |||
| 111 | friend class Model; | ||
| 112 | friend class openstudio::IdfObject; | ||
| 113 | |||
| 114 | explicit InternalMassDefinition(std::shared_ptr<detail::InternalMassDefinition_Impl> impl); | ||
| 115 | |||
| 116 | /// @endcond | ||
| 117 | private: | ||
| 118 | REGISTER_LOGGER("openstudio.model.InternalMassDefinition"); | ||
| 119 | }; | ||
| 120 | |||
| 121 | /** \relates InternalMassDefinition*/ | ||
| 122 | using OptionalInternalMassDefinition = boost::optional<InternalMassDefinition>; | ||
| 123 | |||
| 124 | /** \relates InternalMassDefinition*/ | ||
| 125 | using InternalMassDefinitionVector = std::vector<InternalMassDefinition>; | ||
| 126 | |||
| 127 | } // namespace model | ||
| 128 | } // namespace openstudio | ||
| 129 | |||
| 130 | #endif // MODEL_INTERNALMASSDEFINITION_HPP | ||
| 131 |