A functional oriented truncation error adaptation method