Skip to content

Commit

Permalink
done
Browse files Browse the repository at this point in the history
  • Loading branch information
lroberts36 committed Aug 26, 2024
1 parent e0bd43b commit 32a0d24
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/interface/metadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,13 @@ bool Metadata::IsValid(bool throw_on_fail) const {
}
}

// Associated fluxes
if (IsSet(FluxNotOneCopy)) {
PARTHENON_REQUIRE(
IsSet(WithFluxes),
"Asking for non-OneCopy associated fluxes without asking for associated fluxes.");
}

return valid;
}

Expand Down
2 changes: 2 additions & 0 deletions src/interface/metadata.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@
PARTHENON_INTERNAL_FOR_FLAG(Fine) \
/** this variable is the flux for another variable **/ \
PARTHENON_INTERNAL_FOR_FLAG(Flux) \
/** allocate a separate flux array for each stage if WithFluxes is specified**/ \
PARTHENON_INTERNAL_FOR_FLAG(FluxNotOneCopy) \
/************************************************/ \
/** Vars specifying coordinates for visualization purposes **/ \
/** You can specify a single 3D var **/ \
Expand Down
3 changes: 2 additions & 1 deletion src/interface/state_descriptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,8 @@ bool StateDescriptor::AddFieldImpl(const VarID &vid, const Metadata &m_in,
return false; // this field has already been added
} else {
if (m.IsSet(Metadata::WithFluxes) && m.GetFluxName() == "") {
std::vector<MetadataFlag> mFlags = {Metadata::OneCopy, Metadata::Flux};
std::vector<MetadataFlag> mFlags = {Metadata::Flux};
if (!m.IsSet(Metadata::FluxNotOneCopy)) mFlags.push_back(Metadata::OneCopy);
if (m.IsSet(Metadata::Sparse)) mFlags.push_back(Metadata::Sparse);
if (m.IsSet(Metadata::Fine)) mFlags.push_back(Metadata::Fine);
if (m.IsSet(Metadata::Cell))
Expand Down

0 comments on commit 32a0d24

Please sign in to comment.