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 : #include <cstdint> 9 : #include <iosfwd> 10 : 11 : #include "Utilities/MakeArray.hpp" 12 : 13 : namespace domain { 14 : 15 : /// \brief The topology of a Block or Element in a particular dimension 16 : /// 17 : /// \details The Topology is used to determine the geometry of the Block or 18 : /// Element, which can be used to determine: 19 : /// - Whether there is an interface (with a neighbor or external boundary) in a 20 : /// given direction 21 : /// - The block (element) logical coordinate bounds 22 : /// - The appropriate Basis and Quadrature for a Mesh on an Element 23 : /// - Whether or not h-refinement is allowed in the given dimension 24 : /// - Whether or not the hybrid DG-Subcell scheme can be used 25 : /// 26 : /// \note Choose I1 to represent an open interval \f$[-1, 1]\f$ 27 : /// 28 : /// \note Choose S1 to represent a periodic interval \f$[0, 2 \pi)\f$ 29 : /// 30 : /// \note In consecutive dimensions, choose S2Colatitude and S2Longitude to 31 : /// represent the surface of a sphere 32 : /// 33 : /// \note In consecutive dimensions, choose B2Radial and B2Angular to represent 34 : /// a disk (including the center) or cross-section of a cylinder 35 : /// 36 : /// \note In consecutive dimensions, choose B3Radial, B3Colatitude and 37 : /// B3Longitude to represent a sphere 38 : /// 39 : /// \note Currently h-refinement can only be done in dimensions with 40 : /// Topology::I1 41 : /// 42 : /// \note Currently the hybrid DG-Subcell scheme can be used only in Elements 43 : /// for which all dimensions have Topology::I1 44 0 : enum class Topology : uint8_t { 45 : Uninitialized = 0, 46 : I1 = 1, 47 : S1 = 2, 48 : S2Colatitude = 3, 49 : S2Longitude = 4, 50 : B1Radial = 5, 51 : B2Radial = 6, 52 : B2Angular = 7, 53 : B3Radial = 8, 54 : B3Colatitude = 9, 55 : B3Longitude = 10, 56 : CartoonSphere = 11, 57 : CartoonCylinder = 12 58 : }; 59 : 60 : /// Output operator for a Topology. 61 1 : std::ostream& operator<<(std::ostream& os, Topology topology); 62 : 63 0 : namespace topologies { 64 : template <size_t VolumeDim> 65 0 : static constexpr auto hypercube = make_array<VolumeDim>(Topology::I1); 66 : 67 0 : static constexpr auto annulus = std::array{Topology::I1, Topology::S1}; 68 : 69 0 : static constexpr auto disk = 70 : std::array{Topology::B2Radial, Topology::B2Angular}; 71 : 72 0 : static constexpr auto spherical_shell = 73 : std::array{Topology::I1, Topology::S2Colatitude, Topology::S2Longitude}; 74 : 75 0 : static constexpr auto cylindrical_shell = 76 : std::array{Topology::I1, Topology::S1, Topology::I1}; 77 : 78 0 : static constexpr auto full_cylinder = 79 : std::array{Topology::B2Radial, Topology::B2Angular, Topology::I1}; 80 : 81 0 : static constexpr auto full_sphere = std::array{ 82 : Topology::B3Radial, Topology::B3Colatitude, Topology::B3Longitude}; 83 : 84 0 : static constexpr auto cartoon_sphere = 85 : std::array{Topology::I1, Topology::CartoonSphere, Topology::CartoonSphere}; 86 : 87 0 : static constexpr auto cartoon_sphere_inner = std::array{ 88 : Topology::B1Radial, Topology::CartoonSphere, Topology::CartoonSphere}; 89 : 90 0 : static constexpr auto cartoon_cylinder = 91 : std::array{Topology::I1, Topology::I1, Topology::CartoonCylinder}; 92 : 93 0 : static constexpr auto cartoon_cylinder_inner = 94 : std::array{Topology::B1Radial, Topology::I1, Topology::CartoonCylinder}; 95 : } // namespace topologies 96 : 97 : } // namespace domain