Merge pull request #2178 from myerspat/infix-sense-evaluation

Short circuiting and lazy evaluation of CSG regions for cell searching
This commit is contained in:
Paul Romano 2022-09-02 12:05:52 -05:00 committed by GitHub
commit df3765fa07
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 203 additions and 96 deletions

View file

@ -160,14 +160,12 @@ protected:
//! \param[in] instance of the cell to find parent cells for
//! \param[in] p particle used to do a fast search for parent cells
//! \return parent cells
vector<ParentCell> find_parent_cells(
int32_t instance, Particle& p) const;
vector<ParentCell> find_parent_cells(int32_t instance, Particle& p) const;
//! Determine the path to this cell instance in the geometry hierarchy
//! \param[in] instance of the cell to find parent cells for
//! \return parent cells
vector<ParentCell> exhaustive_find_parent_cells(
int32_t instance) const;
vector<ParentCell> exhaustive_find_parent_cells(int32_t instance) const;
//! Inner function for retrieving contained cells
void get_contained_cells_inner(
@ -201,9 +199,7 @@ public:
vector<double> sqrtkT_;
//! Definition of spatial region as Boolean expression of half-spaces
vector<std::int32_t> region_;
//! Reverse Polish notation for region expression
vector<std::int32_t> rpn_;
vector<int32_t> region_;
bool simple_; //!< Does the region contain only intersections?
//! \brief Neighboring cells in the same universe.
@ -248,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<int32_t> rpn);
static BoundingBox bounding_box_complex(vector<int32_t> postfix);
//! Applies DeMorgan's laws to a section of the RPN
//! \param start Starting point for token modification