Skip to content

Commit

Permalink
WIP: Refactor variables
Browse files Browse the repository at this point in the history
  • Loading branch information
kbenne committed Aug 9, 2024
1 parent ee3317f commit 4546331
Show file tree
Hide file tree
Showing 9 changed files with 266 additions and 232 deletions.
1 change: 1 addition & 0 deletions cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ find_package(Boost)
# Normally, we would use conan to pull in spdlog, but the conan build
# is unaware of fmt provided by EnergyPlus
set(SPDLOG_FMT_EXTERNAL ON)
set(SPDLOG_BUILD_PIC ON)
add_subdirectory(spdlog)

# Provides the cmake macro, `catch_discover_tests`
Expand Down
3 changes: 3 additions & 0 deletions energyplus_coroutine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ add_library(
variables.hpp
variables.cpp

energyplus_helpers.hpp
energyplus_helpers.cpp

warmup_manager.hpp
warmup_manager.cpp

Expand Down
2 changes: 1 addition & 1 deletion energyplus_coroutine/energyplus_helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ double ZoneSums::QConSenFlow() const

int ZoneNum(EnergyPlus::EnergyPlusData &energyplus_data, const std::string_view zone_name)
{
auto upper_zone_name = zone_name;
std::string upper_zone_name(zone_name);
std::transform(zone_name.begin(), zone_name.end(), upper_zone_name.begin(), ::toupper);

for (int i = 0; i < energyplus_data.dataGlobal->NumOfZones; ++i) {
Expand Down
3 changes: 2 additions & 1 deletion energyplus_coroutine/spawn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "../util/config.hpp"
#include "../util/conversion.hpp"
#include "../util/math.hpp"
#include "energyplus_helpers.hpp"
#include "idf_to_json.hpp"
#include "idfprep.hpp"
#include "input/user_config.hpp"
Expand Down Expand Up @@ -382,7 +383,7 @@ void Spawn::updateZoneConditions(bool skipConnectedZones)
continue;
}

const auto zonenum = zoneNum(zone.idfname);
const auto zonenum = energyplus::ZoneNum(sim_state, zone.idfname);
updateZoneTemperature(zonenum, dt);
updateZoneHumidityRatio(zonenum, dt);
}
Expand Down
Loading

0 comments on commit 4546331

Please sign in to comment.