Apply Dirichlet BC based on the solution

Hello,

I want to apply a Dirichlet BC on a node of an 1D domain such as

wBCi = DirichletBC(FEM.sub(2), value, on_interface )

but I want the value to be an unknown of the problem such as the velocity lets say.

Is that possible?