-
Notifications
You must be signed in to change notification settings - Fork 66
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
Ensure implicit complement is placed at the back of the DAGMC index space #935
Conversation
This housekeeping failure has dogged me before... there is some inconsistency that I haven't bothered to get to the bottom of, and it requires me to manually override the style guide for this line. |
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.
Looks good to me - should we add a test for this? I guess we'd have to contrive a set of volumes where the implicit complement was in the wrong place?
Yeah, we'd ideally test this. I think we could do it by using the |
You mean we will use a sample model (DAGMC file) in |
We would probably not use a file. Probably manually create a minimal DAGMC model in memory for testing. |
Thanks for the clarification! Creating a minimal DAGMC model in memory for testing sounds like a good approach to minimize source code size. I'm always happy to contribute by making a PR and generating the test file. However, I'm unsure about the process for creating tests for DAGMC. Could you please provide a sample or some guidance to help me get started? |
Proposed minimal model:
Load all of that into a MOAB entity as if it was load_file and then run the code to test this PR's addition. |
Alternative:
Run these methods to move the IC and test |
I ended up taking a slightly different approach here. To trigger this condition we need to load a file with at least To convince myself that this is true, I created a branch that adds this test on top of https://github.com/pshriwise/DAGMC/actions/runs/7748743790/job/21131962325#step:5:100 But with the latest CI run, that same test now passes: https://github.com/svalinn/DAGMC/actions/runs/7748757514/job/21132001898?pr=935 I rather like this test as it demonstrates that the behavior is caused by the number of meshsets in the file, even if they have no bearing on the definition of a DAGMC model. |
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.
Thanks for taking care of this @pshriwise
Description
This PR enforces placement of the implicit complement handle at the back of the surfaces and volumes vectors (contained in the
DagMC::entHandles
data member). It also changes theEntityHandle
-> DAGMC index mapping structure (DagMC::entIndices
) s.t. DAGMC indexes are independent of the EntityHandle ordering produced by MOAB. I decided onstd::unordered_map
for a lookup complexity O(1). The downside here is that the container use more memory, but this should be a small percentage of the overall memory use in DAGMC as I understand it. If others have approaches for maintaining thestd::vector<int>
option I'm all ears, but I have a feeling it would be more trouble than it's worth.I've confirmed that this results in the same eigenvalue as MOAB 5.3.0 for the MSRE model mentioned in #934 with OpenMC.
Motivation and Context
The motivation for this is described in #934.
Changes
entHandles
container.Behavior
In some cases, the implicit complement handle may not be placed at the back of the DAGMC index space and could be checked in point containment queries before other explicit volumes in the model.