Sobolev neural network with residual weighting as a surrogate in linear and non-linear mechanics