GCC Code Coverage Report


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

src/airflow/contam/SimFile.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 AIRFLOW_CONTAM_SIMFILE_HPP
7 #define AIRFLOW_CONTAM_SIMFILE_HPP
8
9 #include "PrjDefines.hpp"
10
11 #include "../../utilities/data/TimeSeries.hpp"
12 #include "../../utilities/core/Path.hpp"
13
14 #include "../AirflowAPI.hpp"
15
16 namespace openstudio {
17 namespace contam {
18
19 class AIRFLOW_API SimFile
20 {
21 public:
22 explicit SimFile(openstudio::path path);
23
24 // These are provided for advanced use
25 std::vector<std::vector<double>> dP() const {
26 return m_dP;
27 }
28 std::vector<std::vector<double>> F0() const {
29 return m_F0;
30 }
31 std::vector<std::vector<double>> F1() const {
32 return m_F1;
33 }
34 std::vector<std::vector<double>> T() const {
35 return m_T;
36 }
37 std::vector<std::vector<double>> P() const {
38 return m_P;
39 }
40 std::vector<std::vector<double>> D() const {
41 return m_D;
42 }
43
44 // Most use should be confined to these
45 boost::optional<openstudio::TimeSeries> pathDeltaP(int nr) const;
46 boost::optional<openstudio::TimeSeries> pathFlow0(int nr) const;
47 boost::optional<openstudio::TimeSeries> pathFlow1(int nr) const;
48 boost::optional<openstudio::TimeSeries> pathFlow(int nr) const;
49 boost::optional<openstudio::TimeSeries> nodeTemperature(int nr) const;
50 boost::optional<openstudio::TimeSeries> nodePressure(int nr) const;
51 boost::optional<openstudio::TimeSeries> nodeDensity(int nr) const;
52 /** Returns a vector of DateTime objects that give the EnergyPlus-style
53 * end of interval times. These are not the actual times in the SIM file */
54 std::vector<openstudio::DateTime> dateTimes() const;
55
56 /** Returns a vector of DateTime objects that the SIM file contains data for.
57 * CONTAM always includes a start time result, so a yearly simulation will
58 * result in 8761 times. */
59 std::vector<openstudio::DateTime> fileDateTimes() const {
60 return m_dateTimes;
61 }
62
63 private:
64 void clearLfr();
65 bool readLfr(const std::string& fileName);
66 void clearNfr();
67 bool readNfr(const std::string& fileName);
68 bool computeDateTimes(const std::vector<std::string>& day, const std::vector<std::string>& time);
69
70 std::vector<int> m_pathNr; // the CONTAM path index
71 std::vector<std::vector<double>> m_dP;
72 std::vector<std::vector<double>> m_F0;
73 std::vector<std::vector<double>> m_F1;
74 std::vector<int> m_nodeNr; // the CONTAM node index
75 std::vector<std::vector<double>> m_T;
76 std::vector<std::vector<double>> m_P;
77 std::vector<std::vector<double>> m_D;
78 std::vector<openstudio::DateTime> m_dateTimes;
79
80 bool m_hasLfr;
81 bool m_hasNfr;
82 bool m_hasNcr;
83
84 − REGISTER_LOGGER("openstudio.contam.SimFile");
85 };
86
87 } // namespace contam
88 } // namespace openstudio
89
90 #endif // AIRFLOW_CONTAM_SIMFILE_HPP
91