Iterate contact with CGsolver

Hi,

Is it possible to iterate contact in the CG solver ??

My contact definition :

n = specialcf.normal(3)
penalty = 1e10
a += penalty * InnerProduct((u * n), (v * n)) * dx(element_boundary=True, 
definedon=mesh.Boundaries(contact_faces))

My CGSolver call :

from ngsolve.krylovspace import CGSolver
inv = CGSolver(a.mat, pre, printrates='\r', tol=1e-6, maxiter=500)
gfu.vec.data += inv * (f.vec - a.Apply(gfu.vec))

Thanks :slight_smile:

yes, you can.

Think you want a boundary integral (instead of element-boundary):

a += penalty * InnerProduct((u * n), (v * n)) * ds(definedon=mesh.Boundaries(contact_faces))

Yes, I see, but the result looks like it hasn’t iterated.

I get this:


Instead of this:

what do you think ?