Error-estimate based adaptive mesh refinement