diff --git a/src/PointwiseFunctions/AnalyticData/BnsInitialData/CMakeLists.txt b/src/PointwiseFunctions/AnalyticData/BnsInitialData/CMakeLists.txt index 8d48657c93e1..72691f86e04d 100644 --- a/src/PointwiseFunctions/AnalyticData/BnsInitialData/CMakeLists.txt +++ b/src/PointwiseFunctions/AnalyticData/BnsInitialData/CMakeLists.txt @@ -4,18 +4,6 @@ set(LIBRARY BnsInitialDataAnalyticData) add_spectre_library(${LIBRARY}) -spectre_target_sources( - ${LIBRARY} - PRIVATE - TovStar.cpp - ) - -spectre_target_headers( - ${LIBRARY} - INCLUDE_DIRECTORY ${CMAKE_SOURCE_DIR}/src - HEADERS - TovStar.hpp - ) target_link_libraries( ${LIBRARY} diff --git a/src/PointwiseFunctions/AnalyticData/BnsInitialData/Factory.hpp b/src/PointwiseFunctions/AnalyticData/BnsInitialData/Factory.hpp index c9b8769fd644..48b01cd9102a 100644 --- a/src/PointwiseFunctions/AnalyticData/BnsInitialData/Factory.hpp +++ b/src/PointwiseFunctions/AnalyticData/BnsInitialData/Factory.hpp @@ -4,7 +4,6 @@ #pragma once #include "PointwiseFunctions/AnalyticData/BnsInitialData/SpecInitialData.hpp" -#include "PointwiseFunctions/AnalyticData/BnsInitialData/TovStar.hpp" namespace BnsInitialData::InitialData { using all_initial_data = tmpl::list>; diff --git a/src/PointwiseFunctions/AnalyticData/BnsInitialData/TovStar.cpp b/src/PointwiseFunctions/AnalyticData/BnsInitialData/TovStar.cpp deleted file mode 100644 index 1d801e39564c..000000000000 --- a/src/PointwiseFunctions/AnalyticData/BnsInitialData/TovStar.cpp +++ /dev/null @@ -1,282 +0,0 @@ -// Distributed under the MIT License. -// See LICENSE.txt for details. - -#include "PointwiseFunctions/AnalyticData/BnsInitialData/TovStar.hpp" - -#include -#include -#include -#include -#include - -#include "DataStructures/DataBox/Prefixes.hpp" -#include "DataStructures/DataVector.hpp" -#include "DataStructures/Tensor/EagerMath/Magnitude.hpp" -#include "DataStructures/Tensor/Tensor.hpp" -#include "Elliptic/Systems/BnsInitialData/Tags.hpp" -#include "Elliptic/Systems/Xcts/Tags.hpp" -#include "NumericalAlgorithms/LinearOperators/PartialDerivatives.hpp" -#include "Options/Options.hpp" -#include "Options/ParseOptions.hpp" -#include "PointwiseFunctions/AnalyticSolutions/Xcts/CommonVariables.tpp" -#include "PointwiseFunctions/AnalyticSolutions/Xcts/WrappedGr.hpp" -#include "PointwiseFunctions/GeneralRelativity/Tags.hpp" -#include "PointwiseFunctions/GeneralRelativity/Tags/Conformal.hpp" -#include "PointwiseFunctions/Hydro/ComovingMagneticField.hpp" -#include "PointwiseFunctions/Hydro/StressEnergy.hpp" -#include "Utilities/ConstantExpressions.hpp" -#include "Utilities/ErrorHandling/Error.hpp" -#include "Utilities/GenerateInstantiations.hpp" -#include "Utilities/Gsl.hpp" -#include "Utilities/Math.hpp" - -namespace BnsInitialData::InitialData::tov_detail { -template -void TovVariables::operator()( - gsl::not_null*> rest_mass_density, - gsl::not_null /*cache*/, - hydro::Tags::RestMassDensity /*meta*/) const { - *rest_mass_density = get_tov_var(hydro::Tags::RestMassDensity{}); -} - -template -void TovVariables::operator()( - gsl::not_null*> specific_enthalpy, - gsl::not_null /*cache*/, - hydro::Tags::SpecificEnthalpy /*meta*/) const { - *specific_enthalpy = get_tov_var(hydro::Tags::SpecificEnthalpy{}); -} -template -void TovVariables::operator()( - const gsl::not_null*> lapse, - const gsl::not_null /* cache */, - gr::Tags::Lapse /*meta*/) const { - *lapse = get_tov_var(gr::Tags::Lapse{}); -} - -template -void TovVariables::operator()( - const gsl::not_null*> deriv_lapse, - const gsl::not_null /* cache */, - ::Tags::deriv, tmpl::size_t<3>, - Frame::Inertial> /*meta*/) const { - *deriv_lapse = get_tov_var(::Tags::deriv, - tmpl::size_t<3>, Frame::Inertial>{}); -} - -template -void TovVariables::operator()( - gsl::not_null*> spatial_metric, - gsl::not_null /*cache*/, - gr::Tags::SpatialMetric /*meta*/) const { - *spatial_metric = get_tov_var(gr::Tags::SpatialMetric{}); -} - -template -void TovVariables::operator()( - gsl::not_null*> inverse_spatial_metric, - gsl::not_null /*cache*/, - gr::Tags::InverseSpatialMetric /*meta*/) const { - *inverse_spatial_metric = - get_tov_var(gr::Tags::InverseSpatialMetric{}); -} - -// TODO: Fix this! The TOV class should potentially implement it. -// This works only if the spatial slice is flat -template -void TovVariables::operator()( - gsl::not_null*> - spatial_christoffel_second_kind_contracted, - gsl::not_null /*cache*/, - gr::Tags::SpatialChristoffelSecondKindContracted /*meta*/) - const { - *spatial_christoffel_second_kind_contracted = - make_with_value>(x, 0.0); -} - -template -void TovVariables::operator()( - const gsl::not_null*> shift, - const gsl::not_null /* cache */, - gr::Tags::Shift /*meta*/) const { - *shift = get_tov_var(gr::Tags::Shift{}); -} -template -void TovVariables::operator()( - gsl::not_null*> deriv_shift, - gsl::not_null /*cache*/, - ::Tags::deriv, tmpl::size_t<3>, - Frame::Inertial> /*meta*/) const { - *deriv_shift = get_tov_var(::Tags::deriv, - tmpl::size_t<3>, Frame::Inertial>{}); -} - -template -void TovVariables::operator()( - gsl::not_null*> rotational_shift, - gsl::not_null /*cache*/, - BnsInitialData::Tags::RotationalShift /*meta*/) const { - const Scalar sqrt_det_spatial_metric = - get_tov_var(gr::Tags::SqrtDetSpatialMetric{}); - const tnsr::I shift = - get_tov_var(gr::Tags::Shift{}); - // We assume the orbital velocity is in the z-direction. We want the outcome - // of the cross product to be a tensor, so we need to multiply by - // 1/sqrt(gamma) - tnsr::I rotational_killing_vector = - hydro::initial_data::irrotational_bns::spatial_rotational_killing_vector( - x, orbital_angular_velocity, sqrt_det_spatial_metric); - - ::tenex::evaluate(rotational_shift, - (rotational_killing_vector(ti::I) + shift(ti::I))); -} -template -void TovVariables::operator()( - gsl::not_null*> velocity_potential, - gsl::not_null /*cache*/, - BnsInitialData::Tags::VelocityPotential /*meta*/) const { - const auto spatial_metric = - get_tov_var(gr::Tags::SpatialMetric{}); - std::array star_velocity{ - -star_center[1] * orbital_angular_velocity, - star_center[0] * orbital_angular_velocity, 0.0}; - *velocity_potential = make_with_value>(spatial_metric, 0); - for (size_t i = 0; i < 3; i++) { - for (size_t j = 0; j < 3; j++) { - // The velocity of the star is taken to be a constant as a guess - velocity_potential->get() += - (spatial_metric.get(i, j) * gsl::at(star_velocity, i) * x.get(j)); - } - } - velocity_potential->get() *= - (get(get_tov_var(hydro::Tags::SpecificEnthalpy{})) * - get(get_tov_var(hydro::Tags::LorentzFactor{}))); -} -template -void TovVariables::operator()( - gsl::not_null*> auxiliary_velocity, - gsl::not_null /*cache*/, - ::Tags::deriv, - tmpl::size_t<3>, Frame::Inertial> /*meta*/) const { - const auto spatial_metric = - get_tov_var(gr::Tags::SpatialMetric{}); - std::array star_velocity{ - -star_center[1] * orbital_angular_velocity, - star_center[0] * orbital_angular_velocity, 0.0}; - for (size_t i = 0; i < 3; i++) { - for (size_t j = 0; j < 3; j++) { - auxiliary_velocity->get(i) += - gsl::at(star_velocity, j) * spatial_metric.get(i, j); - } - const auto& specific_enthalpy = - get(get_tov_var(hydro::Tags::Pressure{})) / - get(get_tov_var(hydro::Tags::RestMassDensity{})) + - get(get_tov_var(hydro::Tags::SpecificInternalEnergy{})) + 1.0; - auxiliary_velocity->get(i) *= - (specific_enthalpy * - get(get_tov_var(hydro::Tags::LorentzFactor{}))); - } -} -template -void TovVariables::operator()( - gsl::not_null*> flux_for_velocity_potential, - gsl::not_null cache, - ::Tags::Flux, - tmpl::size_t<3>, Frame::Inertial> /*meta*/) const { - const auto& rotational_shift_stress = cache->get_var( - *this, BnsInitialData::Tags::RotationalShiftStress{}); - const auto& inverse_spatial_metric = - get_tov_var(gr::Tags::InverseSpatialMetric{}); - const auto& auxiliary_velocity = cache->get_var( - *this, ::Tags::deriv, - tmpl::size_t<3>, Frame::Inertial>{}); - ::tenex::evaluate(flux_for_velocity_potential, - (inverse_spatial_metric(ti::I, ti::J) - - rotational_shift_stress(ti::I, ti::J)) * - auxiliary_velocity(ti::j)); -} - -template -void TovVariables::operator()( - gsl::not_null*> deriv_log_lapse_over_specific_enthalpy, - gsl::not_null cache, - BnsInitialData::Tags::DerivLogLapseTimesDensityOverSpecificEnthalpy< - DataType> /*meta*/) const { - // The specific enthalpy is proportional to one over the lapse inside the star - // which simplifies the derivative substantially - const auto& lapse = cache->get_var(*this, gr::Tags::Lapse{}); - const auto& deriv_of_lapse = - cache->get_var(*this, ::Tags::deriv, - tmpl::size_t<3>, Frame::Inertial>{}); - const auto& rest_mass_density = - cache->get_var(*this, hydro::Tags::RestMassDensity{}); - const auto& specific_enthalpy = - cache->get_var(*this, hydro::Tags::SpecificEnthalpy{}); - // The first term is from lapse + specific enthalpy derivatives, - // second term is due to rest mass density derivative which involves the - // speed of sound. - ::tenex::evaluate( - deriv_log_lapse_over_specific_enthalpy, - deriv_of_lapse(ti::i) / lapse() * - (3.0 - 1.0 / 2.0 * specific_enthalpy() / - tov_star.equation_of_state().chi_from_density( - rest_mass_density)())); -} - -template -void TovVariables::operator()( - gsl::not_null*> fixed_source, gsl::not_null cache, - ::Tags::FixedSource< - BnsInitialData::Tags::VelocityPotential> /*meta*/) const { - const auto& lapse = cache->get_var(*this, gr::Tags::Lapse{}); - const auto& rotational_shift = - cache->get_var(*this, BnsInitialData::Tags::RotationalShift{}); - const auto& deriv_log_lapse_over_specific_enthalpy = cache->get_var( - *this, - BnsInitialData::Tags::DerivLogLapseTimesDensityOverSpecificEnthalpy< - DataType>{}); - const auto& deriv_of_lapse = - cache->get_var(*this, ::Tags::deriv, - tmpl::size_t<3>, Frame::Inertial>{}); - const auto& deriv_of_shift = - cache->get_var(*this, ::Tags::deriv, - tmpl::size_t<3>, Frame::Inertial>{}); - ::tenex::evaluate<>( - fixed_source, euler_enthalpy_constant * - (1.0 / square(lapse()) * rotational_shift(ti::I) * - deriv_log_lapse_over_specific_enthalpy(ti::i) - - 2.0 / square(lapse()) * rotational_shift(ti::I) * - deriv_of_lapse(ti::i) + - 1.0 / square(lapse()) * deriv_of_shift(ti::i, ti::I))); -} - -template -void TovVariables::operator()( - gsl::not_null*> rotational_shift_stress, - gsl::not_null cache, - BnsInitialData::Tags::RotationalShiftStress /*meta*/) const { - const auto& rotational_shift = - cache->get_var(*this, BnsInitialData::Tags::RotationalShift{}); - const auto& lapse = cache->get_var(*this, gr::Tags::Lapse{}); - hydro::initial_data::irrotational_bns::rotational_shift_stress( - rotational_shift_stress, rotational_shift, lapse); -} - -#define DTYPE(data) BOOST_PP_TUPLE_ELEM(0, data) -#define REGION(data) BOOST_PP_TUPLE_ELEM(1, data) - -#define INSTANTIATE(_, data) \ - template class TovVariables; - -GENERATE_INSTANTIATIONS( - INSTANTIATE, (double, DataVector), - (RelativisticEuler::Solutions::tov_detail::StarRegion::Interior, - RelativisticEuler::Solutions::tov_detail::StarRegion::Exterior)) - -#undef DTYPE -#undef INSTANTIATE - -} // namespace BnsInitialData::InitialData::tov_detail - -PUP::able::PUP_ID BnsInitialData::InitialData::TovStar::my_PUP_ID = - 0; // NOLINT diff --git a/src/PointwiseFunctions/AnalyticData/BnsInitialData/TovStar.hpp b/src/PointwiseFunctions/AnalyticData/BnsInitialData/TovStar.hpp deleted file mode 100644 index c56d58dc47a0..000000000000 --- a/src/PointwiseFunctions/AnalyticData/BnsInitialData/TovStar.hpp +++ /dev/null @@ -1,326 +0,0 @@ -// Distributed under the MIT License. -// See LICENSE.txt for details. - -#pragma once - -#include -#include - -#include "DataStructures/CachedTempBuffer.hpp" -#include "DataStructures/DataBox/Prefixes.hpp" -#include "DataStructures/DataVector.hpp" -#include "DataStructures/Tensor/Tensor.hpp" -#include "Elliptic/Systems/BnsInitialData/Tags.hpp" -#include "NumericalAlgorithms/LinearOperators/PartialDerivatives.hpp" -#include "Options/String.hpp" -#include "PointwiseFunctions/AnalyticSolutions/RelativisticEuler/TovStar.hpp" -#include "PointwiseFunctions/AnalyticSolutions/Xcts/CommonVariables.hpp" -#include "PointwiseFunctions/GeneralRelativity/Tags.hpp" -#include "PointwiseFunctions/GeneralRelativity/Tags/Conformal.hpp" -#include "PointwiseFunctions/Hydro/ComovingMagneticField.hpp" -#include "PointwiseFunctions/Hydro/EquationsOfState/EquationOfState.hpp" -#include "PointwiseFunctions/Hydro/InitialData/IrrotationalBns.hpp" -#include "PointwiseFunctions/Hydro/Tags.hpp" -#include "PointwiseFunctions/InitialDataUtilities/Background.hpp" -#include "PointwiseFunctions/InitialDataUtilities/InitialData.hpp" -#include "PointwiseFunctions/InitialDataUtilities/InitialGuess.hpp" -#include "Utilities/Gsl.hpp" -#include "Utilities/Serialization/CharmPupable.hpp" -#include "Utilities/TMPL.hpp" -#include "Utilities/TaggedTuple.hpp" - -/// \cond -namespace PUP { -class er; -} // namespace PUP -/// \endcond - -namespace BnsInitialData::InitialData { -namespace tov_detail { - -using TovCoordinates = RelativisticEuler::Solutions::TovCoordinates; -using StarRegion = RelativisticEuler::Solutions::tov_detail::StarRegion; - -template -using TovVariablesCache = cached_temp_buffer_from_typelist, - ::Tags::deriv, - tmpl::size_t<3>, Frame::Inertial>, - ::Tags::Flux, - tmpl::size_t<3>, Frame::Inertial>, - ::Tags::FixedSource>, - gr::Tags::Lapse, - ::Tags::deriv, tmpl::size_t<3>, Frame::Inertial>, - gr::Tags::Shift, - ::Tags::deriv, tmpl::size_t<3>, - Frame::Inertial>, - BnsInitialData::Tags::RotationalShift, - BnsInitialData::Tags::DerivLogLapseTimesDensityOverSpecificEnthalpy< - DataType>, - BnsInitialData::Tags::RotationalShiftStress, - gr::Tags::SpatialMetric, - gr::Tags::InverseSpatialMetric, - gr::Tags::SpatialChristoffelSecondKindContracted, - hydro::Tags::RestMassDensity, - hydro::Tags::SpecificEnthalpy>>; -template -struct TovVariables - : RelativisticEuler::Solutions::tov_detail::TovVariables { - static constexpr size_t Dim = 3; - - using Base = - RelativisticEuler::Solutions::tov_detail::TovVariables; - using Cache = TovVariablesCache; - using Base::operator(); - using Base::coords; - using Base::eos; - using Base::radial_solution; - - const std::array star_center; - const tnsr::I& x; - const DataType& radius; - const RelativisticEuler::Solutions::TovStar& tov_star; - const double euler_enthalpy_constant; - // Note this is not the angular velocity of the star around its axis, that - // is zero in this case. - const double orbital_angular_velocity; - - TovVariables(const tnsr::I& local_x, - const DataType& local_radius, - const RelativisticEuler::Solutions::TovStar& local_tov_star, - const EquationsOfState::EquationOfState& local_eos, - std::array local_star_center, - const double local_euler_enthalpy_constant, - const double local_orbital_angular_velocity) - : Base(local_x, local_radius, local_tov_star.radial_solution(), - local_eos), - star_center(std::move(local_star_center)), - x(local_x), - radius(local_radius), - tov_star(local_tov_star), - euler_enthalpy_constant(local_euler_enthalpy_constant), - orbital_angular_velocity(local_orbital_angular_velocity) {}; - - void operator()( - gsl::not_null*> velocity_potential, - gsl::not_null cache, - BnsInitialData::Tags::VelocityPotential /*meta*/) const; - void operator()( - gsl::not_null*> auxiliary_velocity, - gsl::not_null cache, - ::Tags::deriv, - tmpl::size_t<3>, Frame::Inertial> /*meta*/) const; - void operator()( - gsl::not_null*> flux_for_velocity_potential, - gsl::not_null cache, - ::Tags::Flux, - tmpl::size_t<3>, Frame::Inertial> /*meta*/) const; - void operator()( - gsl::not_null*> fixed_source, - gsl::not_null cache, - ::Tags::FixedSource< - BnsInitialData::Tags::VelocityPotential> /*meta*/) const; - void operator()(gsl::not_null*> lapse, - gsl::not_null cache, - gr::Tags::Lapse /*meta*/) const; - void operator()(gsl::not_null*> rest_mass_density, - gsl::not_null cache, - hydro::Tags::RestMassDensity /*meta*/) const; - void operator()(gsl::not_null*> specifc_enthalpy, - gsl::not_null cache, - hydro::Tags::SpecificEnthalpy /*meta*/) const; - void operator()(gsl::not_null*> deriv_lapse, - gsl::not_null cache, - ::Tags::deriv, tmpl::size_t<3>, - Frame::Inertial> /*meta*/) const; - - void operator()(gsl::not_null*> shift, - gsl::not_null cache, - gr::Tags::Shift /*meta*/) const; - void operator()(gsl::not_null*> deriv_shift, - gsl::not_null cache, - ::Tags::deriv, tmpl::size_t<3>, - Frame::Inertial> /*meta*/) const; - void operator()( - gsl::not_null*> rotational_shift, - gsl::not_null cache, - BnsInitialData::Tags::RotationalShift /*meta*/) const; - void operator()( - gsl::not_null*> - deriv_log_lapse_over_specific_enthalpy, - gsl::not_null cache, - BnsInitialData::Tags::DerivLogLapseTimesDensityOverSpecificEnthalpy< - DataType> /*meta*/) const; - void operator()( - gsl::not_null*> rotational_shift_stress, - gsl::not_null cache, - BnsInitialData::Tags::RotationalShiftStress /*meta*/) const; - void operator()(gsl::not_null*> spatial_metric, - gsl::not_null cache, - gr::Tags::SpatialMetric /*meta*/) const; - - void operator()(gsl::not_null*> inverse_spatial_metric, - gsl::not_null cache, - gr::Tags::InverseSpatialMetric /*meta*/) const; - - void operator()( - gsl::not_null*> - spatial_christoffel_second_kind_contracted, - gsl::not_null cache, - gr::Tags::SpatialChristoffelSecondKindContracted /*meta*/) - const; - - private: - template - typename Tag::type get_tov_var(Tag /*meta*/) const { - // Possible optimization: Access the cache of the RelEuler::TovStar solution - // so its intermediate quantities don't have to be re-computed repeatedly - return get(tov_star.variables( - x, std::numeric_limits::signaling_NaN(), tmpl::list{})); - } -}; - -} // namespace tov_detail - -/*! - * \brief TOV solution for irrotational BNS data - * - * \see RelativisticEuler::Solutions::TovStar - * \see gr::Solutions::TovSolution - * Teh - */ -class TovStar : public elliptic::analytic_data::Background, - public elliptic::analytic_data::InitialGuess { - private: - using RelEulerTovStar = RelativisticEuler::Solutions::TovStar; - std::array star_center_{}; - double euler_enthalpy_constant_ = - std::numeric_limits::signaling_NaN(); - // Note this is not the angular velocity of the star around its axis, that - // is zero in this case. - double orbital_angular_velocity_ = - std::numeric_limits::signaling_NaN(); - RelEulerTovStar tov_star_; - - public: - struct StarCenter { - using type = std::array; - static constexpr Options::String help = - "The location of the center of the star"; - }; - struct OrbitalAngularVelocity { - using type = double; - static constexpr Options::String help = - "The initial angular velocity of the binary orbit"; - }; - using options = - tmpl::list, - RelEulerTovStar::Coordinates, StarCenter, - OrbitalAngularVelocity>; - static constexpr Options::String help = { - "A TovStar to be used as a background" - "for solving the Irrotational BNS hydro equations"}; - - TovStar() = default; - TovStar(const TovStar&) = default; - TovStar& operator=(const TovStar&) = default; - TovStar(TovStar&&) = default; - TovStar& operator=(TovStar&&) = default; - ~TovStar() override = default; - - // We do not a priori know what the central density will be, a (likely poor) - // guess we use here is that the central enthalpy is equal to the constant - // A better approximation would include some guess for the central lapse and - // set h = C / alpha - TovStar(double euler_enthalpy_constant, - std::unique_ptr> - equation_of_state, - RelativisticEuler::Solutions::TovCoordinates coordinate_system, - std::array star_center, double orbital_angular_velocity) - : star_center_(std::move(star_center)), - euler_enthalpy_constant_(euler_enthalpy_constant), - orbital_angular_velocity_(orbital_angular_velocity) { - auto central_density = - get(equation_of_state->rest_mass_density_from_enthalpy( - Scalar(euler_enthalpy_constant_))); - tov_star_ = RelEulerTovStar(central_density, std::move(equation_of_state), - std::move(coordinate_system)); - Parallel::printf("TOV star radius is %f", - tov_star_.radial_solution().outer_radius()); - } - - const EquationsOfState::EquationOfState& equation_of_state() const { - return tov_star_.equation_of_state(); - } - - const RelativisticEuler::Solutions::TovSolution& radial_solution() const { - return tov_star_.radial_solution(); - } - - /// \cond - explicit TovStar(CkMigrateMessage* m) - : elliptic::analytic_data::Background(m) {} - using PUP::able::register_constructor; - WRAPPED_PUPable_decl_template(TovStar); - std::unique_ptr get_clone() const { - return std::make_unique(*this); - } - /// \endcond - - template - using tags = typename tov_detail::TovVariablesCache::tags_list; - - template - tuples::TaggedTuple variables( - const tnsr::I& x, - tmpl::list /*meta*/) const { - return variables_impl(x, tmpl::list{}); - } - - template - tuples::TaggedTuple variables( - const tnsr::I& x, const Mesh<3>& /*mesh*/, - const InverseJacobian& /*inv_jacobian*/, - tmpl::list /*meta*/) const { - return variables_impl(x, tmpl::list{}); - } - - // NOLINTNEXTLINE(google-runtime-references) - void pup(PUP::er& p) override { - elliptic::analytic_data::Background::pup(p); - p | tov_star_; - p | euler_enthalpy_constant_; - p | star_center_; - p | orbital_angular_velocity_; - } - - private: - template - tuples::TaggedTuple variables_impl( - const tnsr::I& x, - tmpl::list /*meta*/) const { - using VarsComputer = tov_detail::TovVariables; - typename VarsComputer::Cache cache{get_size(*x.begin())}; - const DataType radius = get(magnitude(x)); - const VarsComputer computer{x, - radius, - tov_star_, - tov_star_.equation_of_state(), - star_center_, - euler_enthalpy_constant_, - orbital_angular_velocity_}; - - return {cache.get_var(computer, RequestedTags{})...}; - } - - friend bool operator==(const TovStar& lhs, const TovStar& rhs) { - return lhs.tov_star_ == rhs.tov_star_; - } -}; - -inline bool operator!=(const TovStar& lhs, const TovStar& rhs) { - return not(lhs == rhs); -} -} // namespace BnsInitialData::InitialData