From 811e08e3e94d8646d9c7731e311b5f80f18416cf Mon Sep 17 00:00:00 2001 From: jdolence Date: Tue, 15 Aug 2023 13:21:16 -0600 Subject: [PATCH] add default descriptors/sparse packs for weird usage downstream --- src/amr_criteria/amr_criteria.hpp | 1 - src/interface/make_pack_descriptor.hpp | 2 ++ src/interface/sparse_pack.hpp | 1 + src/interface/sparse_pack_base.hpp | 5 +++++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/amr_criteria/amr_criteria.hpp b/src/amr_criteria/amr_criteria.hpp index 86b09c9728a1..e31bd8b381d8 100644 --- a/src/amr_criteria/amr_criteria.hpp +++ b/src/amr_criteria/amr_criteria.hpp @@ -17,7 +17,6 @@ #include #include "defs.hpp" -//#include "interface/meshblock_data.hpp" #include "mesh/domain.hpp" namespace parthenon { diff --git a/src/interface/make_pack_descriptor.hpp b/src/interface/make_pack_descriptor.hpp index bd838e37363f..f3cfe17ec4f3 100644 --- a/src/interface/make_pack_descriptor.hpp +++ b/src/interface/make_pack_descriptor.hpp @@ -36,6 +36,8 @@ namespace parthenon { +inline auto MakeDefaultPackDescriptor() { return typename SparsePack<>::Descriptor(); } + inline auto MakePackDescriptor(StateDescriptor *psd, const std::vector &vars, const std::vector &use_regex, const std::vector &flags = {}, diff --git a/src/interface/sparse_pack.hpp b/src/interface/sparse_pack.hpp index 4b646abc0793..ef21ee16fa98 100644 --- a/src/interface/sparse_pack.hpp +++ b/src/interface/sparse_pack.hpp @@ -122,6 +122,7 @@ class SparsePack : public SparsePackBase { class Descriptor : public impl::PackDescriptor { public: + Descriptor() = default; explicit Descriptor(const impl::PackDescriptor &desc_in) : impl::PackDescriptor(desc_in) {} diff --git a/src/interface/sparse_pack_base.hpp b/src/interface/sparse_pack_base.hpp index 732862e307d9..97c95995c8ac 100644 --- a/src/interface/sparse_pack_base.hpp +++ b/src/interface/sparse_pack_base.hpp @@ -127,6 +127,11 @@ struct PackDescriptor { void Print() const; + // default constructor needed for certain use cases + PackDescriptor() + : nvar_groups(0), var_group_names({}), var_groups({}), with_fluxes(false), + coarse(false), flat(false) {} + template PackDescriptor(StateDescriptor *psd, const std::vector &var_groups_in, const SELECTOR_t &selector, const std::set &options)