GEOS icon indicating copy to clipboard operation
GEOS copied to clipboard

Acoustic wave solver optimization

Open sframba opened this issue 2 years ago • 0 comments

This PR provides a significant boost to the performance of the Acoustic wave propagator. In particular:

  • The assembly of the (approximate) stiffness matrix exploits the characteristic of the SEM method. The matrix is now constructed as in [1]. This leads to a complexity of $p^5$ instead of $p^9$, with $p$ being the polynomial order of the method
  • An unneeded loop was removed from the mass matrix computation
  • The damping matrix is computed via a slightly more efficient loop on faces

Moreover, the C++ structure of Gauss-Lobatto discretizations in the code is simplified by using a single template class Qk_Hexahedron_Lagrange_GaussLobatto. As a bonus, the Q2 formulation can be added with a single line of code.

In order to specialize the SEM implementation and distinguish it from the FE case, the optional tag formulation of the FiniteElementSpace section in the xml input has been used. One now has to specify SEM instead of default when running the Acoustic SEM solver. The template specializations are resolved using a simple instance of std::enable_if.

A few other modifications needed to enable high-order SEM solvers, originally from PR 2045, are included:

  • A compile directive to skip the precalculation of shape function derivatives in GPU (unnecessary), originally added by @rrsettgast;
  • The removal of the auxiliary Face Manager faceManager0, originally added by @acitrain.

The last modification has the added bonus of resolving issue 2122.

The results have been checked and the gain in performance seems to be very significant, with a factor of 2 in running time for Q1 and a factor of 50 (!) for Q3, cf. PR 2084. After this PR is merged, PR 2045 will no longer be needed.

[1] M. Duruflé, Intégration numérique et éléments finis d'ordre élevé appliqués aux équations de Maxwell en régime harmonique (in French)

sframba avatar Oct 14 '22 13:10 sframba