CommonVariables.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <cstddef>
7 #include <functional>
8 #include <optional>
9 
12 #include "Elliptic/Systems/Xcts/Tags.hpp"
16 #include "Utilities/Gsl.hpp"
17 
18 namespace Xcts::AnalyticData {
19 
20 /// Tags for variables that analytic-data classes can share
21 template <typename DataType>
22 using common_tags = tmpl::list<
23  Tags::InverseConformalMetric<DataType, 3, Frame::Inertial>,
24  Tags::ConformalChristoffelFirstKind<DataType, 3, Frame::Inertial>,
25  Tags::ConformalChristoffelSecondKind<DataType, 3, Frame::Inertial>,
26  Tags::ConformalChristoffelContracted<DataType, 3, Frame::Inertial>,
30  // These tags require numerical differentiation
32  Tags::ConformalChristoffelSecondKind<DataType, 3, Frame::Inertial>,
33  tmpl::size_t<3>, Frame::Inertial>,
34  Tags::ConformalRicciTensor<DataType, 3, Frame::Inertial>,
35  Tags::ConformalRicciScalar<DataType>,
38  ::Tags::div<Tags::LongitudinalShiftBackgroundMinusDtConformalMetric<
39  DataType, 3, Frame::Inertial>>>;
40 
41 /*!
42  * \brief Implementations for variables that analytic-data classes can share
43  *
44  * Analytic-data classes can derive their variable computers from this class to
45  * inherit implementations for the `common_tags`. Note that some variables
46  * require a numeric differentiation. To compute those variables, a `mesh` and
47  * an `inv_jacobian` must be passed to the constructor. The `mesh` and the
48  * `inv_jacobian` can be set to `std::nullopt` if no variables with numeric
49  * derivatives are requested.
50  *
51  * \tparam DataType `double` or `DataVector`. Must be `DataVector` if variables
52  * with numeric derivatives are requested.
53  * \tparam Cache The `CachedTempBuffer` used by the analytic-data class.
54  */
55 template <typename DataType, typename Cache>
57  static constexpr size_t Dim = 3;
58  void operator()(
59  gsl::not_null<tnsr::II<DataType, Dim>*> inv_conformal_metric,
62  const noexcept;
63  void operator()(
64  gsl::not_null<tnsr::ijj<DataType, Dim>*> conformal_christoffel_first_kind,
67  DataType, Dim, Frame::Inertial> /*meta*/) const noexcept;
68  void operator()(gsl::not_null<tnsr::Ijj<DataType, Dim>*>
69  conformal_christoffel_second_kind,
72  DataType, Dim, Frame::Inertial> /*meta*/) const noexcept;
73  void operator()(
74  gsl::not_null<tnsr::i<DataType, Dim>*> conformal_christoffel_contracted,
77  DataType, Dim, Frame::Inertial> /*meta*/) const noexcept;
78  void operator()(
79  gsl::not_null<Scalar<DataType>*> fixed_source_for_hamiltonian_constraint,
82  const noexcept;
83  void operator()(
84  gsl::not_null<Scalar<DataType>*> fixed_source_for_lapse_equation,
87  const noexcept;
88  void operator()(
89  gsl::not_null<tnsr::I<DataType, 3>*> fixed_source_momentum_constraint,
93  const noexcept;
94  void operator()(
95  gsl::not_null<tnsr::iJkk<DataType, Dim>*>
96  deriv_conformal_christoffel_second_kind,
98  ::Tags::deriv<
100  tmpl::size_t<Dim>, Frame::Inertial> /*meta*/) const noexcept;
101  void operator()(
102  gsl::not_null<tnsr::ii<DataType, Dim>*> conformal_ricci_tensor,
105  const noexcept;
106  void operator()(gsl::not_null<Scalar<DataType>*> conformal_ricci_scalar,
108  Tags::ConformalRicciScalar<DataType> /*meta*/) const noexcept;
109  void operator()(
110  gsl::not_null<tnsr::i<DataType, Dim>*> deriv_extrinsic_curvature_trace,
113  tmpl::size_t<Dim>, Frame::Inertial> /*meta*/)
114  const noexcept;
115  void operator()(
116  gsl::not_null<tnsr::I<DataType, Dim>*> div_longitudinal_shift_background,
119  DataType, Dim, Frame::Inertial>> /*meta*/) const noexcept;
120 
123  const InverseJacobian<DataType, Dim, Frame::Logical, Frame::Inertial>>>
124  inv_jacobian;
125 };
126 
127 } // namespace Xcts::AnalyticData
gr::Tags::TraceExtrinsicCurvature
Definition: Tags.hpp:120
Frame::Inertial
Definition: IndexType.hpp:44
Xcts::Tags::Conformal
The quantity Tag scaled by the Xcts::Tags::ConformalFactor to the given Power
Definition: Tags.hpp:30
Divergence.hpp
functional
Xcts::AnalyticData
Analytic data for the XCTS equations, i.e. field configurations that do not solve the equations but a...
Definition: AnalyticData.hpp:8
Xcts::Tags::ConformalChristoffelSecondKind
The Christoffel symbols of the second kind related to the conformal metric .
Definition: Tags.hpp:212
Xcts::Tags::LapseTimesConformalFactor
The product of lapse and conformal factor .
Definition: Tags.hpp:63
Xcts::AnalyticData::CommonVariables
Implementations for variables that analytic-data classes can share.
Definition: CommonVariables.hpp:56
Xcts::Tags::ConformalChristoffelContracted
The Christoffel symbols of the second kind (related to the conformal metric ) contracted in their fir...
Definition: Tags.hpp:222
Xcts::Tags::ConformalFactor
The conformal factor that rescales the spatial metric .
Definition: Tags.hpp:21
Tags::FixedSource
Prefix indicating a source term that is independent of dynamic variables.
Definition: Prefixes.hpp:75
std::reference_wrapper
Xcts::AnalyticData::common_tags
tmpl::list< Tags::InverseConformalMetric< DataType, 3, Frame::Inertial >, Tags::ConformalChristoffelFirstKind< DataType, 3, Frame::Inertial >, Tags::ConformalChristoffelSecondKind< DataType, 3, Frame::Inertial >, Tags::ConformalChristoffelContracted< DataType, 3, Frame::Inertial >, ::Tags::FixedSource< Tags::ConformalFactor< DataType > >, ::Tags::FixedSource< Tags::LapseTimesConformalFactor< DataType > >, ::Tags::FixedSource< Tags::ShiftExcess< DataType, 3, Frame::Inertial > >, ::Tags::deriv< Tags::ConformalChristoffelSecondKind< DataType, 3, Frame::Inertial >, tmpl::size_t< 3 >, Frame::Inertial >, Tags::ConformalRicciTensor< DataType, 3, Frame::Inertial >, Tags::ConformalRicciScalar< DataType >, ::Tags::deriv< gr::Tags::TraceExtrinsicCurvature< DataType >, tmpl::size_t< 3 >, Frame::Inertial >, ::Tags::div< Tags::LongitudinalShiftBackgroundMinusDtConformalMetric< DataType, 3, Frame::Inertial > >> common_tags
Tags for variables that analytic-data classes can share.
Definition: CommonVariables.hpp:39
Tags::div
Prefix indicating the divergence.
Definition: Divergence.hpp:44
cstddef
Xcts::Tags::ShiftExcess
The dynamic part of the shift .
Definition: Tags.hpp:93
ActionTesting::cache
Parallel::GlobalCache< Metavariables > & cache(MockRuntimeSystem< Metavariables > &runner, const ArrayIndex &array_index) noexcept
Returns the GlobalCache of Component with index array_index.
Definition: MockRuntimeSystemFreeFunctions.hpp:382
Scalar
Tensor< T, Symmetry<>, index_list<> > Scalar
Definition: TypeAliases.hpp:21
Gsl.hpp
Xcts::Tags::ConformalChristoffelFirstKind
The Christoffel symbols of the first kind related to the conformal metric .
Definition: Tags.hpp:203
Xcts::Tags::ConformalRicciTensor
The Ricci tensor related to the conformal metric .
Definition: Tags.hpp:231
Tensor.hpp
Tags::deriv
Prefix indicating spatial derivatives.
Definition: PartialDerivatives.hpp:52
optional
PartialDerivatives.hpp
Xcts::Tags::LongitudinalShiftBackgroundMinusDtConformalMetric
The conformal longitudinal operator applied to the background shift vector minus the time derivative ...
Definition: Tags.hpp:158
Prefixes.hpp
Xcts::Tags::ConformalRicciScalar
The Ricci scalar related to the conformal metric .
Definition: Tags.hpp:240
Mesh.hpp
gsl::not_null
Require a pointer to not be a nullptr
Definition: ReadSpecThirdOrderPiecewisePolynomial.hpp:13