sxs-collaboration / spectre

SpECTRE is a code for multi-scale, multi-physics problems in astrophysics and gravitational physics.
https://spectre-code.org
Other
159 stars 189 forks source link

Add 3D EoS test helper and fix bug in 2d random generators #6030

Closed isaaclegred closed 3 months ago

isaaclegred commented 4 months ago

Proposed changes

This PR adds a EoS Test helper for 3-d EoSs, and fixes what I believe to have been a bug in the 2-d EoS test helpers where the specific energy random generators was not being used correctly.

Upgrade instructions

Code review checklist

Further comments

The 3D EoS test helper is essentially a pared-down version of the 2D helper (because we require fewer thermodynamic functions to be implemented for the 3D EoSs) though we work in terms of randomly generated temperatures. In general, random tests should probably be implemented with respect to rest mass density, temperature, and electron fraction, rather than the specific internal energy, because it is hard to determine the valid range for the specific internal energy but it's typically very easy for the temperature.

nilsdeppe commented 3 months ago

Please go ahead and squash :) I have no idea how clang-tidy is deciding these things. It seems to be wrong for the header file...

isaaclegred commented 3 months ago

@nilsdeppe (possibly) modulo the clang-tidy errors I think this is ready to go