-
Notifications
You must be signed in to change notification settings - Fork 391
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
Address 24.2 EMPD Issue #10781
Address 24.2 EMPD Issue #10781
Changes from all commits
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 |
---|---|---|
|
@@ -249,9 +249,9 @@ void GetMoistureBalanceEMPDInput(EnergyPlusData &state) | |
|
||
auto const &constr = state.dataConstruction->Construct(surf.Construction); | ||
auto const *mat = dynamic_cast<const MaterialEMPD *>(s_mat->materials(constr.LayerPoint(constr.TotLayers))); | ||
assert(mat != nullptr); | ||
// assert(mat != nullptr); | ||
|
||
if (mat->mu > 0.0 && surf.Zone > 0) { | ||
if (mat && mat->mu > 0.0 && surf.Zone > 0) { | ||
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. Instead, let's just check that mat is real before accessing it. This will properly pass if the inside layer has EMPD stuff. And it will properly result in a warning message if the layer does not have EMPD stuff. This works happily now. 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. Just curious, why not not the hasEMPD boolean? isn't what it's for? |
||
EMPDzone(surf.Zone) = true; | ||
} else { | ||
++state.dataMoistureBalEMPD->ErrCount; | ||
|
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.
The way things are structured now, it's totally fine for this to result in a nullptr. If the material doesn't have any EMPD properties, that's fine. So we shouldn't do a hard assertion.