GollyGang / ready

A cross-platform implementation of various reaction-diffusion systems and PDEs.
GNU General Public License v3.0
775 stars 60 forks source link

Option to change the stencil accuracy #130

Closed timhutton closed 3 years ago

timhutton commented 3 years ago

This closes #127.

Reducing the accuracy to low from medium gives around a 10% speed boost. But we default to medium because there are anisotropic effects of using the smaller stencil:

With a low-accuracy Laplacian (0,1,0; 1,-4,1; 0,1,0): image Notice the squared-off waves. Compare with using a medium-accuracy (isotropic, 2nd-order errors) Laplacian (1,4,1; 4,-20,4; 1,4,1)/20 (as was used previously, and is our new default) where the waves show no directional preference. image

Higher-accuracy stencils (4th order errors) are useful in advection.vti and likely others. See previous discussion here: #118