Skip to content

Commit

Permalink
add default descriptors/sparse packs for weird usage downstream
Browse files Browse the repository at this point in the history
  • Loading branch information
jdolence committed Aug 15, 2023
1 parent c153a90 commit 811e08e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/amr_criteria/amr_criteria.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include <string>

#include "defs.hpp"
//#include "interface/meshblock_data.hpp"
#include "mesh/domain.hpp"

namespace parthenon {
Expand Down
2 changes: 2 additions & 0 deletions src/interface/make_pack_descriptor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@

namespace parthenon {

inline auto MakeDefaultPackDescriptor() { return typename SparsePack<>::Descriptor(); }

inline auto MakePackDescriptor(StateDescriptor *psd, const std::vector<std::string> &vars,
const std::vector<bool> &use_regex,
const std::vector<MetadataFlag> &flags = {},
Expand Down
1 change: 1 addition & 0 deletions src/interface/sparse_pack.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}

Expand Down
5 changes: 5 additions & 0 deletions src/interface/sparse_pack_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <class GROUP_t, class SELECTOR_t>
PackDescriptor(StateDescriptor *psd, const std::vector<GROUP_t> &var_groups_in,
const SELECTOR_t &selector, const std::set<PDOpt> &options)
Expand Down

0 comments on commit 811e08e

Please sign in to comment.