This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

How to solve A*U = b with linear constraints U = C*Uf + Up

0 votes

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.

asked Mar 27, 2017 by jywu FEniCS Novice (510 points)

The functionality you're looking for is in development in DOLFIN for a release in the near future. Others may have ideas for implementing this for now though.

Thank you, Nate!
Did you mean 2017.01?

1 Answer

0 votes

Since you are already using numpy there is no reason to call up solve in FEniCS. You may solve it in numpy instead. That would only work for rather small matrices though.

answered Mar 29, 2017 by Kent-Andre Mardal FEniCS Expert (14,380 points)
...