| 306 | } |
| 307 | |
| 308 | static openstudio::TimeSeries convertData(std::vector<openstudio::DateTime> inputDateTimes, std::vector<double> inputValues, std::string units) { |
| 309 | // Use a per-interval trapezoidal approximation to convert the CONTAM point data into E+ interval data |
| 310 | std::vector<openstudio::DateTime> dateTimes; |
| 311 | std::vector<double> values; |
| 312 | if (inputDateTimes.size() == 1) // Account for steady simulation results |
| 313 | { |
| 314 | return openstudio::TimeSeries(inputDateTimes, createVector(inputValues), units); |
| 315 | } |
| 316 | for (unsigned i = 1; i < inputDateTimes.size(); i++) { |
| 317 | dateTimes.push_back(inputDateTimes[i]); |
| 318 | values.push_back(0.5 * (inputValues[i - 1] + inputValues[i])); |
| 319 | } |
| 320 | return openstudio::TimeSeries(dateTimes, createVector(values), units); |
| 321 | } |
| 322 | |
| 323 | boost::optional<openstudio::TimeSeries> SimFile::pathDeltaP(int nr) const { |
| 324 | int index = indexOf(m_pathNr, nr); |
no test coverage detected