How we can mark interior nodes and impose some condition on those nodes and then call it in solve()

def boundary_active(x):
    t1 = l_n(x) - c*(u_n(x)-g(x))
    if t1 > 0:
        return True
    else:
        return False
bc_active = DirichletBC(W.sub(0), g, boundary_active, method = "pointwise")

I think bc_active check this condition on the boundary nodes only as i am using DirichletBC() but i want to check this condition on the interior nodes .

So, Can you suggest me the way how i can mark those nodes where t1>0 and impose W.sub(0)=g on those nodes and use this thing as a constraint in solve().

Tell me how i can do this thing in FEniCS.
I am very graceful if you can help me in this part.

See for instance: Boundary conditions on edges or nodes - #6 by dokken on how to apply BCs to a function, which in turn can be visualized in Paraview