Function value at the boundary

Again, your question is fairly generic, with very little context and no code to illustrate your use-case.

There are various ways to access the data on a facet of a mesh. For instance by getting the entity_dofs or entity_closure_dofs and use them to access values in a function u, print(u.vector()[dof] for dof in entity_dofs_of_facet).

The easiest way to debug a DirichletBC is visually using bc.apply on a function, see: Boundary conditions on edges or nodes - #6 by dokken