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 : #include <memory>
8 : #include <optional>
9 : #include <string>
10 : #include <unordered_map>
11 : #include <vector>
12 :
13 : #include "Domain/Creators/OptionTags.hpp"
14 : #include "Evolution/DiscontinuousGalerkin/OptionTags.hpp"
15 : #include "Utilities/TMPL.hpp"
16 :
17 : /// \cond
18 : template <size_t VolumeDim>
19 : class DomainCreator;
20 : template <size_t VolumeDim>
21 : class ElementId;
22 : namespace PUP {
23 : class er;
24 : } // namespace PUP
25 : /// \endcond
26 :
27 : namespace evolution::dg::subcell {
28 : /// Generator for `EqualRateRegions` labeling all elements that are
29 : /// allowed to do subcell and their neighbors. The inverse of the
30 : /// `OnlyDgBlocksAndGroups` input file option.
31 : ///
32 : /// \note When subcell is combined with nonconforming block boundaries (e.g.,
33 : /// `domain::creators::NonconformingSphericalShells`), use
34 : /// `SubcellAndNonconformingEqualRateRegions` instead of pairing this class
35 : /// with `NonconformingEqualRateRegions`.
36 : template <size_t Dim>
37 1 : class SubcellEqualRateRegion {
38 : public:
39 0 : SubcellEqualRateRegion() = default;
40 :
41 0 : using creation_tags =
42 : tmpl::list<evolution::dg::OptionTags::OnlyDgBlocksAndGroups,
43 : domain::OptionTags::DomainCreator<Dim>>;
44 :
45 0 : SubcellEqualRateRegion(
46 : const std::optional<std::vector<std::string>>&
47 : only_dg_block_and_group_names,
48 : const std::unique_ptr<DomainCreator<Dim>>& domain_creator);
49 :
50 0 : std::unordered_map<std::string, size_t> regions() const;
51 :
52 0 : bool is_in_region(size_t region, const ElementId<Dim>& element_id) const;
53 :
54 0 : void pup(PUP::er& p);
55 :
56 : private:
57 0 : std::vector<size_t> only_dg_block_ids_{};
58 : };
59 : } // namespace evolution::dg::subcell
|