How to apply a boundary condition to a range of DOFs?

Dear @mb246,

You have not put much effort into making this into a minimal reproducible example.

I am assuming that your dofs in range 1-6 (I am assuming that you are using 1-indexing) and that you are referring to degrees of freedom located at vertex 1-6 in the input mesh.

You need to map the input vertices to the dofs on your process.
See for instance:

and subsequent posts.

As clearly illustrated by the dolfinx demos, Dirichlet boundary conditions are applied by giving the indices of the dofs as input to dolfinx.fem.dirichletbc, you just need to map your global input vertex numbering to the local dof index on your process.