Skip to content

Commit

Permalink
Merge pull request #83 from SCOREC/cws/describeDim
Browse files Browse the repository at this point in the history
describe: dimension loops from [0:mesh.dim()] (inclusive)
  • Loading branch information
cwsmith authored Feb 6, 2024
2 parents c5f1dc9 + 3912958 commit 08e643b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/describe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ int main(int argc, char** argv)
const int rank = comm->rank();

std::array<Omega_h::GO, 4> counts;
for(int dim=0; dim < mesh.dim(); dim++)
for(int dim=0; dim <= mesh.dim(); dim++)
counts[dim] = mesh.nglobal_ents(dim);

std::array<double, 4> imb;
for(int dim=0; dim < mesh.dim(); dim++)
for(int dim=0; dim <= mesh.dim(); dim++)
imb[dim] = mesh.imbalance(dim);

std::ostringstream oss;
Expand All @@ -86,14 +86,14 @@ int main(int argc, char** argv)
oss << std::fixed;

if(!rank) {
oss << "\nMesh Entity Type: " << Omega_h::topological_singular_name(mesh.family(), mesh.dim()-1) << "\n";
oss << "\nMesh Entity Type: " << Omega_h::topological_singular_name(mesh.family(), mesh.dim()) << "\n";

oss << "\nGlobal Mesh Entity Count and Imbalance (max/avg): (Dim, Entity Count, Imbalance)\n";
for(int dim=0; dim < mesh.dim(); dim++)
for(int dim=0; dim <= mesh.dim(); dim++)
oss << "(" << dim << ", " << counts[dim] << ", " << imb[dim] << ")\n";

oss << "\nTag Properties by Dimension: (Name, Dim, Type, Number of Components, Min. Value, Max. Value)\n";
for (int dim=0; dim < mesh.dim(); dim++)
for (int dim=0; dim <= mesh.dim(); dim++)
for (int tag=0; tag < mesh.ntags(dim); tag++) {
auto tagbase = mesh.get_tag(dim, tag);
if (tagbase->type() == OMEGA_H_I8)
Expand All @@ -117,7 +117,7 @@ int main(int argc, char** argv)
oss.str(""); // clear the stream

std::array<Omega_h::LO, 4> counts = {0,0,0,0};
for(int dim=0; dim < mesh.dim(); dim++)
for(int dim=0; dim <= mesh.dim(); dim++)
counts[dim] = mesh.nents(dim);
oss << "(" << rank << ": " << counts[0] << ", "
<< counts[1] << ", "
Expand All @@ -128,7 +128,7 @@ int main(int argc, char** argv)
comm->barrier();
if (!rank) std::cout << "\nPer Rank Mesh Entity Owned: (Rank: Entity Owned by Dim <0,1,2,3>)\n";
oss.str(""); // clear the stream
for (int dim=0; dim < mesh.dim(); dim++)
for (int dim=0; dim <= mesh.dim(); dim++)
counts[dim] = mesh.nents_owned(dim);
oss << "(" << rank << ": " << counts[0] << ", "
<< counts[1] << ", "
Expand Down

0 comments on commit 08e643b

Please sign in to comment.