Line data Source code
1 0 : // Distributed under the MIT License. 2 : // See LICENSE.txt for details. 3 : 4 : #pragma once 5 : 6 : #include <cstddef> 7 : 8 : #include "DataStructures/DataBox/PrefixHelpers.hpp" 9 : #include "DataStructures/Tensor/Tensor.hpp" 10 : #include "DataStructures/Variables.hpp" 11 : #include "DataStructures/VariablesTag.hpp" 12 : #include "Evolution/Systems/CurvedScalarWave/Worldtube/Tags.hpp" 13 : #include "NumericalAlgorithms/SphericalHarmonics/Tags.hpp" 14 : #include "Parallel/AlgorithmExecution.hpp" 15 : #include "Parallel/GlobalCache.hpp" 16 : #include "PointwiseFunctions/GeneralRelativity/Tags.hpp" 17 : #include "Utilities/Gsl.hpp" 18 : #include "Utilities/TaggedTuple.hpp" 19 : 20 : namespace CurvedScalarWave::Worldtube { 21 : 22 : /*! 23 : * \brief Computes the final acceleration of the particle at this time step. 24 : * \details If `max_iterations` is 0, the acceleration will simply be 25 : * geodesic, see `gr::geodesic_acceleration`. Otherwise, the acceleration due 26 : * to the scalar self-force is additionally applied to it, see 27 : * `self_force_acceleration`. This mutator is run on the worldtube 28 : * singleton chare. 29 : */ 30 1 : struct UpdateAcceleration { 31 0 : static constexpr size_t Dim = 3; 32 0 : using variables_tag = ::Tags::Variables< 33 : tmpl::list<Tags::EvolvedPosition<Dim>, Tags::EvolvedVelocity<Dim>>>; 34 0 : using dt_variables_tag = db::add_tag_prefix<::Tags::dt, variables_tag>; 35 0 : using return_tags = tmpl::list<dt_variables_tag>; 36 0 : using argument_tags = tmpl::list< 37 : Tags::ParticlePositionVelocity<Dim>, Tags::BackgroundQuantities<Dim>, 38 : Tags::GeodesicAcceleration<Dim>, 39 : Stf::Tags::StfTensor<::Tags::dt<Tags::PsiWorldtube>, 0, Dim, 40 : Frame::Inertial>, 41 : Stf::Tags::StfTensor<Tags::PsiWorldtube, 1, Dim, Frame::Inertial>, 42 : Tags::Charge, Tags::Mass, Tags::MaxIterations>; 43 0 : static void apply( 44 : gsl::not_null< 45 : Variables<tmpl::list<::Tags::dt<Tags::EvolvedPosition<Dim>>, 46 : ::Tags::dt<Tags::EvolvedVelocity<Dim>>>>*> 47 : dt_evolved_vars, 48 : const std::array<tnsr::I<double, Dim>, 2>& pos_vel, 49 : const tuples::TaggedTuple<gr::Tags::SpacetimeMetric<double, Dim>, 50 : gr::Tags::InverseSpacetimeMetric<double, Dim>, 51 : Tags::TimeDilationFactor>& background, 52 : const tnsr::I<double, Dim, Frame::Inertial>& geodesic_acc, 53 : const Scalar<double>& dt_psi_monopole, 54 : const tnsr::i<double, Dim, Frame::Inertial>& psi_dipole, double charge, 55 : std::optional<double> mass, size_t max_iterations); 56 : }; 57 : 58 : } // namespace CurvedScalarWave::Worldtube