Skip to content

Commit

Permalink
Add Pixel Counting Resolution field.
Browse files Browse the repository at this point in the history
  • Loading branch information
nealkruis committed Jun 6, 2019
1 parent f3d0cab commit 6f02d69
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 14 deletions.
10 changes: 6 additions & 4 deletions idd/Energy+.idd.in
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ ShadowCalculation,
\extensible:1
A1 , \field Shading Calculation Method
\note Select between CPU-based polygon clipping method, the GPU-based pixel counting method,
\note or an external shading method.
\note or importing from external shading data.
\note If PixelCounting is selected and GPU hardware (or GPU emulation) is not available, a warning will be
\note displayed and EnergyPlus will revert to PolygonClipping.
\note If Scheduled is chosen, the External Shading Fraction Schedule Name is required
Expand All @@ -535,9 +535,7 @@ ShadowCalculation,
\minimum 1
\default 20
\note enter number of days
\note this field is only used if the previous field is set to AverageOverDaysInFrequency
\note 0=Use Default Periodic Calculation|<else> calculate every <value> day
\note only really applicable to RunPeriods
\note this field is only used if the previous field is set to Periodic
\note warning issued if >31
N2 , \field Maximum Figures in Shadow Overlap Calculations
\note Number of allowable figures in shadow overlap in PolygonClipping calculations
Expand All @@ -551,6 +549,10 @@ ShadowCalculation,
\key ConvexWeilerAtherton
\key SutherlandHodgman
\default SutherlandHodgman
N3 , \field Pixel Counting Resolution
\note Number of pixels in both dimensions of the surface rendering
\type integer
\default 512
A4 , \field Sky Diffuse Modeling Algorithm
\note Advanced Feature. Internal default is SimpleSkyDiffuseModeling
\note If you have shading elements that change transmittance over the
Expand Down
8 changes: 7 additions & 1 deletion src/EnergyPlus/SolarShading.cc
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,13 @@ namespace SolarShading {
} else if (UtilityRoutines::SameString(cAlphaArgs(aNum), "PixelCounting")) {
shadingMethod = ShadingMethod::PixelCounting;
cAlphaArgs(aNum) = "PixelCounting";
penumbra = std::unique_ptr<Pumbra::Penumbra>(new Pumbra::Penumbra(512u));
unsigned pixelRes;
if (NumNumbers >= 3) {
pixelRes = (unsigned)rNumericArgs(3);
} else {
pixelRes = 512u;
}
penumbra = std::unique_ptr<Pumbra::Penumbra>(new Pumbra::Penumbra(pixelRes));
} else {
ShowWarningError(cCurrentModuleObject + ": invalid " + cAlphaFieldNames(aNum));
ShowContinueError("Value entered=\"" + cAlphaArgs(aNum) + "\", PolygonClipping will be used.");
Expand Down
1 change: 1 addition & 0 deletions testfiles/SolarShadingTest_DisableSelfShading.idf
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,7 @@
1, !- Shading Calculation Update Frequency
, !- Maximum Figures in Shadow Overlap Calculations
, !- Polygon Clipping Algorithm
, !- Pixel Counting Resolution
, !- Sky Diffuse Modeling Algorithm
, !- Output External Shading Calculation Results
Yes, !- Disable Self-Shading Within Shading Zone Groups
Expand Down
1 change: 1 addition & 0 deletions testfiles/SolarShadingTest_DisableSelfShadingGroup.idf
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,7 @@
1, !- Shading Calculation Update Frequency
, !- Maximum Figures in Shadow Overlap Calculations
, !- Polygon Clipping Algorithm
, !- Pixel Counting Resolution
, !- Sky Diffuse Modeling Algorithm
, !- Output External Shading Calculation Results
Yes, !- Disable Self-Shading Within Shading Zone Groups
Expand Down
1 change: 1 addition & 0 deletions testfiles/SolarShadingTest_ExternalFraction.idf
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,7 @@
1, !- Shading Calculation Update Frequency
, !- Maximum Figures in Shadow Overlap Calculations
, !- Polygon Clipping Algorithm
, !- Pixel Counting Resolution
, !- Sky Diffuse Modeling Algorithm
Yes; !- Output External Shading Calculation Results

Expand Down
1 change: 1 addition & 0 deletions testfiles/SolarShadingTest_ImportedShading.idf
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@
1, !- Shading Calculation Update Frequency
, !- Maximum Figures in Shadow Overlap Calculations
, !- Polygon Clipping Algorithm
, !- Pixel Counting Resolution
, !- Sky Diffuse Modeling Algorithm
No; !- Output External Shading Calculation Results

Expand Down
1 change: 1 addition & 0 deletions tst/EnergyPlus/unit/AirTerminalSingleDuctPIUReheat.unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctSeriesPIU_SimTest)
" , !- Shading Calculation Update Frequency",
" 15000, !- Maximum Figures in Shadow Overlap Calculations",
" , !- Polygon Clipping Algorithm",
" , !- Pixel Counting Resolution",
" SimpleSkyDiffuseModeling;!- Sky Diffuse Modeling Algorithm",

"SurfaceConvectionAlgorithm:Inside,",
Expand Down
21 changes: 12 additions & 9 deletions tst/EnergyPlus/unit/SolarShading.unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -308,11 +308,12 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_FigureSolarBeamAtTimestep)
" , !- Maximum Number of Warmup Days ",
" 6; !- Minimum Number of Warmup Days ",
" ShadowCalculation, ",
" PolygonClipping, !- Shading Calculation Method ",
" Timestep, !- Shading Calculation Update Frequency Method ",
" , !- Shading Calculation Update Frequency ",
" PolygonClipping, !- Shading Calculation Method ",
" Timestep, !- Shading Calculation Update Frequency Method ",
" , !- Shading Calculation Update Frequency ",
" , !- Maximum Figures in Shadow Overlap Calculations ",
" , !- Polygon Clipping Algorithm ",
" , !- Pixel Counting Resolution ",
" DetailedSkyDiffuseModeling; !- Sky Diffuse Modeling Algorithm ",
" SurfaceConvectionAlgorithm:Inside,TARP; ",
" SurfaceConvectionAlgorithm:Outside,TARP; ",
Expand Down Expand Up @@ -686,11 +687,12 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_ExternalShadingIO)
" , !- Maximum Number of Warmup Days ",
" 6; !- Minimum Number of Warmup Days ",
" ShadowCalculation, ",
" Scheduled, !- Shading Calculation Method ",
" Timestep, !- Shading Calculation Update Frequency Method ",
" , !- Shading Calculation Update Frequency ",
" Scheduled, !- Shading Calculation Method ",
" Timestep, !- Shading Calculation Update Frequency Method ",
" , !- Shading Calculation Update Frequency ",
" , !- Maximum Figures in Shadow Overlap Calculations ",
" , !- Polygon Clipping Algorithm ",
" , !- Pixel Counting Resolution ",
" DetailedSkyDiffuseModeling, !- Sky Diffuse Modeling Algorithm ",
" Yes; !- Output External Shading Calculation Results ",
" SurfaceConvectionAlgorithm:Inside,TARP; ",
Expand Down Expand Up @@ -1092,11 +1094,12 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_DisableGroupSelfShading)
" , !- Maximum Number of Warmup Days ",
" 6; !- Minimum Number of Warmup Days ",
" ShadowCalculation, ",
" PolygonClipping, !- Shading Calculation Method ",
" Timestep, !- Shading Calculation Update Frequency Method ",
" , !- Shading Calculation Update Frequency ",
" PolygonClipping, !- Shading Calculation Method ",
" Timestep, !- Shading Calculation Update Frequency Method ",
" , !- Shading Calculation Update Frequency ",
" , !- Maximum Figures in Shadow Overlap Calculations ",
" , !- Polygon Clipping Algorithm ",
" , !- Pixel Counting Resolution ",
" , !- Sky Diffuse Modeling Algorithm ",
" , !- Output External Shading Calculation Results ",
" Yes, !- Disable Shading within A Zone Group ",
Expand Down

7 comments on commit 6f02d69

@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.

penumbra-integration (nealkruis) - x86_64-Linux-Ubuntu-18.04-gcc-7.4: Build Failed

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.

penumbra-integration (nealkruis) - x86_64-Linux-Ubuntu-18.04-custom_check: OK (6 of 6 tests passed, 0 test warnings)

Build 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.

penumbra-integration (nealkruis) - x86_64-Linux-Ubuntu-18.04-gcc-7.4-UnitTestsCoverage-Debug: Build Failed

Build Badge Test Badge Coverage 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.

penumbra-integration (nealkruis) - x86_64-Linux-Ubuntu-18.04-gcc-7.4-IntegrationCoverage-Debug: Build Failed

Build Badge Test Badge Coverage 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.

penumbra-integration (nealkruis) - x86_64-Linux-Ubuntu-18.04-cppcheck: OK (0 of 0 tests passed, 0 test warnings)

Build Badge

@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.

penumbra-integration (nealkruis) - x86_64-MacOS-10.13-clang: Tests Failed (1869 of 2408 tests passed, 116 test warnings)

Messages:\n

  • 655 tests had: EIO diffs.
  • 537 tests had: Table big diffs.
  • 141 tests had: BND diffs.
  • 10 tests had: ERR diffs.
  • 96 tests had: MDD diffs.
  • 102 tests had: MTD diffs.
  • 98 tests had: RDD diffs.
  • 4 tests had: AUD diffs.
  • 5 tests had: ESO big diffs.
  • 3 tests had: SSZ big diffs.
  • 3 tests had: ZSZ big diffs.
  • 1 test had: MTR small diffs.
  • 3 tests had: MTR big diffs.

Failures:\n

regression Test Summary

  • Passed: 116
  • Failed: 539

Build Badge Test 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.

penumbra-integration (nealkruis) - Win64-Windows-10-VisualStudio-16: Tests Failed (1868 of 2408 tests passed, 117 test warnings)

Messages:\n

  • 655 tests had: EIO diffs.
  • 536 tests had: Table big diffs.
  • 141 tests had: BND diffs.
  • 10 tests had: ERR diffs.
  • 96 tests had: MDD diffs.
  • 102 tests had: MTD diffs.
  • 98 tests had: RDD diffs.
  • 4 tests had: AUD diffs.
  • 5 tests had: ESO big diffs.
  • 3 tests had: SSZ big diffs.
  • 3 tests had: ZSZ big diffs.
  • 2 tests had: MTR small diffs.
  • 3 tests had: MTR big diffs.

Failures:\n

regression Test Summary

  • Passed: 117
  • Failed: 538

Build Badge Test Badge

Please sign in to comment.