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/Tensor/TypeAliases.hpp"
9 : #include "Evolution/Systems/GeneralizedHarmonic/ConstraintDamping/Tags.hpp"
10 : #include "Evolution/Systems/GeneralizedHarmonic/Tags.hpp"
11 : #include "ParallelAlgorithms/Interpolation/Protocols/ComputeVarsToInterpolate.hpp"
12 : #include "PointwiseFunctions/GeneralRelativity/Tags.hpp"
13 : #include "Utilities/ProtocolHelpers.hpp"
14 : #include "Utilities/TMPL.hpp"
15 :
16 : /// \cond
17 : class DataVector;
18 : template <size_t Dim>
19 : class Mesh;
20 : template <typename VariablesTags>
21 : class Variables;
22 : namespace gsl {
23 : template <typename T>
24 : class not_null;
25 : } // namespace gsl
26 : /// \endcond
27 :
28 0 : namespace ah {
29 :
30 : /// Given the generalized harmonic variables in the volume, computes
31 : /// the quantities that will be interpolated onto an excision boundary.
32 : ///
33 : /// This is meant to be the primary `compute_vars_to_interpolate`
34 : /// for the computation of the characteristic speeds on the
35 : /// excision boundary.
36 : ///
37 : /// SrcTagList and DestTagList have limited flexibility, and their
38 : /// restrictions are static_asserted inside the apply functions. The
39 : /// lack of complete flexibility is intentional, because most
40 : /// computations (e.g. for observers) should be done only on the
41 : /// horizon surface (i.e. after interpolation) as opposed to in the
42 : /// volume; only those computations that require data in the volume
43 : /// (e.g. volume numerical derivatives) should be done here.
44 : ///
45 : /// For the dual-frame case, numerical derivatives of Jacobians are
46 : /// taken in order to avoid Hessians.
47 : ///
48 : /// SrcTagList is usually `interpolator_source_vars` in the
49 : /// Metavariables, and the allowed and required tags in SrcTagList are
50 : /// given by the type aliases `allowed_src_tags` and `required_src_tags`
51 : /// below.
52 : ///
53 : /// DestTagList is usually `vars_to_interpolate_to_target` in the
54 : /// `InterpolationTarget` that uses `ComputeExcisionBoundaryVolumeQuantities`.
55 : /// The allowed and required tags in DestTagList are given by
56 : /// the type aliases `allowed_dest_tags` and `required_dest_tags` below.
57 1 : struct ComputeExcisionBoundaryVolumeQuantities
58 : : tt::ConformsTo<intrp::protocols::ComputeVarsToInterpolate> {
59 : /// Single-frame case
60 : template <typename SrcTagList, typename DestTagList>
61 1 : static void apply(const gsl::not_null<Variables<DestTagList>*> target_vars,
62 : const Variables<SrcTagList>& src_vars, const Mesh<3>& mesh);
63 : /// Dual-frame case
64 : template <typename SrcTagList, typename DestTagList, typename TargetFrame>
65 1 : static void apply(
66 : const gsl::not_null<Variables<DestTagList>*> target_vars,
67 : const Variables<SrcTagList>& src_vars, const Mesh<3>& mesh,
68 : const Jacobian<DataVector, 3, TargetFrame, Frame::Inertial>&
69 : jac_target_to_inertial,
70 : const InverseJacobian<DataVector, 3, TargetFrame, Frame::Inertial>&
71 : invjac_target_to_inertial,
72 : const Jacobian<DataVector, 3, Frame::ElementLogical, TargetFrame>&
73 : jac_logical_to_target,
74 : const InverseJacobian<DataVector, 3, Frame::ElementLogical, TargetFrame>&
75 : invjac_logical_to_target,
76 : const tnsr::I<DataVector, 3, Frame::Inertial>& inertial_mesh_velocity,
77 : const tnsr::I<DataVector, 3, TargetFrame>&
78 : grid_to_target_frame_mesh_velocity);
79 :
80 0 : using allowed_src_tags =
81 : tmpl::list<gr::Tags::SpacetimeMetric<DataVector, 3>,
82 : gh::Tags::Pi<DataVector, 3>, gh::Tags::Phi<DataVector, 3>,
83 : ::Tags::deriv<gh::Tags::Phi<DataVector, 3>, tmpl::size_t<3>,
84 : Frame::Inertial>>;
85 :
86 0 : using required_src_tags =
87 : tmpl::list<gr::Tags::SpacetimeMetric<DataVector, 3>>;
88 :
89 : template <typename TargetFrame>
90 0 : using allowed_dest_tags_target_frame =
91 : tmpl::list<gr::Tags::SpatialMetric<DataVector, 3, TargetFrame>,
92 : gr::Tags::SpacetimeMetric<DataVector, 3, TargetFrame>,
93 : gr::Tags::Lapse<DataVector>,
94 : gr::Tags::Shift<DataVector, 3, TargetFrame>,
95 : gr::Tags::ShiftyQuantity<DataVector, 3, TargetFrame>>;
96 :
97 : template <typename TargetFrame>
98 0 : using allowed_dest_tags = tmpl::remove_duplicates<
99 : tmpl::append<allowed_dest_tags_target_frame<TargetFrame>,
100 : allowed_dest_tags_target_frame<Frame::Inertial>>>;
101 :
102 : template <typename TargetFrame>
103 0 : using required_dest_tags = tmpl::list<>;
104 : };
105 :
106 : } // namespace ah
|