diff --git a/src/amr_criteria/amr_criteria.hpp b/src/amr_criteria/amr_criteria.hpp index 42fcb6d65502..86b09c9728a1 100644 --- a/src/amr_criteria/amr_criteria.hpp +++ b/src/amr_criteria/amr_criteria.hpp @@ -23,7 +23,8 @@ namespace parthenon { class ParameterInput; -template class MeshBlockData; +template +class MeshBlockData; struct AMRBounds { AMRBounds(const IndexRange &ib, const IndexRange &jb, const IndexRange &kb) diff --git a/src/interface/mesh_data.hpp b/src/interface/mesh_data.hpp index 5c17ce80eb71..614c72656a27 100644 --- a/src/interface/mesh_data.hpp +++ b/src/interface/mesh_data.hpp @@ -438,7 +438,7 @@ class MeshData { }; template -std::vector UidIntersection(MeshData *md1, MeshData *md2, Args &&... args) { +std::vector UidIntersection(MeshData *md1, MeshData *md2, Args &&...args) { auto u1 = md1->GetBlockData(0)->GetVariableUIDs(std::forward(args)...); auto u2 = md2->GetBlockData(0)->GetVariableUIDs(std::forward(args)...); return UidIntersection(u1, u2); diff --git a/src/interface/meshblock_data.hpp b/src/interface/meshblock_data.hpp index 0221e0d6eaab..4ca32223efae 100644 --- a/src/interface/meshblock_data.hpp +++ b/src/interface/meshblock_data.hpp @@ -189,11 +189,11 @@ class MeshBlockData { } std::vector GetVariableUIDs(const std::vector &names, - const std::vector &sparse_ids = {}) { + const std::vector &sparse_ids = {}) { return GetVariablesByName(names, sparse_ids).unique_ids(); } std::vector GetVariableUIDs(const Metadata::FlagCollection &flags, - const std::vector &sparse_ids = {}) { + const std::vector &sparse_ids = {}) { return GetVariablesByFlag(flags, sparse_ids).unique_ids(); } std::vector GetVariableUIDs(const std::vector &sparse_ids = {}) { @@ -661,7 +661,7 @@ class MeshBlockData { template std::vector UidIntersection(MeshBlockData *mbd1, MeshBlockData *mbd2, - Args &&... args) { + Args &&...args) { auto u1 = mbd1->GetVariableUIDs(std::forward(args)...); auto u2 = mbd2->GetVariableUIDs(std::forward(args)...); return UidIntersection(u1, u2); diff --git a/src/interface/sparse_pack_base.hpp b/src/interface/sparse_pack_base.hpp index 1249b890714f..732862e307d9 100644 --- a/src/interface/sparse_pack_base.hpp +++ b/src/interface/sparse_pack_base.hpp @@ -35,7 +35,7 @@ namespace parthenon { class SparsePackCache; namespace impl { -class PackDescriptor; +class PackDescriptor; } // Map for going from variable names to sparse pack variable indices @@ -45,8 +45,6 @@ class StateDescriptor; enum class PDOpt { WithFluxes, Coarse, Flatten }; - - class SparsePackBase { public: SparsePackBase() = default; @@ -126,18 +124,16 @@ struct PackDescriptor { using VariableGroup_t = std::vector>; using SelectorFunction_t = std::function; using SelectorFunctionUid_t = std::function; - + void Print() const; - - template - PackDescriptor(StateDescriptor *psd, - const std::vector &var_groups_in, - const SELECTOR_t &selector, - const std::set &options) + + template + PackDescriptor(StateDescriptor *psd, const std::vector &var_groups_in, + const SELECTOR_t &selector, const std::set &options) : nvar_groups(var_groups_in.size()), var_group_names(MakeGroupNames(var_groups_in)), var_groups(BuildUids(var_groups_in.size(), psd, selector)), - with_fluxes(options.count(PDOpt::WithFluxes)), coarse(options.count(PDOpt::Coarse)), - flat(options.count(PDOpt::Flatten)) { + with_fluxes(options.count(PDOpt::WithFluxes)), + coarse(options.count(PDOpt::Coarse)), flat(options.count(PDOpt::Flatten)) { PARTHENON_REQUIRE(!(with_fluxes && coarse), "Probably shouldn't be making a coarse pack with fine fluxes."); } @@ -150,25 +146,23 @@ struct PackDescriptor { const bool flat; private: - template std::vector - BuildUids(int nvgs, const StateDescriptor *const psd, - const FUNC_t &selector) { + BuildUids(int nvgs, const StateDescriptor *const psd, const FUNC_t &selector) { auto fields = psd->AllFields(); std::vector vgs(nvgs); for (auto [id, md] : fields) { for (int i = 0; i < nvgs; ++i) { auto uid = Variable::GetUniqueID(id.label()); - if constexpr (std::is_invocable::value) { + if constexpr (std::is_invocable::value) { if (selector(i, id, md)) { vgs[i].push_back({id, uid}); } - } else if constexpr (std::is_invocable::value) { + } else if constexpr (std::is_invocable::value) { if (selector(i, uid, md)) { vgs[i].push_back({id, uid}); } - } else { + } else { PARTHENON_FAIL("Passing the wrong sort of selector."); } } @@ -184,13 +178,14 @@ struct PackDescriptor { return vgs; } - template + template std::vector MakeGroupNames(const std::vector &var_groups) { - if constexpr (std::is_same::value) { - return var_groups; - } else if constexpr (std::is_same::value) { - std::vector var_group_names; - for (auto &vg : var_groups) var_group_names.push_back(std::to_string(vg)); + if constexpr (std::is_same::value) { + return var_groups; + } else if constexpr (std::is_same::value) { + std::vector var_group_names; + for (auto &vg : var_groups) + var_group_names.push_back(std::to_string(vg)); return var_group_names; } } diff --git a/src/parthenon/driver.hpp b/src/parthenon/driver.hpp index 9fd8c3e8ea3e..a62773cbcc87 100644 --- a/src/parthenon/driver.hpp +++ b/src/parthenon/driver.hpp @@ -69,9 +69,9 @@ using ::parthenon::TaskListStatus; using ::parthenon::TaskRegion; using ::parthenon::TaskStatus; using ::parthenon::TaskType; +using ::parthenon::Uid_t; using ::parthenon::DriverUtils::ConstructAndExecuteBlockTasks; using ::parthenon::DriverUtils::ConstructAndExecuteTaskLists; -using ::parthenon::Uid_t; namespace partition { using ::parthenon::partition::Partition_t; diff --git a/src/utils/unique_id.hpp b/src/utils/unique_id.hpp index a0168297b479..eca507f886a1 100644 --- a/src/utils/unique_id.hpp +++ b/src/utils/unique_id.hpp @@ -15,6 +15,7 @@ #define UTILS_UNIQUE_ID_HPP_ #include +#include #include