Skip to content

Commit

Permalink
Adjust logic for setting implicit complement in entHandles
Browse files Browse the repository at this point in the history
  • Loading branch information
pshriwise committed Jan 11, 2024
1 parent 0ac87d8 commit 928c606
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions src/dagmc/DagMC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -924,19 +924,18 @@ ErrorCode DagMC::build_indices(Range& surfs, Range& vols) {
// be checked before the implicit complement
EntityHandle implicit_complement {0};
rval = geom_tool()->get_implicit_complement(implicit_complement);
if (rval != MB_SUCCESS || implicit_complement == 0) {
logger.message("Could not get the implicit complement");
return rval;
}
auto it = std::find(vol_handles().begin(), vol_handles().end(), implicit_complement);
if (it != vol_handles().end()) {
vol_handles().erase(it);
}
else {
logger.message("Could not find the implicit complement in the volume handles vector");
return MB_FAILURE;
if (rval == MB_SUCCESS && implicit_complement != 0) {
auto it = std::find(vol_handles().begin(), vol_handles().end(), implicit_complement);
if (it != vol_handles().end()) {
vol_handles().erase(it);
}
else {
logger.message("Could not find the implicit complement in the volume handles vector");
return MB_FAILURE;
}
// insert the implicit complement at the end of the vector
vol_handles().push_back(implicit_complement);
}
vol_handles().push_back(implicit_complement);

idx = 1;
for (auto vol_handle : vol_handles()) {
Expand Down

0 comments on commit 928c606

Please sign in to comment.