Skip to content

Commit

Permalink
EXODIFF: Better name consistency checking
Browse files Browse the repository at this point in the history
  • Loading branch information
gsjaardema committed Nov 20, 2023
1 parent 72ce97a commit a9d6071
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 9 deletions.
4 changes: 2 additions & 2 deletions packages/seacas/applications/exodiff/ED_Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
// See packages/seacas/LICENSE for details
#pragma once

static std::string version("3.27");
static std::string verdate("2023-11-08");
static std::string version("3.28");
static std::string verdate("2023-11-14");
54 changes: 47 additions & 7 deletions packages/seacas/applications/exodiff/check.C
Original file line number Diff line number Diff line change
Expand Up @@ -402,9 +402,11 @@ namespace {
is_same = false;
}
if (!interFace.by_name && assembly1->Name() != assembly2->Name()) {
Warning(fmt::format(".. Assembly {} names don't agree ('{}' != '{}').\n", assembly1->Id(),
assembly1->Name(), assembly2->Name()));
is_same = false;
if (!assembly1->generatedName_ && !assembly2->generatedName_) {
Warning(fmt::format(".. Assembly {} names don't agree ('{}' != '{}').\n", assembly1->Id(),
assembly1->Name(), assembly2->Name()));
is_same = false;
}
}
if (assembly1->Type() != assembly2->Type()) {
Warning(fmt::format(".. Assembly '{}': entity types don't agree ({} != {}).\n",
Expand Down Expand Up @@ -441,12 +443,18 @@ namespace {
if (interFace.by_name && block1->Id() != block2->Id()) {
Warning(fmt::format(".. Block '{}' ids don't agree ({} != {}).\n", block1->Name(),
block1->Id(), block2->Id()));
is_same = false;
if (interFace.pedantic) {
is_same = false;
}
}
if (!interFace.by_name && block1->Name() != block2->Name()) {
Warning(fmt::format(".. Block {} names don't agree ({} != {}).\n", block1->Id(),
block1->Name(), block2->Name()));
is_same = false;
if (!block1->generatedName_ && !block2->generatedName_) {
Warning(fmt::format(".. Block {} names don't agree ({} != {}).\n", block1->Id(),
block1->Name(), block2->Name()));
if (interFace.pedantic) {
is_same = false;
}
}
}
if (!(no_case_equals(block1->Element_Type(), block2->Element_Type()))) {
if (!interFace.short_block_check ||
Expand Down Expand Up @@ -521,6 +529,22 @@ namespace {
is_same = false;
}
}
if (interFace.by_name && set1->Id() != set2->Id()) {
Warning(fmt::format(".. Nodeset '{}' ids don't agree ({} != {}).\n", set1->Name(),
set1->Id(), set2->Id()));
if (interFace.pedantic) {
is_same = false;
}
}
if (!interFace.by_name && set1->Name() != set2->Name()) {
if (!set1->generatedName_ && !set2->generatedName_) {
Warning(fmt::format(".. Nodeset {} names don't agree ({} != {}).\n", set1->Id(),
set1->Name(), set2->Name()));
if (interFace.pedantic) {
is_same = false;
}
}
}
}
}

Expand Down Expand Up @@ -631,6 +655,22 @@ namespace {
is_same = false;
}
}
if (interFace.by_name && set1->Id() != set2->Id()) {
Warning(fmt::format(".. Sideset '{}' ids don't agree ({} != {}).\n", set1->Name(),
set1->Id(), set2->Id()));
if (interFace.pedantic) {
is_same = false;
}
}
if (!interFace.by_name && set1->Name() != set2->Name()) {
if (!set1->generatedName_ && !set2->generatedName_) {
Warning(fmt::format(".. Sideset {} names don't agree ({} != {}).\n", set1->Id(),
set1->Name(), set2->Name()));
if (interFace.pedantic) {
is_same = false;
}
}
}
}
}

Expand Down
2 changes: 2 additions & 0 deletions packages/seacas/applications/exodiff/exo_entity.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ class Exo_Entity
// Return "block", "nodelist", "surface", depending on underlying type.
virtual const char *short_label() const = 0;

bool generatedName_{true};

protected:
std::string name_{};
int fileId{-1};
Expand Down

0 comments on commit a9d6071

Please sign in to comment.