Let us consider a general problem AU = b, with U constrained as U = CUf + Up, where C is the constant constraint matrix, Uf is the free dofs to be determined, Up is a known prescribed vector. The above problem is usually solved by: (C^T * A * C)*Uf = C^T * (b - A * Up).
A and b can be obtained from the assemble_system:
A, b = assemble_system(J, Du_energy_functional, bcs)
But the manipulations on A and b are computationally prohibitive, since the constraint matrix C can be constructed as a dense matrix.
# infeasible
Aff = np.dot(np.dot(C.transpose(), A), C)
bf = np.dot(C.transpose, b)
solve(Aff, uf, bf)
u.vector():[] = C*uf + up
I am wondering, how can fenics to solve such a conventional problem with linear constraints?
Actually, the displacement controlled loading follows the same argument, though fenics uses a different strategy to deal with the Dirichlet BC.