flexible general pde calc function. takes function to obtain sipmhist as an argument