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.