Hi creativeworker,
you can use a BitArray to sort dofs. This works only for lowest order H1 elements where every dof is associated with the vertex value.
For example
Code:
fes = H1(mesh, order=1)
gfu = GridFunction(fes)
gfu.Set(x*y+2*y)
limit = 1.5
dofs = BitArray(fes.ndof)
dofs[:] = False
for i in range(fes.ndof):
if gfu.vec[i] > limit:
dofs[i] = True
saves all dofs where gfu is greater than 1.5.
Defining a second space which lives only on these dofs can be done only with
Code:
fes2 = H1(mesh, order=1, dirichlet="left|top|bottom|right")
for i in range(fes.ndof):
if dofs[i] == False:
fes2.SetCouplingType(i,COUPLING_TYPE.UNUSED_DOF)
fes2 = Compress(fes2)
Best,
Michael