SSAFEM: Move some computations out of inner loops.