From 5c1a2575bc7a12f7d7bb1a0d2432601f447b39ca Mon Sep 17 00:00:00 2001 From: Isaac Legred Date: Sat, 13 Apr 2024 15:06:45 -0700 Subject: [PATCH] fixup 2 --- .../Hydro/InitialData/CMakeLists.txt | 1 + .../Hydro/InitialData/IrrotationalBns.cpp | 6 ++--- .../Hydro/InitialData/IrrotationalBns.hpp | 26 +++++++++++-------- .../Hydro/InitialData/CMakeLists.txt | 16 ++---------- .../InitialData/Test_IrrotationalBns.cpp | 4 +-- 5 files changed, 23 insertions(+), 30 deletions(-) diff --git a/src/PointwiseFunctions/Hydro/InitialData/CMakeLists.txt b/src/PointwiseFunctions/Hydro/InitialData/CMakeLists.txt index 0c82eb075dc69..93c7ae78b4763 100644 --- a/src/PointwiseFunctions/Hydro/InitialData/CMakeLists.txt +++ b/src/PointwiseFunctions/Hydro/InitialData/CMakeLists.txt @@ -1,5 +1,6 @@ # Distributed under the MIT License. # See LICENSE.txt for details. + spectre_target_sources( ${LIBRARY} PRIVATE diff --git a/src/PointwiseFunctions/Hydro/InitialData/IrrotationalBns.cpp b/src/PointwiseFunctions/Hydro/InitialData/IrrotationalBns.cpp index b1897e395ec44..896c668d51ff6 100644 --- a/src/PointwiseFunctions/Hydro/InitialData/IrrotationalBns.cpp +++ b/src/PointwiseFunctions/Hydro/InitialData/IrrotationalBns.cpp @@ -13,7 +13,7 @@ #include "Utilities/Gsl.hpp" #include "Utilities/SetNumberOfGridPoints.hpp" -namespace hydro::initial_data { +namespace hydro::initial_data::irrotational_bns { template void rotational_shift( const gsl::not_null*> result, @@ -143,7 +143,7 @@ void derivative_spatial_rotational_killing_vector( const Scalar& /*local_angular_velocity_around_z*/, const Scalar& /*sqrt_det_spatial_metric*/) { set_number_of_grid_points(result, x); - tenex::update(result, 0.0 * (*result)(ti::i, ti::J)); + std::fill(result->begin(), result->end(), 0.0); } template @@ -227,4 +227,4 @@ GENERATE_INSTANTIATIONS(INSTANTIATION, (double, DataVector)) #undef DTYPE #undef INSTANTIATION -} // namespace hydro::initial_data +} // namespace hydro::initial_data::irrotational_bns diff --git a/src/PointwiseFunctions/Hydro/InitialData/IrrotationalBns.hpp b/src/PointwiseFunctions/Hydro/InitialData/IrrotationalBns.hpp index d976b578067ff..9d6423fda5655 100644 --- a/src/PointwiseFunctions/Hydro/InitialData/IrrotationalBns.hpp +++ b/src/PointwiseFunctions/Hydro/InitialData/IrrotationalBns.hpp @@ -6,11 +6,10 @@ #include "DataStructures/Tensor/TypeAliases.hpp" #include "Utilities/Gsl.hpp" - /*! * \ingroup HydroInitialDataGroup * \brief Items related to solving for irrotational bns initial data - * See e.g. Baumgarte and Shapiro, Ch. 15 (P. 523) + * See e.g. \cite BaumgarteShapiro Ch. 15 (P. 523) */ namespace hydro::initial_data::irrotational_bns { /// @{ @@ -22,11 +21,13 @@ void rotational_shift( gsl::not_null*> result, const tnsr::I& shift, const tnsr::I& spatial_rotational_killing_vector); -/// @} + template tnsr::I rotational_shift( const tnsr::I& shift, const tnsr::I& spatial_rotational_killing_vector); +/// @} + /// @{ /// \brief Compute the stress-energy corresponding to the rotation shift /// @@ -68,13 +69,15 @@ tnsr::iJ derivative_rotational_shift_over_lapse( /// the spacetime /// /// The eqn. is identical to B&S 15.76 -/// \f[ -/// h^2 \rho^2 = \frac{1}{\alpha^2} \left(C + B^i D_i \Phi\right)^2 - D_i -/// \Phi D^i \Phi -/// \f] -/// Where \f$\Phi \f$ is the velocity potential, andC is the Euler-constant, -/// which in a slowly rotating, slowly orbiting configuration becomes the -/// central enthalpy squared over the central lapse squared +/*! + \f[ + h^2 \rho^2 = \frac{1}{\alpha^2} \left(C + B^i D_i \Phi\right)^2 - D_i + \Phi D^i \Phi + \f] +*/ +/// Where \f$\Phi \f$ is the velocity potential, and \f$C\f$ is the +/// Euler-constant, which in a slowly rotating, slowly orbiting configuration +/// becomes the central enthalpy squared over the central lapse squared template void enthalpy_density_squared( gsl::not_null*> result, @@ -108,7 +111,8 @@ tnsr::I spatial_rotational_killing_vector( /// @{ /// \brief The spatial derivative of the spatial rotational killing vector /// -/// As above, assumes uniform rotation around the z-axis +/// As for `spatial_rotational_killing_vector`, assumes uniform rotation around +/// the z-axis template void derivative_spatial_rotational_killing_vector( gsl::not_null*> result, const tnsr::I& x, diff --git a/tests/Unit/PointwiseFunctions/Hydro/InitialData/CMakeLists.txt b/tests/Unit/PointwiseFunctions/Hydro/InitialData/CMakeLists.txt index 3d1467bd5bbdc..41b9f9e650dce 100644 --- a/tests/Unit/PointwiseFunctions/Hydro/InitialData/CMakeLists.txt +++ b/tests/Unit/PointwiseFunctions/Hydro/InitialData/CMakeLists.txt @@ -4,25 +4,13 @@ set(LIBRARY "Test_HydroInitialData") set(LIBRARY_SOURCES Test_IrrotationalBns.cpp -) + ) add_test_library(${LIBRARY} "${LIBRARY_SOURCES}") - - target_link_libraries( ${LIBRARY} PRIVATE - CoordinateMaps DataStructures - DataStructuresHelpers - Domain - GeneralRelativity - GeneralRelativityHelpers Hydro - HydroHelpers - IO - LinearOperators - Spectral - Utilities -) + ) diff --git a/tests/Unit/PointwiseFunctions/Hydro/InitialData/Test_IrrotationalBns.cpp b/tests/Unit/PointwiseFunctions/Hydro/InitialData/Test_IrrotationalBns.cpp index ac2c9fe7a6494..01cb0d1f4e126 100644 --- a/tests/Unit/PointwiseFunctions/Hydro/InitialData/Test_IrrotationalBns.cpp +++ b/tests/Unit/PointwiseFunctions/Hydro/InitialData/Test_IrrotationalBns.cpp @@ -12,7 +12,7 @@ #include "Framework/SetupLocalPythonEnvironment.hpp" #include "PointwiseFunctions/Hydro/InitialData/IrrotationalBns.hpp" -namespace hydro::initial_data { +namespace hydro::initial_data::irrotational_bns { SPECTRE_TEST_CASE("Unit.PointwiseFunctions.Hydro.InitialData.IrrotationalBns", "[Unit][Hydro][Elliptic]") { pypp::SetupLocalPythonEnvironment local_python_env( @@ -58,4 +58,4 @@ SPECTRE_TEST_CASE("Unit.PointwiseFunctions.Hydro.InitialData.IrrotationalBns", "IrrotationalBns", "derivative_spatial_rotational_killing_vector", {{{0.0, 1.0}}}, used_for_size); } -} // namespace hydro::initial_data +} // namespace hydro::initial_data::irrotational_bns