SpECTRE Documentation Coverage Report
Current view: top level - Evolution/Systems/ScalarWave - Initialize.hpp Hit Total Coverage
Commit: d07bc7e978f0161d6eb259d687cd7878b5f9f6f0 Lines: 1 4 25.0 %
Date: 2020-09-24 02:51:00
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 "DataStructures/DataBox/DataBox.hpp"
       7             : #include "DataStructures/DataBox/DataBoxTag.hpp"
       8             : #include "DataStructures/DataBox/Prefixes.hpp"
       9             : #include "DataStructures/Tensor/EagerMath/Norms.hpp"
      10             : #include "DataStructures/Variables.hpp"
      11             : #include "ErrorHandling/Assert.hpp"
      12             : #include "Evolution/Initialization/DiscontinuousGalerkin.hpp"
      13             : #include "Evolution/Initialization/Evolution.hpp"
      14             : #include "Evolution/Systems/ScalarWave/Constraints.hpp"
      15             : #include "Evolution/Systems/ScalarWave/System.hpp"
      16             : #include "Evolution/Systems/ScalarWave/Tags.hpp"
      17             : #include "Parallel/GlobalCache.hpp"
      18             : #include "ParallelAlgorithms/Initialization/MergeIntoDataBox.hpp"
      19             : 
      20             : namespace ScalarWave {
      21           0 : namespace Actions {
      22             : /// \ingroup InitializationGroup
      23             : /// \brief Initialize items related to constraints of the ScalarWave system
      24             : ///
      25             : /// We add both constraints and the constraint damping parameter to the
      26             : /// evolution databox.
      27             : ///
      28             : /// DataBox changes:
      29             : /// - Adds:
      30             : ///   * `ScalarWave::Tags::ConstraintGamma2`
      31             : ///   * `ScalarWave::Tags::OneIndexConstraint<Dim>`
      32             : ///   * `ScalarWave::Tags::TwoIndexConstraint<Dim>`
      33             : ///   * `::Tags::PointwiseL2Norm<ScalarWave::Tags::OneIndexConstraint<Dim>>`
      34             : ///   * `::Tags::PointwiseL2Norm<ScalarWave::Tags::TwoIndexConstraint<Dim>>`
      35             : /// - Removes: nothing
      36             : /// - Modifies: nothing
      37             : ///
      38             : template <size_t Dim>
      39           1 : struct InitializeConstraints {
      40             :   template <typename DbTagsList, typename... InboxTags, typename Metavariables,
      41             :             typename ArrayIndex, typename ActionList,
      42             :             typename ParallelComponent>
      43           0 :   static auto apply(db::DataBox<DbTagsList>& box,
      44             :                     const tuples::TaggedTuple<InboxTags...>& /*inboxes*/,
      45             :                     const Parallel::GlobalCache<Metavariables>& /*cache*/,
      46             :                     const ArrayIndex& /*array_index*/,
      47             :                     const ActionList /*meta*/,
      48             :                     const ParallelComponent* const /*meta*/) noexcept {
      49             :     const auto& mesh = db::get<domain::Tags::Mesh<Dim>>(box);
      50             :     Scalar<DataVector> gamma_2{mesh.number_of_grid_points(), 0.};
      51             :     using compute_tags =
      52             :         db::AddComputeTags<ScalarWave::Tags::OneIndexConstraintCompute<Dim>,
      53             :                            ScalarWave::Tags::TwoIndexConstraintCompute<Dim>,
      54             :                            ::Tags::PointwiseL2NormCompute<
      55             :                                ScalarWave::Tags::OneIndexConstraint<Dim>>,
      56             :                            ::Tags::PointwiseL2NormCompute<
      57             :                                ScalarWave::Tags::TwoIndexConstraint<Dim>>>;
      58             : 
      59             :     return std::make_tuple(
      60             :         Initialization::merge_into_databox<
      61             :             InitializeConstraints,
      62             :             db::AddSimpleTags<ScalarWave::Tags::ConstraintGamma2>,
      63             :             compute_tags>(std::move(box), std::move(gamma_2)));
      64             :   }
      65             : };
      66             : }  // namespace Actions
      67             : }  // namespace ScalarWave

Generated by: LCOV version 1.14