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

Retrieve ordering of Nédélec and Raviart-Thomas degrees of freedom #4209

Open
pazathoth opened this issue Mar 24, 2024 · 1 comment
Open
Assignees

Comments

@pazathoth
Copy link

I'd like to use MFEM as a drop-in replacement for FreeFem in the magnetohydrodynamics solver I'm developing as part of my PhD thesis. I already have a master student's toy model implementation in MFEM and a rudimentary interface. Now I'd like to know if my approach for further integration is feasible before I continue. I would need a few pointers, either to the relevant part of the code itself or someone familiar with the topic whom I could ask. Tzanio already pointed out that @mlstowell, @psocratis and @dylan-copeland might be able to help.

I use an iterative scheme and need to calculate the magnetic vector potential from the current density as part of every iteration step. Now I'm using lowest-order Nédélec and Raviart-Thomas elements, respectively, but I might need higher orders later. FreeFem uses its own scripting language, which means I can just provide the weak form of Ampère's law in a very succinct syntax. On the other hand, it's not very flexible, so I resorted to calculating the FE DOFs already in Fortran. Given the node ordering and coordinates, I know the mapping for edge DOFs and can write to and read from FreeFem's arrays directly. Can I somehow do the same with MFEM?

Starting from scratch, I'd do things differently, but I already have most other pieces of the puzzle. My master student provided an MFEM implementation for the problem described above, as well as another problem that only needs H1 elements (of second-lowest order for now). For the latter, we have an interface using callbacks e.g. for the linear form integrators. With a good hundred iteration steps, the amount of indirection becomes quite expensive, since I could provide the DOFs directly already. For simple nodal elements, the DOF ordering in MFEM corresponds to the node ordering, as far as I can tell. The question now is, how can I retrieve the ordering of DOFs for (lowest-order) Nédélec and Raviart-Thomas elements?

I hope my request is somewhat clear – I only have a tenuous grasp of FEM, also concerning terminology, but I'm happy to discuss with anyone willing and able to provide support, also if you suggest an alternative approach.

@pazner
Copy link
Member

pazner commented Apr 10, 2024

Lowest-order Nédélec DOFs correspond to the mesh edges, and lowest-order Raviart-Thomas DOFs correspond to the mesh faces.

Note that FiniteElementSpace provides functions GetVertexDofs, GetEdgeDofs, and GetFaceDofs that will give you the DOFs corresponding to the different geometric entities in the mesh.

@pazner pazner self-assigned this Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants