Skip to content

Commit

Permalink
Changing to std::vector for debugging purposes
Browse files Browse the repository at this point in the history
  • Loading branch information
amirroth committed Dec 11, 2024
1 parent 72066d1 commit 5f69976
Show file tree
Hide file tree
Showing 74 changed files with 48 additions and 122 deletions.
2 changes: 1 addition & 1 deletion src/EnergyPlus/AirflowNetwork/src/Solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
// ObjexxFCL Headers
#include <ObjexxFCL/Array.functions.hh>
#include <ObjexxFCL/Array2D.hh>
#include <ObjexxFCL/Fmath.hh>
// #include <ObjexxFCL/Fmath.hh>

// EnergyPlus Headers
#include <AirflowNetwork/Elements.hpp>
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/BaseboardRadiator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

// ObjexxFCL Headers
#include <ObjexxFCL/Array.functions.hh>
#include <ObjexxFCL/Fmath.hh>
// #include <ObjexxFCL/Fmath.hh>

// EnergyPlus Headers
#include <EnergyPlus/Autosizing/HeatingCapacitySizing.hh>
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/BoilerSteam.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

// ObjexxFCL Headers
#include <ObjexxFCL/Array.functions.hh>
#include <ObjexxFCL/Fmath.hh>
// #include <ObjexxFCL/Fmath.hh>

// EnergyPlus Headers
#include <EnergyPlus/Autosizing/Base.hh>
Expand Down
7 changes: 3 additions & 4 deletions src/EnergyPlus/Boilers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@

// ObjexxFCL Headers
#include <ObjexxFCL/Array.functions.hh>
#include <ObjexxFCL/Fmath.hh>

// EnergyPlus Headers
#include <EnergyPlus/Autosizing/Base.hh>
Expand Down Expand Up @@ -879,7 +878,7 @@ void BoilerSpecs::CalcBoilerModel(EnergyPlusData &state,

if ((BoilerDeltaTemp > 0.0) && (this->BoilerLoad > 0.0)) {
this->BoilerMassFlowRate = this->BoilerLoad / Cp / BoilerDeltaTemp;
this->BoilerMassFlowRate = min(BoilerMassFlowRateMax, this->BoilerMassFlowRate);
this->BoilerMassFlowRate = std::min(BoilerMassFlowRateMax, this->BoilerMassFlowRate);
} else {
this->BoilerMassFlowRate = 0.0;
}
Expand Down Expand Up @@ -908,8 +907,8 @@ void BoilerSpecs::CalcBoilerModel(EnergyPlusData &state,
this->BoilerOutletTemp = state.dataLoopNodes->Node(BoilerInletNode).Temp;
}
this->BoilerPLR = this->BoilerLoad / BoilerNomCap; // operating part load ratio
this->BoilerPLR = min(this->BoilerPLR, BoilerMaxPLR);
this->BoilerPLR = max(this->BoilerPLR, BoilerMinPLR);
this->BoilerPLR = std::min(this->BoilerPLR, BoilerMaxPLR);
this->BoilerPLR = std::max(this->BoilerPLR, BoilerMinPLR);

// calculate theoretical fuel use based on nominal thermal efficiency
Real64 const TheorFuelUse = this->BoilerLoad / BoilerNomEff; // Theoretical (stoichiometric) fuel use
Expand Down
3 changes: 3 additions & 0 deletions src/EnergyPlus/DataBSDFWindow.hh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@
#include <ObjexxFCL/Array1D.hh>
#include <ObjexxFCL/Array2D.hh>
#include <ObjexxFCL/Array3D.hh>
#include <ObjexxFCL/Vector3.fwd.hh>

using ObjexxFCL::Vector3;

// EnergyPlus Headers
#include <EnergyPlus/Data/BaseData.hh>
Expand Down
3 changes: 3 additions & 0 deletions src/EnergyPlus/DataEnvironment.hh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@

// ObjexxFCL Headers
#include <ObjexxFCL/Array1D.hh>
#include <ObjexxFCL/Vector3.hh>

using ObjexxFCL::Vector3;

// EnergyPlus Headers
#include <EnergyPlus/Data/BaseData.hh>
Expand Down
17 changes: 0 additions & 17 deletions src/EnergyPlus/DataGlobalConstants.hh
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@
#define DataGlobalConstants_hh_INCLUDED

// EnergyPlus Headers
#include <fmt/format.h>
// #include <EnergyPlus/Data/BaseData.hh>
#include <EnergyPlus/EnergyPlus.hh>

namespace EnergyPlus {
Expand Down Expand Up @@ -477,21 +475,6 @@ namespace Constant {
"customEMS" // customEMS
};

inline std::string unitToString(Units unit)
{
switch (unit) {
case Units::Invalid:
return "invalid";
default:
const int iUnit = static_cast<int>(unit);
constexpr int numUnitNames = unitNames.size();
if (0 <= iUnit && iUnit < numUnitNames) {
return fmt::format("[{}]", unitNames[iUnit]);
}
return "invalid-out-of-range";
}
}

constexpr std::array<std::string_view, (int)Units::Num> unitNamesUC = {
"KG/S", // kg_s
"C", // C
Expand Down
4 changes: 3 additions & 1 deletion src/EnergyPlus/DataSurfaces.hh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@
// ObjexxFCL Headers
#include <ObjexxFCL/Array1D.hh>
#include <ObjexxFCL/Array2D.hh>
#include <ObjexxFCL/Vector4.hh>
#include <ObjexxFCL/Vector4.fwd.hh>

using ObjexxFCL::Vector4;

// EnergyPlus Headers
#include <EnergyPlus/ConvectionConstants.hh>
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/EnergyPlus.hh
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ using ObjexxFCL::Vector4;

// ObjexxFCL Functions
#include <ObjexxFCL/Array.functions.hh>
#include <ObjexxFCL/Fmath.hh>
// #include <ObjexxFCL/Fmath.hh>
#include <ObjexxFCL/environment.hh>
#include <ObjexxFCL/floops.hh>
#include <ObjexxFCL/numeric.hh>
Expand Down
1 change: 0 additions & 1 deletion src/EnergyPlus/HybridEvapCoolingModel.hh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@

// ObjexxFCL Headers
#include <ObjexxFCL/Array.functions.hh>
#include <ObjexxFCL/Fmath.hh>

#define MINIMUM_LOAD_TO_ACTIVATE 0.5 // (kw) sets a minimum load to avoid the system fluttering on and off.
#define IMPLAUSIBLE_POWER 10000000
Expand Down
4 changes: 2 additions & 2 deletions src/EnergyPlus/InternalHeatGains.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2631,8 +2631,8 @@ namespace InternalHeatGains {
}

// Calculate nominal min/max equipment level
thisZoneITEq.NomMinDesignLevel = thisZoneITEq.DesignTotalPower * thisZoneITEq.operSched->getMinVal(state);
thisZoneITEq.NomMaxDesignLevel = thisZoneITEq.DesignTotalPower * thisZoneITEq.operSched->getMaxVal(state);
thisZoneITEq.NomMinDesignLevel = thisZoneITEq.DesignTotalPower * thisZoneITEq.cpuLoadSched->getMinVal(state);
thisZoneITEq.NomMaxDesignLevel = thisZoneITEq.DesignTotalPower * thisZoneITEq.cpuLoadSched->getMaxVal(state);

thisZoneITEq.DesignFanPowerFrac = IHGNumbers(4);
thisZoneITEq.DesignFanPower = thisZoneITEq.DesignFanPowerFrac * thisZoneITEq.DesignTotalPower;
Expand Down
1 change: 0 additions & 1 deletion src/EnergyPlus/Plant/DataPlant.hh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@

// ObjexxFCL Headers
#include <ObjexxFCL/Array1D.hh>
#include <ObjexxFCL/Fmath.hh>

// EnergyPlus Headers
#include <EnergyPlus/Data/BaseData.hh>
Expand Down
1 change: 0 additions & 1 deletion src/EnergyPlus/Plant/LoopSide.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.

#include <ObjexxFCL/Fmath.hh>
#include <ObjexxFCL/member.functions.hh>

#include <EnergyPlus/Data/EnergyPlusData.hh>
Expand Down
1 change: 0 additions & 1 deletion src/EnergyPlus/Plant/PlantManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@

// ObjexxFCL Headers
#include <ObjexxFCL/Array.functions.hh>
#include <ObjexxFCL/Fmath.hh>
#include <ObjexxFCL/string.functions.hh>

// EnergyPlus Headers
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/Psychrometrics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
#include <cstdlib>

// ObjexxFCL Headers
#include <ObjexxFCL/Fmath.hh>
// #include <ObjexxFCL/Fmath.hh>

// EnergyPlus Headers
#include <EnergyPlus/CommandLineInterface.hh>
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/Psychrometrics.hh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

// ObjexxFCL Headers
#include <ObjexxFCL/Array1D.hh>
#include <ObjexxFCL/Fmath.hh>
// #include <ObjexxFCL/Fmath.hh>

// EnergyPlus Headers
#include <EnergyPlus/Data/BaseData.hh>
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/Pumps.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

// ObjexxFCL Headers
#include <ObjexxFCL/Array.functions.hh>
#include <ObjexxFCL/Fmath.hh>
// #include <ObjexxFCL/Fmath.hh>

// EnergyPlus Headers
#include <EnergyPlus/Autosizing/Base.hh>
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/PurchasedAirManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

// ObjexxFCL Headers
#include <ObjexxFCL/Array.functions.hh>
#include <ObjexxFCL/Fmath.hh>
// #include <ObjexxFCL/Fmath.hh>
#include <ObjexxFCL/string.functions.hh>

// EnergyPlus Headers
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/RefrigeratedCase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
// ObjexxFCL Headers
#include <ObjexxFCL/Array.functions.hh>
#include <ObjexxFCL/Array2D.hh>
#include <ObjexxFCL/Fmath.hh>
// #include <ObjexxFCL/Fmath.hh>

// EnergyPlus Headers
#include <EnergyPlus/BranchNodeConnections.hh>
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/RoomAirModelAirflowNetwork.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
// ObjexxFCL Headers
#include <ObjexxFCL/Array.functions.hh>
#include <ObjexxFCL/Array1D.hh>
#include <ObjexxFCL/Fmath.hh>
// #include <ObjexxFCL/Fmath.hh>

// EnergyPlus Headers
#include <AirflowNetwork/Solver.hpp>
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/RoomAirModelManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
#include <ObjexxFCL/Array.functions.hh>
#include <ObjexxFCL/Array1D.hh>
#include <ObjexxFCL/Array2D.hh>
#include <ObjexxFCL/Fmath.hh>
// #include <ObjexxFCL/Fmath.hh>

// EnergyPlus Headers
#include <AirflowNetwork/Solver.hpp>
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/RoomAirModelUserTempPattern.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
#include <ObjexxFCL/Array.functions.hh>
#include <ObjexxFCL/Array1D.hh>
#include <ObjexxFCL/ArrayS.functions.hh>
#include <ObjexxFCL/Fmath.hh>
// #include <ObjexxFCL/Fmath.hh>
#include <ObjexxFCL/member.functions.hh>

// EnergyPlus Headers
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/RootFinder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
#include <cmath>

// ObjexxFCL Headers
#include <ObjexxFCL/Fmath.hh>
// #include <ObjexxFCL/Fmath.hh>

// EnergyPlus Headers
#include <EnergyPlus/Data/EnergyPlusData.hh>
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/RuntimeLanguageProcessor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
#include <ObjexxFCL/Array.functions.hh>
#include <ObjexxFCL/Array2D.hh>
#include <ObjexxFCL/ArrayS.functions.hh>
#include <ObjexxFCL/Fmath.hh>
// #include <ObjexxFCL/Fmath.hh>
#include <ObjexxFCL/char.functions.hh>
#include <ObjexxFCL/random.hh>
#include <ObjexxFCL/string.functions.hh>
Expand Down
1 change: 0 additions & 1 deletion src/EnergyPlus/SZVAVModel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
#include <cstdlib>

// ObjexxFCL Headers
#include <ObjexxFCL/Fmath.hh>
#include <ObjexxFCL/string.functions.hh>

// EnergyPlus Headers
Expand Down
16 changes: 11 additions & 5 deletions src/EnergyPlus/ScheduleManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ namespace Sched {
return false;
} // ScheduleDay::checkValsForBadIntegers()

void DaySchedule::populateFromMinuteVals(EnergyPlusData &state, std::array<Real64, Constant::iMinutesInDay> const &minuteVals)
void DaySchedule::populateFromMinuteVals(EnergyPlusData &state, std::vector<Real64> const &minuteVals)
{
auto &s_glob = state.dataGlobal;
if (this->interpolation == Interpolation::Average) {
Expand Down Expand Up @@ -342,8 +342,13 @@ namespace Sched {

std::string CFld; // Character field for error message
// CHARACTER(len=20) CFld1 ! Character field for error message
std::array<Real64, Constant::iMinutesInDay> minuteVals; // Temporary for processing interval schedules
std::array<bool, Constant::iMinutesInDay> setMinuteVals; // Temporary for processing interval schedules

std::vector<Real64> minuteVals;
std::vector<bool> setMinuteVals;

minuteVals.resize(Constant::iMinutesInDay);
setMinuteVals.resize(Constant::iMinutesInDay);

int NumFields;
// LOGICAL RptSchedule

Expand Down Expand Up @@ -2633,8 +2638,8 @@ namespace Sched {
Array1S<Real64> const Numbers,
int const NumUntils,
int const NumNumbers,
std::array<Real64, Constant::iMinutesInDay> &minuteVals,
std::array<bool, Constant::iMinutesInDay> &setMinuteVals,
std::vector<Real64> &minuteVals,
std::vector<bool> &setMinuteVals,
bool &ErrorsFound,
std::string const &DayScheduleName, // Name (used for errors)
std::string const &ErrContext, // Context (used for errors)
Expand Down Expand Up @@ -2665,6 +2670,7 @@ namespace Sched {

std::fill(minuteVals.begin(), minuteVals.end(), 0.0);
std::fill(setMinuteVals.begin(), setMinuteVals.end(), false);

sFld = 0;

Real64 StartValue = 0;
Expand Down
6 changes: 3 additions & 3 deletions src/EnergyPlus/ScheduleManager.hh
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ namespace Sched {

bool checkValsForLimitViolations(EnergyPlusData &state) const;
bool checkValsForBadIntegers(EnergyPlusData &state) const;
void populateFromMinuteVals(EnergyPlusData &state, std::array<Real64, Constant::iMinutesInDay> const &minVals);
void populateFromMinuteVals(EnergyPlusData &state, std::vector<Real64> const &minuteVals);
std::vector<Real64> const &getDayVals([[maybe_unused]] EnergyPlusData &state, int jDay = -1, int dayOfWeek = -1) { return tsVals; }
void setMinMaxVals(EnergyPlusData &state);
};
Expand Down Expand Up @@ -371,8 +371,8 @@ namespace Sched {
Array1S<Real64> const Numbers,
int const NumUntils,
int const NumNumbers,
std::array<Real64, Constant::iMinutesInDay> &minuteVals,
std::array<bool, Constant::iMinutesInDay> &setMinuteVals,
std::vector<Real64> &minuteVals,
std::vector<bool> &setMinuteVals,
bool &ErrorsFound,
std::string const &DayScheduleName, // Name (used for errors)
std::string const &ErrContext, // Context (used for errors)
Expand Down
1 change: 0 additions & 1 deletion src/EnergyPlus/SimAirServingZones.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
// ObjexxFCL Headers
#include <ObjexxFCL/Array.functions.hh>
#include <ObjexxFCL/Array1D.hh>
#include <ObjexxFCL/Fmath.hh>
#include <ObjexxFCL/string.functions.hh>

// EnergyPlus Headers
Expand Down
1 change: 0 additions & 1 deletion src/EnergyPlus/SimulationManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ extern "C" {
// ObjexxFCL Headers
#include <ObjexxFCL/Array.functions.hh>
#include <ObjexxFCL/Array1D.hh>
#include <ObjexxFCL/Fmath.hh>
#include <ObjexxFCL/environment.hh>
#include <ObjexxFCL/string.functions.hh>

Expand Down
1 change: 0 additions & 1 deletion src/EnergyPlus/SingleDuct.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@

// ObjexxFCL Headers
#include <ObjexxFCL/Array.functions.hh>
#include <ObjexxFCL/Fmath.hh>

// EnergyPlus Headers
#include <AirflowNetwork/Solver.hpp>
Expand Down
1 change: 0 additions & 1 deletion src/EnergyPlus/SolarCollectors.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@

// ObjexxFCL Headers
#include <ObjexxFCL/Array.functions.hh>
#include <ObjexxFCL/Fmath.hh>

// EnergyPlus Headers
#include <EnergyPlus/BranchNodeConnections.hh>
Expand Down
3 changes: 0 additions & 3 deletions src/EnergyPlus/SolarReflectionManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@
#include <cassert>
#include <cmath>

// ObjexxFCL Headers
#include <ObjexxFCL/Fmath.hh>

// EnergyPlus Headers
#include <EnergyPlus/Construction.hh>
#include <EnergyPlus/Data/EnergyPlusData.hh>
Expand Down
1 change: 0 additions & 1 deletion src/EnergyPlus/SolarShading.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@

// ObjexxFCL Headers
#include <ObjexxFCL/Array.functions.hh>
#include <ObjexxFCL/Fmath.hh>
#include <ObjexxFCL/Vector3.hh>
#include <ObjexxFCL/member.functions.hh>

Expand Down
3 changes: 0 additions & 3 deletions src/EnergyPlus/StandardRatings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@
// C++ Headers
#include <string>

// ObjexxFCL Headers
#include <ObjexxFCL/Fmath.hh>

// EnergyPlus Headers
#include <EnergyPlus/CurveManager.hh>
#include <EnergyPlus/Data/EnergyPlusData.hh>
Expand Down
1 change: 0 additions & 1 deletion src/EnergyPlus/SteamCoils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@

// ObjexxFCL Headers
#include <ObjexxFCL/Array.functions.hh>
#include <ObjexxFCL/Fmath.hh>

// EnergyPlus Headers
#include <EnergyPlus/Autosizing/All_Simple_Sizing.hh>
Expand Down
Loading

3 comments on commit 5f69976

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ScheduleAPI (amirroth) - x86_64-Linux-Ubuntu-24.04-gcc-13.2: Build Failed

Failures:\n

API Test Summary

  • Failed: 11
  • notrun: 5

integration Test Summary

  • Passed: 2
  • Failed: 799

Build Badge Test Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ScheduleAPI (amirroth) - x86_64-Linux-Ubuntu-24.04-gcc-13.2-UnitTestsCoverage-RelWithDebInfo: Build Failed

Failures:\n

API Test Summary

  • Failed: 11
  • notrun: 5

Build Badge Test Badge Coverage Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ScheduleAPI (amirroth) - x86_64-Linux-Ubuntu-24.04-gcc-13.2-IntegrationCoverage-RelWithDebInfo: Build Failed

Failures:\n

integration Test Summary

  • Passed: 2
  • Failed: 799

Build Badge Test Badge Coverage Badge

Please sign in to comment.