vectorized boundary conditions