Try dual boundary constraints.