Finding Beltrami field in torus

Hello,

I’m trying to find the Beltrami, linear force-free field (\nabla \times B = \mu B, where \mu is a constant) in a torus with the condition of the field being tangent on the boundary, \nabla . B = 0, and an integral constraint on the flux.

My experience with finite elements is minimal and so I’m looking for general advice, e.g. how to create the mesh, find the appropriate variational form, and how to implement the problem in dolfinx. Links to similar problems solved in dolfinx are also welcome.

Thanks in advance