Skip to content

Commit

Permalink
constexprd externs-DSV, removed extra comments-FM, fixed shadingMetho…
Browse files Browse the repository at this point in the history
…d linking
  • Loading branch information
jmythms committed Mar 5, 2021
1 parent 9a0d63c commit 8065bf4
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 70 deletions.
36 changes: 0 additions & 36 deletions src/EnergyPlus/DataSystemVariables.cc
Original file line number Diff line number Diff line change
Expand Up @@ -96,42 +96,6 @@ namespace DataSystemVariables {

// MODULE PARAMETER DEFINITIONS:

std::string const DDOnlyEnvVar("DDONLY"); // Only run design days
std::string const ReverseDDEnvVar("REVERSEDD"); // Reverse DD during run
std::string const DisableGLHECachingEnvVar("DISABLEGLHECACHING");
std::string const FullAnnualSimulation("FULLANNUALRUN"); // Generate annual run
std::string const cDeveloperFlag("DeveloperFlag");
std::string const cDisplayAllWarnings("DisplayAllWarnings");
std::string const cDisplayExtraWarnings("DisplayExtraWarnings");
std::string const cDisplayAdvancedReportVariables("DisplayAdvancedReportVariables");
std::string const cDisplayUnusedObjects("DisplayUnusedObjects");
std::string const cDisplayUnusedSchedules("DisplayUnusedSchedules");
std::string const cDisplayZoneAirHeatBalanceOffBalance("DisplayZoneAirHeatBalanceOffBalance");
std::string const cSortIDD("SortIDD");
std::string const cReportDuringWarmup("ReportDuringWarmup");
std::string const cReportDuringHVACSizingSimulation("REPORTDURINGHVACSIZINGSIMULATION");
std::string const cIgnoreSolarRadiation("IgnoreSolarRadiation");
std::string const cIgnoreBeamRadiation("IgnoreBeamRadiation");
std::string const cIgnoreDiffuseRadiation("IgnoreDiffuseRadiation");
std::string const cSutherlandHodgman("SutherlandHodgman");
std::string const cSlaterBarsky("SlaterBarsky");
std::string const cMinimalSurfaceVariables("CreateMinimalSurfaceVariables");
std::string const cMinimalShadowing("MinimalShadowing");
std::string const cNumActiveSims("cntActv");
std::string const cInputPath1("epin"); // EP-Launch setting. Full path + project name
std::string const cInputPath2("input_path"); // RunEplus.bat setting. Full path
std::string const cProgramPath("program_path");
std::string const cTimingFlag("TimingFlag");
std::string const TrackAirLoopEnvVar("TRACK_AIRLOOP"); // To generate a file with runtime statistics
// for each controller on each air loop
std::string const TraceAirLoopEnvVar("TRACE_AIRLOOP"); // To generate a trace file with the converged
// solutions of all controllers on each air loop at each call to SimAirLoop()
std::string const TraceHVACControllerEnvVar("TRACE_HVACCONTROLLER"); // To generate a trace file for
// each individual HVAC controller with all controller iterations

std::string const MinReportFrequencyEnvVar("MINREPORTFREQUENCY"); // environment var for reporting frequency.
std::string const
cDisplayInputInAuditEnvVar("DISPLAYINPUTINAUDIT"); // environmental variable that enables the echoing of the input file into the audit file

// DERIVED TYPE DEFINITIONS
// na
Expand Down
63 changes: 32 additions & 31 deletions src/EnergyPlus/DataSystemVariables.hh
Original file line number Diff line number Diff line change
Expand Up @@ -69,41 +69,42 @@ namespace DataSystemVariables {

// MODULE PARAMETER DEFINITIONS:

extern std::string const DDOnlyEnvVar; // Only run design days
extern std::string const ReverseDDEnvVar; // Reverse DD during run
extern std::string const DisableGLHECachingEnvVar; // GLHE Caching
extern std::string const FullAnnualSimulation; // Generate annual run
extern std::string const cDeveloperFlag;
extern std::string const cDisplayAllWarnings;
extern std::string const cDisplayExtraWarnings;
extern std::string const cDisplayAdvancedReportVariables;
extern std::string const cDisplayUnusedObjects;
extern std::string const cDisplayUnusedSchedules;
extern std::string const cDisplayZoneAirHeatBalanceOffBalance;
extern std::string const cSortIDD;
extern std::string const cReportDuringWarmup;
extern std::string const cReportDuringHVACSizingSimulation;
extern std::string const cIgnoreSolarRadiation;
extern std::string const cIgnoreBeamRadiation;
extern std::string const cIgnoreDiffuseRadiation;
extern std::string const cSutherlandHodgman;
extern std::string const cSlaterBarsky;
extern std::string const cMinimalSurfaceVariables;
extern std::string const cMinimalShadowing;
extern std::string const cNumActiveSims;
extern std::string const cInputPath1; // EP-Launch setting. Full path + project name
extern std::string const cInputPath2; // RunEplus.bat setting. Full path
extern std::string const cProgramPath;
extern std::string const cTimingFlag;
extern std::string const TrackAirLoopEnvVar; // To generate a file with runtime statistics
auto constexpr DDOnlyEnvVar("DDONLY"); // Only run design days
auto constexpr ReverseDDEnvVar("REVERSEDD"); // Reverse DD during run
auto constexpr DisableGLHECachingEnvVar("DISABLEGLHECACHING");
auto constexpr FullAnnualSimulation("FULLANNUALRUN"); // Generate annual run
auto constexpr cDeveloperFlag("DeveloperFlag");
auto constexpr cDisplayAllWarnings("DisplayAllWarnings");
auto constexpr cDisplayExtraWarnings("DisplayExtraWarnings");
auto constexpr cDisplayAdvancedReportVariables("DisplayAdvancedReportVariables");
auto constexpr cDisplayUnusedObjects("DisplayUnusedObjects");
auto constexpr cDisplayUnusedSchedules("DisplayUnusedSchedules");
auto constexpr cDisplayZoneAirHeatBalanceOffBalance("DisplayZoneAirHeatBalanceOffBalance");
auto constexpr cSortIDD("SortIDD");
auto constexpr cReportDuringWarmup("ReportDuringWarmup");
auto constexpr cReportDuringHVACSizingSimulation("REPORTDURINGHVACSIZINGSIMULATION");
auto constexpr cIgnoreSolarRadiation("IgnoreSolarRadiation");
auto constexpr cIgnoreBeamRadiation("IgnoreBeamRadiation");
auto constexpr cIgnoreDiffuseRadiation("IgnoreDiffuseRadiation");
auto constexpr cSutherlandHodgman("SutherlandHodgman");
auto constexpr cSlaterBarsky("SlaterBarsky");
auto constexpr cMinimalSurfaceVariables("CreateMinimalSurfaceVariables");
auto constexpr cMinimalShadowing("MinimalShadowing");
auto constexpr cNumActiveSims("cntActv");
auto constexpr cInputPath1("epin"); // EP-Launch setting. Full path + project name
auto constexpr cInputPath2("input_path"); // RunEplus.bat setting. Full path
auto constexpr cProgramPath("program_path");
auto constexpr cTimingFlag("TimingFlag");
auto constexpr TrackAirLoopEnvVar("TRACK_AIRLOOP"); // To generate a file with runtime statistics
// for each controller on each air loop

This comment has been minimized.

Copy link
@amirroth

amirroth Mar 5, 2021

Collaborator

I would personally like to minimize the use of auto within EnergyPlus. C++ is not dynamically typed, auto does not enable any new functionality as far as I can tell and primarily serves to reduce code readability. Can someone make a good counter-argument?

This comment has been minimized.

Copy link
@Myoldmopar

Myoldmopar Mar 5, 2021

Member

Yes, these should likely be changed back to the actual type instead of relying on the compiler to deduce it. I think there are a few amazing use cases for auto:

  • To create local references without having to declare some annoying long type declaration auto &s = PlantLoop(LoopNum).LoopSide(LoopSideNum);
  • When doing range based loops for (auto const & s : surfaces) {}
  • If you are creating something where the type is explicitly listed in the RHS: auto s = std::make_shared<SomeTypeHere>()

In this particular case, it doesn't really add anything so these will be converted back

This comment has been minimized.

Copy link
@jmythms

jmythms Mar 5, 2021

Author Contributor

I will get it changed, thank you for the feedback.

extern std::string const TraceAirLoopEnvVar; // To generate a trace file with the converged
auto constexpr TraceAirLoopEnvVar("TRACE_AIRLOOP"); // To generate a trace file with the converged
// solutions of all controllers on each air loop at each call to SimAirLoop()
extern std::string const TraceHVACControllerEnvVar; // To generate a trace file for
auto constexpr TraceHVACControllerEnvVar("TRACE_HVACCONTROLLER"); // To generate a trace file for
// each individual HVAC controller with all controller iterations

extern std::string const MinReportFrequencyEnvVar; // environment var for reporting frequency.
extern std::string const cDisplayInputInAuditEnvVar; // environmental variable that enables the echoing of the input file into the audit file
auto constexpr MinReportFrequencyEnvVar("MINREPORTFREQUENCY"); // environment var for reporting frequency.
auto constexpr cDisplayInputInAuditEnvVar(
"DISPLAYINPUTINAUDIT"); // environmental variable that enables the echoing of the input file into the audit file

// DERIVED TYPE DEFINITIONS
// na
Expand Down
2 changes: 0 additions & 2 deletions src/EnergyPlus/FaultsManager.hh
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,6 @@ namespace FaultsManager {
// 'FaultModel:DamperLeakage:ReturnAir ', &
// 'FaultModel:DamperLeakage:OutdoorAir ' /)

//extern Array1D_string const cFaults;
//extern Array1D_int const iFaultTypeEnums;



Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/SolarShading.cc
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ namespace EnergyPlus::SolarShading {
ShowContinueError(state, "Value entered=\"" + cAlphaArgs(aNum) + "\"");
ShowContinueError(state, "This version of EnergyPlus was not compiled to use OpenGL (required for PixelCounting)");
ShowContinueError(state, "PolygonClipping will be used instead");
shadingMethod = ShadingMethod::PolygonClipping;
state.dataSysVars->shadingMethod = ShadingMethod::PolygonClipping;
cAlphaArgs(aNum) = "PolygonClipping";
#else
auto error_callback = [](const int messageType, const std::string & message, void *contextPtr){
Expand Down

5 comments on commit 8065bf4

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

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

Global-DataSysVars (jmythms) - x86_64-MacOS-10.15-clang-11.0.0: OK (3059 of 3059 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

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

Global-DataSysVars (jmythms) - x86_64-Linux-Ubuntu-18.04-gcc-7.5: OK (3098 of 3099 tests passed, 0 test warnings)

Messages:\n

  • 1 test had: EIO diffs.
  • 1 test had: ESO small diffs.
  • 1 test had: MTR small diffs.
  • 1 test had: Table big diffs.

Failures:\n

regression Test Summary

  • Passed: 741
  • Failed: 1

Build Badge Test Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

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

Global-DataSysVars (jmythms) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-UnitTestsCoverage-Debug: OK (1613 of 1613 tests passed, 0 test warnings)

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.

Global-DataSysVars (jmythms) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-IntegrationCoverage-Debug: OK (727 of 727 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

Global-DataSysVars (jmythms) - Win64-Windows-10-VisualStudio-16: OK (2308 of 2308 tests passed, 0 test warnings)

Build Badge Test Badge

Please sign in to comment.