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

AMR for ElementSubdomainModifier #19519

Closed
wants to merge 18 commits into from
Closed

Conversation

fdkong
Copy link
Contributor

@fdkong fdkong commented Dec 1, 2021

Closes #20387

@fdkong fdkong marked this pull request as draft December 1, 2021 20:54
@fdkong
Copy link
Contributor Author

fdkong commented Dec 1, 2021

Depend on this libMesh/libmesh#3094

@@ -27,15 +27,16 @@ class ErrorFractionMarker : public IndicatorMarker

protected:
virtual MarkerValue computeElementMarker() override;
bool checkElementSubdomainConsistent(const Elem * const & _current_elem);
Copy link
Member

@loganharbour loganharbour Dec 1, 2021

Choose a reason for hiding this comment

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

Suggested change
bool checkElementSubdomainConsistent(const Elem * const & _current_elem);
bool checkSubdomainConsistency(const Elem & elem) const;

also add docstring


Real _coarsen;
Real _refine;
bool _clear_extremes;
bool _is_subdomain_consistent;
Copy link
Member

@loganharbour loganharbour Dec 1, 2021

Choose a reason for hiding this comment

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

Suggested change
bool _is_subdomain_consistent;
// Whether or not to check the consistency of subdomain ids when coarsening
const bool _check_subdomain_consistency;


// Change the parent's subdomain, if any
// We do not save the parent info since they are inactive
setAncestorsSubdomainIDs(subdomain_id, elem_id);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
setAncestorsSubdomainIDs(subdomain_id, elem_id);
setAncestorsSubdomainIDs(*elem);

Comment on lines +376 to +476
void
ElementSubdomainModifier::setAncestorsSubdomainIDs(const SubdomainID & subdomain_id,
Copy link
Member

Choose a reason for hiding this comment

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

This should be:

void
ElementSubdomainModifier::setAncestorsSubdomainIDs(Elem & elem) const
{
  Elem * current_elem = &elem;
  unsigned int lv = current_elem->level();

  for (unsigned int i = lv; i > 0; --i)
  {
    current_elem = curent_elem->parent();
    current_elem->subdomain_id() = elem.subdomain_id();

    // displaced parent element
    Elem * displaced_elem = _displaced_problem ? _displaced_problem->mesh().elemPtr(id) : nullptr;
    if (displaced_elem)
      displaced_elem->subdomain_id() = elem.subdomain_id();
  }
}

There's no need to ever call _mesh.elemPtr(). current_elem->parent() should return a non-const elem because current_elem is non const

framework/src/markers/ErrorFractionMarker.C Outdated Show resolved Hide resolved
@fdkong fdkong changed the title WIP: AMR for CoupledVarThresholdElementSubdomainModifier AMR for ElementSubdomainModifier Feb 23, 2022
@fdkong
Copy link
Contributor Author

fdkong commented Feb 23, 2022

Need libmesh update libMesh/libmesh#3094

libmesh Outdated
@@ -1 +1 @@
Subproject commit 544e2c87ea2f35aab900dde8b8f1e0926d720421
Subproject commit f2940e0fcffcb81301cd14c88088a09727b55ebe
Copy link
Contributor

Choose a reason for hiding this comment

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

Caution! This contains a submodule update

libmesh Outdated
@@ -1 +1 @@
Subproject commit 544e2c87ea2f35aab900dde8b8f1e0926d720421
Subproject commit f2940e0fcffcb81301cd14c88088a09727b55ebe
Copy link
Contributor

Choose a reason for hiding this comment

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

Caution! This contains a submodule update

libmesh Outdated
@@ -1 +1 @@
Subproject commit 544e2c87ea2f35aab900dde8b8f1e0926d720421
Subproject commit f2940e0fcffcb81301cd14c88088a09727b55ebe
Copy link
Contributor

Choose a reason for hiding this comment

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

Caution! This contains a submodule update

@moosebuild
Copy link
Contributor

moosebuild commented Feb 24, 2022

Job Documentation on 628b8cf wanted to post the following:

View the site here

This comment will be updated on new commits.

Copy link
Member

@loganharbour loganharbour left a comment

Choose a reason for hiding this comment

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

Warning: This PR changes repo size by 6.43 MiB.

way too much for only a few tests

@fdkong
Copy link
Contributor Author

fdkong commented Feb 24, 2022

Warning: This PR changes repo size by 6.43 MiB.

way too much for only a few tests

I will try to make the mesh smaller ....

@loganharbour
Copy link
Member

I've got a partial review going for this from december, give me a ping @fdkong when you're ready

@fdkong
Copy link
Contributor Author

fdkong commented Feb 24, 2022

I need to add more tests.

libmesh Outdated
@@ -1 +1 @@
Subproject commit 544e2c87ea2f35aab900dde8b8f1e0926d720421
Subproject commit f2940e0fcffcb81301cd14c88088a09727b55ebe
Copy link
Contributor

Choose a reason for hiding this comment

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

Caution! This contains a submodule update

@@ -1 +1 @@
Subproject commit 544e2c87ea2f35aab900dde8b8f1e0926d720421
Subproject commit 0c01ac73068bbf19891001680c44ec6b6d0420b8
Copy link
Contributor

Choose a reason for hiding this comment

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

Caution! This contains a submodule update

We did this tmp update to check if the code still works
@@ -1 +1 @@
Subproject commit 544e2c87ea2f35aab900dde8b8f1e0926d720421
Subproject commit 0c01ac73068bbf19891001680c44ec6b6d0420b8
Copy link
Contributor

Choose a reason for hiding this comment

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

Caution! This contains a submodule update

@moosebuild
Copy link
Contributor

Job Precheck on 628b8cf wanted to post the following:

The following file(s) are changed:

conda/libmesh/meta.yaml

The libmesh conda configuration has changed; ping @idaholab/moose-dev-ops

@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity in the last 30 days. It will be closed in 3 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale PRs that have reached or exceeded 90 days with no activity label Mar 27, 2022
@github-actions github-actions bot closed this Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale PRs that have reached or exceeded 90 days with no activity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable AMR for subdomain modifier
4 participants