Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
583f11c
Fix sqlite bugs and add more unit tests upstream
mbadams5 Jun 25, 2015
9f4f6fd
Fix unit test failures
mbadams5 Jun 26, 2015
7471a43
Merge branch 'develop' into sqlite_timeseries
mbadams5 Jun 26, 2015
50f2366
Fix windows newline issue (for real hopefully)
mbadams5 Jun 26, 2015
d1f5c03
Add more unit tests
mbadams5 Jun 27, 2015
43aa536
Merge branch 'develop' into sqlite_timeseries
mbadams5 Jun 27, 2015
60be015
Add more unit test
mbadams5 Jun 27, 2015
ced5959
Fix minor bug not related to sqlite
mbadams5 Jun 27, 2015
b6e1d2d
Add more unit tests
mbadams5 Jun 27, 2015
e4eedef
Add extra validation to DateToStringWithMonth
mbadams5 Jun 27, 2015
c7cfc17
Clean up to get tests to appear in CI
mbadams5 Jun 27, 2015
18797a4
Add more unit tests and clean up tests
mbadams5 Jun 27, 2015
c57daaa
Add more unit tests
mbadams5 Jun 28, 2015
e2654fa
Try to fix failing Windows unit test
mbadams5 Jun 28, 2015
92864c7
Work on more unit tests
mbadams5 Jun 30, 2015
e6a9cc5
Merge branch 'develop' into sqlite_timeseries
mbadams5 Jun 30, 2015
227ffe9
Add EnergyPlusFixture and OutputProcessorFixture
mbadams5 Jun 30, 2015
8dca04a
Clean up EnergyPlusFixture
mbadams5 Jun 30, 2015
49beb82
Add documentation, add compare cerr/cout
mbadams5 Jun 30, 2015
b18b8c1
Get rid of cerr output in DXCoil unit test
mbadams5 Jun 30, 2015
6c67ab9
Add InputProcessor unit tests
mbadams5 Jul 1, 2015
42e1bca
Try to fix failing unit tests and build failures
mbadams5 Jul 1, 2015
6701f54
Try to fix failing unit test again
mbadams5 Jul 2, 2015
7f06e89
Fix failing unit tests and add IDF parsing
mbadams5 Jul 2, 2015
4e46eff
Major clean up and fix bad unit tests
mbadams5 Jul 2, 2015
cc27226
Add new unit test
mbadams5 Jul 3, 2015
0dbaeac
Implement IDD cache, show message, clean up
mbadams5 Jul 3, 2015
8db0d03
Refactor names and remove unnecessary nullptr
mbadams5 Jul 3, 2015
acd4fd4
Add more unit tests, clean up code
mbadams5 Jul 4, 2015
69e41eb
Move ReportNumberCounter, fix build error
mbadams5 Jul 4, 2015
27adb17
Add more unit tests and failing unit test for bug fix
mbadams5 Jul 6, 2015
acab755
FINALLY fix original bugs
mbadams5 Jul 6, 2015
26aa73a
Clean up unit test
mbadams5 Jul 6, 2015
7c10c47
Fix unit test and linux warning
mbadams5 Jul 6, 2015
f308377
This is a major clean up and adds a custom parser
mbadams5 Jul 8, 2015
85710b9
Add clear_state(), move function static, clean up
mbadams5 Jul 8, 2015
905c8d4
Merge branch 'develop' into sqlite_timeseries
mbadams5 Jul 8, 2015
1397fa5
Add unit tests, fix unit failures, clean up code
mbadams5 Jul 9, 2015
f5127f3
Documentation and clean up
mbadams5 Jul 9, 2015
7d5dbf3
Merge branch 'develop' into sqlite_timeseries
mbadams5 Jul 9, 2015
2105e04
Major clean up and more documentation
mbadams5 Jul 10, 2015
cf3ab52
Add more clear_state() and refactor Humidifiers tests
mbadams5 Jul 10, 2015
0c67f9d
Refactor HeatBalanceManager tests
mbadams5 Jul 11, 2015
26c5ec0
Add more clear_state() and clean up
mbadams5 Jul 11, 2015
1ea3d1b
Refactor MixedAir unit test
mbadams5 Jul 11, 2015
6ee14d9
Fix compile errors
mbadams5 Jul 11, 2015
6cbad89
Fix failing windows unit test
mbadams5 Jul 11, 2015
59e9dd7
Change idf checks and clean up OutputProcessor test
mbadams5 Jul 11, 2015
2b49b0e
Update and clean up based on @kbenne comments
mbadams5 Jul 15, 2015
23535fb
Fix compare_containers usage to match documentation
mbadams5 Jul 15, 2015
460124d
Merge branch 'develop' into sqlite_timeseries
mbadams5 Jul 15, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/EnergyPlus/CurveManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,21 @@ namespace CurveManager {

// Functions

// Clears the global data in CurveManager.
// Needed for unit tests, should not be normally called.
void
clear_state()
{
NumCurves = 0;
GetCurvesInputFlag = true;
PerfCurve.deallocate();
PerfCurveTableData.deallocate();
TableData.deallocate();
TempTableData.deallocate();
Temp2TableData.deallocate();
TableLookup.deallocate();
}

void
ResetPerformanceCurveOutput()
{
Expand Down
5 changes: 5 additions & 0 deletions src/EnergyPlus/CurveManager.hh
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,11 @@ namespace CurveManager {

// Functions

// Clears the global data in CurveManager.
// Needed for unit tests, should not be normally called.
void
clear_state();

void
ResetPerformanceCurveOutput();

Expand Down
25 changes: 25 additions & 0 deletions src/EnergyPlus/DataAirLoop.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,31 @@ namespace DataAirLoop {
Array1D< OAControllerData > OAControllerInfo;
Array1D< OutsideAirSysProps > OutsideAirSys;

// Clears the global data in DataAirLoop.
// Needed for unit tests, should not be normally called.
void
clear_state()
{
NumOASystems = 0;
LoopFanOperationMode = 0;
LoopSystemOnMassFlowrate = 0.0;
LoopSystemOffMassFlowrate = 0.0;
LoopOnOffFanPartLoadRatio = 0.0;
LoopHeatingCoilMaxRTF = 0.0;
LoopOnOffFanRTF = 0.0;
LoopDXCoilRTF = 0.0;
LoopCompCycRatio = 0.0;
AirLoopInputsFilled = false;
AirToZoneNodeInfo.deallocate();
AirToOANodeInfo.deallocate();
PriAirSysAvailMgr.deallocate();
AirLoopZoneInfo.deallocate();
AirLoopControlInfo.deallocate();
AirLoopFlow.deallocate();
OAControllerInfo.deallocate();
OutsideAirSys.deallocate();
}

// NOTICE
// Copyright � 1996-2014 The Board of Trustees of the University of Illinois
// and The Regents of the University of California through Ernest Orlando Lawrence
Expand Down
5 changes: 5 additions & 0 deletions src/EnergyPlus/DataAirLoop.hh
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,11 @@ namespace DataAirLoop {
extern Array1D< OAControllerData > OAControllerInfo;
extern Array1D< OutsideAirSysProps > OutsideAirSys;

// Clears the global data in DataAirLoop.
// Needed for unit tests, should not be normally called.
void
clear_state();

} // DataAirLoop

} // EnergyPlus
Expand Down
20 changes: 20 additions & 0 deletions src/EnergyPlus/DataBranchNodeConnections.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,26 @@ namespace DataBranchNodeConnections {
Array1D< NodeConnectionDef > NodeConnections;
Array1D< EqNodeConnectionDef > AirTerminalNodeConnections;

// Clears the global data in DataBranchNodeConnections.
// Needed for unit tests, should not be normally called.
void
clear_state()
{
NumCompSets = 0;
NumNodeConnectionErrors = 0;
NumOfNodeConnections = 0;
MaxNumOfNodeConnections = 0;
NodeConnectionAlloc = 1000;
NumOfActualParents = 0;
NumOfAirTerminalNodes = 0;
MaxNumOfAirTerminalNodes = 0;
EqNodeConnectionAlloc = 100;
CompSets.deallocate();
ParentNodeList.deallocate();
NodeConnections.deallocate();
AirTerminalNodeConnections.deallocate();
}

// NOTICE
// Copyright � 1996-2014 The Board of Trustees of the University of Illinois
// and The Regents of the University of California through Ernest Orlando Lawrence
Expand Down
5 changes: 5 additions & 0 deletions src/EnergyPlus/DataBranchNodeConnections.hh
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,11 @@ namespace DataBranchNodeConnections {
extern Array1D< NodeConnectionDef > NodeConnections;
extern Array1D< EqNodeConnectionDef > AirTerminalNodeConnections;

// Clears the global data in DataBranchNodeConnections.
// Needed for unit tests, should not be normally called.
void
clear_state();

} // DataBranchNodeConnections

} // EnergyPlus
Expand Down
116 changes: 116 additions & 0 deletions src/EnergyPlus/DataEnvironment.cc
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,122 @@ namespace DataEnvironment {

// Functions

// Clears the global data in DataEnvironment.
// Needed for unit tests, should not be normally called.
void
clear_state()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm curious what is the analog if this if the namespaces were evolved into classes? Would you just destroy the object and recreate a new one. Or would you still have this method exposed publicly?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You seem to be setting up a scenario where namespaces could become classes and perhaps their ctor take idf text or alternatively a data structure produced by your parser. ??

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm in favor of that view of the world. Data gets classified as time vary or not time varying. Class are instantiated with all not time varying data, possibly from idf parser. time varying data must be passed into and out of member functions.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think generally most of the namespace variables become member variables of a class and, yes, get recreated on any new object. There may be cases where this needs to be publicly exposed still, but I can't think of any off the top of my head.

Yes it would be nice if each class got instantiated by a data structure parsed by the InputProcessor. I'll address your comment about 'my' parser in a different comment.

I tend to agree with your 3rd comment.

{
BeamSolarRad = Real64();
EMSBeamSolarRadOverrideOn = false;
EMSBeamSolarRadOverrideValue = Real64();
DayOfMonth = int();
DayOfMonthTomorrow = int();
DayOfWeek = int();
DayOfWeekTomorrow = int();
DayOfYear = int();
DayOfYear_Schedule = int();
DifSolarRad = Real64();
EMSDifSolarRadOverrideOn = false;
EMSDifSolarRadOverrideValue = Real64();
DSTIndicator = int();
Elevation = Real64();
EndMonthFlag = bool();
GndReflectanceForDayltg = Real64();
GndReflectance = Real64();
GndSolarRad = Real64();
GroundTemp = Real64();
GroundTempKelvin = Real64();
GroundTempFC = Real64();
GroundTemp_Surface = Real64();
GroundTemp_Deep = Real64();
PubGroundTempSurface = Array1D< Real64 >( 12 );
PubGroundTempSurfFlag = bool();
HolidayIndex = int();
HolidayIndexTomorrow = int();
IsRain = bool();
IsSnow = bool();
Latitude = Real64();
Longitude = Real64();
Month = int();
MonthTomorrow = int();
OutBaroPress = Real64();
OutDryBulbTemp = Real64();
EMSOutDryBulbOverrideOn = false;
EMSOutDryBulbOverrideValue = Real64();
OutHumRat = Real64();
OutRelHum = Real64();
OutRelHumValue = Real64();
EMSOutRelHumOverrideOn = false;
EMSOutRelHumOverrideValue = Real64();
OutEnthalpy = Real64();
OutAirDensity = Real64();
OutWetBulbTemp = Real64();
OutDewPointTemp = Real64();
EMSOutDewPointTempOverrideOn = false;
EMSOutDewPointTempOverrideValue = Real64();
SkyTemp = Real64();
SkyTempKelvin = Real64();
LiquidPrecipitation = Real64();
SunIsUp = bool();
WindDir = Real64();
EMSWindDirOverrideOn = false;
EMSWindDirOverrideValue = Real64();
WindSpeed = Real64();
EMSWindSpeedOverrideOn = false;
EMSWindSpeedOverrideValue = Real64();
WaterMainsTemp = Real64();
Year = int();
YearTomorrow = int();
SOLCOS = Array1D< Real64 >( 3 );
CloudFraction = Real64();
HISKF = Real64();
HISUNF = Real64();
HISUNFnorm = Real64();
PDIRLW = Real64();
PDIFLW = Real64();
SkyClearness = Real64();
SkyBrightness = Real64();
StdBaroPress = 101325.0;
StdRhoAir = Real64();
TimeZoneNumber = Real64();
TimeZoneMeridian = Real64();
EnvironmentName = std::string();
WeatherFileLocationTitle = std::string();
CurMnDyHr = std::string();
CurMnDy = std::string();
CurEnvirNum = int();
TotDesDays = 0;
TotRunDesPersDays = 0;
CurrentOverallSimDay = int();
TotalOverallSimDays = int();
MaxNumberSimYears = int();
RunPeriodStartDayOfWeek = int();
CosSolarDeclinAngle = Real64();
EquationOfTime = Real64();
SinLatitude = Real64();
CosLatitude = Real64();
SinSolarDeclinAngle = Real64();
TS1TimeOffset = -0.5;
WeatherFileWindModCoeff = 1.5863;
WeatherFileTempModCoeff = 0.0;
SiteWindExp = 0.22;
SiteWindBLHeight = 370.0;
SiteTempGradient = 0.0065;
GroundTempObjInput = false;
GroundTemp_SurfaceObjInput = false;
GroundTemp_DeepObjInput = false;
FCGroundTemps = false;
DisplayWeatherMissingDataWarnings = false;
IgnoreSolarRadiation = false;
IgnoreBeamRadiation = false;
IgnoreDiffuseRadiation = false;
PrintEnvrnStampWarmup = false;
PrintEnvrnStampWarmupPrinted = false;
RunPeriodEnvironment = false;
EnvironmentStartEnd = std::string();
CurrentYearIsLeapYear = false;
}

Real64
OutDryBulbTempAt( Real64 const Z ) // Height above ground (m)
{
Expand Down
5 changes: 5 additions & 0 deletions src/EnergyPlus/DataEnvironment.hh
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@ namespace DataEnvironment {

// Functions

// Clears the global data in DataEnvironment.
// Needed for unit tests, should not be normally called.
void
clear_state();

Real64
OutDryBulbTempAt( Real64 const Z ); // Height above ground (m)

Expand Down
91 changes: 88 additions & 3 deletions src/EnergyPlus/DataGlobals.cc
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
// C++ Headers
#include <ostream>
#include <string>

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

// EnergyPlus Headers
#include <DataGlobals.hh>
#include <DataPrecisionGlobals.hh>

namespace EnergyPlus {

Expand Down Expand Up @@ -36,7 +34,6 @@ namespace DataGlobals {
// na

// Using/Aliasing
using namespace DataPrecisionGlobals;

// Data
// -only module should be available to other modules and routines.
Expand Down Expand Up @@ -197,6 +194,94 @@ namespace DataGlobals {
void ( *fProgressPtr )( int const );
void ( *fMessagePtr )( std::string const & );

// Clears the global data in DataGlobals.
// Needed for unit tests, should not be normally called.
void
clear_state()
{
runReadVars = false;
DDOnlySimulation = false;
AnnualSimulation = false;
BeginDayFlag = false;
BeginEnvrnFlag = false;
BeginHourFlag = false;
BeginSimFlag = false;
BeginFullSimFlag = false;
BeginTimeStepFlag = false;
DayOfSim = 0;
DayOfSimChr = "0";
EndEnvrnFlag = false;
EndDesignDayEnvrnsFlag = false;
EndDayFlag = false;
EndHourFlag = false;
PreviousHour = 0;
HourOfDay = 0;
WeightPreviousHour = 0.0;
WeightNow = 0.0;
NumOfDayInEnvrn = 0;
NumOfTimeStepInHour = 0;
NumOfZones = 0;
TimeStep = 0;
TimeStepZone = 0.0;
WarmupFlag = false;
OutputFileStandard = 0;
StdOutputRecordCount = 0;
OutputFileInits = 0;
OutputFileDebug = 0;
OutputFileZoneSizing = 0;
OutputFileSysSizing = 0;
OutputFileMeters = 0;
StdMeterRecordCount = 0;
OutputFileBNDetails = 0;
ZoneSizingCalc = false;
SysSizingCalc = false;
DoZoneSizing = false;
DoSystemSizing = false;
DoPlantSizing = false;
DoDesDaySim = false;
DoWeathSim = false;
DoHVACSizingSimulation = false;
HVACSizingSimMaxIterations = 0;
WeathSimReq = false;
KindOfSim = 0;
DoOutputReporting = false;
DoingSizing = false;
DoingHVACSizingSimulations = false;
DoingInputProcessing = false;
DisplayAllWarnings = false;
DisplayExtraWarnings = false;
DisplayUnusedObjects = false;
DisplayUnusedSchedules = false;
DisplayAdvancedReportVariables = false;
DisplayZoneAirHeatBalanceOffBalance = false;
DisplayInputInAudit = false;
CreateMinimalSurfaceVariables = false;
CurrentTime = 0.0;
SimTimeSteps = 0;
MinutesPerTimeStep = 0;
TimeStepZoneSec = 0.0;
MetersHaveBeenInitialized = false;
KickOffSimulation = false;
KickOffSizing = false;
RedoSizesHVACSimulation = false;
FinalSizingHVACSizingSimIteration = false;
AnyEnergyManagementSystemInModel = false;
AnyPlantInModel = false;
CacheIPErrorFile = 0;
AnyIdealCondEntSetPointInModel = false;
RunOptCondEntTemp = false;
CompLoadReportIsReq = false;
isPulseZoneSizing = false;
OutputFileZonePulse = 0;
doLoadComponentPulseNow = false;
ShowDecayCurvesInEIO = false;
AnySlabsInModel = false;
AnyBasementsInModel = false;
Progress = 0;
eso_stream = nullptr;
mtr_stream = nullptr;
}

// NOTICE
// Copyright © 1996-2014 The Board of Trustees of the University of Illinois
// and The Regents of the University of California through Ernest Orlando Lawrence
Expand Down
5 changes: 5 additions & 0 deletions src/EnergyPlus/DataGlobals.hh
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,11 @@ namespace DataGlobals {
extern void ( *fProgressPtr )( int const );
extern void ( *fMessagePtr )( std::string const & );

// Clears the global data in DataGlobals.
// Needed for unit tests, should not be normally called.
void
clear_state();

} // DataGlobals

} // EnergyPlus
Expand Down
Loading