From 9fbb81dc0451db859af6b54b295b22a241e7b4c9 Mon Sep 17 00:00:00 2001 From: Kyle Nelli Date: Fri, 21 Jun 2024 09:47:40 -0700 Subject: [PATCH 1/2] Use common time dep opts in BCO domains --- .../BinaryCompactObject.cpp | 108 +++++++++--------- .../BinaryCompactObject.hpp | 101 ++-------------- support/Pipelines/Bbh/Inspiral.yaml | 12 +- .../CurvedScalarWave/WorldtubeKerrSchild.yaml | 12 +- .../InputTimeDependent3D.yaml | 12 +- .../CylindricalBinaryBlackHole.yaml | 12 +- .../GhValenciaDivClean/BinaryNeutronStar.yaml | 12 +- .../Creators/Test_BinaryCompactObject.cpp | 10 +- .../Test_CylindricalBinaryCompactObject.cpp | 52 +++++---- .../Test_BinaryCompactObject.cpp | 82 +++++++++++-- .../Worldtube/TestHelpers.cpp | 12 +- 11 files changed, 228 insertions(+), 197 deletions(-) diff --git a/src/Domain/Creators/TimeDependentOptions/BinaryCompactObject.cpp b/src/Domain/Creators/TimeDependentOptions/BinaryCompactObject.cpp index 846fcde2349d..a9cf6b960109 100644 --- a/src/Domain/Creators/TimeDependentOptions/BinaryCompactObject.cpp +++ b/src/Domain/Creators/TimeDependentOptions/BinaryCompactObject.cpp @@ -42,9 +42,9 @@ TimeDependentMapOptions::TimeDependentMapOptions( std::optional> shape_options_B, const Options::Context& context) : initial_time_(initial_time), - expansion_map_options_(expansion_map_options), - rotation_map_options_(rotation_map_options), - translation_map_options_(translation_map_options), + expansion_map_options_(std::move(expansion_map_options)), + rotation_map_options_(std::move(rotation_map_options)), + translation_map_options_(std::move(translation_map_options)), shape_options_A_(shape_options_A), shape_options_B_(shape_options_B) { if (not(expansion_map_options_.has_value() or @@ -82,37 +82,51 @@ TimeDependentMapOptions::create_worldtube_functions_of_time() std::unordered_map> result{}; + // The functions of time need to be valid only for the very first time step, // after that they need to be updated by the worldtube singleton. const double initial_expiration_time = initial_time_ + 1e-10; if (not expansion_map_options_.has_value()) { ERROR("Initial values for the expansion map need to be provided."); } + if (not expansion_map_options_->asymptotic_velocity_outer_boundary + .has_value()) { + ERROR( + "The BinaryCompactObject domains don't support using a " + "SettleToConstant function of time for the expansion map. Set the " + "asymptotic velocity to a value and set the decay timescale to " + "'None'"); + } result[expansion_name] = std::make_unique( initial_time_, std::array{ - {{gsl::at(expansion_map_options_.value().initial_values, 0)}, - {gsl::at(expansion_map_options_.value().initial_values, 1)}}}, + expansion_map_options_.value().initial_values[0][0], + expansion_map_options_.value().initial_values[1][0]}, initial_expiration_time, false); result[expansion_outer_boundary_name] = std::make_unique( 1.0, initial_time_, - expansion_map_options_.value().outer_boundary_velocity, - expansion_map_options_.value().outer_boundary_decay_time); + expansion_map_options_.value() + .asymptotic_velocity_outer_boundary.value(), + expansion_map_options_.value().decay_timescale_outer_boundary); + if (not rotation_map_options_.has_value()) { ERROR( "Initial values for the rotation map need to be provided when using " "the worldtube."); } + if (rotation_map_options_->decay_timescale.has_value()) { + ERROR( + "The BinaryCompactObject domains don't support using a " + "SettleToConstant function of time for the rotation map. Set the " + "decay timescale to 'None'"); + } result[rotation_name] = std::make_unique( initial_time_, - std::array{ - 0., - gsl::at(rotation_map_options_.value().initial_angular_velocity, - 2)}, + std::array{0., rotation_map_options_.value().angles[1][2]}, initial_expiration_time, true); // Size and Shape FunctionOfTime for objects A and B. Only spherical excision @@ -189,64 +203,52 @@ TimeDependentMapOptions::create_functions_of_time( // ExpansionMap FunctionOfTime for the function \f$a(t)\f$ in the // domain::CoordinateMaps::TimeDependent::RotScaleTrans map if (expansion_map_options_.has_value()) { + if (not expansion_map_options_->asymptotic_velocity_outer_boundary + .has_value()) { + ERROR( + "The BinaryCompactObject domains don't support using a " + "SettleToConstant function of time for the expansion map. Set the " + "asymptotic velocity to a value and set the decay timescale to " + "'None'"); + } + result[expansion_name] = std::make_unique>( - initial_time_, - std::array{ - {{gsl::at(expansion_map_options_.value().initial_values, 0)}, - {gsl::at(expansion_map_options_.value().initial_values, 1)}, - {0.0}}}, + initial_time_, expansion_map_options_->initial_values, expiration_times.at(expansion_name)); // ExpansionMap FunctionOfTime for the function \f$b(t)\f$ in the // domain::CoordinateMaps::TimeDependent::RotScaleTrans map result[expansion_outer_boundary_name] = std::make_unique( - 1.0, initial_time_, - expansion_map_options_.value().outer_boundary_velocity, - expansion_map_options_.value().outer_boundary_decay_time); + expansion_map_options_->initial_values_outer_boundary[0][0], + initial_time_, + expansion_map_options_->asymptotic_velocity_outer_boundary.value(), + expansion_map_options_->decay_timescale_outer_boundary); } // RotationMap FunctionOfTime for the rotation angles about each - // axis. The initial rotation angles don't matter as we never - // actually use the angles themselves. We only use their derivatives - // (omega) to determine map parameters. In theory we could determine - // each initial angle from the input axis-angle representation, but - // we don't need to. + // axis. if (rotation_map_options_.has_value()) { - result[rotation_name] = std::make_unique< - FunctionsOfTime::QuaternionFunctionOfTime<3>>( - initial_time_, - std::array{DataVector{1.0, 0.0, 0.0, 0.0}}, - std::array{ - {{3, 0.0}, - {gsl::at(rotation_map_options_.value().initial_angular_velocity, - 0), - gsl::at(rotation_map_options_.value().initial_angular_velocity, - 1), - gsl::at(rotation_map_options_.value().initial_angular_velocity, - 2)}, - {3, 0.0}, - {3, 0.0}}}, - expiration_times.at(rotation_name)); + if (rotation_map_options_->decay_timescale.has_value()) { + ERROR( + "The BinaryCompactObject domains don't support using a " + "SettleToConstant function of time for the rotation map. Set the " + "decay timescale to 'None'"); + } + + result[rotation_name] = + std::make_unique>( + initial_time_, std::array{rotation_map_options_->quaternions[0]}, + rotation_map_options_->angles, expiration_times.at(rotation_name)); } // TranslationMap FunctionOfTime if (translation_map_options_.has_value()) { - result[translation_name] = std::make_unique< - FunctionsOfTime::PiecewisePolynomial<2>>( - initial_time_, - std::array{ - {{gsl::at(translation_map_options_.value().initial_values, 0)[0], - gsl::at(translation_map_options_.value().initial_values, 0)[1], - gsl::at(translation_map_options_.value().initial_values, 0)[2]}, - {gsl::at(translation_map_options_.value().initial_values, 1)[0], - gsl::at(translation_map_options_.value().initial_values, 1)[1], - gsl::at(translation_map_options_.value().initial_values, 1)[2]}, - {gsl::at(translation_map_options_.value().initial_values, 2)[0], - gsl::at(translation_map_options_.value().initial_values, 2)[1], - gsl::at(translation_map_options_.value().initial_values, 2)[2]}}}, - expiration_times.at(translation_name)); + result[translation_name] = + std::make_unique>( + initial_time_, translation_map_options_->initial_values, + expiration_times.at(translation_name)); } // Size and Shape FunctionOfTime for objects A and B diff --git a/src/Domain/Creators/TimeDependentOptions/BinaryCompactObject.hpp b/src/Domain/Creators/TimeDependentOptions/BinaryCompactObject.hpp index 5575cc7844d3..c07c6e21fc4e 100644 --- a/src/Domain/Creators/TimeDependentOptions/BinaryCompactObject.hpp +++ b/src/Domain/Creators/TimeDependentOptions/BinaryCompactObject.hpp @@ -17,8 +17,10 @@ #include "Domain/CoordinateMaps/TimeDependent/Rotation.hpp" #include "Domain/CoordinateMaps/TimeDependent/Shape.hpp" #include "Domain/CoordinateMaps/TimeDependent/ShapeMapTransitionFunctions/ShapeMapTransitionFunction.hpp" +#include "Domain/Creators/TimeDependentOptions/ExpansionMap.hpp" +#include "Domain/Creators/TimeDependentOptions/RotationMap.hpp" #include "Domain/Creators/TimeDependentOptions/ShapeMap.hpp" -#include "Domain/Creators/TimeDependentOptions/Sphere.hpp" +#include "Domain/Creators/TimeDependentOptions/TranslationMap.hpp" #include "Domain/FunctionsOfTime/FunctionOfTime.hpp" #include "Domain/Structure/ObjectLabel.hpp" #include "Options/Auto.hpp" @@ -146,101 +148,20 @@ struct TimeDependentMapOptions { /// The outer boundary radius of the map is always set to /// the outer boundary of the Domain, so there is no option /// here to set the outer boundary radius. - struct ExpansionMapOptions { - using type = Options::Auto; - static std::string name() { return "ExpansionMap"; } - static constexpr Options::String help = { - "Options for the expansion map. Specify 'None' to not use this map."}; - struct InitialValues { - using type = std::array; - static constexpr Options::String help = { - "Initial value and deriv of expansion."}; - }; - struct AsymptoticVelocityOuterBoundary { - using type = double; - static constexpr Options::String help = { - "The asymptotic velocity of the outer boundary."}; - }; - struct DecayTimescaleOuterBoundaryVelocity { - using type = double; - static constexpr Options::String help = { - "The timescale for how fast the outer boundary velocity approaches " - "its asymptotic value."}; - }; - using options = tmpl::list; - ExpansionMapOptions() = default; - ExpansionMapOptions(std::array initial_values_in, - double outer_boundary_velocity_in, - double outer_boundary_decay_time_in) - : initial_values(initial_values_in), - outer_boundary_velocity(outer_boundary_velocity_in), - outer_boundary_decay_time(outer_boundary_decay_time_in) {} - - std::array initial_values{ - std::numeric_limits::signaling_NaN(), - std::numeric_limits::signaling_NaN()}; - double outer_boundary_velocity{ - std::numeric_limits::signaling_NaN()}; - double outer_boundary_decay_time{ - std::numeric_limits::signaling_NaN()}; - }; - - struct RotationMapOptions { - using type = Options::Auto; - static std::string name() { return "RotationMap"; } - static constexpr Options::String help = { - "Options for a time-dependent rotation map about an arbitrary axis. " - "Specify 'None' to not use this map."}; - - struct InitialAngularVelocity { - using type = std::array; - static constexpr Options::String help = {"The initial angular velocity."}; - }; - - using options = tmpl::list; + using ExpansionMapOptions = + domain::creators::time_dependent_options::ExpansionMapOptions; - RotationMapOptions() = default; - explicit RotationMapOptions( - std::array initial_angular_velocity_in) - : initial_angular_velocity(initial_angular_velocity_in) {} - - std::array initial_angular_velocity{}; - }; + /// \brief Options for the rotation map + using RotationMapOptions = + domain::creators::time_dependent_options::RotationMapOptions<3>; /// \brief Options for the Translation Map, the outer radius is always set to /// the outer boundary of the Domain, so there's no option needed for outer /// boundary. - struct TranslationMapOptions { - using type = Options::Auto; - static std::string name() { return "TranslationMap"; } - static constexpr Options::String help = { - "Options for a time-dependent translation map. Specify 'None' to not " - "use this map."}; - - struct InitialValues { - using type = std::array, 3>; - static constexpr Options::String help = { - "Initial position, velocity and acceleration."}; - }; - - using options = tmpl::list; - TranslationMapOptions() = default; - explicit TranslationMapOptions( - std::array, 3> initial_values_in) - : initial_values(initial_values_in) {} - - std::array, 3> initial_values{}; - }; + using TranslationMapOptions = + domain::creators::time_dependent_options::TranslationMapOptions<3>; - // We use a type alias here instead of defining the ShapeMapOptions struct - // because there appears to be a bug in clang-10. If the definition of - // ShapeMapOptions is here inside TimeDependentMapOptions, on clang-10 there - // is a linking error that there is an undefined reference to - // Options::Option::parse_as> (and B). This doesn't - // show up for GCC. If we put the definition of ShapeMapOptions outside of - // TimeDependentMapOptions and just use a type alias here, the linking error - // goes away. + /// \brief Options for the shape map template using ShapeMapOptions = domain::creators::time_dependent_options::ShapeMapOptions< diff --git a/support/Pipelines/Bbh/Inspiral.yaml b/support/Pipelines/Bbh/Inspiral.yaml index c2a2a6e48e84..e486863ae053 100644 --- a/support/Pipelines/Bbh/Inspiral.yaml +++ b/support/Pipelines/Bbh/Inspiral.yaml @@ -101,11 +101,17 @@ DomainCreator: TimeDependentMaps: InitialTime: &InitialTime 0.0 ExpansionMap: - InitialValues: [1.0, {{ RadialExpansionVelocity }}] + InitialValues: [1.0, {{ RadialExpansionVelocity }}, 0.0] + InitialValuesOuterBoundary: [1.0, 0.0, 0.0] + DecayTimescale: Auto + DecayTimescaleOuterBoundary: 50.0 AsymptoticVelocityOuterBoundary: -1.0e-6 - DecayTimescaleOuterBoundaryVelocity: 50.0 RotationMap: - InitialAngularVelocity: [0.0, 0.0, {{ InitialAngularVelocity }}] + InitialQuaternions: [[1.0, 0.0, 0.0, 0.0]] + InitialAngles: + - [0.0, 0.0, 0.0] + - [0.0, 0.0, {{ InitialAngularVelocity }}] + DecayTimescale: Auto TranslationMap: InitialValues: [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]] ShapeMapA: diff --git a/tests/InputFiles/CurvedScalarWave/WorldtubeKerrSchild.yaml b/tests/InputFiles/CurvedScalarWave/WorldtubeKerrSchild.yaml index eea71d0dd931..cdc7ed3d8ff3 100644 --- a/tests/InputFiles/CurvedScalarWave/WorldtubeKerrSchild.yaml +++ b/tests/InputFiles/CurvedScalarWave/WorldtubeKerrSchild.yaml @@ -72,11 +72,17 @@ DomainCreator: TimeDependentMaps: InitialTime: 0. ExpansionMap: - InitialValues: [1., 0.] + InitialValues: [1., 0., 0.] + InitialValuesOuterBoundary: [1., 0., 0.] + DecayTimescale: Auto AsymptoticVelocityOuterBoundary: 0. - DecayTimescaleOuterBoundaryVelocity: 1. + DecayTimescaleOuterBoundary: 1. RotationMap: - InitialAngularVelocity: [0., 0., 0.08944271909999159] + InitialQuaternions: [[1., 0., 0., 0.]] + InitialAngles: + - [0., 0., 0.] + - [0., 0., 0.08944271909999159] + DecayTimescale: Auto TranslationMap: InitialValues: [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]] ShapeMapA: diff --git a/tests/InputFiles/ExportCoordinates/InputTimeDependent3D.yaml b/tests/InputFiles/ExportCoordinates/InputTimeDependent3D.yaml index 323dc54eb8e9..2d4804df1203 100644 --- a/tests/InputFiles/ExportCoordinates/InputTimeDependent3D.yaml +++ b/tests/InputFiles/ExportCoordinates/InputTimeDependent3D.yaml @@ -68,11 +68,17 @@ DomainCreator: TimeDependentMaps: InitialTime: 0.0 ExpansionMap: - InitialValues: [1.0, -4.6148457646200002e-05] + InitialValues: [1.0, -4.6148457646200002e-05, 0.0] + InitialValuesOuterBoundary: [1.0, 0.0, 0.0] + DecayTimescale: Auto AsymptoticVelocityOuterBoundary: -1.0e-6 - DecayTimescaleOuterBoundaryVelocity: 50.0 + DecayTimescaleOuterBoundary: 50.0 RotationMap: - InitialAngularVelocity: [0.0, 0.0, 1.5264577062000000e-02] + InitialQuaternions: [[1.0, 0.0, 0.0, 0.0]] + InitialAngles: + - [0.0, 0.0, 0.0,] + - [0.0, 0.0, 1.5264577062000000e-02] + DecayTimescale: Auto TranslationMap: InitialValues: [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]] ShapeMapA: diff --git a/tests/InputFiles/GeneralizedHarmonic/CylindricalBinaryBlackHole.yaml b/tests/InputFiles/GeneralizedHarmonic/CylindricalBinaryBlackHole.yaml index c50fe21a4eae..2335684dbe38 100644 --- a/tests/InputFiles/GeneralizedHarmonic/CylindricalBinaryBlackHole.yaml +++ b/tests/InputFiles/GeneralizedHarmonic/CylindricalBinaryBlackHole.yaml @@ -58,11 +58,17 @@ DomainCreator: TimeDependentMaps: InitialTime: 0.0 ExpansionMap: - InitialValues: [1.0, -4.6148457646200002e-05] + InitialValues: [1.0, -4.6148457646200002e-05, 0.0] + InitialValuesOuterBoundary: [1.0, 0.0, 0.0] + DecayTimescale: Auto + DecayTimescaleOuterBoundary: 50.0 AsymptoticVelocityOuterBoundary: -1.0e-6 - DecayTimescaleOuterBoundaryVelocity: 50.0 RotationMap: - InitialAngularVelocity: [0.0, 0.0, 1.5264577062000000e-02] + InitialQuaternions: [[1.0, 0.0, 0.0, 0.0]] + InitialAngles: + - [0.0, 0.0, 0.0] + - [0.0, 0.0, 1.5264577062000000e-02] + DecayTimescale: Auto TranslationMap: InitialValues: [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]] ShapeMapA: diff --git a/tests/InputFiles/GrMhd/GhValenciaDivClean/BinaryNeutronStar.yaml b/tests/InputFiles/GrMhd/GhValenciaDivClean/BinaryNeutronStar.yaml index f418e124f666..8b443d8700f7 100644 --- a/tests/InputFiles/GrMhd/GhValenciaDivClean/BinaryNeutronStar.yaml +++ b/tests/InputFiles/GrMhd/GhValenciaDivClean/BinaryNeutronStar.yaml @@ -64,11 +64,17 @@ DomainCreator: TimeDependentMaps: InitialTime: 0.0 ExpansionMap: - InitialValues: [1.0, 0.0] + InitialValues: [1.0, 0.0, 0.0] + InitialValuesOuterBoundary: [1.0, 0.0, 0.0] + DecayTimescale: Auto AsymptoticVelocityOuterBoundary: -1.0e-6 - DecayTimescaleOuterBoundaryVelocity: 50.0 + DecayTimescaleOuterBoundary: 50.0 RotationMap: - InitialAngularVelocity: [0.0, 0.0, 0.00826225] + InitialQuaternions: [[1.0, 0.0, 0.0, 0.0]] + InitialAngles: + - [0.0, 0.0, 0.0] + - [0.0, 0.0, 0.00826225] + DecayTimescale: Auto TranslationMap: InitialValues: [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]] ShapeMapA: None diff --git a/tests/Unit/Domain/Creators/Test_BinaryCompactObject.cpp b/tests/Unit/Domain/Creators/Test_BinaryCompactObject.cpp index 1a0518fc92e9..14cdca1a455a 100644 --- a/tests/Unit/Domain/Creators/Test_BinaryCompactObject.cpp +++ b/tests/Unit/Domain/Creators/Test_BinaryCompactObject.cpp @@ -404,11 +404,15 @@ std::string create_option_string( ? " TimeDependentMaps:\n" " InitialTime: 1.0\n" " ExpansionMap: \n" - " InitialValues: [1.0, -0.1]\n" + " InitialValues: [1.0, -0.1, 0.0]\n" + " InitialValuesOuterBoundary: [1.0, 0.0, 0.0]\n" + " DecayTimescale: Auto\n" " AsymptoticVelocityOuterBoundary: -0.1\n" - " DecayTimescaleOuterBoundaryVelocity: 5.0\n" + " DecayTimescaleOuterBoundary: 5.0\n" " RotationMap:\n" - " InitialAngularVelocity: [0.0, 0.0, -0.2]\n" + " InitialQuaternions: [[1.0, 0.0, 0.0, 0.0]]\n" + " InitialAngles: [[0.0, 0.0, 0.0], [0.0, 0.0, -0.2]]\n" + " DecayTimescale: Auto\n" " TranslationMap:\n" " InitialValues: [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0], " " [0.0, 0.0, 0.0]]\n"s + diff --git a/tests/Unit/Domain/Creators/Test_CylindricalBinaryCompactObject.cpp b/tests/Unit/Domain/Creators/Test_CylindricalBinaryCompactObject.cpp index 7609cb76bf8a..d0f7bf4ae6e8 100644 --- a/tests/Unit/Domain/Creators/Test_CylindricalBinaryCompactObject.cpp +++ b/tests/Unit/Domain/Creators/Test_CylindricalBinaryCompactObject.cpp @@ -240,21 +240,24 @@ std::string create_option_string( const double inner_radius_objectA, const double inner_radius_objectB, const double outer_radius) { const std::string time_dependence{ - add_time_dependence ? " TimeDependentMaps:\n" - " InitialTime: 1.0\n" - " ExpansionMap: None\n" - " RotationMap:\n" - " InitialAngularVelocity: [0.0, 0.0, -0.2]\n" - " TranslationMap: None\n" - " ShapeMapA:\n" - " LMax: 8\n" - " InitialValues: Spherical\n" - " SizeInitialValues: [1.1, 0.0, 0.0]\n" - " ShapeMapB:\n" - " LMax: 8\n" - " InitialValues: Spherical\n" - " SizeInitialValues: [1.2, 0.0, 0.0]\n" - : " TimeDependentMaps: None\n"}; + add_time_dependence + ? " TimeDependentMaps:\n" + " InitialTime: 1.0\n" + " ExpansionMap: None\n" + " RotationMap:\n" + " InitialQuaternions: [[1.0, 0.0, 0.0, 0.0]]\n" + " InitialAngles: [[0.0, 0.0, 0.0], [0.0, 0.0, -0.2]]\n" + " DecayTimescale: Auto\n" + " TranslationMap: None\n" + " ShapeMapA:\n" + " LMax: 8\n" + " InitialValues: Spherical\n" + " SizeInitialValues: [1.1, 0.0, 0.0]\n" + " ShapeMapB:\n" + " LMax: 8\n" + " InitialValues: Spherical\n" + " SizeInitialValues: [1.2, 0.0, 0.0]\n" + : " TimeDependentMaps: None\n"}; const std::string boundary_conditions{ add_boundary_condition ? std::string{" BoundaryConditions:\n" @@ -400,9 +403,13 @@ TimeDepOptions construct_time_dependent_options() { return TimeDepOptions{ expected_time, std::nullopt, - TimeDepOptions::RotationMapOptions{{initial_angular_velocity[0], - initial_angular_velocity[1], - initial_angular_velocity[2]}}, + TimeDepOptions::RotationMapOptions{ + std::vector{std::array{10.0, 0.0, 0.0, 0.0}}, + std::vector{std::array{0.0, 0.0, 0.0}, + std::array{initial_angular_velocity[0], + initial_angular_velocity[1], + initial_angular_velocity[2]}}, + std::nullopt}, std::nullopt, TimeDepOptions::ShapeMapOptions{ 8_st, @@ -475,10 +482,11 @@ void test_parse_errors() { domain::creators::CylindricalBinaryCompactObject( {{4.0, 0.0, 0.0}}, {-4.0, 0.0, 0.0}, 1.0, 1.0, false, false, false, 25.0, false, 1_st, 3_st, - TimeDepOptions{ - 0.0, std::nullopt, - TimeDepOptions::RotationMapOptions{std::array{0.0, 0.0, 0.0}}, - std::nullopt, std::nullopt, std::nullopt}, + TimeDepOptions{0.0, std::nullopt, + TimeDepOptions::RotationMapOptions{ + std::vector{std::array{1.0, 0.0, 0.0, 0.0}}, + std::nullopt, std::nullopt}, + std::nullopt, std::nullopt, std::nullopt}, create_inner_boundary_condition(), create_outer_boundary_condition(), Options::Context{false, {}, 1, 1}), Catch::Matchers::ContainsSubstring( diff --git a/tests/Unit/Domain/Creators/TimeDependentOptions/Test_BinaryCompactObject.cpp b/tests/Unit/Domain/Creators/TimeDependentOptions/Test_BinaryCompactObject.cpp index 787de68a5f68..a4c19ed31f5e 100644 --- a/tests/Unit/Domain/Creators/TimeDependentOptions/Test_BinaryCompactObject.cpp +++ b/tests/Unit/Domain/Creators/TimeDependentOptions/Test_BinaryCompactObject.cpp @@ -125,17 +125,20 @@ void test(const bool include_expansion, const bool include_rotation, std::optional> shape_map_a_options{}; std::optional> shape_map_b_options{}; - const std::array exp_values{1.0, 0.0}; + const std::array exp_values{1.0, 0.0, 0.0}; const double exp_outer_boundary_velocity = -0.01; const double exp_outer_boundary_timescale = 25.0; if (include_expansion) { exp_map_options = ExpMapOptions{ - exp_values, exp_outer_boundary_velocity, exp_outer_boundary_timescale}; + exp_values, std::array{1.0, 0.0, 0.0}, exp_outer_boundary_timescale, + std::nullopt, exp_outer_boundary_velocity}; } const std::array angular_velocity{0.2, -0.4, 0.6}; if (include_rotation) { - rot_map_options = RotMapOptions{angular_velocity}; + rot_map_options = RotMapOptions{ + std::vector{std::array{1.0, 0.0, 0.0, 0.0}}, + std::vector{std::array{0.0, 0.0, 0.0}, angular_velocity}, std::nullopt}; } const std::array, 3> translation_values = { @@ -573,6 +576,44 @@ void test_errors() { Catch::Matchers::ContainsSubstring( "Time dependent map options were " "specified, but all options were 'None'.")); + CHECK_THROWS_WITH( + ([]() { + const TimeDependentMapOptions time_dep_opts{ + 1.0, + ExpMapOptions{std::array{1.0, 0.0, 0.0}, + std::array{1.0, 0.0, 0.0}, 0.01, 1.0, + std::nullopt}, + RotMapOptions{ + std::vector{std::array{1.0, 0.0, 0.0, 0.0}}, std::nullopt, + std::nullopt}, + std::nullopt, + std::nullopt, + ShapeMapBOptions{8, {}}}; + time_dep_opts.create_functions_of_time({}); + }()), + Catch::Matchers::ContainsSubstring( + "The BinaryCompactObject domains don't support using a " + "SettleToConstant function of time for the expansion map. Set the " + "asymptotic velocity to a value and set the decay timescale to " + "'None'")); + CHECK_THROWS_WITH( + ([]() { + const TimeDependentMapOptions time_dep_opts{ + 1.0, + ExpMapOptions{std::array{1.0, 0.0, 0.0}, + std::array{1.0, 0.0, 0.0}, 0.01, + std::nullopt, -0.1}, + RotMapOptions{ + std::vector{std::array{1.0, 0.0, 0.0, 0.0}}, std::nullopt, 1.0}, + std::nullopt, + std::nullopt, + ShapeMapBOptions{8, {}}}; + time_dep_opts.create_functions_of_time({}); + }()), + Catch::Matchers::ContainsSubstring( + "The BinaryCompactObject domains don't support using a " + "SettleToConstant function of time for the rotation map. Set the " + "decay timescale to 'None'")); using RadiiType = std::optional>; RadiiType radii{}; if constexpr (IsCylindrical) { @@ -584,8 +625,12 @@ void test_errors() { ([&radii]() { TimeDependentMapOptions time_dep_opts{ 1.0, - ExpMapOptions{{1.0, 0.0}, 0.0, 0.01}, - RotMapOptions{{0.0, 0.0, 0.0}}, + ExpMapOptions{std::array{1.0, 0.0, 0.0}, + std::array{1.0, 0.0, 0.0}, 0.01, + std::nullopt, 0.0}, + RotMapOptions{ + std::vector{std::array{1.0, 0.0, 0.0, 0.0}}, std::nullopt, + std::nullopt}, std::nullopt, std::nullopt, ShapeMapBOptions{8, {}}}; @@ -600,8 +645,12 @@ void test_errors() { ([&radii]() { TimeDependentMapOptions time_dep_opts{ 1.0, - ExpMapOptions{{1.0, 0.0}, 0.0, 0.01}, - RotMapOptions{{0.0, 0.0, 0.0}}, + ExpMapOptions{std::array{1.0, 0.0, 0.0}, + std::array{1.0, 0.0, 0.0}, 0.01, + std::nullopt, 0.0}, + RotMapOptions{ + std::vector{std::array{1.0, 0.0, 0.0, 0.0}}, std::nullopt, + std::nullopt}, std::nullopt, ShapeMapAOptions{8, {}}, std::nullopt}; @@ -617,8 +666,12 @@ void test_errors() { ([&radii]() { TimeDependentMapOptions time_dep_opts{ 1.0, - ExpMapOptions{{1.0, 0.0}, 0.0, 0.01}, - RotMapOptions{{0.0, 0.0, 0.0}}, + ExpMapOptions{std::array{1.0, 0.0, 0.0}, + std::array{1.0, 0.0, 0.0}, 1.0, + std::nullopt, 0.01}, + RotMapOptions{ + std::vector{std::array{1.0, 0.0, 0.0, 0.0}}, + std::vector{std::array{0.0, 0.0, 0.0}}, std::nullopt}, std::nullopt, ShapeMapAOptions{8, {}}, std::nullopt}; @@ -674,8 +727,15 @@ void test_worldtube_fots() { const TimeDependentMapOptions worldtube_options{ initial_time, ExpMapOptions{ - {initial_expansion, initial_expansion_deriv}, 1., 1.}, - RotMapOptions{{0.0, 0.0, 1.0}}, + std::array{initial_expansion, initial_expansion_deriv, 0.0}, + std::array{1.0, 0.0, 0.0}, + {1.0}, + std::nullopt, + {1.0}}, + RotMapOptions{ + std::vector{std::array{1.0, 0.0, 0.0, 0.0}}, + std::vector{std::array{0.0, 0.0, 0.0}, std::array{0.0, 0.0, 1.0}}, + std::nullopt}, std::nullopt, ShapeMapAOptions{2, {}, std::make_optional(size_a_opts)}, ShapeMapBOptions{2, {}, std::make_optional(size_b_opts)}}; diff --git a/tests/Unit/Helpers/Evolution/Systems/CurvedScalarWave/Worldtube/TestHelpers.cpp b/tests/Unit/Helpers/Evolution/Systems/CurvedScalarWave/Worldtube/TestHelpers.cpp index 34a33a83ffa3..896428c4fb7b 100644 --- a/tests/Unit/Helpers/Evolution/Systems/CurvedScalarWave/Worldtube/TestHelpers.cpp +++ b/tests/Unit/Helpers/Evolution/Systems/CurvedScalarWave/Worldtube/TestHelpers.cpp @@ -63,11 +63,17 @@ std::unique_ptr> worldtube_binary_compact_object( " TimeDependentMaps:\n" " InitialTime: 0.0\n" " ExpansionMap: \n" - " InitialValues: [1.0, 0.0]\n" + " InitialValues: [1.0, 0.0, 0.0]\n" + " InitialValuesOuterBoundary: [1.0, 0.0, 0.0]\n" + " DecayTimescale: Auto\n" + " DecayTimescaleOuterBoundary: 1.0\n" " AsymptoticVelocityOuterBoundary: 0.0\n" - " DecayTimescaleOuterBoundaryVelocity: 1.0\n" " RotationMap:\n" - " InitialAngularVelocity: [0.0, 0.0," + + " InitialQuaternions: [[1.0, 0.0, 0.0, 0.0]]\n" + " DecayTimescale: Auto\n" + " InitialAngles:\n" + " - [0.0, 0.0, 0.0]\n" + " - [0.0, 0.0, " + angular_velocity_stream.str() + "]\n" " TranslationMap:\n" From 716e2089f5b6ea9e40fc670be7ee5c6d2c929abe Mon Sep 17 00:00:00 2001 From: Kyle Nelli Date: Fri, 21 Jun 2024 11:03:34 -0700 Subject: [PATCH 2/2] Use common time dep opts in Sphere domain --- .../Creators/TimeDependentOptions/Sphere.cpp | 119 ++++++------------ .../Creators/TimeDependentOptions/Sphere.hpp | 111 ++-------------- ...ahlkorperCoefsInRingdownDistortedFrame.cpp | 11 +- ...ahlkorperCoefsInRingdownDistortedFrame.hpp | 2 +- tests/Unit/Domain/Creators/Test_Sphere.cpp | 13 +- ...ahlkorperCoefsInRingdownDistortedFrame.cpp | 11 +- 6 files changed, 67 insertions(+), 200 deletions(-) diff --git a/src/Domain/Creators/TimeDependentOptions/Sphere.cpp b/src/Domain/Creators/TimeDependentOptions/Sphere.cpp index 69a6863fec10..9bd7d161318c 100644 --- a/src/Domain/Creators/TimeDependentOptions/Sphere.cpp +++ b/src/Domain/Creators/TimeDependentOptions/Sphere.cpp @@ -30,29 +30,6 @@ namespace domain::creators::sphere { -TimeDependentMapOptions::RotationMapOptions::RotationMapOptions() = default; -TimeDependentMapOptions::RotationMapOptions::RotationMapOptions( - const std::array, 3> initial_values_in, - const double decay_timescale_in) - : initial_values(initial_values_in), decay_timescale(decay_timescale_in) {} - -TimeDependentMapOptions::ExpansionMapOptions::ExpansionMapOptions() = default; -TimeDependentMapOptions::ExpansionMapOptions::ExpansionMapOptions( - const std::array initial_values_in, - const double decay_timescale_in, - const std::array initial_values_outer_boundary_in, - const double decay_timescale_outer_boundary_in) - : initial_values(initial_values_in), - decay_timescale(decay_timescale_in), - initial_values_outer_boundary(initial_values_outer_boundary_in), - decay_timescale_outer_boundary(decay_timescale_outer_boundary_in) {} - -TimeDependentMapOptions::TranslationMapOptions::TranslationMapOptions() = - default; -TimeDependentMapOptions::TranslationMapOptions::TranslationMapOptions( - const std::array, 3> initial_values_in) - : initial_values(initial_values_in) {} - TimeDependentMapOptions::TimeDependentMapOptions( const double initial_time, std::optional shape_map_options, std::optional rotation_map_options, @@ -79,6 +56,8 @@ TimeDependentMapOptions::create_functions_of_time( std::unordered_map expiration_times{ {size_name, std::numeric_limits::infinity()}, {shape_name, std::numeric_limits::infinity()}, + {rotation_name, std::numeric_limits::infinity()}, + {expansion_name, std::numeric_limits::infinity()}, {translation_name, std::numeric_limits::infinity()}}; // If we have control systems, overwrite these expiration times with the ones @@ -107,75 +86,57 @@ TimeDependentMapOptions::create_functions_of_time( // ExpansionMap FunctionOfTime if (expansion_map_options_.has_value()) { - result[expansion_name] = - std::make_unique( - std::array{ - {{gsl::at(expansion_map_options_.value().initial_values, 0)}, - {gsl::at(expansion_map_options_.value().initial_values, 1)}, - {gsl::at(expansion_map_options_.value().initial_values, 2)}}}, - initial_time_, expansion_map_options_.value().decay_timescale); + if (expansion_map_options_->decay_timescale.has_value()) { + result[expansion_name] = + std::make_unique( + expansion_map_options_->initial_values, initial_time_, + expansion_map_options_->decay_timescale.value()); + } else { + result[expansion_name] = + std::make_unique>( + initial_time_, expansion_map_options_->initial_values, + expiration_times.at(expansion_name)); + } // ExpansionMap in the Outer regionFunctionOfTime - result[expansion_outer_boundary_name] = std::make_unique< - FunctionsOfTime::SettleToConstant>( - std::array{ - {{gsl::at( - expansion_map_options_.value().initial_values_outer_boundary, - 0)}, - {gsl::at( - expansion_map_options_.value().initial_values_outer_boundary, - 1)}, - {gsl::at( - expansion_map_options_.value().initial_values_outer_boundary, - 2)}}}, - initial_time_, - expansion_map_options_.value().decay_timescale_outer_boundary); + if (expansion_map_options_->asymptotic_velocity_outer_boundary + .has_value()) { + result[expansion_outer_boundary_name] = + std::make_unique( + expansion_map_options_->initial_values[0][0], initial_time_, + expansion_map_options_->asymptotic_velocity_outer_boundary + .value(), + expansion_map_options_->decay_timescale_outer_boundary); + } else { + result[expansion_outer_boundary_name] = + std::make_unique( + expansion_map_options_->initial_values_outer_boundary, + initial_time_, + expansion_map_options_->decay_timescale_outer_boundary); + } } - DataVector initial_quaternion_value{4, 0.0}; - DataVector initial_quaternion_first_derivative_value{4, 0.0}; - DataVector initial_quaternion_second_derivative_value{4, 0.0}; - // RotationMap FunctionOfTime if (rotation_map_options_.has_value()) { - for (size_t i = 0; i < 4; i++) { - initial_quaternion_value[i] = - gsl::at(gsl::at(rotation_map_options_.value().initial_values, 0), i); - initial_quaternion_first_derivative_value[i] = - gsl::at(gsl::at(rotation_map_options_.value().initial_values, 1), i); - initial_quaternion_second_derivative_value[i] = - gsl::at(gsl::at(rotation_map_options_.value().initial_values, 2), i); + if (rotation_map_options_->decay_timescale.has_value()) { + result[rotation_name] = + std::make_unique>( + initial_time_, std::array{rotation_map_options_->quaternions[0]}, + rotation_map_options_->angles, + expiration_times.at(rotation_name)); + } else { + result[rotation_name] = + std::make_unique( + rotation_map_options_->quaternions, initial_time_, + rotation_map_options_->decay_timescale.value()); } - result[rotation_name] = - std::make_unique( - std::array{ - std::move(initial_quaternion_value), - std::move(initial_quaternion_first_derivative_value), - std::move(initial_quaternion_second_derivative_value)}, - initial_time_, rotation_map_options_.value().decay_timescale); } - DataVector initial_translation_center{3, 0.0}; - DataVector initial_translation_velocity{3, 0.0}; - DataVector initial_translation_acceleration{3, 0.0}; - // Translation FunctionOfTime if (translation_map_options_.has_value()) { - for (size_t i = 0; i < 3; i++) { - initial_translation_center[i] = gsl::at( - gsl::at(translation_map_options_.value().initial_values, 0), i); - initial_translation_velocity[i] = gsl::at( - gsl::at(translation_map_options_.value().initial_values, 1), i); - initial_translation_acceleration[i] = gsl::at( - gsl::at(translation_map_options_.value().initial_values, 2), i); - } result[translation_name] = std::make_unique>( - initial_time_, - std::array{ - {std::move(initial_translation_center), - std::move(initial_translation_velocity), - std::move(initial_translation_acceleration)}}, + initial_time_, translation_map_options_->initial_values, expiration_times.at(translation_name)); } diff --git a/src/Domain/Creators/TimeDependentOptions/Sphere.hpp b/src/Domain/Creators/TimeDependentOptions/Sphere.hpp index 84bb62e719af..f52c6f6b6336 100644 --- a/src/Domain/Creators/TimeDependentOptions/Sphere.hpp +++ b/src/Domain/Creators/TimeDependentOptions/Sphere.hpp @@ -16,7 +16,10 @@ #include "Domain/CoordinateMaps/TimeDependent/RotScaleTrans.hpp" #include "Domain/CoordinateMaps/TimeDependent/Shape.hpp" #include "Domain/CoordinateMaps/TimeDependent/Translation.hpp" +#include "Domain/Creators/TimeDependentOptions/ExpansionMap.hpp" +#include "Domain/Creators/TimeDependentOptions/RotationMap.hpp" #include "Domain/Creators/TimeDependentOptions/ShapeMap.hpp" +#include "Domain/Creators/TimeDependentOptions/TranslationMap.hpp" #include "Domain/FunctionsOfTime/FunctionOfTime.hpp" #include "Domain/Structure/ObjectLabel.hpp" #include "Options/Auto.hpp" @@ -88,112 +91,12 @@ struct TimeDependentMapOptions { using ShapeMapOptions = time_dependent_options::ShapeMapOptions; - struct RotationMapOptions { - using type = Options::Auto; - static std::string name() { return "RotationMap"; } - static constexpr Options::String help = { - "Options for a time-dependent rotation map about an arbitrary axis. " - "Specify 'None' to not use this map."}; - - struct InitialValues { - using type = std::array, 3>; - static constexpr Options::String help = { - "The initial values for the quaternion function and its first two " - "derivatives."}; - }; - - struct DecayTimescaleRotation { - using type = double; - static constexpr Options::String help = { - "The timescale for how fast the rotation approaches its asymptotic " - "value."}; - }; - - using options = tmpl::list; - RotationMapOptions(); - RotationMapOptions(std::array, 3> initial_values_in, - double decay_timescale_in); - - std::array, 3> initial_values{}; - double decay_timescale{std::numeric_limits::signaling_NaN()}; - }; - - struct ExpansionMapOptions { - using type = Options::Auto; - static std::string name() { return "ExpansionMap"; } - static constexpr Options::String help = { - "Options for the expansion map. Specify 'None' to not use this map."}; - - struct InitialValues { - using type = std::array; - static constexpr Options::String help = { - "Initial value and first two derivatives of expansion."}; - }; - - struct DecayTimescaleExpansion { - using type = double; - static constexpr Options::String help = { - "The timescale for how fast the expansion approaches " - "its asymptotic value."}; - }; + using RotationMapOptions = time_dependent_options::RotationMapOptions<2>; - struct InitialValuesOuterBoundary { - using type = std::array; - static constexpr Options::String help = { - "Initial value and first two derivatives of expansion outside the " - "transition region."}; - }; + using ExpansionMapOptions = time_dependent_options::ExpansionMapOptions; - struct DecayTimescaleExpansionOuterBoundary { - using type = double; - static constexpr Options::String help = { - "The timescale for how fast the expansion approaches " - "its asymptotic value outside the transition region."}; - }; - - using options = tmpl::list; - ExpansionMapOptions(); - ExpansionMapOptions(std::array initial_values_in, - double decay_timescale_in, - std::array initial_values_outer_boundary_in, - double decay_timescale_outer_boundary_in); - - std::array initial_values{ - std::numeric_limits::signaling_NaN(), - std::numeric_limits::signaling_NaN(), - std::numeric_limits::signaling_NaN()}; - double decay_timescale{std::numeric_limits::signaling_NaN()}; - std::array initial_values_outer_boundary{ - std::numeric_limits::signaling_NaN(), - std::numeric_limits::signaling_NaN(), - std::numeric_limits::signaling_NaN()}; - double decay_timescale_outer_boundary{ - std::numeric_limits::signaling_NaN()}; - }; - - struct TranslationMapOptions { - using type = Options::Auto; - static std::string name() { return "TranslationMap"; } - static constexpr Options::String help = { - "Options for a time-dependent translation map in that keeps the " - "outer boundary fixed. Specify 'None' to not use this map."}; - - struct InitialValues { - using type = std::array, 3>; - static constexpr Options::String help = { - "Initial values for the translation map, its velocity and " - "acceleration."}; - }; - - using options = tmpl::list; - TranslationMapOptions(); - explicit TranslationMapOptions( - std::array, 3> initial_values_in); - - std::array, 3> initial_values{}; - }; + using TranslationMapOptions = + time_dependent_options::TranslationMapOptions<3>; using options = tmpl::list; diff --git a/src/Evolution/Ringdown/StrahlkorperCoefsInRingdownDistortedFrame.cpp b/src/Evolution/Ringdown/StrahlkorperCoefsInRingdownDistortedFrame.cpp index 444ad20765a3..b92cfa5958ee 100644 --- a/src/Evolution/Ringdown/StrahlkorperCoefsInRingdownDistortedFrame.cpp +++ b/src/Evolution/Ringdown/StrahlkorperCoefsInRingdownDistortedFrame.cpp @@ -26,7 +26,7 @@ std::vector strahlkorper_coefs_in_ringdown_distorted_frame( const double settling_timescale, const std::array& exp_func_and_2_derivs, const std::array& exp_outer_bdry_func_and_2_derivs, - const std::array, 3>& rot_func_and_2_derivs) { + const std::vector>& rot_func_and_2_derivs) { // Read the AhC coefficients from the H5 file const std::vector>& ahc_inertial_h5 = ylm::read_surface_ylm( @@ -52,11 +52,12 @@ std::vector strahlkorper_coefs_in_ringdown_distorted_frame( const domain::creators::sphere::TimeDependentMapOptions::ShapeMapOptions shape_map_options{l_max, std::nullopt, std::nullopt}; const domain::creators::sphere::TimeDependentMapOptions::ExpansionMapOptions - expansion_map_options{exp_func_and_2_derivs, settling_timescale, - exp_outer_bdry_func_and_2_derivs, - settling_timescale}; + expansion_map_options{ + exp_func_and_2_derivs, exp_outer_bdry_func_and_2_derivs, + settling_timescale, settling_timescale, std::nullopt}; const domain::creators::sphere::TimeDependentMapOptions::RotationMapOptions - rotation_map_options{rot_func_and_2_derivs, settling_timescale}; + rotation_map_options{rot_func_and_2_derivs, std::nullopt, + settling_timescale}; const domain::creators::sphere::TimeDependentMapOptions time_dependent_map_options{match_time, shape_map_options, rotation_map_options, expansion_map_options, diff --git a/src/Evolution/Ringdown/StrahlkorperCoefsInRingdownDistortedFrame.hpp b/src/Evolution/Ringdown/StrahlkorperCoefsInRingdownDistortedFrame.hpp index 835a1a7ee303..ea6c83b7d109 100644 --- a/src/Evolution/Ringdown/StrahlkorperCoefsInRingdownDistortedFrame.hpp +++ b/src/Evolution/Ringdown/StrahlkorperCoefsInRingdownDistortedFrame.hpp @@ -39,5 +39,5 @@ std::vector strahlkorper_coefs_in_ringdown_distorted_frame( double settling_timescale, const std::array& exp_func_and_2_derivs, const std::array& exp_outer_bdry_func_and_2_derivs, - const std::array, 3>& rot_func_and_2_derivs); + const std::vector>& rot_func_and_2_derivs); } // namespace evolution::Ringdown diff --git a/tests/Unit/Domain/Creators/Test_Sphere.cpp b/tests/Unit/Domain/Creators/Test_Sphere.cpp index f8f8e30b01f3..48178b985c5b 100644 --- a/tests/Unit/Domain/Creators/Test_Sphere.cpp +++ b/tests/Unit/Domain/Creators/Test_Sphere.cpp @@ -601,10 +601,10 @@ void test_parse_errors() { radial_distribution, which_wedges, TDMO{1.0, TDMO::ShapeMapOptions{5, std::nullopt}, std::nullopt, std::nullopt, - TDMO::TranslationMapOptions{ - {std::array{0.0, 0.0, 0.0}, - std::array{0.001, -0.003, 0.005}, - std::array{0.0, 0.0, 0.0}}}}, + TDMO::TranslationMapOptions{std::array{ + std::array{0.0, 0.0, 0.0}, + std::array{0.001, -0.003, 0.005}, + std::array{0.0, 0.0, 0.0}}}}, nullptr), Catch::Matchers::ContainsSubstring( "Currently cannot use hard-coded time dependent maps with an inner " @@ -712,8 +712,9 @@ void test_sphere(const gsl::not_null gen) { l_max, std::nullopt}, std::nullopt, std::nullopt, creators::sphere::TimeDependentMapOptions::TranslationMapOptions{ - {std::array{0.0, 0.0, 0.0}, translation_velocity, - std::array{0.0, 0.0, 0.0}}}); + std::array{std::array{0.0, 0.0, 0.0}, + translation_velocity, + std::array{0.0, 0.0, 0.0}}}); } else { time_dependent_options = std::make_unique< domain::creators::time_dependence::UniformTranslation<3, 0>>( diff --git a/tests/Unit/Evolution/Ringdown/Test_StrahlkorperCoefsInRingdownDistortedFrame.cpp b/tests/Unit/Evolution/Ringdown/Test_StrahlkorperCoefsInRingdownDistortedFrame.cpp index cd3dcdd678ad..6bff874bdb5f 100644 --- a/tests/Unit/Evolution/Ringdown/Test_StrahlkorperCoefsInRingdownDistortedFrame.cpp +++ b/tests/Unit/Evolution/Ringdown/Test_StrahlkorperCoefsInRingdownDistortedFrame.cpp @@ -86,7 +86,7 @@ SPECTRE_TEST_CASE( for (size_t i = 0; i < 4; ++i) { gsl::at(initial_unit_quaternion, i) /= initial_unit_quaternion_magnitude; } - const std::array, 3> rot_func_and_2_derivs{ + const std::vector> rot_func_and_2_derivs{ initial_unit_quaternion, make_with_random_values>(make_not_null(&generator), make_not_null(&fot_dist)), @@ -99,11 +99,12 @@ SPECTRE_TEST_CASE( const domain::creators::sphere::TimeDependentMapOptions::ShapeMapOptions shape_map_options{l_max, std::nullopt}; const domain::creators::sphere::TimeDependentMapOptions::ExpansionMapOptions - expansion_map_options{exp_func_and_2_derivs, settling_timescale, - exp_outer_bdry_func_and_2_derivs, - settling_timescale}; + expansion_map_options{ + exp_func_and_2_derivs, exp_outer_bdry_func_and_2_derivs, + settling_timescale, settling_timescale, std::nullopt}; const domain::creators::sphere::TimeDependentMapOptions::RotationMapOptions - rotation_map_options{rot_func_and_2_derivs, settling_timescale}; + rotation_map_options{rot_func_and_2_derivs, std::nullopt, + settling_timescale}; const domain::creators::sphere::TimeDependentMapOptions time_dependent_map_options{match_time, shape_map_options, rotation_map_options, expansion_map_options,