SpECTRE Documentation Coverage Report
Current view: top level - PointwiseFunctions/AnalyticData/Xcts - CommonVariables.hpp Hit Total Coverage
Commit: 990bc653376fc4a4068db06123ec02659d814816 Lines: 2 18 11.1 %
Date: 2021-05-16 17:17:32
Legend: Lines: hit not hit

          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             : #include <functional>
       8             : #include <optional>
       9             : 
      10             : #include "DataStructures/DataBox/Prefixes.hpp"
      11             : #include "DataStructures/Tensor/Tensor.hpp"
      12             : #include "Elliptic/Systems/Xcts/Tags.hpp"
      13             : #include "NumericalAlgorithms/LinearOperators/Divergence.hpp"
      14             : #include "NumericalAlgorithms/LinearOperators/PartialDerivatives.hpp"
      15             : #include "NumericalAlgorithms/Spectral/Mesh.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           1 : 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>,
      27             :     ::Tags::FixedSource<Tags::ConformalFactor<DataType>>,
      28             :     ::Tags::FixedSource<Tags::LapseTimesConformalFactor<DataType>>,
      29             :     ::Tags::FixedSource<Tags::ShiftExcess<DataType, 3, Frame::Inertial>>,
      30             :     // These tags require numerical differentiation
      31             :     ::Tags::deriv<
      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>,
      36             :     ::Tags::deriv<gr::Tags::TraceExtrinsicCurvature<DataType>, tmpl::size_t<3>,
      37             :                   Frame::Inertial>,
      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>
      56           1 : struct CommonVariables {
      57           0 :   static constexpr size_t Dim = 3;
      58           0 :   void operator()(
      59             :       gsl::not_null<tnsr::II<DataType, Dim>*> inv_conformal_metric,
      60             :       gsl::not_null<Cache*> cache,
      61             :       Tags::InverseConformalMetric<DataType, Dim, Frame::Inertial> /*meta*/)
      62             :       const noexcept;
      63           0 :   void operator()(
      64             :       gsl::not_null<tnsr::ijj<DataType, Dim>*> conformal_christoffel_first_kind,
      65             :       gsl::not_null<Cache*> cache,
      66             :       Tags::ConformalChristoffelFirstKind<
      67             :           DataType, Dim, Frame::Inertial> /*meta*/) const noexcept;
      68           0 :   void operator()(gsl::not_null<tnsr::Ijj<DataType, Dim>*>
      69             :                       conformal_christoffel_second_kind,
      70             :                   gsl::not_null<Cache*> cache,
      71             :                   Tags::ConformalChristoffelSecondKind<
      72             :                       DataType, Dim, Frame::Inertial> /*meta*/) const noexcept;
      73           0 :   void operator()(
      74             :       gsl::not_null<tnsr::i<DataType, Dim>*> conformal_christoffel_contracted,
      75             :       gsl::not_null<Cache*> cache,
      76             :       Tags::ConformalChristoffelContracted<
      77             :           DataType, Dim, Frame::Inertial> /*meta*/) const noexcept;
      78           0 :   void operator()(
      79             :       gsl::not_null<Scalar<DataType>*> fixed_source_for_hamiltonian_constraint,
      80             :       gsl::not_null<Cache*> cache,
      81             :       ::Tags::FixedSource<Tags::ConformalFactor<DataType>> /*meta*/)
      82             :       const noexcept;
      83           0 :   void operator()(
      84             :       gsl::not_null<Scalar<DataType>*> fixed_source_for_lapse_equation,
      85             :       gsl::not_null<Cache*> cache,
      86             :       ::Tags::FixedSource<Tags::LapseTimesConformalFactor<DataType>> /*meta*/)
      87             :       const noexcept;
      88           0 :   void operator()(
      89             :       gsl::not_null<tnsr::I<DataType, 3>*> fixed_source_momentum_constraint,
      90             :       gsl::not_null<Cache*> cache,
      91             :       ::Tags::FixedSource<
      92             :           Tags::ShiftExcess<DataType, 3, Frame::Inertial>> /*meta*/)
      93             :       const noexcept;
      94           0 :   void operator()(
      95             :       gsl::not_null<tnsr::iJkk<DataType, Dim>*>
      96             :           deriv_conformal_christoffel_second_kind,
      97             :       gsl::not_null<Cache*> cache,
      98             :       ::Tags::deriv<
      99             :           Tags::ConformalChristoffelSecondKind<DataType, Dim, Frame::Inertial>,
     100             :           tmpl::size_t<Dim>, Frame::Inertial> /*meta*/) const noexcept;
     101           0 :   void operator()(
     102             :       gsl::not_null<tnsr::ii<DataType, Dim>*> conformal_ricci_tensor,
     103             :       gsl::not_null<Cache*> cache,
     104             :       Tags::ConformalRicciTensor<DataType, Dim, Frame::Inertial> /*meta*/)
     105             :       const noexcept;
     106           0 :   void operator()(gsl::not_null<Scalar<DataType>*> conformal_ricci_scalar,
     107             :                   gsl::not_null<Cache*> cache,
     108             :                   Tags::ConformalRicciScalar<DataType> /*meta*/) const noexcept;
     109           0 :   void operator()(
     110             :       gsl::not_null<tnsr::i<DataType, Dim>*> deriv_extrinsic_curvature_trace,
     111             :       gsl::not_null<Cache*> cache,
     112             :       ::Tags::deriv<gr::Tags::TraceExtrinsicCurvature<DataType>,
     113             :                     tmpl::size_t<Dim>, Frame::Inertial> /*meta*/)
     114             :       const noexcept;
     115           0 :   void operator()(
     116             :       gsl::not_null<tnsr::I<DataType, Dim>*> div_longitudinal_shift_background,
     117             :       gsl::not_null<Cache*> cache,
     118             :       ::Tags::div<Tags::LongitudinalShiftBackgroundMinusDtConformalMetric<
     119             :           DataType, Dim, Frame::Inertial>> /*meta*/) const noexcept;
     120             : 
     121           0 :   std::optional<std::reference_wrapper<const Mesh<Dim>>> mesh;
     122             :   std::optional<std::reference_wrapper<
     123             :       const InverseJacobian<DataType, Dim, Frame::Logical, Frame::Inertial>>>
     124           0 :       inv_jacobian;
     125             : };
     126             : 
     127             : }  // namespace Xcts::AnalyticData

Generated by: LCOV version 1.14