Numerical methods as applied to linear and nonlinear wave equations with solutions having different levels of smoothness