GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 22 / 0 / 22
Functions: 100.0% 1 / 0 / 1
Branches: 90.7% 39 / 0 / 43

src/energyplus/ForwardTranslator/CreateAirLoopHVACReturnPath.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/Model.hpp"
8 #include "../../model/AirLoopHVAC.hpp"
9 #include "../../model/AirLoopHVAC_Impl.hpp"
10 #include "../../model/Node.hpp"
11 #include "../../model/Node_Impl.hpp"
12 #include "../../model/AirLoopHVACZoneMixer.hpp"
13 #include "../../model/AirLoopHVACZoneMixer_Impl.hpp"
14 #include "../../model/AirLoopHVACReturnPlenum.hpp"
15 #include "../../model/AirLoopHVACReturnPlenum_Impl.hpp"
16 #include "../../utilities/idf/IdfExtensibleGroup.hpp"
17 #include "../../utilities/idf/Workspace.hpp"
18 #include "../../utilities/idf/WorkspaceObjectOrder.hpp"
19 #include "../../utilities/core/Logger.hpp"
20 #include "../../utilities/core/Assert.hpp"
21 #include "../../utilities/geometry/Geometry.hpp"
22 #include "../../utilities/geometry/Point3d.hpp"
23 #include "../../utilities/geometry/Vector3d.hpp"
24 #include "../../utilities/geometry/EulerAngles.hpp"
25 #include "../../utilities/geometry/Transformation.hpp"
26 #include <utilities/idd/AirLoopHVAC_ReturnPath_FieldEnums.hxx>
27 #include <utilities/idd/IddEnums.hxx>
28
29 using namespace openstudio::model;
30
31 using namespace std;
32
33 namespace openstudio {
34
35 namespace energyplus {
36
37 200 boost::optional<IdfObject> ForwardTranslator::createAirLoopHVACReturnPath(AirLoopHVAC& airLoopHVAC) {
38
2/2
✓ Branch 1 taken 200 times.
✓ Branch 4 taken 200 times.
200 IdfObject returnPathIdf(openstudio::IddObjectType::AirLoopHVAC_ReturnPath);
39
1/1
✓ Branch 1 taken 200 times.
200 m_idfObjects.push_back(returnPathIdf);
40
41
4/4
✓ Branch 1 taken 200 times.
✓ Branch 4 taken 200 times.
✓ Branch 7 taken 200 times.
✓ Branch 10 taken 200 times.
200 returnPathIdf.setName(airLoopHVAC.name().get() + " Return Path");
42
43
1/1
✓ Branch 1 taken 200 times.
200 Node node = airLoopHVAC.demandOutletNode();
44
3/3
✓ Branch 1 taken 200 times.
✓ Branch 4 taken 200 times.
✓ Branch 7 taken 200 times.
200 returnPathIdf.setString(openstudio::AirLoopHVAC_ReturnPathFields::ReturnAirPathOutletNodeName, node.name().get());
45
46
2/2
✓ Branch 1 taken 200 times.
✓ Branch 4 taken 200 times.
200 std::vector<ModelObject> returnPlenums = airLoopHVAC.demandComponents(AirLoopHVACReturnPlenum::iddObjectType());
47
2/2
✓ Branch 5 taken 3 times.
✓ Branch 6 taken 200 times.
203 for (auto& returnPlenum : returnPlenums) {
48
1/1
✓ Branch 1 taken 3 times.
3 IdfExtensibleGroup eg = returnPathIdf.pushExtensibleGroup();
49
1/1
✓ Branch 1 taken 3 times.
3 boost::optional<IdfObject> _returnPlenum = translateAndMapModelObject(returnPlenum);
50
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 4 not taken.
3 OS_ASSERT(_returnPlenum);
51
4/4
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
3 eg.setString(AirLoopHVAC_ReturnPathExtensibleFields::ComponentObjectType, _returnPlenum->iddObject().name());
52
4/4
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
3 eg.setString(AirLoopHVAC_ReturnPathExtensibleFields::ComponentName, _returnPlenum->name().get());
53 3 }
54
55
1/1
✓ Branch 1 taken 200 times.
200 AirLoopHVACZoneMixer zoneMixer = airLoopHVAC.zoneMixer();
56
1/1
✓ Branch 1 taken 200 times.
200 boost::optional<IdfObject> _zoneMixer = translateAndMapModelObject(zoneMixer);
57
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 200 times.
✗ Branch 4 not taken.
200 OS_ASSERT(_zoneMixer);
58
1/1
✓ Branch 1 taken 200 times.
200 IdfExtensibleGroup eg = returnPathIdf.pushExtensibleGroup();
59
4/4
✓ Branch 1 taken 200 times.
✓ Branch 4 taken 200 times.
✓ Branch 7 taken 200 times.
✓ Branch 10 taken 200 times.
200 eg.setString(AirLoopHVAC_ReturnPathExtensibleFields::ComponentObjectType, _zoneMixer->iddObject().name());
60
4/4
✓ Branch 1 taken 200 times.
✓ Branch 4 taken 200 times.
✓ Branch 7 taken 200 times.
✓ Branch 10 taken 200 times.
200 eg.setString(AirLoopHVAC_ReturnPathExtensibleFields::ComponentName, _zoneMixer->name().get());
61
62
1/1
✓ Branch 1 taken 200 times.
400 return boost::optional<IdfObject>(returnPathIdf);
63 200 }
64
65 } // namespace energyplus
66
67 } // namespace openstudio
68