From 047735d8d7ec97c7dff19c22f433eed369e21004 Mon Sep 17 00:00:00 2001 From: Rick Strand Date: Wed, 10 Jul 2024 06:30:08 -0500 Subject: [PATCH 01/14] 10299 Split GetShadowingInput This commit splits GetShadowingInput into two separate routines and will test to see if the split has been done correctly. The split is important because the actual getting of the input needs to be moved up in the order of calls to resolve this defect, but some of the processing needs to stay where it is at because it needs zones and surfaces read in. --- src/EnergyPlus/DataSystemVariables.hh | 5 + src/EnergyPlus/SolarShading.cc | 159 ++++++++++++----------- src/EnergyPlus/SolarShading.hh | 2 + tst/EnergyPlus/unit/SolarShading.unit.cc | 2 + 4 files changed, 92 insertions(+), 76 deletions(-) diff --git a/src/EnergyPlus/DataSystemVariables.hh b/src/EnergyPlus/DataSystemVariables.hh index 7de50eec237..156d628ab01 100644 --- a/src/EnergyPlus/DataSystemVariables.hh +++ b/src/EnergyPlus/DataSystemVariables.hh @@ -112,6 +112,11 @@ struct SystemVarsData : BaseGlobalStruct bool ReportExtShadingSunlitFrac = false; // when true, the sunlit fraction for all surfaces are exported as a csv format output bool DisableGroupSelfShading = false; // when true, defined shadowing surfaces group is ignored when calculating sunlit fraction bool DisableAllSelfShading = false; // when true, all external shadowing surfaces is ignored when calculating sunlit fraction + bool DisableSelfShadingWithinGroup = false; + bool DisableSelfShadingBetweenGroup = false; + + int shadingGroupsNum = 0; // number of shading groups + Array1D_string zoneName; // array of zone names in user input bool TrackAirLoopEnvFlag = false; // If TRUE generates a file with runtime statistics for each HVAC // controller on each air loop diff --git a/src/EnergyPlus/SolarShading.cc b/src/EnergyPlus/SolarShading.cc index adbeb77c6ce..be6f9f9ebc4 100644 --- a/src/EnergyPlus/SolarShading.cc +++ b/src/EnergyPlus/SolarShading.cc @@ -197,6 +197,7 @@ void InitSolarCalculations(EnergyPlusData &state) if (state.dataSolarShading->GetInputFlag) { checkShadingSurfaceSchedules(state); GetShadowingInput(state); + processShadowingInput(state); state.dataSolarShading->GetInputFlag = false; state.dataSolarShading->MaxHCV = (((max(15, state.dataSurface->MaxVerticesPerSurface) + 16) / 16) * 16) - 1; // Assure MaxHCV+1 is multiple of 16 for 128 B alignment @@ -629,30 +630,11 @@ void GetShadowingInput(EnergyPlusData &state) state.dataIPShortCut->cAlphaArgs(aNum) = "No"; state.dataSysVars->ReportExtShadingSunlitFrac = false; } - if (state.dataSysVars->shadingMethod == ShadingMethod::Imported) { - int ExtShadingSchedNum; - for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { - ExtShadingSchedNum = ScheduleManager::GetScheduleIndex(state, state.dataSurface->Surface(SurfNum).Name + "_shading"); - if (ExtShadingSchedNum != 0) { - state.dataSurface->Surface(SurfNum).SurfSchedExternalShadingFrac = true; - state.dataSurface->Surface(SurfNum).SurfExternalShadingSchInd = ExtShadingSchedNum; - } else { - ShowWarningError(state, - format("{}: sunlit fraction schedule not found for {} when using ImportedShading.", - cCurrentModuleObject, - state.dataSurface->Surface(SurfNum).Name)); - ShowContinueError(state, "These values are set to 1.0."); - } - } - } - - bool DisableSelfShadingWithinGroup = false; - bool DisableSelfShadingBetweenGroup = false; aNum++; if (NumAlphas >= aNum) { if (Util::SameString(state.dataIPShortCut->cAlphaArgs(aNum), "Yes")) { - DisableSelfShadingWithinGroup = true; + state.dataSysVars->DisableSelfShadingWithinGroup = true; state.dataIPShortCut->cAlphaArgs(aNum) = "Yes"; } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(aNum), "No")) { state.dataIPShortCut->cAlphaArgs(aNum) = "No"; @@ -668,7 +650,7 @@ void GetShadowingInput(EnergyPlusData &state) aNum++; if (NumAlphas >= aNum) { if (Util::SameString(state.dataIPShortCut->cAlphaArgs(aNum), "Yes")) { - DisableSelfShadingBetweenGroup = true; + state.dataSysVars->DisableSelfShadingBetweenGroup = true; state.dataIPShortCut->cAlphaArgs(aNum) = "Yes"; } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(aNum), "No")) { state.dataIPShortCut->cAlphaArgs(aNum) = "No"; @@ -681,66 +663,17 @@ void GetShadowingInput(EnergyPlusData &state) state.dataIPShortCut->cAlphaArgs(aNum) = "No"; } - if (DisableSelfShadingBetweenGroup && DisableSelfShadingWithinGroup) { + if (state.dataSysVars->DisableSelfShadingBetweenGroup && state.dataSysVars->DisableSelfShadingWithinGroup) { state.dataSysVars->DisableAllSelfShading = true; - } else if (DisableSelfShadingBetweenGroup || DisableSelfShadingWithinGroup) { + } else if (state.dataSysVars->DisableSelfShadingBetweenGroup || state.dataSysVars->DisableSelfShadingWithinGroup) { state.dataSysVars->DisableGroupSelfShading = true; } aNum++; - int SurfZoneGroup, CurZoneGroup; - if (state.dataSysVars->DisableGroupSelfShading) { - Array1D_int DisableSelfShadingGroups; - int NumOfShadingGroups; - if (NumAlphas >= aNum) { - // Read all shading groups - NumOfShadingGroups = NumAlphas - (aNum - 1); - DisableSelfShadingGroups.allocate(NumOfShadingGroups); - for (int i = 1; i <= NumOfShadingGroups; i++) { - Found = Util::FindItemInList( - state.dataIPShortCut->cAlphaArgs(i + (aNum - 1)), state.dataHeatBal->ZoneList, state.dataHeatBal->NumOfZoneLists); - if (Found != 0) DisableSelfShadingGroups(i) = Found; - } - - for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; SurfNum++) { - if (state.dataSurface->Surface(SurfNum).ExtBoundCond == 0) { // Loop through all exterior surfaces - SurfZoneGroup = 0; - // Check the shading zone group of each exterior surface - for (int ZoneGroupLoop = 1; ZoneGroupLoop <= NumOfShadingGroups; ZoneGroupLoop++) { // Loop through all defined shading groups - CurZoneGroup = DisableSelfShadingGroups(ZoneGroupLoop); - for (int ZoneNum = 1; ZoneNum <= state.dataHeatBal->ZoneList(CurZoneGroup).NumOfZones; - ZoneNum++) { // Loop through all zones in the zone list - if (state.dataSurface->Surface(SurfNum).Zone == state.dataHeatBal->ZoneList(CurZoneGroup).Zone(ZoneNum)) { - SurfZoneGroup = CurZoneGroup; - break; - } - } - } - // if a surface is not in any zone group, no self shading is disabled for this surface - if (SurfZoneGroup != 0) { - // if DisableSelfShadingWithinGroup, add all zones in the same zone group to the surface's disabled zone list - // if DisableSelfShadingBetweenGroups, add all zones in all other zone groups to the surface's disabled zone list - for (int ZoneGroupLoop = 1; ZoneGroupLoop <= NumOfShadingGroups; ZoneGroupLoop++) { // Loop through all defined shading groups - CurZoneGroup = DisableSelfShadingGroups(ZoneGroupLoop); - if (SurfZoneGroup == CurZoneGroup && DisableSelfShadingWithinGroup) { - for (int ZoneNum = 1; ZoneNum <= state.dataHeatBal->ZoneList(CurZoneGroup).NumOfZones; - ZoneNum++) { // Loop through all zones in the zone list - state.dataSurface->SurfShadowDisabledZoneList(SurfNum).push_back( - state.dataHeatBal->ZoneList(CurZoneGroup).Zone(ZoneNum)); - } - } else if (SurfZoneGroup != CurZoneGroup && DisableSelfShadingBetweenGroup) { - for (int ZoneNum = 1; ZoneNum <= state.dataHeatBal->ZoneList(CurZoneGroup).NumOfZones; ZoneNum++) { - state.dataSurface->SurfShadowDisabledZoneList(SurfNum).push_back( - state.dataHeatBal->ZoneList(CurZoneGroup).Zone(ZoneNum)); - } - } - } - } - } - } - } else { - ShowFatalError(state, "No Shading groups are defined when disabling grouped self shading."); - } + state.dataSysVars->shadingGroupsNum = NumAlphas - (aNum - 1); + state.dataSysVars->zoneName.allocate(state.dataSysVars->shadingGroupsNum); + for (int numZone = 1; numZone <= state.dataSysVars->shadingGroupsNum; ++numZone) { + state.dataSysVars->zoneName(numZone) = state.dataIPShortCut->cAlphaArgs(aNum - 1 + numZone); } if (!state.dataSysVars->DetailedSolarTimestepIntegration && state.dataSurface->ShadingTransmittanceVaries && @@ -797,6 +730,80 @@ void GetShadowingInput(EnergyPlusData &state) state.dataIPShortCut->cAlphaArgs(7)); } +void processShadowingInput(EnergyPlusData &state) +{ + // all shadow input processing that needed zones and surfaces to already be read into data (part of fix for Defect #10299) + + if (state.dataSysVars->shadingMethod == DataSystemVariables::ShadingMethod::Imported) { + int ExtShadingSchedNum; + for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { + ExtShadingSchedNum = ScheduleManager::GetScheduleIndex(state, state.dataSurface->Surface(SurfNum).Name + "_shading"); + if (ExtShadingSchedNum != 0) { + state.dataSurface->Surface(SurfNum).SurfSchedExternalShadingFrac = true; + state.dataSurface->Surface(SurfNum).SurfExternalShadingSchInd = ExtShadingSchedNum; + } else { + ShowWarningError(state, + format("processShadowingInput: sunlit fraction schedule not found for {} when using ImportedShading.", + state.dataSurface->Surface(SurfNum).Name)); + ShowContinueError(state, "These values are set to 1.0."); + } + } + } + + int SurfZoneGroup, CurZoneGroup; + int Found = 0; + if (state.dataSysVars->DisableGroupSelfShading) { + Array1D_int DisableSelfShadingGroups; + int NumOfShadingGroups = state.dataSysVars->shadingGroupsNum; + if (NumOfShadingGroups > 0) { + DisableSelfShadingGroups.allocate(NumOfShadingGroups); + for (int i = 1; i <= NumOfShadingGroups; i++) { + Found = Util::FindItemInList(state.dataSysVars->zoneName(i), state.dataHeatBal->ZoneList, state.dataHeatBal->NumOfZoneLists); + if (Found != 0) DisableSelfShadingGroups(i) = Found; + } + + for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; SurfNum++) { + if (state.dataSurface->Surface(SurfNum).ExtBoundCond == 0) { // Loop through all exterior surfaces + SurfZoneGroup = 0; + // Check the shading zone group of each exterior surface + for (int ZoneGroupLoop = 1; ZoneGroupLoop <= NumOfShadingGroups; ZoneGroupLoop++) { // Loop through all defined shading groups + CurZoneGroup = DisableSelfShadingGroups(ZoneGroupLoop); + for (int ZoneNum = 1; ZoneNum <= state.dataHeatBal->ZoneList(CurZoneGroup).NumOfZones; + ZoneNum++) { // Loop through all zones in the zone list + if (state.dataSurface->Surface(SurfNum).Zone == state.dataHeatBal->ZoneList(CurZoneGroup).Zone(ZoneNum)) { + SurfZoneGroup = CurZoneGroup; + break; + } + } + } + // if a surface is not in any zone group, no self shading is disabled for this surface + if (SurfZoneGroup != 0) { + // if DisableSelfShadingWithinGroup, add all zones in the same zone group to the surface's disabled zone list + // if DisableSelfShadingBetweenGroups, add all zones in all other zone groups to the surface's disabled zone list + for (int ZoneGroupLoop = 1; ZoneGroupLoop <= NumOfShadingGroups; ZoneGroupLoop++) { // Loop through all defined shading groups + CurZoneGroup = DisableSelfShadingGroups(ZoneGroupLoop); + if (SurfZoneGroup == CurZoneGroup && state.dataSysVars->DisableSelfShadingWithinGroup) { + for (int ZoneNum = 1; ZoneNum <= state.dataHeatBal->ZoneList(CurZoneGroup).NumOfZones; + ZoneNum++) { // Loop through all zones in the zone list + state.dataSurface->SurfShadowDisabledZoneList(SurfNum).push_back( + state.dataHeatBal->ZoneList(CurZoneGroup).Zone(ZoneNum)); + } + } else if (SurfZoneGroup != CurZoneGroup && state.dataSysVars->DisableSelfShadingBetweenGroup) { + for (int ZoneNum = 1; ZoneNum <= state.dataHeatBal->ZoneList(CurZoneGroup).NumOfZones; ZoneNum++) { + state.dataSurface->SurfShadowDisabledZoneList(SurfNum).push_back( + state.dataHeatBal->ZoneList(CurZoneGroup).Zone(ZoneNum)); + } + } + } + } + } + } + } else { + ShowFatalError(state, "No Shading groups are defined when disabling grouped self shading."); + } + } +} + void checkScheduledSurfacePresent(EnergyPlusData &state) { // User has chosen "Scheduled" for sunlit fraction so check to see which surfaces don't have a schedule diff --git a/src/EnergyPlus/SolarShading.hh b/src/EnergyPlus/SolarShading.hh index cb1dba901c0..5e3d62e5f41 100644 --- a/src/EnergyPlus/SolarShading.hh +++ b/src/EnergyPlus/SolarShading.hh @@ -99,6 +99,8 @@ namespace SolarShading { void GetShadowingInput(EnergyPlusData &state); + void processShadowingInput(EnergyPlusData &state); + void checkScheduledSurfacePresent(EnergyPlusData &state); void AllocateModuleArrays(EnergyPlusData &state); diff --git a/tst/EnergyPlus/unit/SolarShading.unit.cc b/tst/EnergyPlus/unit/SolarShading.unit.cc index dc0d2d47e29..c53be169dae 100644 --- a/tst/EnergyPlus/unit/SolarShading.unit.cc +++ b/tst/EnergyPlus/unit/SolarShading.unit.cc @@ -1484,6 +1484,7 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_DisableGroupSelfShading) compare_err_stream(""); // just for debugging SolarShading::GetShadowingInput(*state); + SolarShading::processShadowingInput(*state); for (int SurfNum = 1; SurfNum <= state->dataSurface->TotSurfaces; SurfNum++) { if (state->dataSurface->Surface(SurfNum).ExtBoundCond == 0 && state->dataSurface->Surface(SurfNum).Zone != 0) { @@ -3887,6 +3888,7 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_Warn_Pixel_Count_and_TM_Schedule) EXPECT_EQ(state->dataErrTracking->TotalSevereErrors, 0); SolarShading::GetShadowingInput(*state); + SolarShading::processShadowingInput(*state); #ifdef EP_NO_OPENGL EXPECT_EQ(state->dataErrTracking->TotalWarningErrors, 1); From c5f39452edc4734dce7aec7d5e12c89aa1ea536c Mon Sep 17 00:00:00 2001 From: Rick Strand Date: Wed, 10 Jul 2024 16:16:29 -0500 Subject: [PATCH 02/14] 10299 Separation of Get and Process The previous version of GetShadowingInput obtained the ShadowCalculation input but then also did some processing. In order to solve #10299, these needed to be separated so that when surfaces are read in that it knows the ShadowCalculation input and thus can produce error messages appropriately. This commit separates the two parts of the previous routine into two routines which are now called at the appropriate places. The next step will be to implement the solution and create a unit test. --- src/EnergyPlus/HeatBalanceManager.cc | 2 ++ src/EnergyPlus/SolarShading.cc | 6 +++++- src/EnergyPlus/SolarShading.hh | 1 + tst/EnergyPlus/unit/SolarShading.unit.cc | 27 ++++++++++++------------ 4 files changed, 21 insertions(+), 15 deletions(-) diff --git a/src/EnergyPlus/HeatBalanceManager.cc b/src/EnergyPlus/HeatBalanceManager.cc index 1791b5b2895..b569d688d90 100644 --- a/src/EnergyPlus/HeatBalanceManager.cc +++ b/src/EnergyPlus/HeatBalanceManager.cc @@ -1967,6 +1967,8 @@ namespace HeatBalanceManager { // METHODOLOGY EMPLOYED: // The GetObjectItem routines are employed to retrieve the data. + SolarShading::GetShadowingInput(state); + GetZoneData(state, ErrorsFound); // Read Zone data from input file SurfaceGeometry::SetupZoneGeometry(state, ErrorsFound); diff --git a/src/EnergyPlus/SolarShading.cc b/src/EnergyPlus/SolarShading.cc index be6f9f9ebc4..4d2776e0156 100644 --- a/src/EnergyPlus/SolarShading.cc +++ b/src/EnergyPlus/SolarShading.cc @@ -196,7 +196,6 @@ void InitSolarCalculations(EnergyPlusData &state) if (state.dataSolarShading->GetInputFlag) { checkShadingSurfaceSchedules(state); - GetShadowingInput(state); processShadowingInput(state); state.dataSolarShading->GetInputFlag = false; state.dataSolarShading->MaxHCV = @@ -412,6 +411,11 @@ void GetShadowingInput(EnergyPlusData &state) using DataSystemVariables::ShadingMethod; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + if (state.dataSolarShading->getShadowingCalculationInput) { + state.dataSolarShading->getShadowingCalculationInput = false; + } else { + return; + } int NumItems; int NumNumbers; int NumAlphas; diff --git a/src/EnergyPlus/SolarShading.hh b/src/EnergyPlus/SolarShading.hh index 5e3d62e5f41..bd466b327bf 100644 --- a/src/EnergyPlus/SolarShading.hh +++ b/src/EnergyPlus/SolarShading.hh @@ -437,6 +437,7 @@ struct SolarShadingData : BaseGlobalStruct #endif bool GetInputFlag = true; + bool getShadowingCalculationInput = true; bool anyScheduledShadingSurface = false; bool firstTime = true; bool debugging = false; diff --git a/tst/EnergyPlus/unit/SolarShading.unit.cc b/tst/EnergyPlus/unit/SolarShading.unit.cc index 7b168088659..d25e609a388 100644 --- a/tst/EnergyPlus/unit/SolarShading.unit.cc +++ b/tst/EnergyPlus/unit/SolarShading.unit.cc @@ -1461,6 +1461,8 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_DisableGroupSelfShading) HeatBalanceManager::GetConstructData(*state, FoundError); EXPECT_FALSE(FoundError); + SolarShading::GetShadowingInput(*state); + HeatBalanceManager::GetZoneData(*state, FoundError); // Read Zone data from input file EXPECT_FALSE(FoundError); @@ -1483,7 +1485,6 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_DisableGroupSelfShading) compare_err_stream(""); // just for debugging - SolarShading::GetShadowingInput(*state); SolarShading::processShadowingInput(*state); for (int SurfNum = 1; SurfNum <= state->dataSurface->TotSurfaces; SurfNum++) { @@ -3868,6 +3869,8 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_Warn_Pixel_Count_and_TM_Schedule) HeatBalanceManager::GetConstructData(*state, FoundError); EXPECT_FALSE(FoundError); + SolarShading::GetShadowingInput(*state); + HeatBalanceManager::GetZoneData(*state, FoundError); EXPECT_FALSE(FoundError); @@ -3890,11 +3893,11 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_Warn_Pixel_Count_and_TM_Schedule) EXPECT_EQ(state->dataSolarShading->anyScheduledShadingSurface, true); EXPECT_EQ(state->dataErrTracking->AskForSurfacesReport, true); - EXPECT_EQ(state->dataErrTracking->TotalWarningErrors, 0); + EXPECT_EQ(state->dataErrTracking->TotalWarningErrors, + 1); // with the rearrangement of code, one warning now gets produced in the shadow calculations // Expect no severe errors at this point EXPECT_EQ(state->dataErrTracking->TotalSevereErrors, 0); - SolarShading::GetShadowingInput(*state); SolarShading::processShadowingInput(*state); #ifdef EP_NO_OPENGL @@ -3902,17 +3905,9 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_Warn_Pixel_Count_and_TM_Schedule) EXPECT_EQ(state->dataErrTracking->TotalSevereErrors, 0); EXPECT_EQ(state->dataErrTracking->LastSevereError, ""); #else - if (!Penumbra::Penumbra::is_valid_context()) { - EXPECT_EQ(state->dataErrTracking->TotalWarningErrors, 1); - EXPECT_EQ(state->dataErrTracking->TotalSevereErrors, 0); - EXPECT_EQ(state->dataErrTracking->LastSevereError, ""); - } else { - EXPECT_EQ(state->dataErrTracking->TotalWarningErrors, 0); - // Now expect one severe error from GetShadowInput() - EXPECT_EQ(state->dataErrTracking->TotalSevereErrors, 1); - // There should be a severe warning reported about the PixelCounting and the scheduled shading surface tm values > 0.0 combination. - EXPECT_EQ(state->dataErrTracking->LastSevereError, "The Shading Calculation Method of choice is \"PixelCounting\"; "); - } + EXPECT_EQ(state->dataErrTracking->TotalWarningErrors, 1); + EXPECT_EQ(state->dataErrTracking->TotalSevereErrors, 0); + EXPECT_EQ(state->dataErrTracking->LastSevereError, ""); #endif } @@ -4180,6 +4175,8 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_PolygonOverlap) HeatBalanceManager::GetConstructData(*state, FoundError); EXPECT_FALSE(FoundError); + SolarShading::GetShadowingInput(*state); + HeatBalanceManager::GetZoneData(*state, FoundError); // Read Zone data from input file EXPECT_FALSE(FoundError); @@ -4202,6 +4199,8 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_PolygonOverlap) SurfaceGeometry::GetSurfaceData(*state, FoundError); // setup zone geometry and get zone data EXPECT_FALSE(FoundError); // expect no errors + SolarShading::processShadowingInput(*state); + // compare_err_stream( "" ); // just for debugging SurfaceGeometry::SetupZoneGeometry(*state, FoundError); // this calls GetSurfaceData() From eaf73f99d8cc6c94b160c0679e49f6f480e4f474 Mon Sep 17 00:00:00 2001 From: Rick Strand Date: Fri, 12 Jul 2024 14:21:39 -0500 Subject: [PATCH 03/14] 10299 Fix and Reverse Old Unit Fix to the problem. Testing reveals that the code now does what it is supposed to do. Also, reversed some changes to an existing unit test as the changes were causing some issues in the test suite. Hopefully this makes those issues disappear. --- src/EnergyPlus/SurfaceGeometry.cc | 7 ++++--- tst/EnergyPlus/unit/SolarShading.unit.cc | 14 ++++++++++---- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/EnergyPlus/SurfaceGeometry.cc b/src/EnergyPlus/SurfaceGeometry.cc index c8191fa36c2..09b60d6a98f 100644 --- a/src/EnergyPlus/SurfaceGeometry.cc +++ b/src/EnergyPlus/SurfaceGeometry.cc @@ -68,6 +68,7 @@ #include #include #include +#include #include #include #include @@ -15680,9 +15681,9 @@ namespace SurfaceGeometry { if (SignFlag != PrevSignFlag) { if (state.dataGlobal->DisplayExtraWarnings && surfaceTmp.ExtSolar && - (state.dataHeatBal->SolarDistribution != DataHeatBalance::Shadowing::Minimal) && - // Warn only once - surfaceTmp.IsConvex) { + (state.dataHeatBal->SolarDistribution != DataHeatBalance::Shadowing::Minimal) && surfaceTmp.IsConvex && + !state.dataSysVars->SutherlandHodgman && + (state.dataSysVars->shadingMethod == DataSystemVariables::ShadingMethod::PolygonClipping)) { ShowWarningError(state, format("CheckConvexity: Zone=\"{}\", Surface=\"{}\" is non-convex.", state.dataHeatBal->Zone(surfaceTmp.Zone).Name, diff --git a/tst/EnergyPlus/unit/SolarShading.unit.cc b/tst/EnergyPlus/unit/SolarShading.unit.cc index d25e609a388..20591d52914 100644 --- a/tst/EnergyPlus/unit/SolarShading.unit.cc +++ b/tst/EnergyPlus/unit/SolarShading.unit.cc @@ -3901,13 +3901,19 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_Warn_Pixel_Count_and_TM_Schedule) SolarShading::processShadowingInput(*state); #ifdef EP_NO_OPENGL - EXPECT_EQ(state->dataErrTracking->TotalWarningErrors, 1); + EXPECT_EQ(state->dataErrTracking->TotalWarningErrors, 2); EXPECT_EQ(state->dataErrTracking->TotalSevereErrors, 0); EXPECT_EQ(state->dataErrTracking->LastSevereError, ""); #else - EXPECT_EQ(state->dataErrTracking->TotalWarningErrors, 1); - EXPECT_EQ(state->dataErrTracking->TotalSevereErrors, 0); - EXPECT_EQ(state->dataErrTracking->LastSevereError, ""); + if (!Penumbra::Penumbra::is_valid_context()) { + EXPECT_EQ(state->dataErrTracking->TotalWarningErrors, 2); + EXPECT_EQ(state->dataErrTracking->TotalSevereErrors, 0); + EXPECT_EQ(state->dataErrTracking->LastSevereError, ""); + } else { + EXPECT_EQ(state->dataErrTracking->TotalWarningErrors, 1); + EXPECT_EQ(state->dataErrTracking->TotalSevereErrors, 0); + EXPECT_EQ(state->dataErrTracking->LastSevereError, ""); + } #endif } From 4a504167e2f50bb0474b932bfd575fb1f20da5dc Mon Sep 17 00:00:00 2001 From: Rick Strand Date: Fri, 12 Jul 2024 18:31:17 -0500 Subject: [PATCH 04/14] 10299 Unit Test and Fixes Addition of new unit tests and fixes to the one that doesn't work properly for Windows (experimental solution based on surrounding code). If this works, this is a potential pull request version. --- tst/EnergyPlus/unit/SolarShading.unit.cc | 214 ++++++++++++++++++++++- 1 file changed, 212 insertions(+), 2 deletions(-) diff --git a/tst/EnergyPlus/unit/SolarShading.unit.cc b/tst/EnergyPlus/unit/SolarShading.unit.cc index 20591d52914..68f5b573a56 100644 --- a/tst/EnergyPlus/unit/SolarShading.unit.cc +++ b/tst/EnergyPlus/unit/SolarShading.unit.cc @@ -3893,11 +3893,19 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_Warn_Pixel_Count_and_TM_Schedule) EXPECT_EQ(state->dataSolarShading->anyScheduledShadingSurface, true); EXPECT_EQ(state->dataErrTracking->AskForSurfacesReport, true); - EXPECT_EQ(state->dataErrTracking->TotalWarningErrors, - 1); // with the rearrangement of code, one warning now gets produced in the shadow calculations // Expect no severe errors at this point EXPECT_EQ(state->dataErrTracking->TotalSevereErrors, 0); +#ifdef EP_NO_OPENGL + EXPECT_EQ(state->dataErrTracking->TotalWarningErrors, 2); +#else + if (!Penumbra::Penumbra::is_valid_context()) { + EXPECT_EQ(state->dataErrTracking->TotalWarningErrors, 2); + } else { + EXPECT_EQ(state->dataErrTracking->TotalWarningErrors, 1); + } +#endif + SolarShading::processShadowingInput(*state); #ifdef EP_NO_OPENGL @@ -5954,3 +5962,205 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_CalcInteriorSolarDistribution_EQL) EXPECT_NEAR(0.0, state->dataHeatBalSurf->SurfWinInitialDifSolInTrans(windowSurfNum), 0.01); EXPECT_NEAR(1.4736, state->dataHeatBalSurf->SurfWinInitialDifSolInTrans(windowSurfNum2), 0.01); } + +TEST_F(EnergyPlusFixture, SolarShadingTest_GetShadowingInputTest1) +{ + // Tests for Defect #10299: Test GetShadowingInput for various combinations of input + // with a focus put on the correct setting of variables associated with calculation + // method and polygon clipping algorithm + std::string const idf_objects = delimited_string({ + " ShadowCalculation,", + " PolygonClipping, !- Shading Calculation Method", + " Timestep, !- Shading Calculation Update Frequency Method", + " 1, !- Shading Calculation Update Frequency", + " 200, !- Maximum Figures in Shadow Overlap Calculations", + " ConvexWeilerAtherton, !- Polygon Clipping Algorithm", + " 512.0, !- Pixel Counting Resolution", + " DetailedSkyDiffuseModeling; !- Sky Diffuse Modeling Algorithm", + }); + + ASSERT_TRUE(process_idf(idf_objects)); + + state->dataSolarShading->anyScheduledShadingSurface = false; + + // Test 1 of 6: Polygon Clipping and ConvexWeilerAtherton + SolarShading::GetShadowingInput(*state); + int expectedFrequency = 1; + int expectedOverlaps = 200; + EXPECT_TRUE(state->dataSysVars->DetailedSkyDiffuseAlgorithm); + EXPECT_TRUE(state->dataSysVars->DetailedSolarTimestepIntegration); + EXPECT_EQ(expectedFrequency, state->dataSolarShading->ShadowingCalcFrequency); + EXPECT_EQ(expectedOverlaps, state->dataSolarShading->MaxHCS); + EXPECT_FALSE(state->dataSysVars->SutherlandHodgman); + EXPECT_FALSE(state->dataSysVars->SlaterBarsky); + EXPECT_EQ(state->dataSysVars->shadingMethod, ShadingMethod::PolygonClipping); +} + +TEST_F(EnergyPlusFixture, SolarShadingTest_GetShadowingInputTest2) +{ + // Tests for Defect #10299: Test GetShadowingInput for various combinations of input + // with a focus put on the correct setting of variables associated with calculation + // method and polygon clipping algorithm + std::string const idf_objects = delimited_string({ + " ShadowCalculation,", + " PolygonClipping, !- Shading Calculation Method", + " Periodic, !- Shading Calculation Update Frequency Method", + " 10, !- Shading Calculation Update Frequency", + " 2000, !- Maximum Figures in Shadow Overlap Calculations", + " SutherlandHodgman, !- Polygon Clipping Algorithm", + " 512.0, !- Pixel Counting Resolution", + " SimpleSkyDiffuseModeling; !- Sky Diffuse Modeling Algorithm", + }); + + ASSERT_TRUE(process_idf(idf_objects)); + + state->dataSolarShading->anyScheduledShadingSurface = false; + + // Test 2 of 6: Polygon Clipping and SutherlandHodgman + SolarShading::GetShadowingInput(*state); + int expectedFrequency = 10; + int expectedOverlaps = 2000; + EXPECT_FALSE(state->dataSysVars->DetailedSkyDiffuseAlgorithm); + EXPECT_FALSE(state->dataSysVars->DetailedSolarTimestepIntegration); + EXPECT_EQ(expectedFrequency, state->dataSolarShading->ShadowingCalcFrequency); + EXPECT_EQ(expectedOverlaps, state->dataSolarShading->MaxHCS); + EXPECT_TRUE(state->dataSysVars->SutherlandHodgman); + EXPECT_FALSE(state->dataSysVars->SlaterBarsky); + EXPECT_EQ(state->dataSysVars->shadingMethod, ShadingMethod::PolygonClipping); +} + +TEST_F(EnergyPlusFixture, SolarShadingTest_GetShadowingInputTest3) +{ + // Tests for Defect #10299: Test GetShadowingInput for various combinations of input + // with a focus put on the correct setting of variables associated with calculation + // method and polygon clipping algorithm + std::string const idf_objects = delimited_string({ + " ShadowCalculation,", + " PolygonClipping, !- Shading Calculation Method", + " Timestep, !- Shading Calculation Update Frequency Method", + " 30, !- Shading Calculation Update Frequency", + " 15000, !- Maximum Figures in Shadow Overlap Calculations", + " SlaterBarskyandSutherlandHodgman, !- Polygon Clipping Algorithm", + " 512.0, !- Pixel Counting Resolution", + " DetailedSkyDiffuseModeling; !- Sky Diffuse Modeling Algorithm", + }); + + ASSERT_TRUE(process_idf(idf_objects)); + + state->dataSolarShading->anyScheduledShadingSurface = false; + + // Test 3 of 6: Polygon Clipping and SlaterBarskyandSutherlandHodgman + SolarShading::GetShadowingInput(*state); + int expectedFrequency = 30; + int expectedOverlaps = 15000; + EXPECT_TRUE(state->dataSysVars->DetailedSkyDiffuseAlgorithm); + EXPECT_TRUE(state->dataSysVars->DetailedSolarTimestepIntegration); + EXPECT_EQ(expectedFrequency, state->dataSolarShading->ShadowingCalcFrequency); + EXPECT_EQ(expectedOverlaps, state->dataSolarShading->MaxHCS); + EXPECT_TRUE(state->dataSysVars->SutherlandHodgman); + EXPECT_TRUE(state->dataSysVars->SlaterBarsky); + EXPECT_EQ(state->dataSysVars->shadingMethod, ShadingMethod::PolygonClipping); +} + +TEST_F(EnergyPlusFixture, SolarShadingTest_GetShadowingInputTest4) +{ + // Tests for Defect #10299: Test GetShadowingInput for various combinations of input + // with a focus put on the correct setting of variables associated with calculation + // method and polygon clipping algorithm + std::string const idf_objects = delimited_string({ + " ShadowCalculation,", + " PixelCounting, !- Shading Calculation Method", + " Periodic, !- Shading Calculation Update Frequency Method", + " 1, !- Shading Calculation Update Frequency", + " 200, !- Maximum Figures in Shadow Overlap Calculations", + " ConvexWeilerAtherton, !- Polygon Clipping Algorithm", + " 512.0, !- Pixel Counting Resolution", + " DetailedSkyDiffuseModeling; !- Sky Diffuse Modeling Algorithm", + }); + + ASSERT_TRUE(process_idf(idf_objects)); + + state->dataSolarShading->anyScheduledShadingSurface = false; + + // Test 4 of 6: Pixel Counting and ConvexWeilerAtherton + SolarShading::GetShadowingInput(*state); + int expectedFrequency = 1; + int expectedOverlaps = 200; + EXPECT_TRUE(state->dataSysVars->DetailedSkyDiffuseAlgorithm); + EXPECT_FALSE(state->dataSysVars->DetailedSolarTimestepIntegration); + EXPECT_EQ(expectedFrequency, state->dataSolarShading->ShadowingCalcFrequency); + EXPECT_EQ(expectedOverlaps, state->dataSolarShading->MaxHCS); + EXPECT_FALSE(state->dataSysVars->SutherlandHodgman); + EXPECT_FALSE(state->dataSysVars->SlaterBarsky); + EXPECT_EQ(state->dataSysVars->shadingMethod, ShadingMethod::PixelCounting); +} + +TEST_F(EnergyPlusFixture, SolarShadingTest_GetShadowingInputTest5) +{ + // Tests for Defect #10299: Test GetShadowingInput for various combinations of input + // with a focus put on the correct setting of variables associated with calculation + // method and polygon clipping algorithm + std::string const idf_objects = delimited_string({ + " ShadowCalculation,", + " PixelCounting, !- Shading Calculation Method", + " Periodic, !- Shading Calculation Update Frequency Method", + " 10, !- Shading Calculation Update Frequency", + " 2000, !- Maximum Figures in Shadow Overlap Calculations", + " SutherlandHodgman, !- Polygon Clipping Algorithm", + " 512.0, !- Pixel Counting Resolution", + " DetailedSkyDiffuseModeling; !- Sky Diffuse Modeling Algorithm", + }); + + ASSERT_TRUE(process_idf(idf_objects)); + + state->dataSolarShading->anyScheduledShadingSurface = false; + + // Test 5 of 6: Pixel Counting and SutherlandHodgman + SolarShading::GetShadowingInput(*state); + int expectedFrequency = 10; + int expectedOverlaps = 2000; + EXPECT_TRUE(state->dataSysVars->DetailedSkyDiffuseAlgorithm); + EXPECT_FALSE(state->dataSysVars->DetailedSolarTimestepIntegration); + EXPECT_EQ(expectedFrequency, state->dataSolarShading->ShadowingCalcFrequency); + EXPECT_EQ(expectedOverlaps, state->dataSolarShading->MaxHCS); + EXPECT_TRUE(state->dataSysVars->SutherlandHodgman); + EXPECT_FALSE(state->dataSysVars->SlaterBarsky); + EXPECT_EQ(state->dataSysVars->shadingMethod, ShadingMethod::PixelCounting); +} + +TEST_F(EnergyPlusFixture, SolarShadingTest_GetShadowingInputTest6) +{ + // Tests for Defect #10299: Test GetShadowingInput for various combinations of input + // with a focus put on the correct setting of variables associated with calculation + // method and polygon clipping algorithm + std::string const idf_objects = delimited_string({ + " ShadowCalculation,", + " PixelCounting, !- Shading Calculation Method", + " Periodic, !- Shading Calculation Update Frequency Method", + " 56, !- Shading Calculation Update Frequency", + " 1234, !- Maximum Figures in Shadow Overlap Calculations", + " SlaterBarskyandSutherlandHodgman, !- Polygon Clipping Algorithm", + " 512.0, !- Pixel Counting Resolution", + " SimpleSkyDiffuseModeling; !- Sky Diffuse Modeling Algorithm", + }); + + ASSERT_TRUE(process_idf(idf_objects)); + + state->dataSolarShading->anyScheduledShadingSurface = false; + + // Test 36of 6: Pixel Counting and SlaterBarskyandSutherlandHodgman + SolarShading::GetShadowingInput(*state); + + int expectedFrequency = 56; + int expectedOverlaps = 1234; + EXPECT_FALSE(state->dataSysVars->DetailedSkyDiffuseAlgorithm); + EXPECT_FALSE(state->dataSysVars->DetailedSolarTimestepIntegration); + EXPECT_EQ(expectedFrequency, state->dataSolarShading->ShadowingCalcFrequency); + EXPECT_EQ(expectedOverlaps, state->dataSolarShading->MaxHCS); + EXPECT_TRUE(state->dataSysVars->SutherlandHodgman); + EXPECT_TRUE(state->dataSysVars->SlaterBarsky); + EXPECT_EQ(state->dataSysVars->shadingMethod, ShadingMethod::PixelCounting); + std::string const error_string = delimited_string({" ** Warning ** ShadowCalculation: suspect Shading Calculation Update Frequency", + " ** ~~~ ** Value entered=[56], Shadowing Calculations will be inaccurate."}); + EXPECT_TRUE(compare_err_stream(error_string, true)); +} From 608530e8fd40fb6a79e8dfc0f5ef508db9ea261a Mon Sep 17 00:00:00 2001 From: Rick Strand Date: Fri, 12 Jul 2024 21:55:21 -0500 Subject: [PATCH 05/14] 10299 Unit Test Change Backup Backed out something that was tried but resulted in more issues. --- tst/EnergyPlus/unit/SolarShading.unit.cc | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/tst/EnergyPlus/unit/SolarShading.unit.cc b/tst/EnergyPlus/unit/SolarShading.unit.cc index 68f5b573a56..123369cd2d7 100644 --- a/tst/EnergyPlus/unit/SolarShading.unit.cc +++ b/tst/EnergyPlus/unit/SolarShading.unit.cc @@ -3893,19 +3893,10 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_Warn_Pixel_Count_and_TM_Schedule) EXPECT_EQ(state->dataSolarShading->anyScheduledShadingSurface, true); EXPECT_EQ(state->dataErrTracking->AskForSurfacesReport, true); + EXPECT_EQ(state->dataErrTracking->TotalWarningErrors, 1); // Expect no severe errors at this point EXPECT_EQ(state->dataErrTracking->TotalSevereErrors, 0); -#ifdef EP_NO_OPENGL - EXPECT_EQ(state->dataErrTracking->TotalWarningErrors, 2); -#else - if (!Penumbra::Penumbra::is_valid_context()) { - EXPECT_EQ(state->dataErrTracking->TotalWarningErrors, 2); - } else { - EXPECT_EQ(state->dataErrTracking->TotalWarningErrors, 1); - } -#endif - SolarShading::processShadowingInput(*state); #ifdef EP_NO_OPENGL From ce283a328081cdc0539fa7c1afd7b7efccb61cd3 Mon Sep 17 00:00:00 2001 From: Rick Strand Date: Fri, 19 Jul 2024 16:45:15 -0500 Subject: [PATCH 06/14] 10299 Correction of Unit Test enum Correction of enum comparisons to eliminate errors in energyplus_tests --- tst/EnergyPlus/unit/SolarShading.unit.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tst/EnergyPlus/unit/SolarShading.unit.cc b/tst/EnergyPlus/unit/SolarShading.unit.cc index 123369cd2d7..c4bc0c9044b 100644 --- a/tst/EnergyPlus/unit/SolarShading.unit.cc +++ b/tst/EnergyPlus/unit/SolarShading.unit.cc @@ -5984,7 +5984,7 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_GetShadowingInputTest1) EXPECT_EQ(expectedOverlaps, state->dataSolarShading->MaxHCS); EXPECT_FALSE(state->dataSysVars->SutherlandHodgman); EXPECT_FALSE(state->dataSysVars->SlaterBarsky); - EXPECT_EQ(state->dataSysVars->shadingMethod, ShadingMethod::PolygonClipping); + EXPECT_ENUM_EQ(state->dataSysVars->shadingMethod, ShadingMethod::PolygonClipping); } TEST_F(EnergyPlusFixture, SolarShadingTest_GetShadowingInputTest2) @@ -6017,7 +6017,7 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_GetShadowingInputTest2) EXPECT_EQ(expectedOverlaps, state->dataSolarShading->MaxHCS); EXPECT_TRUE(state->dataSysVars->SutherlandHodgman); EXPECT_FALSE(state->dataSysVars->SlaterBarsky); - EXPECT_EQ(state->dataSysVars->shadingMethod, ShadingMethod::PolygonClipping); + EXPECT_ENUM_EQ(state->dataSysVars->shadingMethod, ShadingMethod::PolygonClipping); } TEST_F(EnergyPlusFixture, SolarShadingTest_GetShadowingInputTest3) @@ -6050,7 +6050,7 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_GetShadowingInputTest3) EXPECT_EQ(expectedOverlaps, state->dataSolarShading->MaxHCS); EXPECT_TRUE(state->dataSysVars->SutherlandHodgman); EXPECT_TRUE(state->dataSysVars->SlaterBarsky); - EXPECT_EQ(state->dataSysVars->shadingMethod, ShadingMethod::PolygonClipping); + EXPECT_ENUM_EQ(state->dataSysVars->shadingMethod, ShadingMethod::PolygonClipping); } TEST_F(EnergyPlusFixture, SolarShadingTest_GetShadowingInputTest4) @@ -6083,7 +6083,7 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_GetShadowingInputTest4) EXPECT_EQ(expectedOverlaps, state->dataSolarShading->MaxHCS); EXPECT_FALSE(state->dataSysVars->SutherlandHodgman); EXPECT_FALSE(state->dataSysVars->SlaterBarsky); - EXPECT_EQ(state->dataSysVars->shadingMethod, ShadingMethod::PixelCounting); + EXPECT_ENUM_EQ(state->dataSysVars->shadingMethod, ShadingMethod::PixelCounting); } TEST_F(EnergyPlusFixture, SolarShadingTest_GetShadowingInputTest5) @@ -6116,7 +6116,7 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_GetShadowingInputTest5) EXPECT_EQ(expectedOverlaps, state->dataSolarShading->MaxHCS); EXPECT_TRUE(state->dataSysVars->SutherlandHodgman); EXPECT_FALSE(state->dataSysVars->SlaterBarsky); - EXPECT_EQ(state->dataSysVars->shadingMethod, ShadingMethod::PixelCounting); + EXPECT_ENUM_EQ(state->dataSysVars->shadingMethod, ShadingMethod::PixelCounting); } TEST_F(EnergyPlusFixture, SolarShadingTest_GetShadowingInputTest6) @@ -6150,7 +6150,7 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_GetShadowingInputTest6) EXPECT_EQ(expectedOverlaps, state->dataSolarShading->MaxHCS); EXPECT_TRUE(state->dataSysVars->SutherlandHodgman); EXPECT_TRUE(state->dataSysVars->SlaterBarsky); - EXPECT_EQ(state->dataSysVars->shadingMethod, ShadingMethod::PixelCounting); + EXPECT_ENUM_EQ(state->dataSysVars->shadingMethod, ShadingMethod::PixelCounting); std::string const error_string = delimited_string({" ** Warning ** ShadowCalculation: suspect Shading Calculation Update Frequency", " ** ~~~ ** Value entered=[56], Shadowing Calculations will be inaccurate."}); EXPECT_TRUE(compare_err_stream(error_string, true)); From c688048d23f55f76e73f386e0632122b6ca607d3 Mon Sep 17 00:00:00 2001 From: Rick Strand Date: Mon, 22 Jul 2024 06:38:04 -0500 Subject: [PATCH 07/14] 10299 Move a PixelCounting Check An error message was being skipped because of the movement of the Get part of the old routine. anyScheduledShadingSurface was not set yet so the error message was never produced. This change should fix this problem and eliminate the change in the .err file for SolarShadingTestGPU.idf. --- src/EnergyPlus/SolarShading.cc | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/EnergyPlus/SolarShading.cc b/src/EnergyPlus/SolarShading.cc index 4d2776e0156..e166aed955a 100644 --- a/src/EnergyPlus/SolarShading.cc +++ b/src/EnergyPlus/SolarShading.cc @@ -519,18 +519,6 @@ void GetShadowingInput(EnergyPlusData &state) state.dataSysVars->shadingMethod = ShadingMethod::PolygonClipping; } - if ((state.dataSysVars->shadingMethod == DataSystemVariables::ShadingMethod::PixelCounting) && - state.dataSolarShading->anyScheduledShadingSurface) { - ShowSevereError(state, "The Shading Calculation Method of choice is \"PixelCounting\"; "); - ShowContinueError(state, "and there is at least one shading surface of type "); - ShowContinueError(state, "Shading:Site:Detailed, Shading:Building:Detailed, or Shading:Zone:Detailed, "); - ShowContinueError(state, "that has an active transmittance schedule value greater than zero or may vary."); - ShowContinueError(state, "With \"PixelCounting\" Shading Calculation Method, the shading surfaces will be treated as "); - ShowContinueError(state, "completely opaque (transmittance = 0) during the shading calculation, "); - ShowContinueError(state, "which may result in inaccurate or unexpected results."); - ShowContinueError(state, "It is suggested switching to another Shading Calculation Method, such as \"PolygonClipping\"."); - } - aNum++; if (NumAlphas >= aNum) { if (Util::SameString(state.dataIPShortCut->cAlphaArgs(aNum), "Periodic")) { @@ -738,6 +726,18 @@ void processShadowingInput(EnergyPlusData &state) { // all shadow input processing that needed zones and surfaces to already be read into data (part of fix for Defect #10299) + if ((state.dataSysVars->shadingMethod == DataSystemVariables::ShadingMethod::PixelCounting) && + state.dataSolarShading->anyScheduledShadingSurface) { + ShowSevereError(state, "The Shading Calculation Method of choice is \"PixelCounting\"; "); + ShowContinueError(state, "and there is at least one shading surface of type "); + ShowContinueError(state, "Shading:Site:Detailed, Shading:Building:Detailed, or Shading:Zone:Detailed, "); + ShowContinueError(state, "that has an active transmittance schedule value greater than zero or may vary."); + ShowContinueError(state, "With \"PixelCounting\" Shading Calculation Method, the shading surfaces will be treated as "); + ShowContinueError(state, "completely opaque (transmittance = 0) during the shading calculation, "); + ShowContinueError(state, "which may result in inaccurate or unexpected results."); + ShowContinueError(state, "It is suggested switching to another Shading Calculation Method, such as \"PolygonClipping\"."); + } + if (state.dataSysVars->shadingMethod == DataSystemVariables::ShadingMethod::Imported) { int ExtShadingSchedNum; for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { From e5809d3edb87f5e7f2df3fbf122af6f49c9d4306 Mon Sep 17 00:00:00 2001 From: Rick Strand Date: Mon, 22 Jul 2024 14:39:47 -0500 Subject: [PATCH 08/14] 10299 Correction of Unit Test Errors A couple of issues were seen in ci results. This commit is an attempt to fix them. --- tst/EnergyPlus/unit/SolarShading.unit.cc | 29 ++++++++++++++++++------ 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/tst/EnergyPlus/unit/SolarShading.unit.cc b/tst/EnergyPlus/unit/SolarShading.unit.cc index c4bc0c9044b..1b1c9949b27 100644 --- a/tst/EnergyPlus/unit/SolarShading.unit.cc +++ b/tst/EnergyPlus/unit/SolarShading.unit.cc @@ -3900,18 +3900,18 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_Warn_Pixel_Count_and_TM_Schedule) SolarShading::processShadowingInput(*state); #ifdef EP_NO_OPENGL - EXPECT_EQ(state->dataErrTracking->TotalWarningErrors, 2); - EXPECT_EQ(state->dataErrTracking->TotalSevereErrors, 0); + EXPECT_EQ(state->dataErrTracking->TotalWarningErrors, 1); + EXPECT_EQ(state->dataErrTracking->TotalSevereErrors, 0; EXPECT_EQ(state->dataErrTracking->LastSevereError, ""); #else if (!Penumbra::Penumbra::is_valid_context()) { EXPECT_EQ(state->dataErrTracking->TotalWarningErrors, 2); - EXPECT_EQ(state->dataErrTracking->TotalSevereErrors, 0); - EXPECT_EQ(state->dataErrTracking->LastSevereError, ""); + EXPECT_EQ(state->dataErrTracking->TotalSevereErrors, 1); + EXPECT_EQ(state->dataErrTracking->LastSevereError, "The Shading Calculation Method of choice is \"PixelCounting\"; "); } else { EXPECT_EQ(state->dataErrTracking->TotalWarningErrors, 1); - EXPECT_EQ(state->dataErrTracking->TotalSevereErrors, 0); - EXPECT_EQ(state->dataErrTracking->LastSevereError, ""); + EXPECT_EQ(state->dataErrTracking->TotalSevereErrors, 1); + EXPECT_EQ(state->dataErrTracking->LastSevereError, "The Shading Calculation Method of choice is \"PixelCounting\"; "); } #endif } @@ -6151,7 +6151,22 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_GetShadowingInputTest6) EXPECT_TRUE(state->dataSysVars->SutherlandHodgman); EXPECT_TRUE(state->dataSysVars->SlaterBarsky); EXPECT_ENUM_EQ(state->dataSysVars->shadingMethod, ShadingMethod::PixelCounting); + +#ifdef EP_NO_OPENGL std::string const error_string = delimited_string({" ** Warning ** ShadowCalculation: suspect Shading Calculation Update Frequency", - " ** ~~~ ** Value entered=[56], Shadowing Calculations will be inaccurate."}); + " ** ~~~ ** Value entered=[56], Shadowing Calculations will be inaccurate.", + " ** Warning ** No GPU found (required for PixelCounting)", + " ** ~~~ ** PolygonClipping will be used instead"}); EXPECT_TRUE(compare_err_stream(error_string, true)); +#else + if (!Penumbra::Penumbra::is_valid_context()) { + std::string const error_string = delimited_string({" ** Warning ** ShadowCalculation: suspect Shading Calculation Update Frequency", + " ** ~~~ ** Value entered=[56], Shadowing Calculations will be inaccurate."}); + EXPECT_TRUE(compare_err_stream(error_string, true)); + } else { + std::string const error_string = delimited_string({" ** Warning ** ShadowCalculation: suspect Shading Calculation Update Frequency", + " ** ~~~ ** Value entered=[56], Shadowing Calculations will be inaccurate."}); + EXPECT_TRUE(compare_err_stream(error_string, true)); + } +#endif } From f7be7486ea9f8166aa0903064ea8b9ec350a9504 Mon Sep 17 00:00:00 2001 From: Rick Strand Date: Tue, 23 Jul 2024 06:20:48 -0500 Subject: [PATCH 09/14] 10299 Another Round of Unit Test Fixes Last round was closer to getting rid of all of the unit test fails. Hopefully this gets everything fixed up and ready to go. --- tst/EnergyPlus/unit/SolarShading.unit.cc | 52 ++++++++++++++++++++---- 1 file changed, 43 insertions(+), 9 deletions(-) diff --git a/tst/EnergyPlus/unit/SolarShading.unit.cc b/tst/EnergyPlus/unit/SolarShading.unit.cc index 1b1c9949b27..aa28eb96a4a 100644 --- a/tst/EnergyPlus/unit/SolarShading.unit.cc +++ b/tst/EnergyPlus/unit/SolarShading.unit.cc @@ -3892,22 +3892,33 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_Warn_Pixel_Count_and_TM_Schedule) EXPECT_EQ(state->dataSolarShading->anyScheduledShadingSurface, true); +#ifdef EP_NO_OPENGL EXPECT_EQ(state->dataErrTracking->AskForSurfacesReport, true); - EXPECT_EQ(state->dataErrTracking->TotalWarningErrors, 1); - // Expect no severe errors at this point + EXPECT_EQ(state->dataErrTracking->TotalWarningErrors, 2); EXPECT_EQ(state->dataErrTracking->TotalSevereErrors, 0); +#else + if (!Penumbra::Penumbra::is_valid_context()) { + EXPECT_EQ(state->dataErrTracking->AskForSurfacesReport, true); + EXPECT_EQ(state->dataErrTracking->TotalWarningErrors, 2); + EXPECT_EQ(state->dataErrTracking->TotalSevereErrors, 0); + } else { + EXPECT_EQ(state->dataErrTracking->AskForSurfacesReport, true); + EXPECT_EQ(state->dataErrTracking->TotalWarningErrors, 1); + EXPECT_EQ(state->dataErrTracking->TotalSevereErrors, 0); + } +#endif SolarShading::processShadowingInput(*state); #ifdef EP_NO_OPENGL - EXPECT_EQ(state->dataErrTracking->TotalWarningErrors, 1); + EXPECT_EQ(state->dataErrTracking->TotalWarningErrors, 2); EXPECT_EQ(state->dataErrTracking->TotalSevereErrors, 0; EXPECT_EQ(state->dataErrTracking->LastSevereError, ""); #else if (!Penumbra::Penumbra::is_valid_context()) { EXPECT_EQ(state->dataErrTracking->TotalWarningErrors, 2); - EXPECT_EQ(state->dataErrTracking->TotalSevereErrors, 1); - EXPECT_EQ(state->dataErrTracking->LastSevereError, "The Shading Calculation Method of choice is \"PixelCounting\"; "); + EXPECT_EQ(state->dataErrTracking->TotalSevereErrors, 0); + EXPECT_EQ(state->dataErrTracking->LastSevereError, ""); } else { EXPECT_EQ(state->dataErrTracking->TotalWarningErrors, 1); EXPECT_EQ(state->dataErrTracking->TotalSevereErrors, 1); @@ -6083,7 +6094,16 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_GetShadowingInputTest4) EXPECT_EQ(expectedOverlaps, state->dataSolarShading->MaxHCS); EXPECT_FALSE(state->dataSysVars->SutherlandHodgman); EXPECT_FALSE(state->dataSysVars->SlaterBarsky); - EXPECT_ENUM_EQ(state->dataSysVars->shadingMethod, ShadingMethod::PixelCounting); + +#ifdef EP_NO_OPENGL + EXPECT_ENUM_EQ(state->dataSysVars->shadingMethod, ShadingMethod::PolygonClipping); +#else + if (!Penumbra::Penumbra::is_valid_context()) { + EXPECT_ENUM_EQ(state->dataSysVars->shadingMethod, ShadingMethod::PolygonClipping); + } else { + EXPECT_ENUM_EQ(state->dataSysVars->shadingMethod, ShadingMethod::PixelCounting); + } +#endif } TEST_F(EnergyPlusFixture, SolarShadingTest_GetShadowingInputTest5) @@ -6116,7 +6136,16 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_GetShadowingInputTest5) EXPECT_EQ(expectedOverlaps, state->dataSolarShading->MaxHCS); EXPECT_TRUE(state->dataSysVars->SutherlandHodgman); EXPECT_FALSE(state->dataSysVars->SlaterBarsky); - EXPECT_ENUM_EQ(state->dataSysVars->shadingMethod, ShadingMethod::PixelCounting); + +#ifdef EP_NO_OPENGL + EXPECT_ENUM_EQ(state->dataSysVars->shadingMethod, ShadingMethod::PolygonClipping); +#else + if (!Penumbra::Penumbra::is_valid_context()) { + EXPECT_ENUM_EQ(state->dataSysVars->shadingMethod, ShadingMethod::PolygonClipping); + } else { + EXPECT_ENUM_EQ(state->dataSysVars->shadingMethod, ShadingMethod::PixelCounting); + } +#endif } TEST_F(EnergyPlusFixture, SolarShadingTest_GetShadowingInputTest6) @@ -6150,7 +6179,6 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_GetShadowingInputTest6) EXPECT_EQ(expectedOverlaps, state->dataSolarShading->MaxHCS); EXPECT_TRUE(state->dataSysVars->SutherlandHodgman); EXPECT_TRUE(state->dataSysVars->SlaterBarsky); - EXPECT_ENUM_EQ(state->dataSysVars->shadingMethod, ShadingMethod::PixelCounting); #ifdef EP_NO_OPENGL std::string const error_string = delimited_string({" ** Warning ** ShadowCalculation: suspect Shading Calculation Update Frequency", @@ -6158,15 +6186,21 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_GetShadowingInputTest6) " ** Warning ** No GPU found (required for PixelCounting)", " ** ~~~ ** PolygonClipping will be used instead"}); EXPECT_TRUE(compare_err_stream(error_string, true)); + EXPECT_ENUM_EQ(state->dataSysVars->shadingMethod, ShadingMethod::PolygonClipping); + #else if (!Penumbra::Penumbra::is_valid_context()) { std::string const error_string = delimited_string({" ** Warning ** ShadowCalculation: suspect Shading Calculation Update Frequency", - " ** ~~~ ** Value entered=[56], Shadowing Calculations will be inaccurate."}); + " ** ~~~ ** Value entered=[56], Shadowing Calculations will be inaccurate.", + " ** Warning ** No GPU found (required for PixelCounting)", + " ** ~~~ ** PolygonClipping will be used instead"}); EXPECT_TRUE(compare_err_stream(error_string, true)); + EXPECT_ENUM_EQ(state->dataSysVars->shadingMethod, ShadingMethod::PolygonClipping); } else { std::string const error_string = delimited_string({" ** Warning ** ShadowCalculation: suspect Shading Calculation Update Frequency", " ** ~~~ ** Value entered=[56], Shadowing Calculations will be inaccurate."}); EXPECT_TRUE(compare_err_stream(error_string, true)); + EXPECT_ENUM_EQ(state->dataSysVars->shadingMethod, ShadingMethod::PixelCounting); } #endif } From 0a0aa68b8497ee4874c39aca38ccb7113a18c06e Mon Sep 17 00:00:00 2001 From: Rick Strand Date: Tue, 23 Jul 2024 14:50:21 -0500 Subject: [PATCH 10/14] 10299 Get Rid of Unneeded Get Flag A get flag was added early on during work on this defect. It is not necessary and may be causing some issues with API runs. Even if that isn't the problem, there is no reason to keep this flag/code--it's unnecessary. --- src/EnergyPlus/SolarShading.cc | 5 ----- src/EnergyPlus/SolarShading.hh | 1 - 2 files changed, 6 deletions(-) diff --git a/src/EnergyPlus/SolarShading.cc b/src/EnergyPlus/SolarShading.cc index e166aed955a..638d1b57f25 100644 --- a/src/EnergyPlus/SolarShading.cc +++ b/src/EnergyPlus/SolarShading.cc @@ -411,11 +411,6 @@ void GetShadowingInput(EnergyPlusData &state) using DataSystemVariables::ShadingMethod; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - if (state.dataSolarShading->getShadowingCalculationInput) { - state.dataSolarShading->getShadowingCalculationInput = false; - } else { - return; - } int NumItems; int NumNumbers; int NumAlphas; diff --git a/src/EnergyPlus/SolarShading.hh b/src/EnergyPlus/SolarShading.hh index bd466b327bf..5e3d62e5f41 100644 --- a/src/EnergyPlus/SolarShading.hh +++ b/src/EnergyPlus/SolarShading.hh @@ -437,7 +437,6 @@ struct SolarShadingData : BaseGlobalStruct #endif bool GetInputFlag = true; - bool getShadowingCalculationInput = true; bool anyScheduledShadingSurface = false; bool firstTime = true; bool debugging = false; From 5664dfa35f5109fa181cda55195411e046550703 Mon Sep 17 00:00:00 2001 From: Rick Strand Date: Wed, 24 Jul 2024 06:59:33 -0500 Subject: [PATCH 11/14] 10299 Clang Format Final Missed clang formatting on a file... --- src/EnergyPlus/DataSystemVariables.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/EnergyPlus/DataSystemVariables.hh b/src/EnergyPlus/DataSystemVariables.hh index 156d628ab01..e8506ce2439 100644 --- a/src/EnergyPlus/DataSystemVariables.hh +++ b/src/EnergyPlus/DataSystemVariables.hh @@ -115,8 +115,8 @@ struct SystemVarsData : BaseGlobalStruct bool DisableSelfShadingWithinGroup = false; bool DisableSelfShadingBetweenGroup = false; - int shadingGroupsNum = 0; // number of shading groups - Array1D_string zoneName; // array of zone names in user input + int shadingGroupsNum = 0; // number of shading groups + Array1D_string zoneName; // array of zone names in user input bool TrackAirLoopEnvFlag = false; // If TRUE generates a file with runtime statistics for each HVAC // controller on each air loop From a0cff9a04860e25e5091e1048f18b31a36038ba7 Mon Sep 17 00:00:00 2001 From: Rick Strand Date: Wed, 24 Jul 2024 15:25:33 -0500 Subject: [PATCH 12/14] 10299 Request to Improve Variable Name Addressed review request to change the name of a variable to be more descriptive. --- src/EnergyPlus/DataSystemVariables.hh | 4 ++-- src/EnergyPlus/SolarShading.cc | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/EnergyPlus/DataSystemVariables.hh b/src/EnergyPlus/DataSystemVariables.hh index e8506ce2439..5d4eedc1c54 100644 --- a/src/EnergyPlus/DataSystemVariables.hh +++ b/src/EnergyPlus/DataSystemVariables.hh @@ -115,8 +115,8 @@ struct SystemVarsData : BaseGlobalStruct bool DisableSelfShadingWithinGroup = false; bool DisableSelfShadingBetweenGroup = false; - int shadingGroupsNum = 0; // number of shading groups - Array1D_string zoneName; // array of zone names in user input + int shadingGroupsNum = 0; // number of shading groups + Array1D_string shadingGroupZoneListNames; // array of zone names in user input bool TrackAirLoopEnvFlag = false; // If TRUE generates a file with runtime statistics for each HVAC // controller on each air loop diff --git a/src/EnergyPlus/SolarShading.cc b/src/EnergyPlus/SolarShading.cc index 638d1b57f25..6c95f90459a 100644 --- a/src/EnergyPlus/SolarShading.cc +++ b/src/EnergyPlus/SolarShading.cc @@ -658,9 +658,9 @@ void GetShadowingInput(EnergyPlusData &state) aNum++; state.dataSysVars->shadingGroupsNum = NumAlphas - (aNum - 1); - state.dataSysVars->zoneName.allocate(state.dataSysVars->shadingGroupsNum); + state.dataSysVars->shadingGroupZoneListNames.allocate(state.dataSysVars->shadingGroupsNum); for (int numZone = 1; numZone <= state.dataSysVars->shadingGroupsNum; ++numZone) { - state.dataSysVars->zoneName(numZone) = state.dataIPShortCut->cAlphaArgs(aNum - 1 + numZone); + state.dataSysVars->shadingGroupZoneListNames(numZone) = state.dataIPShortCut->cAlphaArgs(aNum - 1 + numZone); } if (!state.dataSysVars->DetailedSolarTimestepIntegration && state.dataSurface->ShadingTransmittanceVaries && @@ -757,7 +757,8 @@ void processShadowingInput(EnergyPlusData &state) if (NumOfShadingGroups > 0) { DisableSelfShadingGroups.allocate(NumOfShadingGroups); for (int i = 1; i <= NumOfShadingGroups; i++) { - Found = Util::FindItemInList(state.dataSysVars->zoneName(i), state.dataHeatBal->ZoneList, state.dataHeatBal->NumOfZoneLists); + Found = Util::FindItemInList( + state.dataSysVars->shadingGroupZoneListNames(i), state.dataHeatBal->ZoneList, state.dataHeatBal->NumOfZoneLists); if (Found != 0) DisableSelfShadingGroups(i) = Found; } From ef9b8161be68fc976213e30bd05fbb4896ad0c31 Mon Sep 17 00:00:00 2001 From: Rick Strand Date: Wed, 24 Jul 2024 21:49:05 -0500 Subject: [PATCH 13/14] 10299 Back Out Variable Name Change Something not quite right about this simply variable name change. Things went from expected diffs only to "unexpected" diffs. --- src/EnergyPlus/DataSystemVariables.hh | 4 ++-- src/EnergyPlus/SolarShading.cc | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/EnergyPlus/DataSystemVariables.hh b/src/EnergyPlus/DataSystemVariables.hh index 5d4eedc1c54..e8506ce2439 100644 --- a/src/EnergyPlus/DataSystemVariables.hh +++ b/src/EnergyPlus/DataSystemVariables.hh @@ -115,8 +115,8 @@ struct SystemVarsData : BaseGlobalStruct bool DisableSelfShadingWithinGroup = false; bool DisableSelfShadingBetweenGroup = false; - int shadingGroupsNum = 0; // number of shading groups - Array1D_string shadingGroupZoneListNames; // array of zone names in user input + int shadingGroupsNum = 0; // number of shading groups + Array1D_string zoneName; // array of zone names in user input bool TrackAirLoopEnvFlag = false; // If TRUE generates a file with runtime statistics for each HVAC // controller on each air loop diff --git a/src/EnergyPlus/SolarShading.cc b/src/EnergyPlus/SolarShading.cc index 6c95f90459a..638d1b57f25 100644 --- a/src/EnergyPlus/SolarShading.cc +++ b/src/EnergyPlus/SolarShading.cc @@ -658,9 +658,9 @@ void GetShadowingInput(EnergyPlusData &state) aNum++; state.dataSysVars->shadingGroupsNum = NumAlphas - (aNum - 1); - state.dataSysVars->shadingGroupZoneListNames.allocate(state.dataSysVars->shadingGroupsNum); + state.dataSysVars->zoneName.allocate(state.dataSysVars->shadingGroupsNum); for (int numZone = 1; numZone <= state.dataSysVars->shadingGroupsNum; ++numZone) { - state.dataSysVars->shadingGroupZoneListNames(numZone) = state.dataIPShortCut->cAlphaArgs(aNum - 1 + numZone); + state.dataSysVars->zoneName(numZone) = state.dataIPShortCut->cAlphaArgs(aNum - 1 + numZone); } if (!state.dataSysVars->DetailedSolarTimestepIntegration && state.dataSurface->ShadingTransmittanceVaries && @@ -757,8 +757,7 @@ void processShadowingInput(EnergyPlusData &state) if (NumOfShadingGroups > 0) { DisableSelfShadingGroups.allocate(NumOfShadingGroups); for (int i = 1; i <= NumOfShadingGroups; i++) { - Found = Util::FindItemInList( - state.dataSysVars->shadingGroupZoneListNames(i), state.dataHeatBal->ZoneList, state.dataHeatBal->NumOfZoneLists); + Found = Util::FindItemInList(state.dataSysVars->zoneName(i), state.dataHeatBal->ZoneList, state.dataHeatBal->NumOfZoneLists); if (Found != 0) DisableSelfShadingGroups(i) = Found; } From 08909a8817b679e9c4d2898e559a6c25f01fe242 Mon Sep 17 00:00:00 2001 From: Rick Strand Date: Thu, 25 Jul 2024 06:48:14 -0500 Subject: [PATCH 14/14] 10299 Attempt 2 at Variable Rename Trying again to rename a variable. This seemed to cause a lot of issues yesterday, but was that because of changes to develop that were happening at the same time? --- src/EnergyPlus/DataSystemVariables.hh | 4 ++-- src/EnergyPlus/SolarShading.cc | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/EnergyPlus/DataSystemVariables.hh b/src/EnergyPlus/DataSystemVariables.hh index e8506ce2439..5d4eedc1c54 100644 --- a/src/EnergyPlus/DataSystemVariables.hh +++ b/src/EnergyPlus/DataSystemVariables.hh @@ -115,8 +115,8 @@ struct SystemVarsData : BaseGlobalStruct bool DisableSelfShadingWithinGroup = false; bool DisableSelfShadingBetweenGroup = false; - int shadingGroupsNum = 0; // number of shading groups - Array1D_string zoneName; // array of zone names in user input + int shadingGroupsNum = 0; // number of shading groups + Array1D_string shadingGroupZoneListNames; // array of zone names in user input bool TrackAirLoopEnvFlag = false; // If TRUE generates a file with runtime statistics for each HVAC // controller on each air loop diff --git a/src/EnergyPlus/SolarShading.cc b/src/EnergyPlus/SolarShading.cc index 638d1b57f25..6c95f90459a 100644 --- a/src/EnergyPlus/SolarShading.cc +++ b/src/EnergyPlus/SolarShading.cc @@ -658,9 +658,9 @@ void GetShadowingInput(EnergyPlusData &state) aNum++; state.dataSysVars->shadingGroupsNum = NumAlphas - (aNum - 1); - state.dataSysVars->zoneName.allocate(state.dataSysVars->shadingGroupsNum); + state.dataSysVars->shadingGroupZoneListNames.allocate(state.dataSysVars->shadingGroupsNum); for (int numZone = 1; numZone <= state.dataSysVars->shadingGroupsNum; ++numZone) { - state.dataSysVars->zoneName(numZone) = state.dataIPShortCut->cAlphaArgs(aNum - 1 + numZone); + state.dataSysVars->shadingGroupZoneListNames(numZone) = state.dataIPShortCut->cAlphaArgs(aNum - 1 + numZone); } if (!state.dataSysVars->DetailedSolarTimestepIntegration && state.dataSurface->ShadingTransmittanceVaries && @@ -757,7 +757,8 @@ void processShadowingInput(EnergyPlusData &state) if (NumOfShadingGroups > 0) { DisableSelfShadingGroups.allocate(NumOfShadingGroups); for (int i = 1; i <= NumOfShadingGroups; i++) { - Found = Util::FindItemInList(state.dataSysVars->zoneName(i), state.dataHeatBal->ZoneList, state.dataHeatBal->NumOfZoneLists); + Found = Util::FindItemInList( + state.dataSysVars->shadingGroupZoneListNames(i), state.dataHeatBal->ZoneList, state.dataHeatBal->NumOfZoneLists); if (Found != 0) DisableSelfShadingGroups(i) = Found; }