src/model/CurveQuartic.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_CURVEQUARTIC_HPP | ||
| 7 | #define MODEL_CURVEQUARTIC_HPP | ||
| 8 | |||
| 9 | #include "ModelAPI.hpp" | ||
| 10 | #include "Curve.hpp" | ||
| 11 | |||
| 12 | namespace openstudio { | ||
| 13 | namespace model { | ||
| 14 | |||
| 15 | namespace detail { | ||
| 16 | |||
| 17 | class CurveQuartic_Impl; | ||
| 18 | |||
| 19 | } // namespace detail | ||
| 20 | |||
| 21 | /** CurveQuartic is a Curve that wraps the OpenStudio IDD object 'OS:Curve:Quartic'. The | ||
| 22 | * functional form is \f$f(x) = c_1 + c_2 \cdot x + c_3 \cdot x^2 + c_4 \cdot x^3 + c_5 \cdot x^4\f$ */ | ||
| 23 | class MODEL_API CurveQuartic : public Curve | ||
| 24 | { | ||
| 25 | public: | ||
| 26 | /** @name Constructors and Destructors */ | ||
| 27 | //@{ | ||
| 28 | |||
| 29 | /** Initializes \f$c_1 = c_2 = c_3 = c_4 = 0.0,\ c_5 = 1.0,\ x\ \text{in}\ [0.0,1.0]\f$ */ | ||
| 30 | explicit CurveQuartic(const Model& model); | ||
| 31 | |||
| 32 | 21 | virtual ~CurveQuartic() override = default; | |
| 33 | // Default the copy and move operators because the virtual dtor is explicit | ||
| 34 | 1 | CurveQuartic(const CurveQuartic& other) = default; | |
| 35 | 1 | CurveQuartic(CurveQuartic&& other) = default; | |
| 36 | ✗ | CurveQuartic& operator=(const CurveQuartic&) = default; | |
| 37 | ✗ | CurveQuartic& operator=(CurveQuartic&&) = default; | |
| 38 | |||
| 39 | //@} | ||
| 40 | |||
| 41 | static IddObjectType iddObjectType(); | ||
| 42 | |||
| 43 | static std::vector<std::string> validInputUnitTypeforXValues(); | ||
| 44 | |||
| 45 | static std::vector<std::string> validOutputUnitTypeValues(); | ||
| 46 | |||
| 47 | /** @name Getters */ | ||
| 48 | //@{ | ||
| 49 | |||
| 50 | double coefficient1Constant() const; | ||
| 51 | |||
| 52 | double coefficient2x() const; | ||
| 53 | |||
| 54 | double coefficient3xPOW2() const; | ||
| 55 | |||
| 56 | double coefficient4xPOW3() const; | ||
| 57 | |||
| 58 | double coefficient5xPOW4() const; | ||
| 59 | |||
| 60 | double minimumValueofx() const; | ||
| 61 | |||
| 62 | double maximumValueofx() const; | ||
| 63 | |||
| 64 | boost::optional<double> minimumCurveOutput() const; | ||
| 65 | |||
| 66 | boost::optional<double> maximumCurveOutput() const; | ||
| 67 | |||
| 68 | std::string inputUnitTypeforX() const; | ||
| 69 | |||
| 70 | bool isInputUnitTypeforXDefaulted() const; | ||
| 71 | |||
| 72 | std::string outputUnitType() const; | ||
| 73 | |||
| 74 | bool isOutputUnitTypeDefaulted() const; | ||
| 75 | |||
| 76 | //@} | ||
| 77 | /** @name Setters */ | ||
| 78 | //@{ | ||
| 79 | |||
| 80 | bool setCoefficient1Constant(double coefficient1Constant); | ||
| 81 | |||
| 82 | bool setCoefficient2x(double coefficient2x); | ||
| 83 | |||
| 84 | bool setCoefficient3xPOW2(double coefficient3xPOW2); | ||
| 85 | |||
| 86 | bool setCoefficient4xPOW3(double coefficient4xPOW3); | ||
| 87 | |||
| 88 | bool setCoefficient5xPOW4(double coefficient5xPOW4); | ||
| 89 | |||
| 90 | bool setMinimumValueofx(double minimumValueofx); | ||
| 91 | |||
| 92 | bool setMaximumValueofx(double maximumValueofx); | ||
| 93 | |||
| 94 | bool setMinimumCurveOutput(double minimumCurveOutput); | ||
| 95 | |||
| 96 | void resetMinimumCurveOutput(); | ||
| 97 | |||
| 98 | bool setMaximumCurveOutput(double maximumCurveOutput); | ||
| 99 | |||
| 100 | void resetMaximumCurveOutput(); | ||
| 101 | |||
| 102 | bool setInputUnitTypeforX(const std::string& inputUnitTypeforX); | ||
| 103 | |||
| 104 | void resetInputUnitTypeforX(); | ||
| 105 | |||
| 106 | bool setOutputUnitType(const std::string& outputUnitType); | ||
| 107 | |||
| 108 | void resetOutputUnitType(); | ||
| 109 | |||
| 110 | //@} | ||
| 111 | /** @name Other */ | ||
| 112 | //@{ | ||
| 113 | |||
| 114 | //@} | ||
| 115 | protected: | ||
| 116 | /// @cond | ||
| 117 | using ImplType = detail::CurveQuartic_Impl; | ||
| 118 | |||
| 119 | explicit CurveQuartic(std::shared_ptr<detail::CurveQuartic_Impl> impl); | ||
| 120 | |||
| 121 | friend class detail::CurveQuartic_Impl; | ||
| 122 | friend class Model; | ||
| 123 | friend class IdfObject; | ||
| 124 | friend class openstudio::detail::IdfObject_Impl; | ||
| 125 | |||
| 126 | /// @endcond | ||
| 127 | private: | ||
| 128 | REGISTER_LOGGER("openstudio.model.CurveQuartic"); | ||
| 129 | }; | ||
| 130 | |||
| 131 | /** \relates CurveQuartic*/ | ||
| 132 | using OptionalCurveQuartic = boost::optional<CurveQuartic>; | ||
| 133 | |||
| 134 | /** \relates CurveQuartic*/ | ||
| 135 | using CurveQuarticVector = std::vector<CurveQuartic>; | ||
| 136 | |||
| 137 | } // namespace model | ||
| 138 | } // namespace openstudio | ||
| 139 | |||
| 140 | #endif // MODEL_CURVEQUARTIC_HPP | ||
| 141 |