GRTLCollaboration / GRChombo

An AMR based open-source code for numerical relativity simulations.
BSD 3-Clause "New" or "Revised" License
82 stars 53 forks source link

4th order derivative stencils hard-coded in GammaCalculator class #251

Open the-florist opened 5 months ago

the-florist commented 5 months ago

The GammaCalculator class (Source/CCZ4/GammaCalculator.hpp) uses a m_deriv object to calculate spatial derivatives of the spatial tensor, but declares this m_deriv object as a protected ForthOrderDerivatives object belonging to the class, and does not change the type of the object depending on the max_spatial_derivative_order flag in params, nor does it throw an error if the user requests 6th order derivatives.

I'm happy to write a bit of code to either create this dependence on the max_spatial_derivative_order flag, or throw an error if a larger derivative order is requested.

-- Ericka

mirenradia commented 5 months ago

I guess it would be best to just template the class over a deriv_t type with default FourthOrderDerivatives. Feel free to open a PR to do this.