diff --git a/src/Evolution/Executables/Cce/KleinGordonCharacteristicExtract.hpp b/src/Evolution/Executables/Cce/KleinGordonCharacteristicExtract.hpp index 14aa1e047316..7d8dc5b52dd0 100644 --- a/src/Evolution/Executables/Cce/KleinGordonCharacteristicExtract.hpp +++ b/src/Evolution/Executables/Cce/KleinGordonCharacteristicExtract.hpp @@ -53,8 +53,7 @@ struct EvolutionMetavars : CharacteristicExtractDefaults { Cce::Tags::EvolutionGaugeBoundaryValue>; using klein_gordon_scri_tags = - tmpl::list, - Cce::Tags::ScriPlus>; + tmpl::list>; using cce_step_choosers = tmpl::list, @@ -109,6 +108,14 @@ struct EvolutionMetavars : CharacteristicExtractDefaults { tmpl::list, Cce::Tags::RegularIntegrand>; + using scri_values_to_observe = + tmpl::append>>; + + using cce_scri_tags = + tmpl::append>>; + using component_list = tmpl::list, cce_boundary_component, diff --git a/src/Evolution/Systems/Cce/ScriPlusValues.cpp b/src/Evolution/Systems/Cce/ScriPlusValues.cpp index 868a218fe818..4ad9662557d6 100644 --- a/src/Evolution/Systems/Cce/ScriPlusValues.cpp +++ b/src/Evolution/Systems/Cce/ScriPlusValues.cpp @@ -364,4 +364,21 @@ void CalculateScriPlusValue<::Tags::dt>::apply( get(*dt_inertial_time).size()); get(*dt_inertial_time) = real(exp_2_beta_at_scri.data()); } + +void CalculateScriPlusValue>::apply( + const gsl::not_null>*> + kg_psi_scri, + const Scalar>& dy_kg_psi, + const Scalar>& boundary_r, size_t l_max, + size_t number_of_radial_points) { + const size_t number_of_angular_points = + Spectral::Swsh::number_of_swsh_collocation_points(l_max); + + const SpinWeighted dy_kg_psi_scri; + make_const_view(make_not_null(&dy_kg_psi_scri), get(dy_kg_psi), + (number_of_radial_points - 1) * number_of_angular_points, + number_of_angular_points); + + get(*kg_psi_scri) = -2. * get(boundary_r) * dy_kg_psi_scri; +} } // namespace Cce diff --git a/src/Evolution/Systems/Cce/ScriPlusValues.hpp b/src/Evolution/Systems/Cce/ScriPlusValues.hpp index 1c91306af471..fdc526b3dcff 100644 --- a/src/Evolution/Systems/Cce/ScriPlusValues.hpp +++ b/src/Evolution/Systems/Cce/ScriPlusValues.hpp @@ -407,6 +407,37 @@ struct CalculateScriPlusValue { size_t l_max); }; +/*! + * \brief Computes the leading part of the scalar field \f$\psi\f$ near + * \f$\mathcal I^+\f$. + * + * \details The value \f$\psi\f$ scales asymptotically as \f$r^{-1}\f$. Assuming + * \f$\psi^{(n)}\f$ is the \f$1/r^n\f$ part of \f$\psi\f$ evaluated at + * \f$\mathcal I^+\f$, so for any \f$\psi\f$, + * + * \f{align*}{ + * \psi^{(1)} = (- 2 R \partial_y \psi)|_{y = 1}, + * \f} + * + * where the expansion is determined by the conversion between Bondi and + * numerical radii \f$r = 2 R / (1 - y)\f$. + */ +template <> +struct CalculateScriPlusValue> { + using return_tags = tmpl::list>; + using tensor_argument_tags = + tmpl::list, + Tags::EvolutionGaugeBoundaryValue>; + using argument_tags = tmpl::push_back; + + static void apply( + gsl::not_null>*> kg_psi_scri, + const Scalar>& dy_kg_psi, + const Scalar>& boundary_r, + size_t l_max, size_t number_of_radial_points); +}; + /// Initialize the \f$\mathcal I^+\f$ value `Tag` for the first hypersurface. template struct InitializeScriPlusValue; diff --git a/tests/Unit/Evolution/Systems/Cce/ScriPlusValues.py b/tests/Unit/Evolution/Systems/Cce/ScriPlusValues.py index 64135929c672..aaf67339bfc3 100644 --- a/tests/Unit/Evolution/Systems/Cce/ScriPlusValues.py +++ b/tests/Unit/Evolution/Systems/Cce/ScriPlusValues.py @@ -133,3 +133,7 @@ def strain(dy_bondi_j, eth_eth_retarded_time, boundary_r): return -2.0 * np.conj(boundary_r * dy_bondi_j) + np.conj( eth_eth_retarded_time ) + + +def klein_gordon_psi(dy_kg_psi, boundary_r): + return -2.0 * boundary_r * dy_kg_psi diff --git a/tests/Unit/Evolution/Systems/Cce/Test_ScriPlusValues.cpp b/tests/Unit/Evolution/Systems/Cce/Test_ScriPlusValues.cpp index ebd9532a276f..2f710ce19b72 100644 --- a/tests/Unit/Evolution/Systems/Cce/Test_ScriPlusValues.cpp +++ b/tests/Unit/Evolution/Systems/Cce/Test_ScriPlusValues.cpp @@ -90,6 +90,13 @@ void pypp_test_scri_plus_computation_steps() { CalculateScriPlusValue>>::apply, "ScriPlusValues", {"strain"}, {{{0.1, 1.0}}}, DataVector{Spectral::Swsh::number_of_swsh_collocation_points(l_max)}); + + pypp::check_with_random_values<1>( + &WrapScriPlusComputation< + l_max, number_of_radial_points, + CalculateScriPlusValue>>::apply, + "ScriPlusValues", {"klein_gordon_psi"}, {{{0.1, 1.0}}}, + DataVector{Spectral::Swsh::number_of_swsh_collocation_points(l_max)}); } void check_inertial_retarded_time_utilities() {