-
Notifications
You must be signed in to change notification settings - Fork 92
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
Decoupling of Geometrical, Topological and Algebraical Interfaces #519
Conversation
This looks like a big effort! I'm not sure I'm following all the points that you want to make here, this is what I can see:
Most likely I didn't capture everything in this PR, feel free to add to my list! One of the main reasons that we haven't merged the DofHandlers yet is that it turned out hard to do it without breaking basic functionality. I'm all ears for suggestions how to solve this problem! #445 was an attempt as unifying things but it turned out to be more breaking than it initially looked, so it is stalling at the moment. |
Thanks for taking the time to look at the proposal Kim! Appreciate it. :) Yes, this PR is not intended to be merged as is, but I will consecutively cherry pick changes into separate PRs. I am mostly exploring ideas to generalize and decouple things that should be separate. My work here aims at several things.
More things that I am trying to address is the introduction of 4D and space-time elements, routines to change the interpolation for the mesh geometry (which might be handy for e.g. higher order FEM in mechanics), better integration for sub- and superparametric elements and finally to simplify the dof management for distributed code. Also, having a good topology interface will be crucial for highly efficient space-time adaptive codes, which is still the main goal in the long run. Hope that explais it better. Edit 1: So another big issue is that we do not strictly separate the algebraic interface, e.g. if I remember correctly, then we assume in several parts in the code that the solution approximation is nodal and in tight relation with the geometry of each element. This is a blocker for most H(div) and H(curl) approximations. See e.g. https://defelement.com/elements/examples/triangle-Nedelec-1.html for an example and e.g. https://defelement.com/ciarlet.html for a short introduction to the math behind FEM with cleaner definitions. |
I think that should only be in the VTK output where something along those lines is assumed. |
Thanks for the pointer Kristoffer. Indeed, VTK export is one of the portions where I saw this assumption. So, if I see it correctly then the "nodesset" really is intended to be a constraint on the geometric nodes of the grid and not on the algebraic nodes of the solution approximation? Edit: I will propose something to remove this constraint. |
Yes, constraints on the nodes are constraints only on the geometric nodes. The |
Sorry to ask, but what is the use-case for this? Wouldn't it make more sense to just directly constrain the dofs here instead of the nodes? |
E.g. on the cohesive elements that I presented at FerriteCon, there is no face on two of the sides, but it still makes sense to apply Dirichlet boundary conditions there (not Neumann though, thus no face). I usually constrain them via constraining these nodes (which I can get from the meshing routine I use, opposed to the dofs). I would also say it is fairly common to use the same approximation on the geometry and the function and to constrain node sets then. |
What do you suggest to remove? |
It is also quite common to have to prescribe some corner in order to avoid rigid body motion. Prescribing the node is the only current way of reaching for those dofs. |
If I see this correctly, then wouldn't this be a constraint on the vertex?
I want to remove the constraint in the VTK export, that the geometrical nodes have to match the algebraic nodes in some way. This should be rather easy, as, in my understanding, VTK only needs the solution at the geometric nodes, which can be interpolated from the algebraic nodes via some
If we only talk about displacement fields then yes, it is common to use the same ansatz for geometry and solution. Edit: Thanks for elaborating! |
In that sense I think we have a solution already in terms of being able to use |
I mean, yes, we could do it this way, but it will not be super efficient. You already have all information on the cell which you want to export, so there is no need to project the solution globally and search the node. I almost have a general solution in FerriteVis.jl which I would just adapt. |
Codecov ReportBase: 92.34% // Head: 78.85% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #519 +/- ##
===========================================
- Coverage 92.34% 78.85% -13.49%
===========================================
Files 22 27 +5
Lines 3762 4455 +693
===========================================
+ Hits 3474 3513 +39
- Misses 288 942 +654
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. |
…orithm for the dof distribution idea.
So the first set of changes which I want to pick out of this branch is the breaking change of the element interface. Here I have different suggestions
Edit: The related files with a sketch of the ideas can be found in the Mesh folder. |
Cool!
|
Thanks for taking time Knut! Let me answer in order.
|
2. Yes, the ability to get the geometric interpolation does make a lot of sense - I was just a bit worried about how breaking it would be and thus think it would be nice to have a few clear reasons (e.g. required for MPI:)). |
Please note that none of these first changes will help with improving the distributed assembly. I also play a bit around with partial materialization in this branch, but nothing is really satisfactory yet.
For all H(curl) and H(div) conforming elements. They are vector-valued (e.g. 3d vector in 3d space) but have only 1 dof per vector and not 3. See e.g. https://defelement.com/elements/examples/triangle-Nedelec-1.html . I remember that there have been some issues when trying to implement the Nedelec elements (https://github.com/Ferrite-FEM/Ferrite.jl/tree/mk/nedelec). |
Made a full 180° and found my example from back then, in which the current It was Hermite elements, which often cannot be distinguished from some Lagrangian counterparts with the current interface (ran into this problem because one of my students was tasked to implement some Hermite formulation). Two representative examples here:
We can argue now that interpolations different from Lagrangian must require custom cell types, which I think is fine. However, all embedded elements are currently not out of the box functional, because we are missing an implementation for the Jacobian on these. Which is now dependent on the interpretation of these elements - are they shells/beams/... or surface/edge/... elements? To elaborate, with shells I refer to elements which are common in continuum mechanics, which come with some artificial treatment in their thickness direction. With surface elements I refer to elements which behave as expected, for example reaction systems defined on the surface of a sphere in 3D. Edit: To summarize, my argument why we should default for the latter behavior is that shells require special treatment depending on their formulation, while regular surface/edge/... elements do not care what the surrounding dimension is and they behave consistently. Edit 2: I still do not have a really satisfactory design, because my proposal now couples geometry and topology... for which I am not sure if this is good or bad. |
Almost all changes proposed here have been redistributed to separate PRs and merged in improved versions after more discussion on Slack (compare #651 ,#679, #694, #708 -- I think these are all). The only open remaining proposed change is the introduction of a dimension independent dof distribution algorithm (see |
This PR explores possibilities to simplify and generalize the code base. Legacy code is removed and ambiguities are resolved on the way. Note that the naming is not final and I can sweep unwanted renamings back to the current naming scheme. The renaming is also there because I want to be able to test different combinations of the old and new interface and its equivalence in tests.
Addresses #191 #167 #395 #394 and is a foundation for #272 and 4D elements. Will be the basis to simplify #486 . Will also be a foundation to merge MixedDofHandler into DofHandler.
TODOs