Accurate computation of local and global electrostatic quantities from FE solutions