MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / doSystemSizingCalculation

Method doSystemSizingCalculation

src/model/SimulationControl.cpp:218–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

216 }
217
218 bool SimulationControl_Impl::doSystemSizingCalculation() const {
219
220 auto shouldItBeOn = [this]() -> bool {
221 const auto m = model();
222 return !m.getModelObjects<SizingPeriod>().empty() && !m.getConcreteModelObjects<AirLoopHVAC>().empty();
223 };
224
225 if (!isDoSystemSizingCalculationDefaulted()) {
226 boost::optional<std::string> value = getString(OS_SimulationControlFields::DoSystemSizingCalculation, true);
227 OS_ASSERT(value);
228 const auto result = openstudio::istringEqual(value.get(), "Yes");
229 if (!result && shouldItBeOn()) {
230 LOG(Warn, "You have AirLoopHVAC(s) and design day(s), it's possible you should enable SimulationControl::DoSystemSizingCalculation");
231 }
232 return result;
233 }
234
235 const auto result = shouldItBeOn();
236 if (result) {
237 LOG(Debug, "You have AirLoopHVAC(s) and design day(s), and SimulationControl::DoSystemSizingCalculation is defaulted: assuming on.");
238 }
239
240 return result;
241 }
242
243 bool SimulationControl_Impl::isDoSystemSizingCalculationDefaulted() const {
244 return isEmpty(OS_SimulationControlFields::DoSystemSizingCalculation);

Callers 3

TEST_FFunction · 0.80
TEST_FFunction · 0.80

Calls 3

istringEqualFunction · 0.85
emptyMethod · 0.45
getMethod · 0.45

Tested by 2

TEST_FFunction · 0.64
TEST_FFunction · 0.64