Weak form of peridynamics