Applying the boundary conditions to the model.