SpECTRE Documentation Coverage Report
Current view: top level - Domain/Structure - IndexToSliceAt.hpp Hit Total Coverage
Commit: 3c072f0ce967e2e56649d3fa12aa2a0e4fe2a42e Lines: 1 2 50.0 %
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 <cstddef>
       7             : 
       8             : #include "DataStructures/Index.hpp"
       9             : #include "Domain/Structure/Direction.hpp"
      10             : #include "Domain/Structure/Side.hpp"
      11             : 
      12             : /// \ingroup ComputationalDomainGroup
      13             : /// \brief Finds the index in the perpendicular dimension of an element boundary
      14             : ///
      15             : /// Optionally provide an `offset` to find an index offset from the element
      16             : /// boundary.
      17             : template <size_t Dim>
      18           1 : size_t index_to_slice_at(const Index<Dim>& extents,
      19             :                          const Direction<Dim>& direction,
      20             :                          const size_t offset = 0) {
      21             :   return direction.side() == Side::Lower
      22             :              ? offset
      23             :              : extents[direction.dimension()] - 1 - offset;
      24             : }

Generated by: LCOV version 1.14