Dirichlet boundary condition in dolfinx

Hi everyone!
I have the following question about setting the boundary conditions for dolfinx:
Problem : For mandatory Dirichlet boundary conditions.
Ax=b for example:x2 is known (i.e. Dirichlet boundary condition)
image
In order to obtain a solution that satisfies the Dirichlet boundary.Often, this equation is treated like this:
image
So I want to know how dolfinx achieves this?
By apply_lifting(b,[a],[bcs]) ?

Yes, DOLFINx does this by:

  1. Supplying bcs to assemble_matrix, this sets the columns and rows with bcs to the identity row/column
  2. Use apply lifting to get the system above (note still with some rows for the dirichlet bc dofs
  3. Using set_bc to avoid having to do back substitution after solving the problem
2 Likes