SpECTRE Documentation Coverage Report
Current view: top level - Evolution/Systems/GrMhd/GhValenciaDivClean/BoundaryConditions - Factory.hpp Hit Total Coverage
Commit: 3f09028930c0450a2fb61ee918b22882f5d03d2b Lines: 1 2 50.0 %
Date: 2021-10-22 20:52:16
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 "Domain/BoundaryConditions/Periodic.hpp"
       7             : #include "Evolution/Systems/GeneralizedHarmonic/BoundaryConditions/Factory.hpp"
       8             : #include "Evolution/Systems/GrMhd/GhValenciaDivClean/BoundaryConditions/BoundaryCondition.hpp"
       9             : #include "Evolution/Systems/GrMhd/GhValenciaDivClean/BoundaryConditions/ProductOfConditions.hpp"
      10             : #include "Evolution/Systems/GrMhd/ValenciaDivClean/BoundaryConditions/Factory.hpp"
      11             : #include "Utilities/TMPL.hpp"
      12             : 
      13             : namespace grmhd::GhValenciaDivClean::BoundaryConditions {
      14             : namespace detail {
      15             : template <typename DerivedGhCondition, typename DerivedValenciaCondition>
      16             : using ProductOfConditionsIfConsistent = tmpl::conditional_t<
      17             :     (DerivedGhCondition::bc_type ==
      18             :      evolution::BoundaryConditions::Type::Outflow) xor
      19             :         (DerivedValenciaCondition::bc_type ==
      20             :          evolution::BoundaryConditions::Type::Outflow),
      21             :     tmpl::list<>,
      22             :     ProductOfConditions<DerivedGhCondition, DerivedValenciaCondition>>;
      23             : 
      24             : template <typename GhList, typename ValenciaList>
      25             : struct AllProductConditions;
      26             : 
      27             : template <typename GhList, typename... ValenciaConditions>
      28             : struct AllProductConditions<GhList, tmpl::list<ValenciaConditions...>> {
      29             :   using type = tmpl::flatten<tmpl::list<tmpl::transform<
      30             :       GhList, tmpl::bind<ProductOfConditionsIfConsistent, tmpl::_1,
      31             :                          tmpl::pin<ValenciaConditions>>>...>>;
      32             : };
      33             : 
      34             : template <typename ClassList>
      35             : struct remove_periodic_conditions {
      36             :   using type = tmpl::remove_if<
      37             :       ClassList,
      38             :       std::is_base_of<domain::BoundaryConditions::MarkAsPeriodic, tmpl::_1>>;
      39             : };
      40             : 
      41             : template <typename ClassList>
      42             : using remove_periodic_conditions_t =
      43             :     typename remove_periodic_conditions<ClassList>::type;
      44             : }  // namespace detail
      45             : 
      46             : // remove the periodic BCs from the creatable classes of the
      47             : // individual systems; for the remaining conditions, include a
      48             : // `ProductOfConditions` for each pair with compatible `bc_type`s.
      49             : /// Typelist of standard BoundaryConditions
      50           1 : using standard_boundary_conditions = tmpl::push_back<
      51             :     typename detail::AllProductConditions<
      52             :         detail::remove_periodic_conditions_t<
      53             :             typename GeneralizedHarmonic::BoundaryConditions::
      54             :                 standard_boundary_conditions<3_st>>,
      55             :         detail::remove_periodic_conditions_t<
      56             :             typename grmhd::ValenciaDivClean::BoundaryConditions::
      57             :                 standard_boundary_conditions>>::type,
      58             :     domain::BoundaryConditions::Periodic<BoundaryCondition>>;
      59             : }  // namespace grmhd::GhValenciaDivClean::BoundaryConditions

Generated by: LCOV version 1.14