-
Notifications
You must be signed in to change notification settings - Fork 89
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
resolve inconsistency between refcube and refshape interpolation in 3D #523
Conversation
Codecov ReportBase: 92.37% // Head: 92.37% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## master #523 +/- ##
=======================================
Coverage 92.37% 92.37%
=======================================
Files 22 22
Lines 3776 3776
=======================================
Hits 3488 3488
Misses 288 288
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Can we include some regression test to catch future problems with wrong dispatches on these functions? |
second order Hexahedron has inconsistent edges as well :(
I guess the points match but are numbered differently |
@@ -80,6 +80,23 @@ for interpolation in ( | |||
@test __outward_normal(coords, facenodes) ≈ normal | |||
end | |||
end | |||
# regression for https://github.com/Ferrite-FEM/Ferrite.jl/issues/520 | |||
interpolation_type = typeof(interpolation).name.wrapper |
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.
is there a better way to extract the type of the interpolation, e.g. Lagrange
, Serendipity
etc.?
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.
You can check interpolation isa Lagrange
instead
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.
ideally this should be checked for non-lagrangian interpolations, too. Since in the codebase DiscontinuousLagrange
, CrouzeixRaviart
, BubbleEnrichedLagrange
is already introduced
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.
Also I will include H(div) and H(curl) interpolations soon, because our group need them.
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.
is there a better way to extract the type of the interpolation, e.g. Lagrange, Serendipity etc.?
@koehlerson : I noted down this trick with ref to this thread (used it in testing as well), but recently I saw
@inline basetypeof(x::T) where T = basetypeof(T)
@generated function basetypeof(::Type{T}) where T
if T isa Union
T
else
getfield(parentmodule(T), nameof(T))
end
end
I needed to change the edge ordering and IIRC @lijas you mentioned something that the order is different in vtk. Do we need to change something additional for the vtk export? |
I dont remember where I noticed that... but for hexahedron it looks like we use the same numbering |
I had this conversation in mind: #353 (comment) |
Actually, it seems like they order their edges for hexahedron differently: So they number their vertical edges 9,10,11, and 12, and for us they are 5,6,7 and 8 |
can you tell me where we need to change code in the Edit: hm does it actually matter when we export it for normal stuff (H1 problems, no Hcurl or Hdiv, nodal interpolation ansatz)? Because |
It should matter if we output the results on a quadratic hexahedron mesh, right? I guess we should change the ordering of the edges Line 732 in f3057f3
and here: Ferrite.jl/src/interpolations.jl Line 501 in f3057f3
to be consistent with that of VTK. Or we can implement nodes_to_vtkorder for QuadraticHexahedrons. |
ye but What do you think @fredrikekre @KristofferC @kimauth ? |
We really should decouple the vtk representation from our internal representation. If I find some time I will make a better VTK export based on interpolation of data to the nodes instead of some reordering magic (which does not work e.g. for CR elements). |
Yes, this is true, I did not think of that. So our edge ordering can be different I guess 🤔 |
Actually it shouldn't matter that we order them differently, because apparently all of us use the whole time the linear hexahedron export and the linear hexahedron shares the "wrong" edge numbering (just without the higher order nodes). I just aligned the full quadratic interpolation (note that I don't mean |
#520