Framework for solving reaction diffusion equations using finite difference or spectral methods