SpECTRE Documentation Coverage Report
Current view: top level - Evolution/Systems/GrMhd/GhValenciaDivClean/Subcell - ZeroTimeDerivatives.hpp Hit Total Coverage
Commit: 1f2210958b4f38fdc0400907ee7c6d5af5111418 Lines: 1 5 20.0 %
Date: 2025-12-05 05:03:31
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 <algorithm>
       7             : #include <cstddef>
       8             : 
       9             : #include "DataStructures/DataBox/PrefixHelpers.hpp"
      10             : #include "DataStructures/DataBox/Prefixes.hpp"
      11             : #include "DataStructures/VariablesTag.hpp"
      12             : #include "Domain/Structure/Element.hpp"
      13             : #include "Domain/Tags.hpp"
      14             : #include "Evolution/DgSubcell/SubcellOptions.hpp"
      15             : #include "Evolution/DgSubcell/Tags/SubcellOptions.hpp"
      16             : #include "Evolution/Systems/GrMhd/GhValenciaDivClean/System.hpp"
      17             : #include "Evolution/Systems/GrMhd/ValenciaDivClean/System.hpp"
      18             : #include "Utilities/Algorithm.hpp"
      19             : #include "Utilities/TMPL.hpp"
      20             : 
      21             : namespace grmhd::GhValenciaDivClean::subcell {
      22             : /*!
      23             :  * \brief Zeros out the MHD time derivatives in the elements next to a DG-only
      24             :  * block that themselves are not DG-only elements.
      25             :  */
      26             : template <typename System>
      27           1 : struct ZeroMhdTimeDerivatives {
      28           0 :   using return_tags = tmpl::list<::Tags::Variables<
      29             :       db::wrap_tags_in<::Tags::dt, typename System::variables_tag::tags_list>>>;
      30           0 :   using argument_tags =
      31             :       tmpl::list<domain::Tags::Element<3>,
      32             :                  evolution::dg::subcell::Tags::SubcellOptions<3>>;
      33             : 
      34             :   template <class DtTagsList>
      35           0 :   static void apply(
      36             :       const gsl::not_null<Variables<DtTagsList>*> dt_variables,
      37             :       const Element<3>& element,
      38             :       const evolution::dg::subcell::SubcellOptions& subcell_options) {
      39             :     const bool bordering_dg_block = alg::any_of(
      40             :         element.neighbors(),
      41             :         [&subcell_options](const auto& direction_and_neighbor) {
      42             :           const size_t first_block_id =
      43             :               direction_and_neighbor.second.ids().begin()->block_id();
      44             :           return std::binary_search(subcell_options.only_dg_block_ids().begin(),
      45             :                                     subcell_options.only_dg_block_ids().end(),
      46             :                                     first_block_id);
      47             :         });
      48             :     const bool in_dg_only_zone = std::binary_search(
      49             :         subcell_options.only_dg_block_ids().begin(),
      50             :         subcell_options.only_dg_block_ids().end(), element.id().block_id());
      51             :     if (bordering_dg_block and not in_dg_only_zone) {
      52             :       tmpl::for_each<
      53             :           typename grmhd::ValenciaDivClean::System::variables_tag::tags_list>(
      54             :           [&dt_variables]<class Tag>(tmpl::type_<Tag> /*meta*/) {
      55             :             auto& var = get<::Tags::dt<Tag>>(*dt_variables);
      56             :             for (size_t i = 0; i < var.size(); ++i) {
      57             :               var[i] = 0.0;
      58             :             }
      59             :           });
      60             :     }
      61             :   }
      62             : };
      63             : }  // namespace grmhd::GhValenciaDivClean::subcell

Generated by: LCOV version 1.14