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

ElementSubdomainModifier should not modify SubdomainIDs during the element loop #23371

Closed
dschwen opened this issue Feb 7, 2023 · 6 comments · Fixed by #23372
Closed

ElementSubdomainModifier should not modify SubdomainIDs during the element loop #23371

dschwen opened this issue Feb 7, 2023 · 6 comments · Fixed by #23372
Assignees
Labels
T: task An enhancement to the software.

Comments

@dschwen
Copy link
Member

dschwen commented Feb 7, 2023

Reason

ElementSubdomainModifier is currently changing element->subdomain_id() in execute(). This will cause UOs in the same execution stage operating on the same element (or face of the same element), see a subdomain ID that is inconsistent with the current subdomain set in onSubdomainChange. This will trip this assertion for example.

Design

Store all subdomain id reassignments in a list first and only apply them to the elements in finalize.

Impact

More robust capability. Ping @dewenyushu

@dschwen dschwen added the T: task An enhancement to the software. label Feb 7, 2023
@dschwen dschwen self-assigned this Feb 7, 2023
dschwen added a commit to dschwen/moose that referenced this issue Feb 7, 2023
@dewenyushu
Copy link
Contributor

Nice finding!

@hugary1995
Copy link
Contributor

Caching is a fix. The ultimate fix in my opinion is to set up a dependency graph for runtime mesh modifiers (including this element subdomain modifier), pretty much like the current MeshGenerators.

@dschwen
Copy link
Member Author

dschwen commented Feb 8, 2023

Yeah, multiple options here

  • A runtime mesh modifier system that runs independently of UOs
  • Multiple UO loops
  • A custom execute_on for a second UO loop :-p

I was going for the lowest hanging fruit.

dschwen added a commit to dschwen/moose that referenced this issue Feb 8, 2023
@hugary1995
Copy link
Contributor

Several things we frequently use at hand could be unified in to the runtime mesh modifier system, such as XFEM and CZM. I know I'm dreaming right now, but if we are heading towards that direction, I'd be happy to help.

@dschwen
Copy link
Member Author

dschwen commented Feb 8, 2023

I like that idea. The scope is not small though and would require some funding. Maybe we can propose a workpackage that could cover this activity for next FY?

dschwen added a commit to dschwen/moose that referenced this issue Feb 8, 2023
@hugary1995
Copy link
Contributor

Sure, let's talk before FY24 planning.

dschwen added a commit to dschwen/moose that referenced this issue Feb 8, 2023
maxnezdyur pushed a commit to maxnezdyur/moose that referenced this issue Feb 12, 2023
maxnezdyur pushed a commit to maxnezdyur/moose that referenced this issue Feb 12, 2023
MengnanLi91 pushed a commit to MengnanLi91/moose that referenced this issue Feb 22, 2023
MengnanLi91 pushed a commit to MengnanLi91/moose that referenced this issue Feb 22, 2023
MengnanLi91 pushed a commit to MengnanLi91/moose that referenced this issue Feb 23, 2023
MengnanLi91 pushed a commit to MengnanLi91/moose that referenced this issue Feb 23, 2023
MengnanLi91 pushed a commit to MengnanLi91/moose that referenced this issue Mar 8, 2023
MengnanLi91 pushed a commit to MengnanLi91/moose that referenced this issue Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: task An enhancement to the software.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants