Solving partial differential equations in computational mechanics via nonlocal numerical approaches