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

Add ORANGE surface construction components #1001

Merged
merged 14 commits into from
Nov 3, 2023

Conversation

sethrj
Copy link
Member

@sethrj sethrj commented Oct 27, 2023

This adds two classes necessary for constructing surfaces from shapes:

  • LocalSurfaceInserter which deduplicates surfaces, including chaining nearly-adjacent surfaces (see test) which is something the SCALE ORANGE fails to do
  • FaceNamer which constructs surface extensions (e.g. px, p1, s) to be combined with shape names to form surface names

Currently inserting N surfaces with deduplication is an O(N^2) operation because the initial implementation does not use hashing to reduce the number of surfaces needed to test. However, in opt mode (on my laptop) 32k surface insertions take under a second, and a debug build takes just over a second to do 8k surfaces.

@sethrj sethrj added enhancement New feature or request orange Work on ORANGE geometry engine labels Oct 27, 2023
@sethrj sethrj requested a review from elliottbiondo October 27, 2023 14:25
@sethrj sethrj added this to the v0.4.0 milestone Nov 2, 2023
* id.
*
* The second case adds the surface so that multiple nearby surfaces can be
* \em chained together, even if the tolerance between the furthest apart is
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand the purpose of the em-dashes above, but not in this paragraph.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The em is the <em> html tag aka "emphasis" (i.e., italicized).

inline LocalSurfaceId operator()(S const& surface);

private:
using MapSurfId = std::unordered_map<LocalSurfaceId, LocalSurfaceId>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

>>> TYPES, >>> HELPER FUNCTIONS, >>> DATA for consistency, but not necessary


//---------------------------------------------------------------------------//
/*!
* Construct a name for a sphere.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

centered sphere

/*!
* Construct a name for a sphere.
*/
std::string FaceNamer::Impl::operator()(Sphere const&) const
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are sphere and centered sphere supposed to have the same name?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's how it is in the current SCALE builder. I can't think of any shape that has anything but a single sphere...

@sethrj sethrj merged commit 3fb14e5 into celeritas-project:develop Nov 3, 2023
@sethrj sethrj deleted the surface-inserter branch November 3, 2023 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request orange Work on ORANGE geometry engine
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants