src/model/InsideSurfaceConvectionAlgorithm.cpp
| 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 | #include "InsideSurfaceConvectionAlgorithm.hpp" | ||
| 7 | #include "InsideSurfaceConvectionAlgorithm_Impl.hpp" | ||
| 8 | #include "SimulationControl.hpp" | ||
| 9 | #include "SimulationControl_Impl.hpp" | ||
| 10 | #include "Model.hpp" | ||
| 11 | #include "Model_Impl.hpp" | ||
| 12 | |||
| 13 | #include <utilities/idd/IddFactory.hxx> | ||
| 14 | |||
| 15 | #include <utilities/idd/OS_SurfaceConvectionAlgorithm_Inside_FieldEnums.hxx> | ||
| 16 | #include <utilities/idd/IddEnums.hxx> | ||
| 17 | #include "../utilities/core/Assert.hpp" | ||
| 18 | |||
| 19 | namespace openstudio { | ||
| 20 | namespace model { | ||
| 21 | |||
| 22 | namespace detail { | ||
| 23 | |||
| 24 | 212 | InsideSurfaceConvectionAlgorithm_Impl::InsideSurfaceConvectionAlgorithm_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle) | |
| 25 | 212 | : ModelObject_Impl(idfObject, model, keepHandle) { | |
| 26 |
4/6✓ Branch 1 taken 212 times.
✓ Branch 4 taken 212 times.
✓ Branch 7 taken 212 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 212 times.
✗ Branch 13 not taken.
|
212 | OS_ASSERT(idfObject.iddObject().type() == InsideSurfaceConvectionAlgorithm::iddObjectType()); |
| 27 | 212 | } | |
| 28 | |||
| 29 | 40 | InsideSurfaceConvectionAlgorithm_Impl::InsideSurfaceConvectionAlgorithm_Impl(const openstudio::detail::WorkspaceObject_Impl& other, | |
| 30 | 40 | Model_Impl* model, bool keepHandle) | |
| 31 | 40 | : ModelObject_Impl(other, model, keepHandle) { | |
| 32 |
4/6✓ Branch 1 taken 40 times.
✓ Branch 4 taken 40 times.
✓ Branch 7 taken 40 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 40 times.
✗ Branch 13 not taken.
|
40 | OS_ASSERT(other.iddObject().type() == InsideSurfaceConvectionAlgorithm::iddObjectType()); |
| 33 | 40 | } | |
| 34 | |||
| 35 | 107 | InsideSurfaceConvectionAlgorithm_Impl::InsideSurfaceConvectionAlgorithm_Impl(const InsideSurfaceConvectionAlgorithm_Impl& other, | |
| 36 | 107 | Model_Impl* model, bool keepHandle) | |
| 37 | 107 | : ModelObject_Impl(other, model, keepHandle) {} | |
| 38 | |||
| 39 | // return the parent object in the hierarchy | ||
| 40 | ✗ | boost::optional<ParentObject> InsideSurfaceConvectionAlgorithm_Impl::parent() const { | |
| 41 | ✗ | boost::optional<ParentObject> result(model().getUniqueModelObject<SimulationControl>()); | |
| 42 | ✗ | return result; | |
| 43 | } | ||
| 44 | |||
| 45 | // set the parent, child may have to call methods on the parent | ||
| 46 | ✗ | bool InsideSurfaceConvectionAlgorithm_Impl::setParent(ParentObject& newParent) { | |
| 47 | ✗ | if (newParent.optionalCast<SimulationControl>() && (newParent.model() == model())) { | |
| 48 | ✗ | return true; | |
| 49 | } | ||
| 50 | ✗ | return false; | |
| 51 | } | ||
| 52 | |||
| 53 | // Get all output variable names that could be associated with this object. | ||
| 54 | 1 | const std::vector<std::string>& InsideSurfaceConvectionAlgorithm_Impl::outputVariableNames() const { | |
| 55 |
2/4✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
1 | static const std::vector<std::string> result; |
| 56 | 1 | return result; | |
| 57 | } | ||
| 58 | |||
| 59 | 1 | IddObjectType InsideSurfaceConvectionAlgorithm_Impl::iddObjectType() const { | |
| 60 | 1 | return InsideSurfaceConvectionAlgorithm::iddObjectType(); | |
| 61 | } | ||
| 62 | |||
| 63 | 44 | std::string InsideSurfaceConvectionAlgorithm_Impl::algorithm() const { | |
| 64 |
1/1✓ Branch 1 taken 44 times.
|
44 | boost::optional<std::string> value = getString(OS_SurfaceConvectionAlgorithm_InsideFields::Algorithm, true); |
| 65 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 44 times.
✗ Branch 4 not taken.
|
44 | OS_ASSERT(value); |
| 66 |
2/2✓ Branch 1 taken 44 times.
✓ Branch 4 taken 44 times.
|
88 | return value.get(); |
| 67 | 44 | } | |
| 68 | |||
| 69 | ✗ | bool InsideSurfaceConvectionAlgorithm_Impl::isAlgorithmDefaulted() const { | |
| 70 | ✗ | return isEmpty(OS_SurfaceConvectionAlgorithm_InsideFields::Algorithm); | |
| 71 | } | ||
| 72 | |||
| 73 | 171 | bool InsideSurfaceConvectionAlgorithm_Impl::setAlgorithm(const std::string& algorithm) { | |
| 74 | 171 | bool result = setString(OS_SurfaceConvectionAlgorithm_InsideFields::Algorithm, algorithm); | |
| 75 | 171 | return result; | |
| 76 | } | ||
| 77 | |||
| 78 | ✗ | void InsideSurfaceConvectionAlgorithm_Impl::resetAlgorithm() { | |
| 79 | ✗ | bool result = setString(OS_SurfaceConvectionAlgorithm_InsideFields::Algorithm, ""); | |
| 80 | ✗ | OS_ASSERT(result); | |
| 81 | ✗ | } | |
| 82 | |||
| 83 | } // namespace detail | ||
| 84 | |||
| 85 | 9078 | IddObjectType InsideSurfaceConvectionAlgorithm::iddObjectType() { | |
| 86 |
1/1✓ Branch 1 taken 9078 times.
|
9078 | IddObjectType result(IddObjectType::OS_SurfaceConvectionAlgorithm_Inside); |
| 87 | 9078 | return result; | |
| 88 | } | ||
| 89 | |||
| 90 | ✗ | std::vector<std::string> InsideSurfaceConvectionAlgorithm::validAlgorithmValues() { | |
| 91 | ✗ | return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_SurfaceConvectionAlgorithm_InsideFields::Algorithm); | |
| 92 | } | ||
| 93 | |||
| 94 | 44 | std::string InsideSurfaceConvectionAlgorithm::algorithm() const { | |
| 95 |
1/1✓ Branch 3 taken 44 times.
|
44 | return getImpl<detail::InsideSurfaceConvectionAlgorithm_Impl>()->algorithm(); |
| 96 | } | ||
| 97 | |||
| 98 | ✗ | bool InsideSurfaceConvectionAlgorithm::isAlgorithmDefaulted() const { | |
| 99 | ✗ | return getImpl<detail::InsideSurfaceConvectionAlgorithm_Impl>()->isAlgorithmDefaulted(); | |
| 100 | } | ||
| 101 | |||
| 102 | 171 | bool InsideSurfaceConvectionAlgorithm::setAlgorithm(const std::string& algorithm) { | |
| 103 |
1/1✓ Branch 3 taken 171 times.
|
171 | return getImpl<detail::InsideSurfaceConvectionAlgorithm_Impl>()->setAlgorithm(algorithm); |
| 104 | } | ||
| 105 | |||
| 106 | ✗ | void InsideSurfaceConvectionAlgorithm::resetAlgorithm() { | |
| 107 | ✗ | getImpl<detail::InsideSurfaceConvectionAlgorithm_Impl>()->resetAlgorithm(); | |
| 108 | ✗ | } | |
| 109 | |||
| 110 | /// constructor | ||
| 111 | 171 | InsideSurfaceConvectionAlgorithm::InsideSurfaceConvectionAlgorithm(const Model& model) | |
| 112 | 171 | : ModelObject(InsideSurfaceConvectionAlgorithm::iddObjectType(), model) { | |
| 113 |
1/3✗ Branch 2 not taken.
✓ Branch 3 taken 171 times.
✗ Branch 5 not taken.
|
171 | OS_ASSERT(getImpl<detail::InsideSurfaceConvectionAlgorithm_Impl>()); |
| 114 | |||
| 115 |
2/2✓ Branch 1 taken 171 times.
✓ Branch 4 taken 171 times.
|
171 | setAlgorithm("TARP"); |
| 116 | 171 | } | |
| 117 | |||
| 118 | // constructor | ||
| 119 | 105 | InsideSurfaceConvectionAlgorithm::InsideSurfaceConvectionAlgorithm(std::shared_ptr<detail::InsideSurfaceConvectionAlgorithm_Impl> impl) | |
| 120 |
1/1✓ Branch 3 taken 105 times.
|
105 | : ModelObject(std::move(impl)) {} |
| 121 | |||
| 122 | } // namespace model | ||
| 123 | } // namespace openstudio | ||
| 124 |