-
Notifications
You must be signed in to change notification settings - Fork 99
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
Implementation of get_tangent_vector
with similar behavior as get_normal_vector
#1071
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1071 +/- ##
=======================================
Coverage 89.05% 89.06%
=======================================
Files 197 197
Lines 23905 23927 +22
=======================================
+ Hits 21289 21310 +21
- Misses 2616 2617 +1 ☔ View full report in Codecov by Sentry. |
Hi @aerappa , thanks for the contribution! Some comments:
The big question/doubt I have is the following:
Let me know how the testing goes. |
Hey @JordiManyer
I will delete this and just duplicate. I agree it's not useful
Yes, you are right. The quick and dirty solution I can think of is the following function get_edge_tangent(trian::SkeletonTriangulation)
plus = get_edge_tangent(trian.plus)
minus = lazy_map(x -> -x, plus)
SkeletonPair(plus,minus)
end although I'm not sure what the implications are for "ignoring" the information from
Let me know what you think |
Here are my thoughts:
I believe you want this for AMR aposteriori estimators, right? I have recently dipped into the subject, but I don't have much experience with the state of the art. Are edge-based tangencial jumps ever needed in 3D? I would start by implementing this in 2D by taking a rotation of the normals. I would explicitly disable the 3D case for now. We might want to implement it in the future. How do you see it? |
Sounds good to me. Another benefit of the rotation idea is that the tangent vector has a consistent direction on the physical boundary. I have implemented this idea (adding an error when called on anything but 2D) and added corresponding tests. Let me know what you think. |
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.
Some minor changes, but I think it is mostly done. Thank you!
@aerappa could you update NEWS.md with the changes? I'll merge after that is done. |
My motivation for the PR came from the desire to implement a DG scheme for vector value problems with jumping tangential components, e.g.
where the tangent and normal are define schematically via
I followed the outline I found for
get_normal_vector
that works for bothSkeletonTrianguations
andBoundaryTriangulations
but instead of usingget_facet_normal
I usedget_edge_tangent
for the underlyingPolytope
.Here are the resulting normal (resp. tangent) cell fields for a
BoundaryTriangulation
And idem for the
plus
component of aSkeletonTriangulation
I still need to add some tests in the spirit of those in
SkeletonTriangulationTests
andBoundaryTriangulationTests
but I wanted to make this PR first and get some feedback. I also think there could probably be a more elegant way to unify the logic ofget_normal_vector
andget_tangent_vector
to reduce code duplication but this would also probably obfuscate the code a bit.