Generalized variational principles in the finite-element method.