diff --git a/include/openmc/cell.h b/include/openmc/cell.h index fd1883ce57..8171967273 100644 --- a/include/openmc/cell.h +++ b/include/openmc/cell.h @@ -244,7 +244,7 @@ protected: bool contains_simple(Position r, Direction u, int32_t on_surface) const; bool contains_complex(Position r, Direction u, int32_t on_surface) const; BoundingBox bounding_box_simple() const; - static BoundingBox bounding_box_complex(vector rpn); + static BoundingBox bounding_box_complex(vector postfix); //! Applies DeMorgan's laws to a section of the RPN //! \param start Starting point for token modification diff --git a/src/cell.cpp b/src/cell.cpp index 4a61eb60e2..5c3e06eef3 100644 --- a/src/cell.cpp +++ b/src/cell.cpp @@ -624,6 +624,7 @@ CSGCell::CSGCell(pugi::xml_node cell_node) for (auto it = region_.begin(); it != region_.end(); it++) { if (*it == OP_INTERSECTION || *it > OP_COMPLEMENT) { region_.erase(it); + it--; } } region_.shrink_to_fit(); @@ -807,7 +808,7 @@ void CSGCell::remove_complement_ops(vector& infix) // positions in the RPN apply_demorgan(it, stop); // update iterator position - it = std::find(it, infix.end(), OP_COMPLEMENT); + it = std::find(infix.begin(), infix.end(), OP_COMPLEMENT); } }