Fast Physical Simulator for Computations on CPU and Graphics Processing Unit (GPU)