Next: Subroutine DEMBX
Up: Explanation of key
Previous: Explanation of key
The subroutine ENERGY is found in all of the finite element programs. It computes the total energy of the system, which is a quadratic functional of the nodal voltages, in the electrical case, and the nodal displacements, in the elastic case. It also computes the gradient of the energy, to be fed into the subroutine DEMBX, which uses the gradient as a starting point for the conjugate gradient routine. The heart of the subroutine is a matrix multiply of the global stiffness matrix times the vector of displacements or voltages. This is accomplished using only the small, local stiffness matrices dk. Essentially, each matrix multiply goes through the same steps that would be necessary for actually building the global stiffness matrix, but does not store the results, which saves tremendously on storage.