ProjectedDirichlet BC for H(div) and H(curl)#1151
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1151 +/- ##
==========================================
+ Coverage 93.89% 94.02% +0.13%
==========================================
Files 39 39
Lines 6436 6560 +124
==========================================
+ Hits 6043 6168 +125
+ Misses 393 392 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Yea, as already discussed before, I think having a trait system will be useful in the future.
Yes. |
fredrikekre
left a comment
There was a problem hiding this comment.
I haven't gone through the math but if it is sound and tests cover it then 👍
|
Since I just saw it, should we rename |
Yes, seems like |
Co-authored-by: Fredrik Ekre <ekrefredrik@gmail.com>
Decided degree that should pass by checking how high it worked, and finding the threshold
I believe it is sound, but would be good if someone can have a 2nd look on the tests here to make sure that I haven't done anything wrong there. When going through this again now, I realize that I should also test some moment-integrals, as currently only the total integral quantity is tested (e.g. the total flux over the boundary, but not the spatial distribution). Will update with that during the week. |
fredrikekre
left a comment
There was a problem hiding this comment.
Is it too magical if Dirichlet(::HcurlInterpolation) adds a WeakDirichlet? Probably, but would be kind of nice to not have to change the BC when changing interpolations.
|
termi-official
left a comment
There was a problem hiding this comment.
Really cool work here, thanks!
I was asking myself if this infrastructure can help us with applying normal and tangential boundary conditions (e.g. static sliding contact)?
|
Thanks to @termi-official on Slack - it is not a local projection problem for 3D and H(curl), so will add an error message that this is not implemented. |
|
@lijas identified the corresponding functionality in deal.ii! For nodal and hdiv: https://www.dealii.org/current/doxygen/deal.II/namespaceVectorTools.html#a747e71d426643718d52eda904d46bb20 And for hcurl: https://www.dealii.org/current/doxygen/deal.II/group__constraints.html#ga190b302dc1ee7c89727c94c083d132d2 I will look closer if I'm missing something since they have factored out the curl-functionality, but I haven't done that here. |
|
After going through the dealii docs, I've added the relevant reference here: https://ferrite-fem.github.io/Ferrite.jl/previews/PR1151/topics/boundary_conditions/#ProjectedDirichlet. For the H(curl), AFAIU this is related to @termi-official's comment regarding 3d, and they use a stepwise algorithm to reduce the equation system size when it couples (first solving dofs associated with edges, and then those associated with faces). This doesn't affect what is implemented in this PR, nor the user interface. |
|
Should be good from my side. |
termi-official
left a comment
There was a problem hiding this comment.
LGTM
And for hcurl: https://www.dealii.org/current/doxygen/deal.II/group__constraints.html#ga190b302dc1ee7c89727c94c083d132d2
This is quite a smart strategy here. However, we need to implement EdgeValues and the related topological queries to reproduce this efficiently.
|
Thanks for the comments and input @termi-official, @fredrikekre, and @lijas! |
For H(div) and H(curl) interpolations, the dof is not associated with a point, but with facets and edges, respectively. However, the boundary conditions appear for the facets in the forms described in the docstring. This implies that we cannot get a coordinate where we want to assign the dof, but instead we have to minimize the difference, not sure how much theory to include, but we could add for e.g. H(div) that our "problem" is,
where the functional dependence,$f = f(\boldsymbol{x}, t, \boldsymbol{n})$ , is skipped fore brevity.
I also chose to introduce the internal
function_space(::Interpolation)::Valfunction, as this was useful for dispatching. @termi-official:RannacherTurekandCrouzeixRaviartshould beL2, right?Side-note
An alternative name could be L2Dirichlet, as this could also be applied to