SpECTRE Documentation Coverage Report
Current view: top level - Elliptic/Systems/Xcts/BoundaryConditions - Flatness.hpp Hit Total Coverage
Commit: 990bc653376fc4a4068db06123ec02659d814816 Lines: 1 11 9.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 <memory>
       8             : #include <pup.h>
       9             : #include <string>
      10             : 
      11             : #include "DataStructures/Tensor/TypeAliases.hpp"
      12             : #include "Elliptic/BoundaryConditions/BoundaryCondition.hpp"
      13             : #include "Options/Options.hpp"
      14             : #include "Parallel/CharmPupable.hpp"
      15             : #include "Utilities/Gsl.hpp"
      16             : #include "Utilities/TMPL.hpp"
      17             : 
      18             : /// \cond
      19             : class DataVector;
      20             : /// \endcond
      21             : 
      22           0 : namespace Xcts::BoundaryConditions {
      23             : namespace detail {
      24             : 
      25             : struct FlatnessImpl {
      26             :   using options = tmpl::list<>;
      27             :   static constexpr Options::String help =
      28             :       "Impose flat spacetime at this boundary.";
      29             : 
      30             :   using argument_tags = tmpl::list<>;
      31             :   using volume_tags = tmpl::list<>;
      32             : 
      33             :   static void apply(gsl::not_null<Scalar<DataVector>*> conformal_factor,
      34             :                     gsl::not_null<Scalar<DataVector>*>
      35             :                         n_dot_conformal_factor_gradient) noexcept;
      36             : 
      37             :   static void apply(
      38             :       gsl::not_null<Scalar<DataVector>*> conformal_factor,
      39             :       gsl::not_null<Scalar<DataVector>*> lapse_times_conformal_factor,
      40             :       gsl::not_null<Scalar<DataVector>*> n_dot_conformal_factor_gradient,
      41             :       gsl::not_null<Scalar<DataVector>*>
      42             :           n_dot_lapse_times_conformal_factor_gradient) noexcept;
      43             : 
      44             :   static void apply(
      45             :       gsl::not_null<Scalar<DataVector>*> conformal_factor,
      46             :       gsl::not_null<Scalar<DataVector>*> lapse_times_conformal_factor,
      47             :       gsl::not_null<tnsr::I<DataVector, 3>*> shift_excess,
      48             :       gsl::not_null<Scalar<DataVector>*> n_dot_conformal_factor_gradient,
      49             :       gsl::not_null<Scalar<DataVector>*>
      50             :           n_dot_lapse_times_conformal_factor_gradient,
      51             :       gsl::not_null<tnsr::I<DataVector, 3>*>
      52             :           n_dot_longitudinal_shift_excess) noexcept;
      53             : 
      54             :   using argument_tags_linearized = tmpl::list<>;
      55             :   using volume_tags_linearized = tmpl::list<>;
      56             : 
      57             :   static void apply_linearized(
      58             :       gsl::not_null<Scalar<DataVector>*> conformal_factor_correction,
      59             :       gsl::not_null<Scalar<DataVector>*>
      60             :           n_dot_conformal_factor_gradient_correction) noexcept;
      61             : 
      62             :   static void apply_linearized(
      63             :       gsl::not_null<Scalar<DataVector>*> conformal_factor_correction,
      64             :       gsl::not_null<Scalar<DataVector>*>
      65             :           lapse_times_conformal_factor_correction,
      66             :       gsl::not_null<Scalar<DataVector>*>
      67             :           n_dot_conformal_factor_gradient_correction,
      68             :       gsl::not_null<Scalar<DataVector>*>
      69             :           n_dot_lapse_times_conformal_factor_gradient_correction) noexcept;
      70             : 
      71             :   static void apply_linearized(
      72             :       gsl::not_null<Scalar<DataVector>*> conformal_factor_correction,
      73             :       gsl::not_null<Scalar<DataVector>*>
      74             :           lapse_times_conformal_factor_correction,
      75             :       gsl::not_null<tnsr::I<DataVector, 3>*> shift_excess_correction,
      76             :       gsl::not_null<Scalar<DataVector>*>
      77             :           n_dot_conformal_factor_gradient_correction,
      78             :       gsl::not_null<Scalar<DataVector>*>
      79             :           n_dot_lapse_times_conformal_factor_gradient_correction,
      80             :       gsl::not_null<tnsr::I<DataVector, 3>*>
      81             :           n_dot_longitudinal_shift_excess_correction) noexcept;
      82             : };
      83             : 
      84             : bool operator==(const FlatnessImpl& lhs, const FlatnessImpl& rhs) noexcept;
      85             : 
      86             : bool operator!=(const FlatnessImpl& lhs, const FlatnessImpl& rhs) noexcept;
      87             : 
      88             : }  // namespace detail
      89             : 
      90             : // The following implements the registration and factory-creation mechanism
      91             : 
      92             : /// \cond
      93             : template <typename Registrars>
      94             : struct Flatness;
      95             : 
      96             : namespace Registrars {
      97             : struct Flatness {
      98             :   template <typename Registrars>
      99             :   using f = BoundaryConditions::Flatness<Registrars>;
     100             : };
     101             : }  // namespace Registrars
     102             : /// \endcond
     103             : 
     104             : /*!
     105             :  * \brief Impose flat spacetime at this boundary
     106             :  *
     107             :  * Impose \f$\psi=1\f$, \f$\alpha\psi=1\f$, \f$\beta_\mathrm{excess}^i=0\f$ on
     108             :  * this boundary, where \f$\psi\f$ is the conformal factor, \f$\alpha\f$ is the
     109             :  * lapse and \f$\beta_\mathrm{excess}^i=\beta^i-\beta_\mathrm{background}^i\f$
     110             :  * is the shift excess (see `Xcts::Tags::ShiftExcess` for details on the split
     111             :  * of the shift in background and excess). Note that this choice only truly
     112             :  * represents flatness if the conformal background metric is flat.
     113             :  */
     114             : template <typename Registrars = tmpl::list<Registrars::Flatness>>
     115             : class Flatness
     116             :     : public elliptic::BoundaryConditions::BoundaryCondition<3, Registrars>,
     117           1 :       public detail::FlatnessImpl {
     118             :  private:
     119           0 :   using Base = elliptic::BoundaryConditions::BoundaryCondition<3, Registrars>;
     120             : 
     121             :  public:
     122           0 :   Flatness() = default;
     123           0 :   Flatness(const Flatness&) noexcept = default;
     124           0 :   Flatness& operator=(const Flatness&) noexcept = default;
     125           0 :   Flatness(Flatness&&) noexcept = default;
     126           0 :   Flatness& operator=(Flatness&&) noexcept = default;
     127           0 :   ~Flatness() noexcept = default;
     128             : 
     129             :   /// \cond
     130             :   explicit Flatness(CkMigrateMessage* m) noexcept : Base(m) {}
     131             :   using PUP::able::register_constructor;
     132             :   WRAPPED_PUPable_decl_template(Flatness);
     133             :   /// \endcond
     134             : 
     135           0 :   std::unique_ptr<domain::BoundaryConditions::BoundaryCondition> get_clone()
     136             :       const noexcept override {
     137             :     return std::make_unique<Flatness>(*this);
     138             :   }
     139             : };
     140             : 
     141             : /// \cond
     142             : template <typename Registrars>
     143             : PUP::able::PUP_ID Flatness<Registrars>::my_PUP_ID = 0;  // NOLINT
     144             : /// \endcond
     145             : 
     146             : }  // namespace Xcts::BoundaryConditions

Generated by: LCOV version 1.14