-
Notifications
You must be signed in to change notification settings - Fork 46
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
Enable Adaptive Mesh Refinement #964
Open
nuclearkevin
wants to merge
18
commits into
neams-th-coe:devel
Choose a base branch
from
nuclearkevin:enable_amr
base: devel
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+466
−134
Open
Changes from 16 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
14b55ce
Fixed Cell->Element mapping when using AMR.
nuclearkevin a971508
Remove an unused local variable.
nuclearkevin 2d6ac02
Enabled mesh tally adaptivity.
nuclearkevin e6d5f12
Minor improvements and fixes.
nuclearkevin 5249092
Updated tests to account for the removal of 'fixed_mesh'.
nuclearkevin 4774ab8
Adding a displaced problem check for re-initializing coupling.
nuclearkevin e4b8857
Revert previous change
nuclearkevin 4992114
Re-implemented the displaced problem check.
nuclearkevin 0c69ac2
Fix segmentation faults in tallies and the cell->element mapping.
nuclearkevin 253a9b2
Add adaptivity tests.
nuclearkevin 797d9a6
Completed rebase.
nuclearkevin 3fa82c3
Separate hasAdaptivity() from _need_to_reinit_coupling.
nuclearkevin 3bbcd61
Style changes.
nuclearkevin 5681381
Merge branch 'neams-th-coe:devel' into enable_amr
nuclearkevin bbdbaba
Fix tally adaptivity segmentation fault.
nuclearkevin e772e17
Merge branch 'neams-th-coe:devel' into enable_amr
nuclearkevin b93056b
Merge branch 'neams-th-coe:devel' into enable_amr
nuclearkevin b598421
Add a new article for AMR and fix typo in FromXMLFilter.md.
nuclearkevin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Can you explain where this went?
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.
This
#else
statement was the cause of the segmentation faults on CIVET, and more generally it resulted in memory leaks when Cardinal is built without DAGMC and using a moving mesh.When the mesh is changing OpenMCCellAverageProblem needs to reset tallies on every timestep (after the first step), and so it calls
resetTallies()
at the beginning of the step. This is immediately followed by a call tosetupProblem()
. Afterwards, if the mesh is movingsetupProblem()
is called a second time in that#else
statement resulting in an initialization of OpenMC tallies twice for each time they're reset. This causes a memory leak as we don't manage the extra OpenMC tally created on each step.The reason why this caused a segmentation fault is a little more complicated and involves the copy of the mesh created in
MeshTally
containing only active elements. This mesh copy is deleted both whenresetTally()
andinitializeTally()
are called (it's a unique pointer). Since we've been creating two OpenMC tallies per timestep (by accident) the first of those tallies still thinks the mesh copy is valid, and so it tries to tally on datastructures that have had their memory freed. This behaviour is undefined and results in a segmentation fault.This bug only occurs when Cardinal is compiled without DAGMC as
resetTallies()
is called again when skinning the geometry (the previous usecase for the#ifdef
/#else
statement), so nothing breaks.