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 "Domain/Block.hpp"
9 : #include "Domain/Structure/Topology.hpp"
10 : #include "Utilities/Gsl.hpp"
11 :
12 : namespace evolution::dg {
13 : /*!
14 : * \brief Returns whether the `Block`'s topology is compatible with subcell.
15 : *
16 : * Returns `true` only if every dimension of the `Block` has a topology for
17 : * which `domain::topology_supports_subcell` is `true`, i.e. hypercubes and
18 : * the cartoon topologies. Anything else, such as a spherical shell, returns
19 : * `false`.
20 : */
21 : template <size_t Dim>
22 1 : bool block_supports_subcell(const Block<Dim>& block) {
23 : for (size_t d = 0; d < Dim; ++d) {
24 : if (not domain::topology_supports_subcell(gsl::at(block.topologies(), d))) {
25 : return false;
26 : }
27 : }
28 : return true;
29 : }
30 : } // namespace evolution::dg
|