SpECTRE Documentation Coverage Report
Current view: top level - Domain/Amr - UpdateAmrDecision.hpp Hit Total Coverage
Commit: ebec864322c50bab8dca0a90baf8d01875114261 Lines: 1 2 50.0 %
Date: 2020-11-25 20:28:50
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 <array>
       7             : #include <cstddef>
       8             : 
       9             : #include "Domain/Amr/Flag.hpp"
      10             : 
      11             : /// \cond
      12             : namespace gsl {
      13             : template <typename T>
      14             : class not_null;
      15             : }  // namespace gsl
      16             : 
      17             : template <size_t VolumeDim>
      18             : class Element;
      19             : 
      20             : template <size_t VolumeDim>
      21             : class ElementId;
      22             : /// \endcond
      23             : 
      24             : namespace amr {
      25             : /// \ingroup ComputationalDomainGroup
      26             : /// \brief Updates the AMR decisions `my_current_amr_flags` of the Element
      27             : /// `element` based on the AMR decisions `neighbor_amr_flags` of a neighbor
      28             : /// Element with ElementId `neighbor_id`.
      29             : ///
      30             : /// \details  This function is called by each element when it receives the AMR
      31             : /// decisions of one of its neighbors.  If any of its flags are updated, the
      32             : /// element should send its new decisions to each of its neighbors.  The
      33             : /// following changes are made to the current flags of the element:
      34             : /// - If the neighbor wants to be two or more refinement levels higher than
      35             : ///   the element, the flag is updated to bring the element to within one level
      36             : /// - If the element wants to join, and the neighbor is a potential sibling but
      37             : ///   wants to be at a different refinement level in any dimension, the flag is
      38             : ///   updated to not do h-refinement.
      39             : ///
      40             : /// \returns true if any flag is changed
      41             : ///
      42             : /// \note Modifies `my_current_amr_flags` which are the AMR decisions of
      43             : /// `element`.
      44             : template <size_t VolumeDim>
      45           1 : bool update_amr_decision(
      46             :     gsl::not_null<std::array<amr::Flag, VolumeDim>*> my_current_amr_flags,
      47             :     const Element<VolumeDim>& element, const ElementId<VolumeDim>& neighbor_id,
      48             :     const std::array<amr::Flag, VolumeDim>& neighbor_amr_flags) noexcept;
      49             : }  // namespace amr

Generated by: LCOV version 1.14