How to apply boundary conditions to left-hand matrix

Hi, I want to replace the “dolfin” with the latest “dolfinx” in my old project, but I met a problem: the result from “fenics.assemble_system” is different compared with “dolfinx.fem.assemble_matrix” in dolfinx. I find that the result from “dolfinx.fem.assemble_matrix” is equal to the result of “fenics.assemble_system” without boundary conditions. So how can I apply the boundary conditions to the left-hand side matrix?

looking forward to anyone’s help.
Best regard.

See: Application of Dirichlet boundary conditions — FEniCS Tutorial @ Sorbonne
as lifting is equivalent to assemble_system in legacy dolfin (allthough it is not properly documented in the all code).

1 Like