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

Fix Manifold<3, 3>::normal_vector #14183

Merged

Conversation

zjiaqi2018
Copy link
Contributor

@zjiaqi2018 zjiaqi2018 commented Aug 10, 2022

fix #14176
On very coarse meshes, with very particular manifolds, e.g., spherical manifold, polar manifolds, cylindrical manifolds, etc, Manifold<3, 3>::normal_vector may return a zero vector. This issues can be fixed by choosing different combinations of vertices to compute the normal vector.

* to the triangulation.
*
* In 2d, all manifold ids are set to zero, and a SphericalManifold is
* attached to the triangulation. In 3d, only the manifold id of the curved
Copy link
Member

Choose a reason for hiding this comment

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

Why is this different in 2d? I would think there are also flat faces in 2d!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Then we may also need to fix quarter_hyper_shell()?

quarter_hyper_shell(Triangulation<3> & tria,

Copy link
Member

Choose a reason for hiding this comment

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

I would think so. Can you try to address that as well and see what happens?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we remove the spherical manifold on the flat surface, the mesh quality there gets worse as we refine the mesh, as discussed here #14176

Copy link
Member

@masterleinad masterleinad left a comment

Choose a reason for hiding this comment

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

This is not the right solution, see #14176 (comment).

@zjiaqi2018 zjiaqi2018 force-pushed the fix-3d-half_hyper_shell-manifold branch from 873f712 to 03e99f0 Compare September 19, 2022 21:46
@zjiaqi2018
Copy link
Contributor Author

It should work now, @tjhei @luca-heltai

source/grid/manifold.cc Outdated Show resolved Hide resolved
source/grid/manifold.cc Outdated Show resolved Hide resolved
@tjhei
Copy link
Member

tjhei commented Sep 20, 2022

Can you add a changelog and update the text of the PR (when you scroll up here)?

@zjiaqi2018 zjiaqi2018 changed the title Fix half_hyper_shell() manifold Fix Manifold<3, 3>::normal_vector Sep 20, 2022
@masterleinad masterleinad merged commit 7450b74 into dealii:master Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

no normal flux normal vector issue with half_hyper_shell
4 participants