scikit-fem icon indicating copy to clipboard operation
scikit-fem copied to clipboard

Nédélec element availble for MeshTet but not for MeshQuad

Open learning-chip opened this issue 2 years ago • 7 comments

There exist the lowest order Nédélec element skfem.element.ElementTetN0 for 3D tetrahedral mesh, but no such equivalent for other meshes like the 2D MeshQuad.

By looking at the file element_tet_n0.py, the code for defining a new element type seems relatively simple. But I am not sure how to verify the correctness of a new implementation (make sure it works with the rest of the codebases such as matrix assembly). The unit test file test_elements.py does not contain the class ElementTetN0 as of version 5.2.0

learning-chip avatar Feb 16 '22 09:02 learning-chip

but no such equivalent for other meshes like the 2D MeshQuad

The docstring for the superclass ElementHcurl does say

https://github.com/kinnala/scikit-fem/blob/04730d80d612470b7e802eed4c21dd96b89cef61/skfem/element/element_hcurl.py#L9

Do you have an application for H (curl) in two dimensions? I can sort of imagine it, but I don't think I've seen it before. It'd be much like ElementQuadRT0, wouldn't it, with all the vectors rotated through a right-angle? I wonder whether curl is different enough in two and three dimensions that it might make sense to treat these separately rather than trying to generalize the current three-dimensional ElementHcurl.

gdmcbain avatar Feb 17 '22 05:02 gdmcbain

The unit test file test_elements.py does not contain the class ElementTetN0 as of version 5.2.0

ElementTetN0 does appear in

https://github.com/kinnala/scikit-fem/blob/04730d80d612470b7e802eed4c21dd96b89cef61/docs/examples/ex33.py#L24

and so is tested indirectly to some extent in

https://github.com/kinnala/scikit-fem/blob/04730d80d612470b7e802eed4c21dd96b89cef61/tests/test_examples.py#L281

but yes something appropriate and more direct in tests.test_elements might be good too.

gdmcbain avatar Feb 17 '22 05:02 gdmcbain

I suggest we add also a convergence test for ElementTetN0. Could be a manufactured solution, any other suggestions?

kinnala avatar Feb 17 '22 07:02 kinnala

No, that seems best. I was looking at ex33 again in this context and then Schneebeli's ‘An H(curl; Ω)-conforming FEM’, on which it's based. I assume f in (33) for the PDE (1) is from a manufactured solution but I don't see the expression for u… an exercise for the reader? I'll see if I can reverse that next week if you haven't already.

This paper also treats the ElementQuadN0 (§2.3.1).

gdmcbain avatar Feb 19 '22 02:02 gdmcbain

I'll see if I can reverse that next week

No, too hard; I propose manufacturing a new u.

gdmcbain avatar Feb 21 '22 04:02 gdmcbain

Do you have an application for H (curl) in two dimensions?

I came across one: eq. 3.6 and §4.1 of

They do have a nice manufactured solution in Example 4.1 as well as more physically interesting examples in Examples 4.2 – 4.4. There's also a three-dimensional manufactured solution in Example 4.5; however the system is rather more involved than our ex33 so not so suitable for a test.

gdmcbain avatar Feb 21 '22 22:02 gdmcbain

Could be a manufactured solution, any other suggestions?

What about the eigenvalue problem curl curl u = λ u in Ω, n × u = 0 on ∂Ω? For the box 0 < (x/a, y/b, z/c) < π, the eigenvalues are λ = (k0/a)² + (k1/a)² + (k2/c)², where at most one of the ki can vanish at the same time; see (2.7) and (6.4) of

  • Adam, S., Arbenz, P. & Geus, R. (1997). Eigenvalue solvers for electromagnetic fields in cavities (Technische Berichte 275). ETH Zürich, Departement Informatik

gdmcbain avatar Feb 22 '22 00:02 gdmcbain

This has moved forward; there is now ElementTriN0 also and ElementHcurl supports 2D meshes.

kinnala avatar Nov 07 '22 19:11 kinnala

Fixed in #959

kinnala avatar Nov 11 '22 12:11 kinnala