# Dirichlet BCs and PETSc TS

I know this probably isn’t a FEniCS issue per se, but I’m running into it the course of using FEniCS, and don’t know where else to ask. Sorry in advance.

I’m trying to use PETSc TS for time integration, and for problems with only Neumann BCs that seems to work correctly. But now I want to add Dirichlet BCs, and I’m not quite sure how to modify my code.

The Documentation for PETSc TS says the problem should be of the form
F(t, u, \dot{u}) = G(t, u), \quad u(t_0) = u_0
where you supply F, G, \frac{dF}{du^n} and \frac{dG}{du^n}. Again, for only Neumann BCs, I seem to be supplying the the correct vectors/matrices.

As far as I understand, for a linear problem, we modify the unconstrained system
A u = b
by applying lifting to the RHS, and set a identity submatrix for the constrained DOFs in A. Usually I simply use assemble_matrix_block/assemble_vector_block with the bcs parameter, and it gives me a modified system, say
\hat{A} u = \hat{b}
that will fulfill the BCs.

Now for the time dependent problem, I’m not quite sure how the two vectors and two matrices enter into an equation. Do the boundary conditions for one vector need to be multiplied by -1, or by this input shift \sigma, or set to the time derivative of the boundary conditions, or what. At least just setting bcs to the boundary conditions at the currrent time for all vectors/matrices does not seem to work.

Any pointers on what I’m missing are greatly appreciated.