SpECTRE Documentation Coverage Report
Current view: top level - Evolution/Systems/Burgers/BoundaryConditions - DirichletAnalytic.hpp Hit Total Coverage
Commit: 3c072f0ce967e2e56649d3fa12aa2a0e4fe2a42e Lines: 2 30 6.7 %
Date: 2024-04-23 20:50:18
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 <memory>
       7             : #include <optional>
       8             : #include <pup.h>
       9             : #include <string>
      10             : #include <type_traits>
      11             : #include <unordered_map>
      12             : 
      13             : #include "DataStructures/DataBox/Prefixes.hpp"
      14             : #include "DataStructures/DataVector.hpp"
      15             : #include "DataStructures/Tensor/Tensor.hpp"
      16             : #include "DataStructures/Variables.hpp"
      17             : #include "Domain/CoordinateMaps/CoordinateMap.hpp"
      18             : #include "Domain/CoordinateMaps/Tags.hpp"
      19             : #include "Domain/ElementMap.hpp"
      20             : #include "Domain/FunctionsOfTime/FunctionOfTime.hpp"
      21             : #include "Domain/FunctionsOfTime/Tags.hpp"
      22             : #include "Domain/Structure/Direction.hpp"
      23             : #include "Domain/Structure/DirectionMap.hpp"
      24             : #include "Domain/Tags.hpp"
      25             : #include "Evolution/BoundaryConditions/Type.hpp"
      26             : #include "Evolution/DgSubcell/GhostZoneLogicalCoordinates.hpp"
      27             : #include "Evolution/DgSubcell/Tags/Coordinates.hpp"
      28             : #include "Evolution/DgSubcell/Tags/Mesh.hpp"
      29             : #include "Evolution/Systems/Burgers/BoundaryConditions/BoundaryCondition.hpp"
      30             : #include "Evolution/Systems/Burgers/FiniteDifference/Factory.hpp"
      31             : #include "Evolution/Systems/Burgers/FiniteDifference/Reconstructor.hpp"
      32             : #include "Evolution/Systems/Burgers/FiniteDifference/Tags.hpp"
      33             : #include "Evolution/Systems/Burgers/Tags.hpp"
      34             : #include "Evolution/TypeTraits.hpp"
      35             : #include "NumericalAlgorithms/Spectral/Mesh.hpp"
      36             : #include "Options/String.hpp"
      37             : #include "PointwiseFunctions/AnalyticData/Tags.hpp"
      38             : #include "PointwiseFunctions/AnalyticSolutions/AnalyticSolution.hpp"
      39             : #include "PointwiseFunctions/InitialDataUtilities/InitialData.hpp"
      40             : #include "Utilities/Gsl.hpp"
      41             : #include "Utilities/Serialization/CharmPupable.hpp"
      42             : #include "Utilities/TMPL.hpp"
      43             : 
      44             : /// \cond
      45             : namespace Tags {
      46             : struct Time;
      47             : }  // namespace Tags
      48             : /// \endcond
      49             : 
      50             : namespace Burgers::BoundaryConditions {
      51             : /*!
      52             :  * \brief Sets Dirichlet boundary conditions using the analytic solution or
      53             :  * analytic data.
      54             :  */
      55           1 : class DirichletAnalytic final : public BoundaryCondition {
      56             :  private:
      57           0 :   using flux_tag =
      58             :       ::Tags::Flux<Burgers::Tags::U, tmpl::size_t<1>, Frame::Inertial>;
      59             : 
      60             :  public:
      61             :   /// \brief What analytic solution/data to prescribe.
      62           1 :   struct AnalyticPrescription {
      63           0 :     static constexpr Options::String help =
      64             :         "What analytic solution/data to prescribe.";
      65           0 :     using type = std::unique_ptr<evolution::initial_data::InitialData>;
      66             :   };
      67             : 
      68           0 :   using options = tmpl::list<AnalyticPrescription>;
      69           0 :   static constexpr Options::String help{
      70             :       "DirichletAnalytic boundary conditions setting the value of U to "
      71             :       "the analytic solution or analytic data."};
      72             : 
      73           0 :   DirichletAnalytic() = default;
      74           0 :   DirichletAnalytic(DirichletAnalytic&&) = default;
      75           0 :   DirichletAnalytic& operator=(DirichletAnalytic&&) = default;
      76           0 :   DirichletAnalytic(const DirichletAnalytic&);
      77           0 :   DirichletAnalytic& operator=(const DirichletAnalytic&);
      78           0 :   ~DirichletAnalytic() override = default;
      79             : 
      80           0 :   explicit DirichletAnalytic(
      81             :       std::unique_ptr<evolution::initial_data::InitialData>
      82             :           analytic_prescription);
      83             : 
      84           0 :   explicit DirichletAnalytic(CkMigrateMessage* msg);
      85             : 
      86           0 :   WRAPPED_PUPable_decl_base_template(
      87             :       domain::BoundaryConditions::BoundaryCondition, DirichletAnalytic);
      88             : 
      89           0 :   auto get_clone() const -> std::unique_ptr<
      90             :       domain::BoundaryConditions::BoundaryCondition> override;
      91             : 
      92           0 :   static constexpr evolution::BoundaryConditions::Type bc_type =
      93             :       evolution::BoundaryConditions::Type::Ghost;
      94             : 
      95           0 :   void pup(PUP::er& p) override;
      96             : 
      97           0 :   using dg_interior_evolved_variables_tags = tmpl::list<>;
      98           0 :   using dg_interior_temporary_tags =
      99             :       tmpl::list<domain::Tags::Coordinates<1, Frame::Inertial>>;
     100           0 :   using dg_gridless_tags = tmpl::list<::Tags::Time>;
     101             : 
     102           0 :   std::optional<std::string> dg_ghost(
     103             :       const gsl::not_null<Scalar<DataVector>*> u,
     104             :       const gsl::not_null<tnsr::I<DataVector, 1, Frame::Inertial>*> flux_u,
     105             :       const std::optional<
     106             :           tnsr::I<DataVector, 1, Frame::Inertial>>& /*face_mesh_velocity*/,
     107             :       const tnsr::i<DataVector, 1, Frame::Inertial>& /*normal_covector*/,
     108             :       const tnsr::I<DataVector, 1, Frame::Inertial>& coords,
     109             :       [[maybe_unused]] const double time) const;
     110             : 
     111           0 :   using fd_interior_evolved_variables_tags = tmpl::list<>;
     112           0 :   using fd_interior_temporary_tags =
     113             :       tmpl::list<evolution::dg::subcell::Tags::Mesh<1>>;
     114           0 :   using fd_gridless_tags =
     115             :       tmpl::list<::Tags::Time, domain::Tags::FunctionsOfTime,
     116             :                  domain::Tags::ElementMap<1, Frame::Grid>,
     117             :                  domain::CoordinateMaps::Tags::CoordinateMap<1, Frame::Grid,
     118             :                                                              Frame::Inertial>,
     119             :                  fd::Tags::Reconstructor>;
     120             : 
     121           0 :   void fd_ghost(const gsl::not_null<Scalar<DataVector>*> u,
     122             :                 const Direction<1>& direction, const Mesh<1> subcell_mesh,
     123             :                 const double time,
     124             :                 const std::unordered_map<
     125             :                     std::string,
     126             :                     std::unique_ptr<domain::FunctionsOfTime::FunctionOfTime>>&
     127             :                     functions_of_time,
     128             :                 const ElementMap<1, Frame::Grid>& logical_to_grid_map,
     129             :                 const domain::CoordinateMapBase<Frame::Grid, Frame::Inertial,
     130             :                                                 1>& grid_to_inertial_map,
     131             :                 const fd::Reconstructor& reconstructor) const;
     132             : 
     133             :  private:
     134           0 :   static void flux_impl(
     135             :       gsl::not_null<tnsr::I<DataVector, 1, Frame::Inertial>*> flux,
     136             :       const Scalar<DataVector>& u_analytic);
     137             : 
     138           0 :   std::unique_ptr<evolution::initial_data::InitialData> analytic_prescription_;
     139             : };
     140             : }  // namespace Burgers::BoundaryConditions

Generated by: LCOV version 1.14