Skip to content

Commit 0eae7aa

Browse files
Committing clang-format changes
1 parent 22ecd6e commit 0eae7aa

File tree

3 files changed

+71
-64
lines changed

3 files changed

+71
-64
lines changed

packages/seacas/applications/exodiff/ED_SystemInterface.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ void SystemInterface::enroll_options()
391391
"If the -partial switch used, print the elements that did not match.", nullptr);
392392
options_.enroll("allow_permuted_connectivity", GetLongOption::NoValue,
393393
"The element connectivities are the same if they match\n"
394-
"\t\texactly *OR* are a permutation of each other.",
394+
"\t\texactly *OR* are a permutation of each other.",
395395
nullptr);
396396
options_.enroll("ignore_dups", GetLongOption::NoValue,
397397
"If two elements/nodes are in the same location in map or partial\n"

packages/seacas/applications/exodiff/ED_SystemInterface.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ class SystemInterface
125125
bool doL1Norm{false};
126126
bool doL2Norm{false};
127127
bool pedantic{false}; // Be most picky on what is different (not fully picky yet)
128-
bool allowPermutation{false}; // Allow element connectivity to be permuted -- same nodes; different order.
128+
bool allowPermutation{
129+
false}; // Allow element connectivity to be permuted -- same nodes; different order.
129130

130131
bool interpolating{false}; // Interpolate times on file2 to match times on file1;
131132
bool by_name{false}; // Match entities by name instead of by id.

packages/seacas/applications/exodiff/check.C

Lines changed: 68 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -326,50 +326,54 @@ namespace {
326326

327327
if (interFace.map_flag != MapType::FILE_ORDER && !node_map.empty()) {
328328
for (size_t e = 0; is_same && e < num_element; ++e) {
329-
for (size_t n = 0; is_same && n < nnpe; ++n) {
330-
if (node_map[conn1[e*nnpe+n] - 1] + 1 != conn2[e*nnpe+n]) {
331-
bool permuted = false;
332-
if (interFace.allowPermutation) {
333-
// Mismatch in ordered connectivity for this element... See if a permutation matches...
334-
std::vector<INT> e1_conn(nnpe);
335-
for (size_t i = 0; i < nnpe; i++) {
336-
e1_conn[i] = node_map[conn1[e*nnpe+i] - 1] + 1;
337-
}
338-
permuted = std::is_permutation(e1_conn.begin(), e1_conn.end(), &conn2[e], &conn2[e+nnpe]);
339-
}
340-
if (!permuted) {
341-
std::string permit_permute = interFace.allowPermutation ? " (or permuted)" : "";
342-
Warning(
343-
fmt::format(".. Connectivities in block id {} are not the same{}.\n"
344-
" First difference is node {} of local element {}\n",
345-
block1->Id(), permit_permute, n + 1, e + 1));
346-
is_same = false;
347-
break;
348-
}
349-
}
350-
}
329+
for (size_t n = 0; is_same && n < nnpe; ++n) {
330+
if (node_map[conn1[e * nnpe + n] - 1] + 1 != conn2[e * nnpe + n]) {
331+
bool permuted = false;
332+
if (interFace.allowPermutation) {
333+
// Mismatch in ordered connectivity for this element... See if a permutation
334+
// matches...
335+
std::vector<INT> e1_conn(nnpe);
336+
for (size_t i = 0; i < nnpe; i++) {
337+
e1_conn[i] = node_map[conn1[e * nnpe + i] - 1] + 1;
338+
}
339+
permuted = std::is_permutation(e1_conn.begin(), e1_conn.end(), &conn2[e],
340+
&conn2[e + nnpe]);
341+
}
342+
if (!permuted) {
343+
std::string permit_permute = interFace.allowPermutation ? " (or permuted)" : "";
344+
Warning(fmt::format(
345+
".. Connectivities in block id {} are not the same{}.\n"
346+
" First difference is node {} of local element {}\n",
347+
block1->Id(), permit_permute, n + 1, e + 1));
348+
is_same = false;
349+
break;
350+
}
351+
}
352+
}
351353
}
352354
}
353355
else {
354356
for (size_t e = 0; is_same && e < num_element; ++e) {
355-
for (size_t n = 0; is_same && n < nnpe; ++n) {
356-
if (conn1[e*nnpe+n] != conn2[e*nnpe+n]) {
357-
bool permuted = false;
358-
if (interFace.allowPermutation) {
359-
// Mismatch in ordered connectivity for this element... See if a permutation matches...
360-
permuted = std::is_permutation(&conn1[e*nnpe], &conn1[e*nnpe+nnpe], &conn2[e*nnpe], &conn2[e*nnpe+nnpe]);
361-
}
362-
if (!permuted) {
363-
std::string permit_permute = interFace.allowPermutation ? " (or permuted)" : "";
364-
Warning(
365-
fmt::format(".. Connectivities in block id {} are not the same{}.\n"
366-
" First difference is node {} of local element {}\n",
367-
block1->Id(), permit_permute, n + 1, e + 1));
368-
is_same = false;
369-
break;
370-
}
371-
}
372-
}
357+
for (size_t n = 0; is_same && n < nnpe; ++n) {
358+
if (conn1[e * nnpe + n] != conn2[e * nnpe + n]) {
359+
bool permuted = false;
360+
if (interFace.allowPermutation) {
361+
// Mismatch in ordered connectivity for this element... See if a permutation
362+
// matches...
363+
permuted = std::is_permutation(&conn1[e * nnpe], &conn1[e * nnpe + nnpe],
364+
&conn2[e * nnpe], &conn2[e * nnpe + nnpe]);
365+
}
366+
if (!permuted) {
367+
std::string permit_permute = interFace.allowPermutation ? " (or permuted)" : "";
368+
Warning(fmt::format(
369+
".. Connectivities in block id {} are not the same{}.\n"
370+
" First difference is node {} of local element {}\n",
371+
block1->Id(), permit_permute, n + 1, e + 1));
372+
is_same = false;
373+
break;
374+
}
375+
}
376+
}
373377
}
374378
}
375379
}
@@ -388,28 +392,30 @@ namespace {
388392
auto n1 = conn1[off1];
389393
auto map_n1 = node_map.empty() ? n1 : node_map[n1 - 1] + 1;
390394
if (map_n1 != conn2[off2]) {
391-
bool permuted = false;
392-
if (interFace.allowPermutation) {
393-
// Mismatch in ordered connectivity for this element... See if a permutation matches...
394-
std::vector<INT> e1_conn(nnpe);
395-
for (size_t i = 0; i < nnpe; i++) {
396-
n1 = conn1[off1];
397-
map_n1 = node_map.empty() ? n1 : node_map[n1 - 1] + 1;
398-
e1_conn[i] = map_n1;
399-
}
400-
permuted = std::is_permutation(e1_conn.begin(), e1_conn.end(), &conn2[e2 * nnpe], &conn2[e2 * nnpe + nnpe]);
401-
}
402-
if (!permuted) {
403-
std::string permit_permute = interFace.allowPermutation ? " (or permuted)" : "";
404-
Warning(
405-
fmt::format(".. Connectivities in block id {} are not the same{}.\n"
406-
" First difference is node {} of local element {} "
407-
"(file1) {} (file2)\n",
408-
block1->Id(), n + 1, e1 + 1, e2 + 1));
409-
is_same = false;
410-
break;
411-
}
412-
}
395+
bool permuted = false;
396+
if (interFace.allowPermutation) {
397+
// Mismatch in ordered connectivity for this element... See if a permutation
398+
// matches...
399+
std::vector<INT> e1_conn(nnpe);
400+
for (size_t i = 0; i < nnpe; i++) {
401+
n1 = conn1[off1];
402+
map_n1 = node_map.empty() ? n1 : node_map[n1 - 1] + 1;
403+
e1_conn[i] = map_n1;
404+
}
405+
permuted = std::is_permutation(e1_conn.begin(), e1_conn.end(), &conn2[e2 * nnpe],
406+
&conn2[e2 * nnpe + nnpe]);
407+
}
408+
if (!permuted) {
409+
std::string permit_permute = interFace.allowPermutation ? " (or permuted)" : "";
410+
Warning(fmt::format(
411+
".. Connectivities in block id {} are not the same{}.\n"
412+
" First difference is node {} of local element {} "
413+
"(file1) {} (file2)\n",
414+
block1->Id(), n + 1, e1 + 1, e2 + 1));
415+
is_same = false;
416+
break;
417+
}
418+
}
413419
}
414420
}
415421
}

0 commit comments

Comments
 (0)