GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 85.7% 12 / 0 / 14
Functions: 100.0% 1 / 0 / 1
Branches: 76.0% 19 / 0 / 25

src/energyplus/ForwardTranslator/ForwardTranslateConvergenceLimits.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 "../ForwardTranslator.hpp"
7 #include "../../model/ConvergenceLimits.hpp"
8 #include <utilities/idd/ConvergenceLimits_FieldEnums.hxx>
9 #include "../../utilities/idd/IddEnums.hpp"
10 #include <utilities/idd/IddEnums.hxx>
11
12 using namespace openstudio::model;
13
14 namespace openstudio {
15 namespace energyplus {
16
17 45 boost::optional<IdfObject> ForwardTranslator::translateConvergenceLimits(ConvergenceLimits& modelObject) {
18
2/2
✓ Branch 1 taken 45 times.
✓ Branch 4 taken 45 times.
45 IdfObject idfObject(openstudio::IddObjectType::ConvergenceLimits);
19
20
3/3
✓ Branch 1 taken 45 times.
✓ Branch 3 taken 35 times.
✓ Branch 4 taken 10 times.
90 if (OptionalInt i = modelObject.minimumSystemTimestep()) {
21
2/2
✓ Branch 1 taken 35 times.
✓ Branch 4 taken 35 times.
35 idfObject.setInt(ConvergenceLimitsFields::MinimumSystemTimestep, *i);
22 } else {
23 // EnergyPlus IDD has a note saying 1 is the default but does not actually list it as the default
24 // A severe error message is issued if this field is blank
25
1/1
✓ Branch 1 taken 10 times.
10 idfObject.setInt(ConvergenceLimitsFields::MinimumSystemTimestep, 1);
26 }
27
28
3/3
✓ Branch 1 taken 45 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 44 times.
45 if (!modelObject.isMaximumHVACIterationsDefaulted()) {
29
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 idfObject.setInt(ConvergenceLimitsFields::MaximumHVACIterations, modelObject.maximumHVACIterations());
30 }
31
32
2/3
✓ Branch 1 taken 45 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 45 times.
45 if (!modelObject.isMinimumPlantIterationsDefaulted()) {
33 ✗ idfObject.setInt(ConvergenceLimitsFields::MinimumPlantIterations, modelObject.minimumPlantIterations());
34 }
35
36
2/3
✓ Branch 1 taken 45 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 45 times.
45 if (!modelObject.isMaximumPlantIterationsDefaulted()) {
37 ✗ idfObject.setInt(ConvergenceLimitsFields::MaximumPlantIterations, modelObject.maximumPlantIterations());
38 }
39
40
1/1
✓ Branch 1 taken 45 times.
45 m_idfObjects.push_back(idfObject);
41
42
1/1
✓ Branch 1 taken 45 times.
90 return idfObject;
43 45 }
44
45 } // namespace energyplus
46 } // namespace openstudio
47