Skip to content

Commit

Permalink
format and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
lroberts36 committed Sep 4, 2024
1 parent dc4efa9 commit 8e8f201
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/interface/meshblock_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ class MeshBlockData {
MeshBlock *GetParentPointer() const { return GetBlockPointer(); }
void SetAllowedDt(const Real dt) const { GetBlockPointer()->SetAllowedDt(dt); }
Mesh *GetMeshPointer() const { return GetBlockPointer()->pmy_mesh; }

// This mirrors a MeshBlockData routine
int NumBlocks() const { return 1;}
int NumBlocks() const { return 1; }

template <class... Ts>
IndexRange GetBoundsI(Ts &&...args) const {
Expand Down
11 changes: 6 additions & 5 deletions src/interface/metadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,13 @@ bool Metadata::IsValid(bool throw_on_fail) const {
PARTHENON_THROW("Either the Independent or Derived flag must be set");
}
}

if (IsSet(FillGhost) && IsSet(CellMemAligned) && (!IsSet(Cell))) {
valid = false;
if (throw_on_fail) {
PARTHENON_THROW("Cannot communicate ghosts of non-cell fields that have cell aligned memory.");
}
PARTHENON_THROW(
"Cannot communicate ghosts of non-cell fields that have cell aligned memory.");
}
}

// Prolongation/restriction
Expand Down Expand Up @@ -325,10 +326,10 @@ Metadata::GetArrayDims(std::weak_ptr<MeshBlock> wpmb, bool coarse) const {
} else if (IsSet(Node)) {
arrDims[MAX_VARIABLE_DIMENSION - 1] = 1; // Only one lower left node per cell
}
if (!IsSet(CellMemAligned) && !IsSet(Cell)) {
if (!IsSet(CellMemAligned) && !IsSet(Cell)) {
arrDims[0]++;
if (arrDims[1] > 1) arrDims[1]++;
if (arrDims[2] > 1) arrDims[2]++;
if (arrDims[2] > 1) arrDims[2]++;
}
} else if (IsSet(Particle)) {
assert(N >= 0 && N <= MAX_VARIABLE_DIMENSION - 1);
Expand Down
1 change: 0 additions & 1 deletion src/interface/metadata.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,6 @@ Set_t GetByFlag(const Metadata::FlagCollection &flags, NameMap_t &nameMap,
return out;
}
} // namespace MetadataUtils

} // namespace parthenon

#endif // INTERFACE_METADATA_HPP_
3 changes: 2 additions & 1 deletion src/interface/sparse_pack_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ SparsePackBase::GetAllocStatus(T *pmd, const PackDescriptor &desc,
const auto &uid_map = pmbd->GetUidMap();
for (int i = 0; i < nvar; ++i) {
for (const auto &[var_name, uid] : desc.var_groups[i]) {
astat[idx++] = uid_map.count(uid) > 0 ? (uid_map.at(uid))->GetAllocationStatus() : -1;
astat[idx++] =
uid_map.count(uid) > 0 ? (uid_map.at(uid))->GetAllocationStatus() : -1;
}
}
});
Expand Down
8 changes: 4 additions & 4 deletions src/interface/sparse_pack_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@ struct PackDescriptor {
const std::size_t nvar_tot;

private:
static int GetNVarsTotal(const std::vector<VariableGroup_t> &var_groups) {
int nvar_tot = 0;
for (const auto &group : var_groups) {
for (const auto &[a, b] : group) {
static int GetNVarsTotal(const std::vector<VariableGroup_t> &var_groups) {
int nvar_tot = 0;
for (const auto &group : var_groups) {
for (const auto &[a, b] : group) {
nvar_tot++;
}
}
Expand Down

0 comments on commit 8e8f201

Please sign in to comment.