Skip to content

Commit

Permalink
Merge branch 'sandialabs:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
mvlopri authored Aug 8, 2024
2 parents 651e4ff + 5353f2b commit b30572c
Showing 1 changed file with 25 additions and 11 deletions.
36 changes: 25 additions & 11 deletions packages/seacas/libraries/ioss/src/Ioss_StructuredBlock.C
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "Ioss_Hex8.h"
#include "Ioss_Property.h" // for Property
#include "Ioss_SmartAssert.h"
#include "Ioss_Sort.h"
#include "Ioss_StructuredBlock.h"
#include <cmath>
#include <cstddef> // for size_t
Expand Down Expand Up @@ -533,25 +534,38 @@ namespace Ioss {
same = false;
}

// NOTE: this comparison assumes that the elements of this vector will
// appear in the same order in two databases that are equivalent.
if (quiet && this->m_zoneConnectivity != rhs.m_zoneConnectivity) {
return false;
}
if (!vec_equal(this->m_zoneConnectivity, rhs.m_zoneConnectivity)) {
fmt::print(Ioss::OUTPUT(), "StructuredBlock: Zone Connectivity mismatch (size {} vs {})\n",
this->m_zoneConnectivity.size(), rhs.m_zoneConnectivity.size());
same = false;
{
auto lhzc = this->m_zoneConnectivity;
auto rhzc = rhs.m_zoneConnectivity;
Ioss::sort(lhzc.begin(), lhzc.end(), [](const ZoneConnectivity &l, const ZoneConnectivity &r) {
return l.m_connectionName < r.m_connectionName;});
Ioss::sort(rhzc.begin(), rhzc.end(), [](const ZoneConnectivity &l, const ZoneConnectivity &r) {
return l.m_connectionName < r.m_connectionName;});
if (!vec_equal(lhzc, rhzc)) {
fmt::print(Ioss::OUTPUT(), "StructuredBlock: Zone Connectivity mismatch (size {} vs {})\n",
this->m_zoneConnectivity.size(), rhs.m_zoneConnectivity.size());
same = false;
}
}

// NOTE: this comparison assumes that the elements of this vector will
// appear in the same order in two databases that are equivalent.
if (quiet && this->m_boundaryConditions != rhs.m_boundaryConditions) {
return false;
}
if (!vec_equal(this->m_boundaryConditions, rhs.m_boundaryConditions)) {
fmt::print(Ioss::OUTPUT(), "StructuredBlock: Boundary Conditions mismatch\n");
same = false;

{
auto lhbc = this->m_boundaryConditions;
auto rhbc = rhs.m_boundaryConditions;
Ioss::sort(lhbc.begin(), lhbc.end(), [](const BoundaryCondition &l, const BoundaryCondition &r) {
return l.m_bcName < r.m_bcName;});
Ioss::sort(rhbc.begin(), rhbc.end(), [](const BoundaryCondition &l, const BoundaryCondition &r) {
return l.m_bcName < r.m_bcName;});
if (!vec_equal(lhbc, rhbc)) {
fmt::print(Ioss::OUTPUT(), "StructuredBlock: Boundary Conditions mismatch\n");
same = false;
}
}

if (!quiet) {
Expand Down

0 comments on commit b30572c

Please sign in to comment.