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
Shorten, simplify and generalise code for Nédélec finite elements #3840
base: devel
Are you sure you want to change the base?
Conversation
6a268a4
to
ebbefa6
Compare
Job Coverage on 55155d4 wanted to post the following: Coverage
Warnings
This comment will be updated on new commits. |
This is usually a good idea and a pretty easy one; see e.g. Heavily refactoring shape function definitions is also usually a good idea and usually not a pretty easy one; see e.g.
With Lagrange shape functions we cache results in between elements, but (unless the elements that are just shifts of each other, where we cache everything for everything) it doesn't quite save as much as you'd think; you don't have to recompute in master space each time but the physical space gradients have some cost.
|
6ac3a4d
to
d36c8ba
Compare
Perfect, my code was already very similar to that, but I've refactored to follow the same style.
Okay, let's leave that for later then. Let's focus on
Good, stored on the element then. |
7216566
to
0926a3f
Compare
Hi Roy (@roystgnr), Alex (@lindsayad),
The overarching idea here is to generalise (some of) the code for arbitrary order finite elements.
I'm aware this would be a mammoth task, but I thought we could start with some small steps to better grasp the range of changes that'd be needed.
Since we are working on adding support for 2nd order Nédélec elements of the first kind, I thought instead of just hard-coding the various properties (e.g. the no. of dofs) we could try to generalise them. In the same spirit, for the shape functions, since they are orientation-dependent, I tried to avoid writing them twice as we had done thus far because even though that's not a lot for 1st order, trust me, it is for 2nd order. Here, it'd also be interesting to experiment with obtaining the shape functions from the dof definitions, although this would (a bit more fundamentally) change the way we think about assembly (we'd need to store the shape functions a-priori for a given element type and order perhaps the first time we see such an element).
Lastly, I'd like to understand what
n_dofs_per_elem
is supposed to return, and in particular its relationship with the middle node on TRI7, QUAD9 or HEX27 elements. For 2nd order Nédélec, we do have some dofs that are associated with the element, so where should they go? The middle node, or the element?Cheers,
-Nuno