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::PsiWorldtube, 0, Dim, Frame::Inertial>,
40 : Stf::Tags::StfTensor<::Tags::dt<Tags::PsiWorldtube>, 0, Dim,
41 : Frame::Inertial>,
42 : Stf::Tags::StfTensor<Tags::PsiWorldtube, 1, Dim, Frame::Inertial>,
43 : Tags::Charge, Tags::Mass, Tags::MaxIterations, ::Tags::Time,
44 : Tags::SelfForceTurnOnTime, Tags::SelfForceTurnOnInterval>;
45 0 : static void apply(
46 : gsl::not_null<
47 : Variables<tmpl::list<::Tags::dt<Tags::EvolvedPosition<Dim>>,
48 : ::Tags::dt<Tags::EvolvedVelocity<Dim>>>>*>
49 : dt_evolved_vars,
50 : const std::array<tnsr::I<double, Dim>, 2>& pos_vel,
51 : const tuples::TaggedTuple<
52 : gr::Tags::SpacetimeMetric<double, Dim>,
53 : gr::Tags::InverseSpacetimeMetric<double, Dim>,
54 : gr::Tags::SpacetimeChristoffelSecondKind<double, Dim>,
55 : gr::Tags::TraceSpacetimeChristoffelSecondKind<double, Dim>,
56 : Tags::TimeDilationFactor>& background,
57 : const tnsr::I<double, Dim, Frame::Inertial>& geodesic_acc,
58 : const Scalar<double>& psi_monopole, const Scalar<double>& dt_psi_monopole,
59 : const tnsr::i<double, Dim, Frame::Inertial>& psi_dipole, double charge,
60 : std::optional<double> mass, size_t max_iterations, double time,
61 : std::optional<double> turn_on_time,
62 : std::optional<double> turn_on_interval);
63 : };
64 :
65 : } // namespace CurvedScalarWave::Worldtube
|