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

Handle zero contour aligning with faces in MeshClassifier. #16950

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

simonsticko
Copy link
Contributor

Change logic in MeshClassifier to handle the situation described issue #16888. Add a new type to the enum LocationToLevelSet that describes that the zero contour is exactly aligned with a face. Change the logic in MeshClassifier to set the "inside" cell sharing an aligned face to intersected and the other cell to outside.

Change logic in MeshClassifier to handle the situation described in
issue dealii#16888. Add a new type to the enum LocationToLevelSet that
describes that the zero contour is exactly aligned with a face.
Change the logic in MeshClassifier to set the "inside" cell sharing
an aligned face to intersected and the other cell to outside.
Test that we do not integrate over the zero contour twice,
when the zero contour falls exactly on the face that is shared
between two cells.
@simonsticko
Copy link
Contributor Author

I was thinking something like this @mschreter. Do you think this makes sense?

Copy link
Contributor

@mschreter mschreter left a comment

Choose a reason for hiding this comment

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

@simonsticko looks very good. I've tried the patch for our application considered in #16888 and the active_fe_index now looks as we agreed. Thank you very much :-).

@@ -56,7 +57,8 @@ namespace NonMatching
inside,
outside,
intersected,
unassigned
unassigned,
aligned
Copy link
Contributor

Choose a reason for hiding this comment

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

Shall we add a comment/assert that a cell should never be aligned?

Copy link
Contributor

Choose a reason for hiding this comment

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

Hello Everyone,
I think that the completeness of such a comment depends on the particular application of the MeshClassifier. In TraceFEM, for example, even faces should never be aligned with the interface.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think there should be an assert. I will add it.

@@ -68,9 +68,11 @@ namespace NonMatching
std::minmax_element(local_levelset_values.begin(),
local_levelset_values.end());

if (*min_max_element.second < 0)
if (*min_max_element.first == 0.0 && *min_max_element.second == 0.0)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we introduce a small tolerance for the check?

Copy link
Contributor

Choose a reason for hiding this comment

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

In my opinion, it is typical for level set methods to actively perturb the interface position so it does not pass through cell vertices exactly. Having this in mind, I would recommend to reserve the "aligned" category for the pure case without a tolerance. I see it as a level set post-processing: if "aligned" perturb so it becomes "intersected".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree that, usually, one should never compare floating point number exactly. But here, also I think that we actually want to. Moving the zero-contour would just change it to one of the other values of LocationToLevelSet.

Regarding tracefem: If we choose to implement it like this I do not think you need to perturb the level set. If a face is aligned, you integrate over the zero contour of the cell that is chosen as intersected and not over the other cell, so it will work also for this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants