Trouble with Mixed Spaces in Viscoelastic Model and Contact

I’m working with contact, currently trying to implement a viscoelastic linear model (Bleyer). This model utilizes a mixed function space, so to integrate it gradually, I’m only creating the mixed space W and working with its vector space.

# Mixed space for the viscoelastic problem
Ve = ufl.VectorElement("P", mesh.ufl_cell(), 1)
Qe = ufl.TensorElement("DG", mesh.ufl_cell(), 1)    
W = fem.FunctionSpace(mesh, ufl.MixedElement([Ve, Qe]))

w = fem.Function(W)
(u, epsv) = ufl.split(w)
w_old = fem.Function(W)
(u_old, epsv_old) = ufl.split(w_old)
w_ = ufl.TestFunction(W)
(u_, epsv_) = ufl.split(w_)
dw = ufl.TrialFunction(W)  
# Space for the linear problem
V = VectorFunctionSpace(mesh, ("Lagrange", args.order))
u = Function(V)
du = Function(V)
v = ufl.TestFunction(V)
w = ufl.TrialFunction(V)

When using W.sub(0), I get the following error:

ValueError: Contact kernel not supported for spaces with value size!=1

From what I’ve reviewed, I made sure they have the same number of cells:
print(len(V.dofmap.list)) and print(len(W.sub(0).dofmap.list)) are both equal to 344. However, when I print V.dofmap.list, it gives me a list with the degrees of freedom of each element, but when I do the same for W.sub(0).dofmap.list, it adds additional elements, I don’t know if the error is due to this.

The error I showed originates from executing this:

contact_problem.generate_contact_data(friction_law, W.sub(0), {"u": u,"du": u_old, "mu": mu0, "lambda": lmbda0, "fric": fric}, E * gamma * args.order**2, theta)

I don’t think I can provide a minimal reproducible code since it requires installing the Asimov repository. Any comments would be appreciated.

Dear @Moises_Gresve , this would be an issue you should create at: Issues · Wells-Group/asimov-contact · GitHub
Please also note that you would have to make a reproducible example for anyone to be able to help you.

Hi @Moises_Gresve

I wanted to know if you had finally succeeded in solving this problem, as I am currently facing the same problem. I was also wondering whether the Asimov code could be used for large deformations.

Thanks

Hello,

Unfortunately, the Asimov code is designed for small deformations, and due to package issues, installation in an Ubuntu environment seems unfeasible. I would recommend installing a version prior to the latest branch available.

An alternative I haven’t explored is using the new_demo_compare_nitsche_snes.py code. I have implemented this code for large deformations with a rigid body. Please send me an internal message so we can stay in touch and discuss further details.