This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

How to solve the inner product on a mixed Nedelec and nodal Space

+2 votes

Im trying to solve an electromagnetic scattering problem with an advanced formulation of coupled vector and scalar potentials A and Phi instead of the common E-field formulation. This potential approach is very promising, especially in terms of accuracy at inner boundaries with huge electrical conductivity contrasts.

For this purpose, I need to define mixed curl-conforming Nedelec and nodal spaces for the real and imaginary parts of both potentials as follows:

V = FunctionSpace(mesh,'N1curl',p)
PHI = FunctionSpace(mesh,'CG',p)    
W = MixedFunctionSpace([V, V, PHI, PHI])
(v_ned_re, v_ned_im, v_nodal_re, v_nodal_im) = TestFunctions(W)
(u_ned_re, u_ned_im, u_nodal_re, u_nodal_im) = TrialFunctions(W)

My solution fails with the above functionspace-formulation, but if I solve my Problem on a nodal 'CG' VectorFunctionSpace: V_cg:

V_cg = VectorFunctionSpace(mesh,'CG',p),

instead of the N1curl space: V, my solution is correct despite artifacts which, from my experience with the E-field formulation on both nodal- and Nedelec spaces, probably occur due to the non-curl-conforming nodal elements.

I suppose my problem is related to the following question:
https://fenicsproject.org/qa/10595/inner-product-of-two-dolfin-function,

because I need to calculate inner products on the mixed spaces, e. g:

inner(sigma * grad(u_ned_re), v_nodal_im)*dx,

Althought the Nedelec and nodal spaces are based on the same mesh, the N1curl-Functionspace is defined on the edges and not the nodes of the elements which is in my opinion equal to the use of two different meshes in an inner product. I think thats why my solution using the Nedelec-Space V is not correct and shows artifacts. This also fits to the fact that solving the Problem on a Vector-CG space instead if the N1curl space works (but with artifacts). On the other hand, I would expect a 'warning' or 'error' if there are issues for to assemble inner products of different Functionspaces/Meshes.

Has anyone an idea how to circumvent my issue?

My ideas are:

  1. Define the nodal space not on the original mesh but on a mesh based on the edge-coordinates of the nedelec space. Issues: Will this solve the problem of the inner product computation and if yes, how to implement this new nodal Functionspace?

  2. Is it possible to project the nodal Test- and Trial functions on the Nedelec-Space before formulating the variational problem?

  3. Is there maybe an alternative in the UFL-form-language which works?

Thank you in advance for any suggestions!

PS: Another realy curious issue: Although my calculated potentials A and PHI, using the N1curl space V, are definitely not correct in terms of amplitude and direction, I am able to derive the exact solution of the magnetic field H, which is the curl of A. How is this possible??? How can the curl operator kind of eliminate the artifacts of the A-PHI computation???

asked Jul 6, 2016 by RR FEniCS User (3,330 points)

I tried Idea 1 and calculated the nodal mesh with node-coordinates matching the edge-coordinates of the Nedelec Space. Setting up the MixedFunctionSpace fails with the error:

"element = ufl.MixedElement(*[V.ufl_element() for V in spaces]) "
"Sub elements must live on the same domain (for now)."

1 Answer

+1 vote

I found out that my issue has nothing to do with the mixed product of nedelec and scalar FunctionSpaces. The fact that brought me on this idea (the electric fields looked not disturbed using the nodal VectorFunctionSpace instead of the Nedelec Space) was just an unfortunate coincidence.

In the end, a simple change of + to - of the scalar potential (depends on the definition of each author) solved my issue:-)

answered Jul 18, 2016 by RR FEniCS User (3,330 points)
...