Dirichlet boundary conditions on linear combination of functions

Linear combinations is a multi-point constraint, and can be done with Lagrange multipliers, Nitsches method or matrix reduction techniques. See for instance: No-penetration_bounadry_condition