Generalized conservation checks in finite element analysis