-
Notifications
You must be signed in to change notification settings - Fork 394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix array bounds error for interzone windows and fix convexity of mirrored surfaces #10498
Changes from 11 commits
17c808c
7461b39
c40c608
bcf2046
259849e
2a93689
85662bb
28ec9eb
b5d41cf
c4fd8dc
57e23ee
ebe5fee
7243d5a
06b60e4
d36f8ba
231b3b1
72f29f7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,7 +74,6 @@ namespace EnergyPlus::DataSurfaces { | |
// Dec 2006, DJS (PSU) added logical ecoroof variable | ||
// Dec 2008, TH added new properties to SurfaceWindowCalc for thermochromic windows | ||
// Jul 2011, M.J. Witte and C.O. Pedersen, add new fields to OSC for last T, max and min | ||
// RE-ENGINEERED na | ||
|
||
// Using/Aliasing | ||
using namespace DataVectorTypes; | ||
|
@@ -88,15 +87,6 @@ using namespace WindowManager; | |
|
||
Array1D_string const cExtBoundCondition({-6, 0}, {"KivaFoundation", "FCGround", "OSCM", "OSC", "OSC", "Ground", "ExternalEnvironment"}); | ||
|
||
// Parameters to indicate surface classes | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed some comments that were left behind at some point when the parameters were moved to an |
||
// Surface Class (FLOOR, WALL, ROOF (incl's CEILING), WINDOW, DOOR, GLASSDOOR, | ||
// SHADING (includes OVERHANG, WING), DETACHED, INTMASS), | ||
// TDD:DOME, TDD:DIFFUSER (for tubular daylighting device) | ||
// (Note: GLASSDOOR and TDD:DIFFUSER get overwritten as WINDOW | ||
// in SurfaceGeometry.cc, SurfaceWindow%OriginalClass holds the true value) | ||
// why aren't these sequential (LKL - 13 Aug 2007) | ||
|
||
// Constructor | ||
Surface2D::Surface2D(ShapeCat const shapeCat, int const axis, Vertices const &v, Vector2D const &vl, Vector2D const &vu) | ||
: axis(axis), vertices(v), vl(vl), vu(vu) | ||
{ | ||
|
@@ -180,7 +170,7 @@ Surface2D::Surface2D(ShapeCat const shapeCat, int const axis, Vertices const &v, | |
xt = xte; | ||
} | ||
#endif | ||
assert((shapeCat == ShapeCat::Nonconvex) || (crossEdges.size() == 2)); | ||
assert((shapeCat == ShapeCat::Nonconvex) || (crossEdges.size() == 2u)); | ||
Comment on lines
-183
to
+173
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the assert that was failing. Initially, I thought it was incorrect and should be |
||
for (auto const &edge : crossEdges) { | ||
size_type const iEdge(std::get<2>(edge)); | ||
slab.edges.push_back(iEdge); // Add edge to slab | ||
|
@@ -470,7 +460,7 @@ Surface2D SurfaceData::computed_surface2d() const | |
|
||
Real64 SurfaceData::get_average_height(EnergyPlusData &state) const | ||
{ | ||
if (std::abs(SinTilt) < 1.e-4) { | ||
if (std::abs(SinTilt) < Constant::DistTooSmall) { | ||
return 0.0; | ||
} | ||
using Vertex2D = ObjexxFCL::Vector2<Real64>; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -311,7 +311,7 @@ namespace SolarReflectionManager { | |
ObsVec = state.dataSurface->Surface(ObsSurfNum).Vertex(loop); | ||
DotProd = dot(state.dataSolarReflectionManager->SolReflRecSurf(RecSurfNum).NormVec, ObsVec - RecVec); | ||
// CR8251 IF(DotProd > 0.01d0) THEN ! This obstructing-surface vertex is not behind receiving surface | ||
if (DotProd > 1.0e-6) { // This obstructing-surface vertex is not behind receiving surface | ||
if (DotProd > Constant::OneMillionth) { // This obstructing-surface vertex is not behind receiving surface | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, that's actually really satisfying to read like this. |
||
ObsBehindRec = false; | ||
break; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some new constants that are used as tolerances in various places in surface geometry and shadowing calculations.
DistToolSmall
was moved up from a local declaration in Vectors.cc - decided to keep the same name.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does DistTooSmall represent a unit or is it dimensionless?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good questions. After some digging, it's in meters. And after some discussion with @JasonGlazer about other geometric tolerances, I'm going to make some other changes. How do you feel about names like this?
Real64 constexpr 1centimeter = 0.01 // Distance tolerance [m]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I mean that exact name won't compile since it starts with a numeric literal :) But I think
oneCentimeter
is fine. Or you could just call it oneHundredth and allow it to be used for multiple units. As long as it's pretty obvious I'm not too picky.