Skip to content
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

Polygon with crossed edges fails debug assert but runs without error in release build #10820

Open
1 of 3 tasks
mjwitte opened this issue Nov 13, 2024 · 1 comment
Open
1 of 3 tasks

Comments

@mjwitte
Copy link
Contributor

mjwitte commented Nov 13, 2024

Issue overview

User file fails debug assert here on line 167.

#ifndef NDEBUG // Check x_bot and x_top are also sorted
Real64 xb(std::get<0>(crossEdges[0]));
Real64 xt(std::get<1>(crossEdges[0]));
Real64 const tol(1.0e-9 * std::max(std::abs(xl), std::abs(xu))); // EnergyPlus vertex precision is not tight so tolerance isn't either
for (auto const &edge : crossEdges) { // Detect non-simple polygon with crossing edges
Real64 const xbe(std::get<0>(edge));
Real64 const xte(std::get<1>(edge));
assert(xb <= xbe + tol);
assert(xt <= xte + tol);
xb = xbe;
xt = xte;
}
#endif

On this surface:

  BuildingSurface:Detailed,
    Surface 224,             !- Name
    Floor,                   !- Surface Type
    INT-FLOOR-TOPSIDE,       !- Construction Name
    Thermal Zone: Space 1001,!- Zone Name
    ,                        !- Space Name
    Adiabatic,               !- Outside Boundary Condition
    Surface 223,             !- Outside Boundary Condition Object
    NoSun,                   !- Sun Exposure
    NoWind,                  !- Wind Exposure
    ,                        !- View Factor to Ground
    4,                       !- Number of Vertices
    4.40088749474129,4.35091266558963,0,  !- X,Y,Z ==> Vertex 1 {m}
    31.1368348989344,-24.4473381871601,0,  !- X,Y,Z ==> Vertex 2 {m}
    26.4975013986653,-29.0874436400291,0,  !- X,Y,Z ==> Vertex 3 {m}
    32.5936992035615,-35.8668490379663,0;  !- X,Y,Z ==> Vertex 4 {m}

Which looks like this:
image

Shouldn't this be a fatal surface error?

Details

Some additional details for this issue (if relevant):

  • Platform (Operating system, version)
  • Version of EnergyPlus (if using an intermediate build, include SHA)
  • Helpdesk ticket number 16795

Checklist

Add to this list or remove from it as applicable. This is a simple templated set of guidelines.

  • Defect file added EnergyPlusDevSupport\DefectFiles
  • Ticket added to EnergyPlus Defect Complexity (Github Project)
  • Pull request created (the pull request will have additional tasks related to reviewing changes that fix this defect)
@jmarrec
Copy link
Contributor

jmarrec commented Dec 16, 2024

I would think the original intent was that this check is expensive-ish, and shouldn't penalize everyone?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants