SpECTRE's C++ tensor expression interface
ORAL
Abstract
SpECTRE is an open-source code for multi-scale, multi-physics problems in astrophysics and gravitational physics. To tackle these problems, SpECTRE implements a tensor class in C++ that tracks the dimensionality and valence of each index, as well as whether the index is spatial or spacetime. Unfortunately, all tensor operations are currently written as for loops that perform element-wise operations. Not only is the same loop structure needed repeatedly throughout the code, but writing these loops is tedious and error prone. These issues are addressed by a newly developed tensor expression interface. This interface enables writing and evaluating tensor expressions with C++ syntax that closely resembles tensor index notation found in physics equations. Ultimately, the tensor expressions in SpECTRE make implementing new equations easier and less error prone, and make the code significantly easier to read. SpECTRE's tensor expressions implement addition, subtraction, contraction, and products. In this talk, I will discuss implementation details, outline what makes this interface different from existing tensor libraries and useful for physics, and present example tensor expressions using this interface in SpECTRE.
–
Authors
-
Alexandra Macedo
California State Univeristy, Fullerton
-
Nils Deppe
California Institute of Technology
-
Geoffrey Lovelace
California State Univeristy, Fullerton, California State University, Fullerton