Skip to content
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

Vector interpolations in 3 spatial dimensions #1159

Open
gijswl opened this issue Feb 23, 2025 · 5 comments
Open

Vector interpolations in 3 spatial dimensions #1159

gijswl opened this issue Feb 23, 2025 · 5 comments

Comments

@gijswl
Copy link

gijswl commented Feb 23, 2025

Hi all, I hope that opening an issue here is the right way to express my interest & get my question out there.

I see that support for H(curl) and H(div) interpolations is being added into Ferrite right now. I'd like to use these to (try to) implement a magnetoquasistatic FEM (e.g. using an $A$- or $A-\phi$ formulation) in 3D. Currently, however, the vector interpolations are only implemented for two-dimensional reference elements. Some necessary boundary conditions, etc. also seem to be under heavy development by @KnutAM .

When do you expect everything to be stable enough to attempt using Ferrite for this purpose?
I am, unfortunately, not familiar enough with the internals to define my own vector interpolations on RefTetrahedrons.

Looking forward, thanks!
Gijs

@KnutAM
Copy link
Member

KnutAM commented Feb 23, 2025

Not sure when I will get around to implement more interpolations, is a bit depending on if I will need them myself I guess. But hopefully with the how-to devdocs in the workings (#1140) it should be easier to extend it yourself: https://ferrite-fem.github.io/Ferrite.jl/previews/PR1140/devdocs/interpolations/#devdocs-interpolations

@gijswl
Copy link
Author

gijswl commented Feb 24, 2025

Thanks for the quick reply. If there is sufficient documentation then I'd be more than happy to give it a go myself.
The biggest issue I see so far is that at least one function that must be defined for vector interpolations is not in the devdocs you link to: get_direction is used in the Piola mappings, but is not documented. Not sure if there are any others that I might run into.

I'll dive into it if I have some time, and post the progress here.

@KnutAM
Copy link
Member

KnutAM commented Feb 24, 2025

get_direction is used in the Piola mappings, but is not documented. Not sure if there are any others that I might run into.

Yes, there might be for sure be, but if you try and hit some just ask (here, or on slack in # ferrite-fem) I've added the get_direction as a todo in 1140, and if more are missing those should be added.

@gijswl
Copy link
Author

gijswl commented Feb 24, 2025

After some reading and playing around, I managed to get something that at least passes the unit tests: gijswl@321ff6d, but I'm not yet convinced everything is correct. Any chance you could check to see if it looks reasonable?

During the process of implementing it, I ran into the following:

  • It was not immediately apparent that the edge ordering on DefElement and in Ferrite's RefTetrahedron were not the same. This was luckily caught by the tests that validate the DOF ordering.
  • Default versions of the <entity>dof_indices functions are defined somewhere, and it was not clear to me which ones to overwrite. I used the existing Nedelec interpolations on RefTriangle's as reference here.
  • get_direction is not part of the interpolation unit tests.

It would be nice if there is also an example of a VectorInterpolation in the docs.

@KnutAM
Copy link
Member

KnutAM commented Feb 24, 2025

Nice!
You can also try the continuity tests (in test_continuity.jl), they are quite good at catching things.
The special casing for one edge for the direction looks suspicious to me.

It was not immediately apparent that the edge ordering on DefElement and in Ferrite's RefTetrahedron were not the same.

Not sure if we should do something here - it could be other ordering in other references. But if we can clarify the ordering somehow suggestions are welcome!

Default versions of the dof_indices functions are defined somewhere, and it was not clear to me which ones to overwrite. I used the existing Nedelec interpolations on RefTriangle's as reference here.

Yes, I'm thinking if we should remove those defaults, as it easily leads to errors when implementing (but at least now it should be caught by the tests)

get_direction is not part of the interpolation unit tests.

That would be a good addition! Have to think a bit though about the test case.

You can also open this as PR, then it is easier to comment directly on the code!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants