# Excluding gradients in non conducting regions of a mesh

Hi,

I’m interested in solving eddy current problems with ngsolve. I’ve already done some experiments with magnetostatic problems. Here I know that I can turn off the gradients in the complete domain by specifying a finite element space of the form

and adding an appropriate regularisation term to the bilinear form.

However, for eddy current problems, I have a conducting region and a non-conducting region. If I used a vector potential formulation, I know that I need to keep the gradients in the conducting region but that are not needed in the non-conducting region. To save on the number of degrees of freedom I would like to turn off the gradients in the non-conducting region. Is this possible through defining an appropriate finite element space that tags a region in the mesh? Or do I need to define two different fes and combine them in someway?

Also, in terms of the local Jacobi preconditioner, can I apply this directly to such problems?

Ben

Yes there is a feature for that:

``````from netgen.csg import *
from ngsolve import *

ngsglobals.msg_level = 0

geo = CSGeometry()
block = OrthoBrick(Pnt(-1,-1,-1), Pnt(1,1,1))
sphere = Sphere(Pnt(0,0,0),0.5)

mesh = Mesh(geo.GenerateMesh())
Draw(mesh)

dom_nrs_metal = [1 if mat == "metal" else 0 for mat in mesh.GetMaterials()]

order = 3
full_fes = HCurl(mesh, order=order)

ndofs = {"air" : {}, "metal" : {}}
if len(el.dofs) not in ndofs[el.mat]:
ndofs[el.mat][len(el.dofs)] = 1
else:
ndofs[el.mat][len(el.dofs)] += 1

print(ndofs)

print("ndof full = ", full_fes.ndof)
``````{'air': {41: 188, 32: 156, 29: 100, 35: 6, 50: 2}, 'metal': {60: 142}}