13.07.2015 Views

TOPOLOGICAL OPTIMIZATION OF THE EVALUATION ... - BearSpace

TOPOLOGICAL OPTIMIZATION OF THE EVALUATION ... - BearSpace

TOPOLOGICAL OPTIMIZATION OF THE EVALUATION ... - BearSpace

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

OPTIMIZING <strong>EVALUATION</strong> <strong>OF</strong> FINITE ELEMENT MATRICES 9Table 4.3Number of multiply-add pairs in the optimized algorithm for computing the Laplacian elementstiffness matrix on triangles and tetrahedra for Lagrange polynomials of degree one through threewithout using symmetry.trianglesdegree n m nm MAPs1 9 4 36 132 36 4 144 253 100 4 400 74tetrahedradegree n m nm MAPs1 16 9 144 432 100 9 900 2053 400 9 3600 864Table 4.4Number of multiply-add pairs in the optimized algorithm for computing the Laplacian elementstiffness matrix on triangles and tetrahedra for Lagrange polynomials of degree one through threeusing symmetry.trianglesdegree n m nm MAPs1 6 3 18 92 21 3 63 173 55 3 165 46tetrahedradegree n m nm MAPs1 10 6 60 272 55 6 330 1013 210 6 1260 370good speedup by simply omitting multiplication by zeros. From this, we only gaineda modest additional speedup by using our additional optimizations. However, this ismost likely due to the relative costs of memory access and floating point operations.We have to load the geometric tensor from memory and we have to write every entryof the matrix to memory. Hence n + m in the tables gives a lower bound on memoryaccess for computing the stiffness matrix. Our optimizations lead to algorithms forwhich there are a comparable number of arithmetic and memory operations. Hence,our optimization has succeeded in reducing the cost of computing the local stiffnessmatrix to a small increment to the cost of writing it to memory.4.2. Advection in one coordinate direction. Now, we consider constantcoefficient advection aligned with a coordinate direction∫a(v, u) = v(x) ∂u(x) dx. (4.3)∂x 1ΩThis is part of the operator associated with constant coefficient advection in somearbitrary direction — optimizing the other coordinate directions would give similarresults. These results are shown in Table 4.5. Again, our optimization generatesalgorithms for which the predominant cost of computing the element matrix is writingit down, as there is significantly fewer than one floating point cycle per matrix entryin every case.4.3. Weighted Laplacian. Our final operator is the variable coefficient Laplacian:∫a w (v, u) = w(x)∇v(x) · ∇u(x) dx. (4.4)ΩThis form may be viewed as a trilinear form a(w, v, u) in which w is the projectionof the coefficient into the finite element space. For many problems, this can be

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!