SpECTRE
v2025.03.17
|
Compute the primitive variables from the conservative variables. More...
#include <PrimitiveFromConservative.hpp>
Public Types | |
using | return_tags = implementation defined |
using | argument_tags = implementation defined |
Static Public Member Functions | |
template<bool EnforcePhysicality = true> | |
static bool | apply (gsl::not_null< Scalar< DataVector > * > rest_mass_density, gsl::not_null< Scalar< DataVector > * > electron_fraction, gsl::not_null< Scalar< DataVector > * > specific_internal_energy, gsl::not_null< tnsr::I< DataVector, 3, Frame::Inertial > * > spatial_velocity, gsl::not_null< tnsr::I< DataVector, 3, Frame::Inertial > * > magnetic_field, gsl::not_null< Scalar< DataVector > * > divergence_cleaning_field, gsl::not_null< Scalar< DataVector > * > lorentz_factor, gsl::not_null< Scalar< DataVector > * > pressure, gsl::not_null< Scalar< DataVector > * > temperature, const Scalar< DataVector > &tilde_d, const Scalar< DataVector > &tilde_ye, const Scalar< DataVector > &tilde_tau, const tnsr::i< DataVector, 3, Frame::Inertial > &tilde_s, const tnsr::I< DataVector, 3, Frame::Inertial > &tilde_b, const Scalar< DataVector > &tilde_phi, const tnsr::ii< DataVector, 3, Frame::Inertial > &spatial_metric, const tnsr::II< DataVector, 3, Frame::Inertial > &inv_spatial_metric, const Scalar< DataVector > &sqrt_det_spatial_metric, const EquationsOfState::EquationOfState< true, 3 > &equation_of_state, const grmhd::ValenciaDivClean::PrimitiveFromConservativeOptions &primitive_from_conservative_options) |
Compute the primitive variables from the conservative variables.
For the Valencia formulation of the GRMHD system with divergence cleaning, the conversion of the evolved conserved variables to the primitive variables cannot be expressed in closed analytic form and requires a root find.
[Siegel {et al}, The Astrophysical Journal 859:71(2018)] (http://iopscience.iop.org/article/10.3847/1538-4357/aabcc5/meta) compares several inversion methods.
If ErrorOnFailure
is false
then the returned bool
will be false
if recovery failed and true
if it succeeded.
If EnforcePhysicality
is false
then the hydrodynamic inversion will return with an error if the input conservatives are unphysical, i.e., if no solution exits. The exact behavior is governed by ErrorOnFailure
.