Debian Codegraph @

packages/seacas/libraries/ioss/src/Ioss_Compare.C

raw
1 // Copyright(C) 1999-2024 National Technology & Engineering Solutions
2 // of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
3 // NTESS, the U.S. Government retains certain rights in this software.
4 //
5 // See packages/seacas/LICENSE for details
6
7 #include <assert.h>
8 #include <cmath>
9 #include <fmt/ostream.h>
10 #include <fmt/ranges.h>
11 #include <iosfwd>
12 #include <stdint.h>
13 #include <stdlib.h>
14 #include <string>
15 #include <vector>
16
17 #include "Ioss_Assembly.h"
18 #include "Ioss_CommSet.h"
19 #include "Ioss_Compare.h"
20 #include "Ioss_CoordinateFrame.h"
21 #include "Ioss_DataPool.h"
22 #include "Ioss_EdgeBlock.h"
23 #include "Ioss_EdgeSet.h"
24 #include "Ioss_ElementBlock.h"
25 #include "Ioss_ElementSet.h"
26 #include "Ioss_EntityType.h"
27 #include "Ioss_FaceBlock.h"
28 #include "Ioss_FaceSet.h"
29 #include "Ioss_Field.h"
30 #include "Ioss_GroupingEntity.h"
31 #include "Ioss_IOFactory.h"
32 #include "Ioss_MeshCopyOptions.h"
33 #include "Ioss_MeshType.h"
34 #include "Ioss_NodeBlock.h"
35 #include "Ioss_NodeSet.h"
36 #include "Ioss_Property.h"
37 #include "Ioss_Region.h"
38 #include "Ioss_SideBlock.h"
39 #include "Ioss_SideSet.h"
40 #include "Ioss_StructuredBlock.h"
41 #include "Ioss_Utils.h"
42 #include "tokenize.h"
43
44 /* These messages indicate a structural difference between the files
45 * being compared. Use Ioss::WarnOut().
46 */
47 #define COUNT_MISMATCH "{} count mismatch ({} vs. {})"
48 #define NOTFOUND_1 "{} '{}' not found in input #1"
49 #define NOTFOUND_2 "{} '{}' not found in input #2"
50
51 /* These messages indicate a value difference between the files
52 * being compared. Use Ioss::OUTPUT().
53 */
54 #define VALUE_MISMATCH "{} value mismatch ({} vs. {})"
55
56 /* These messages indicate a value difference between the files
57 * being compared. Use Ioss::OUTPUT().
58 */
59 #define ATTRIBUTE_FIELD_VALUE_MISMATCH "\n\nATTRIBUTE FIELD data mismatch ({})"
60 #define COMMUNICATION_FIELD_VALUE_MISMATCH "\n\nCOMMUNICATION FIELD data mismatch ({})"
61 #define MESH_FIELD_VALUE_MISMATCH "\n\nMESH FIELD data mismatch ({})"
62 #define TRANSIENT_FIELD_VALUE_MISMATCH "\n\nTRANSIENT FIELD data mismatch ({})"
63 #define TRANSIENT_FIELD_STEP_VALUE_MISMATCH "\n\nTRANSIENT FIELD data mismatch ({} at step {}):"
64
65 // For compare_database...
66 namespace {
67 double rel_tolerance = 0.0;
68 double abs_tolerance = 0.0;
69 double tol_floor = 0.0;
70
71 bool compare_properties(const Ioss::GroupingEntity *ige_1, const Ioss::GroupingEntity *ige_2,
72 std::ostringstream &buf);
73 bool compare_qa_info(const Ioss::Region &input_region_1, const Ioss::Region &input_region_2,
74 std::ostringstream &buf);
75 bool compare_change_sets(const Ioss::Region &input_region_1, const Ioss::Region &input_region_2,
76 std::ostringstream &buf);
77 bool compare_nodeblock(const Ioss::Region &input_region_1, const Ioss::Region &input_region_2);
78 bool compare_assemblies(const Ioss::Region &input_region_1, const Ioss::Region &input_region_2);
79 bool compare_elementblocks(const Ioss::Region &input_region_1,
80 const Ioss::Region &input_region_2);
81 bool compare_edgeblocks(const Ioss::Region &input_region_1, const Ioss::Region &input_region_2);
82 bool compare_faceblocks(const Ioss::Region &input_region_1, const Ioss::Region &input_region_2);
83 bool compare_structuredblocks(const Ioss::Region &input_region_1,
84 const Ioss::Region &input_region_2);
85 bool compare_nodesets(const Ioss::Region &input_region_1, const Ioss::Region &input_region_2);
86 bool compare_edgesets(const Ioss::Region &input_region_1, const Ioss::Region &input_region_2);
87 bool compare_facesets(const Ioss::Region &input_region_1, const Ioss::Region &input_region_2);
88 bool compare_elemsets(const Ioss::Region &input_region_1, const Ioss::Region &input_region_2);
89 bool compare_sidesets(const Ioss::Region &input_region_1, const Ioss::Region &input_region_2);
90 bool compare_commsets(const Ioss::Region &input_region_1, const Ioss::Region &input_region_2);
91 bool compare_coordinate_frames(const Ioss::Region &input_region_1,
92 const Ioss::Region &input_region_2);
93 template <typename T>
94 bool compare_fields(const std::vector<T *> &in_entities_1, const std::vector<T *> &in_entities_2,
95 Ioss::Field::RoleType role, std::ostringstream &buf);
96
97 bool compare_fields(const std::vector<Ioss::StructuredBlock *> &in_entities_1,
98 const std::vector<Ioss::StructuredBlock *> &in_entities_2,
99 Ioss::Field::RoleType role, std::ostringstream &buf);
100
101 bool compare_fields(const Ioss::GroupingEntity *ige_1, const Ioss::GroupingEntity *ige_2,
102 Ioss::Field::RoleType role, std::ostringstream &buf);
103 template <typename T1, typename T2>
104 bool compare_field_data(const std::vector<T1 *> &in_entities_1,
105 const std::vector<T2 *> &in_entities_2, Ioss::DataPool &pool,
106 Ioss::Field::RoleType role, const Ioss::MeshCopyOptions &options,
107 std::ostringstream &buf);
108 bool compare_field_data(const std::vector<Ioss::StructuredBlock *> &in_entities_1,
109 const std::vector<Ioss::StructuredBlock *> &in_entities_2,
110 Ioss::DataPool &pool, Ioss::Field::RoleType role,
111 const Ioss::MeshCopyOptions &options, std::ostringstream &buf);
112 bool compare_field_data(const Ioss::GroupingEntity *ige_1, const Ioss::GroupingEntity *ige_2,
113 Ioss::DataPool &pool, Ioss::Field::RoleType role,
114 const Ioss::MeshCopyOptions &options, std::ostringstream &buf,
115 const std::string &prefix = "");
116 bool compare_field_data_internal(const Ioss::GroupingEntity *ige_1,
117 const Ioss::GroupingEntity *ige_2, Ioss::DataPool &in_pool,
118 const std::string &field_name,
119 const Ioss::MeshCopyOptions &options, std::ostringstream &buf);
120
121 bool open_change_set(const std::string &cs_name, Ioss::Region &region)
122 {
123 bool success = true;
124 if (!cs_name.empty()) {
125 success = region.load_internal_change_set_mesh(cs_name);
126 if (!success) {
127 fmt::print(stderr, "ERROR: Unable to open change_set '{}' in file '{}'\n", cs_name,
128 region.get_database()->get_filename());
129 }
130 }
131 return success;
132 }
133
134 bool compare_database_internal(Ioss::Region &input_region_1, Ioss::Region &input_region_2,
135 const Ioss::MeshCopyOptions &options);
136 } // namespace
137
138 bool Ioss::Compare::compare_database(Ioss::Region &input_region_1, Ioss::Region &input_region_2,
139 const Ioss::MeshCopyOptions &options)
140 {
141 bool overall_result = true;
142
143 rel_tolerance = options.rel_tolerance;
144 abs_tolerance = options.abs_tolerance;
145 tol_floor = options.tol_floor;
146
147 // COMPARE change_sets in the databases...
148 if (options.selected_change_sets.empty()) {
149 std::ostringstream buf;
150 fmt::print(buf, "CHANGE SET mismatch.");
151 if (!compare_change_sets(input_region_1, input_region_2, buf)) {
152 overall_result = false;
153 fmt::print(Ioss::WarnOut(),
154 "{} Only the change sets that are found in both databases will be compared.\n",
155 buf.str());
156 }
157 }
158
159 if (!options.ignore_qa_info) {
160 std::ostringstream buf;
161 fmt::print(buf, "\nQA INFO mismatch\n");
162 if (!compare_qa_info(input_region_1, input_region_2, buf)) {
163 overall_result = false;
164 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
165 }
166 }
167
168 Ioss::NameList cs1_names;
169 Ioss::NameList cs2_names;
170
171 if (!options.selected_change_sets.empty() && options.selected_change_sets != "ALL") {
172 cs1_names = Ioss::tokenize(options.selected_change_sets, ",");
173 bool success = true;
174 for (const auto &cs_name : cs1_names) {
175 success &= Ioss::Utils::check_valid_change_set_name(cs_name, input_region_1);
176 }
177 if (!success) {
178 return false;
179 }
180 cs2_names = cs1_names;
181 }
182 else {
183 cs1_names = input_region_1.get_database()->internal_change_set_describe();
184 cs2_names = input_region_2.get_database()->internal_change_set_describe();
185 }
186
187 for (const auto &cs1_name : cs1_names) {
188 auto it = std::find(cs2_names.cbegin(), cs2_names.cend(), cs1_name);
189 if (it == cs2_names.cend()) {
190 fmt::print(Ioss::WarnOut(), "Skipping change set {}, not found in input #2.\n", cs1_name);
191 continue;
192 }
193
194 bool success1 = open_change_set(cs1_name, input_region_1);
195 bool success2 = open_change_set(cs1_name, input_region_2);
196 if (!success1 || !success2) {
197 continue;
198 }
199 overall_result &= compare_database_internal(input_region_1, input_region_2, options);
200 }
201 return overall_result;
202 }
203
204 namespace {
205 bool compare_database_internal(Ioss::Region &input_region_1, Ioss::Region &input_region_2,
206 const Ioss::MeshCopyOptions &options)
207 {
208 bool rc;
209 bool overall_result = true;
210 Ioss::DataPool data_pool;
211
212 // COMPARE all properties of input database...
213 {
214 std::ostringstream buf;
215 fmt::print(buf, "PROPERTIES mismatch ({})\n", input_region_1.name());
216 if (!compare_properties(&input_region_1, &input_region_2, buf)) {
217 overall_result = false;
218 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
219 }
220 }
221
222 {
223 std::ostringstream buf;
224 fmt::print(buf, "\nNODEBLOCK mismatch\n");
225 if (!compare_nodeblock(input_region_1, input_region_2)) {
226 overall_result = false;
227 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
228 }
229 }
230
231 {
232 std::ostringstream buf;
233 fmt::print(buf, "\nEDGEBLOCK mismatch\n");
234 if (!compare_edgeblocks(input_region_1, input_region_2)) {
235 overall_result = false;
236 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
237 }
238 }
239 {
240 std::ostringstream buf;
241 fmt::print(buf, "\nFACEBLOCK mismatch\n");
242 if (!compare_faceblocks(input_region_1, input_region_2)) {
243 overall_result = false;
244 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
245 }
246 }
247 {
248 std::ostringstream buf;
249 fmt::print(buf, "\nELEMENTBLOCK mismatch\n");
250 if (!compare_elementblocks(input_region_1, input_region_2)) {
251 overall_result = false;
252 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
253 }
254 }
255
256 {
257 std::ostringstream buf;
258 fmt::print(buf, "\nSTRUCTUREDBLOCK mismatch\n");
259 if (!compare_structuredblocks(input_region_1, input_region_2)) {
260 overall_result = false;
261 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
262 }
263 }
264
265 {
266 std::ostringstream buf;
267 fmt::print(buf, "\nNODESET mismatch\n");
268 if (!compare_nodesets(input_region_1, input_region_2)) {
269 overall_result = false;
270 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
271 }
272 }
273
274 {
275 std::ostringstream buf;
276 fmt::print(buf, "\nEDGESET mismatch\n");
277 if (!compare_edgesets(input_region_1, input_region_2)) {
278 overall_result = false;
279 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
280 }
281 }
282
283 {
284 std::ostringstream buf;
285 fmt::print(buf, "\nFACESET mismatch\n");
286 if (!compare_facesets(input_region_1, input_region_2)) {
287 overall_result = false;
288 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
289 }
290 }
291
292 {
293 std::ostringstream buf;
294 fmt::print(buf, "\nELEMSET mismatch\n");
295 if (!compare_elemsets(input_region_1, input_region_2)) {
296 overall_result = false;
297 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
298 }
299 }
300
301 {
302 std::ostringstream buf;
303 fmt::print(buf, "\nSIDESET mismatch\n");
304 if (!compare_sidesets(input_region_1, input_region_2)) {
305 overall_result = false;
306 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
307 }
308 }
309
310 {
311 std::ostringstream buf;
312 fmt::print(buf, "\nCOMMSET mismatch\n");
313 if (!compare_commsets(input_region_1, input_region_2)) {
314 overall_result = false;
315 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
316 }
317 }
318
319 {
320 std::ostringstream buf;
321 fmt::print(buf, "\nCOORDINATE FRAME mismatch\n");
322 if (!compare_coordinate_frames(input_region_1, input_region_2)) {
323 overall_result = false;
324 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
325 }
326 }
327
328 {
329 std::ostringstream buf;
330 fmt::print(buf, "\nASSEMBLY mismatch\n");
331 if (!compare_assemblies(input_region_1, input_region_2)) {
332 overall_result = false;
333 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
334 }
335 }
336
337 bool node_major = input_region_2.node_major();
338
339 if (!node_major) {
340 {
341 std::ostringstream buf;
342 fmt::print(buf, MESH_FIELD_VALUE_MISMATCH " (node_major = {})", "element blocks",
343 node_major);
344 rc = compare_field_data(input_region_1.get_element_blocks(),
345 input_region_2.get_element_blocks(), data_pool, Ioss::Field::MESH,
346 options, buf);
347 if (!rc) {
348 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
349 overall_result = false;
350 }
351 }
352
353 {
354 std::ostringstream buf;
355 fmt::print(buf, ATTRIBUTE_FIELD_VALUE_MISMATCH " (node_major = {})", "element blocks",
356 node_major);
357
358 rc = compare_field_data(input_region_1.get_element_blocks(),
359 input_region_2.get_element_blocks(), data_pool,
360 Ioss::Field::ATTRIBUTE, options, buf);
361 if (!rc) {
362 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
363 overall_result = false;
364 }
365 }
366 }
367
368 if (input_region_1.mesh_type() != Ioss::MeshType::STRUCTURED) {
369 assert(input_region_2.mesh_type() != Ioss::MeshType::STRUCTURED);
370 {
371 std::ostringstream buf;
372 fmt::print(buf, MESH_FIELD_VALUE_MISMATCH, "node blocks");
373
374 rc = compare_field_data(input_region_1.get_node_blocks(), input_region_2.get_node_blocks(),
375 data_pool, Ioss::Field::MESH, options, buf);
376 if (!rc) {
377 overall_result = false;
378 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
379 }
380 }
381 {
382 std::ostringstream buf;
383 fmt::print(buf, ATTRIBUTE_FIELD_VALUE_MISMATCH, "node blocks");
384 rc = compare_field_data(input_region_1.get_node_blocks(), input_region_2.get_node_blocks(),
385 data_pool, Ioss::Field::ATTRIBUTE, options, buf);
386 if (!rc) {
387 overall_result = false;
388 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
389 }
390 }
391 }
392 if (node_major) {
393 {
394 std::ostringstream buf;
395 fmt::print(buf, MESH_FIELD_VALUE_MISMATCH " (node_major = {})", "element blocks",
396 node_major);
397 rc = compare_field_data(input_region_1.get_element_blocks(),
398 input_region_2.get_element_blocks(), data_pool, Ioss::Field::MESH,
399 options, buf);
400 if (!rc) {
401 overall_result = false;
402 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
403 }
404 }
405 {
406 std::ostringstream buf;
407 fmt::print(buf, ATTRIBUTE_FIELD_VALUE_MISMATCH " (node_major = {})", "element blocks",
408 node_major);
409 rc = compare_field_data(input_region_1.get_element_blocks(),
410 input_region_2.get_element_blocks(), data_pool,
411 Ioss::Field::ATTRIBUTE, options, buf);
412 if (!rc) {
413 overall_result = false;
414 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
415 }
416 }
417 }
418
419 {
420 std::ostringstream buf;
421 fmt::print(buf, MESH_FIELD_VALUE_MISMATCH, "structured blocks");
422 rc = compare_field_data(input_region_1.get_structured_blocks(),
423 input_region_2.get_structured_blocks(), data_pool, Ioss::Field::MESH,
424 options, buf);
425 if (!rc) {
426 overall_result = false;
427 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
428 }
429 }
430
431 {
432 std::ostringstream buf;
433 fmt::print(buf, ATTRIBUTE_FIELD_VALUE_MISMATCH, "structured blocks");
434 rc = compare_field_data(input_region_1.get_structured_blocks(),
435 input_region_2.get_structured_blocks(), data_pool,
436 Ioss::Field::ATTRIBUTE, options, buf);
437 if (!rc) {
438 overall_result = false;
439 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
440 }
441 }
442
443 {
444 std::ostringstream buf;
445 fmt::print(buf, MESH_FIELD_VALUE_MISMATCH, "edge blocks");
446 rc = compare_field_data(input_region_1.get_edge_blocks(), input_region_2.get_edge_blocks(),
447 data_pool, Ioss::Field::MESH, options, buf);
448 if (!rc) {
449 overall_result = false;
450 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
451 }
452 }
453
454 {
455 std::ostringstream buf;
456 fmt::print(buf, ATTRIBUTE_FIELD_VALUE_MISMATCH, "edge blocks");
457 rc = compare_field_data(input_region_1.get_edge_blocks(), input_region_2.get_edge_blocks(),
458 data_pool, Ioss::Field::ATTRIBUTE, options, buf);
459 if (!rc) {
460 overall_result = false;
461 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
462 }
463 }
464
465 {
466 std::ostringstream buf;
467 fmt::print(buf, MESH_FIELD_VALUE_MISMATCH, "face blocks");
468 rc = compare_field_data(input_region_1.get_face_blocks(), input_region_2.get_face_blocks(),
469 data_pool, Ioss::Field::MESH, options, buf);
470 if (!rc) {
471 overall_result = false;
472 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
473 }
474 }
475
476 {
477 std::ostringstream buf;
478 fmt::print(buf, ATTRIBUTE_FIELD_VALUE_MISMATCH, "face blocks");
479 rc = compare_field_data(input_region_1.get_face_blocks(), input_region_2.get_face_blocks(),
480 data_pool, Ioss::Field::ATTRIBUTE, options, buf);
481 if (!rc) {
482 overall_result = false;
483 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
484 }
485 }
486
487 {
488 std::ostringstream buf;
489 fmt::print(buf, MESH_FIELD_VALUE_MISMATCH, "element sets");
490 rc = compare_field_data(input_region_1.get_elementsets(), input_region_2.get_elementsets(),
491 data_pool, Ioss::Field::MESH, options, buf);
492 if (!rc) {
493 overall_result = false;
494 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
495 }
496 }
497
498 {
499 std::ostringstream buf;
500 fmt::print(buf, ATTRIBUTE_FIELD_VALUE_MISMATCH, "element sets");
501 rc = compare_field_data(input_region_1.get_elementsets(), input_region_2.get_elementsets(),
502 data_pool, Ioss::Field::ATTRIBUTE, options, buf);
503 if (!rc) {
504 overall_result = false;
505 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
506 }
507 }
508
509 {
510 std::ostringstream buf;
511 fmt::print(buf, MESH_FIELD_VALUE_MISMATCH, "comm sets");
512 rc = compare_field_data(input_region_1.get_commsets(), input_region_2.get_commsets(),
513 data_pool, Ioss::Field::MESH, options, buf);
514 if (!rc) {
515 overall_result = false;
516 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
517 }
518 }
519
520 {
521 std::ostringstream buf;
522 fmt::print(buf, ATTRIBUTE_FIELD_VALUE_MISMATCH, "comm sets");
523 rc = compare_field_data(input_region_1.get_commsets(), input_region_2.get_commsets(),
524 data_pool, Ioss::Field::ATTRIBUTE, options, buf);
525 if (!rc) {
526 overall_result = false;
527 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
528 }
529 }
530
531 {
532 std::ostringstream buf;
533 fmt::print(buf, COMMUNICATION_FIELD_VALUE_MISMATCH, "comm sets");
534 rc = compare_field_data(input_region_1.get_commsets(), input_region_2.get_commsets(),
535 data_pool, Ioss::Field::COMMUNICATION, options, buf);
536 if (!rc) {
537 overall_result = false;
538 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
539 }
540 }
541 // Side Sets
542 if (input_region_1.mesh_type() == Ioss::MeshType::UNSTRUCTURED) {
543 // This should have already been checked.
544 assert(input_region_2.mesh_type() == Ioss::MeshType::UNSTRUCTURED);
545
546 const auto &in_fss_1 = input_region_1.get_sidesets();
547 const auto &in_fss_2 = input_region_2.get_sidesets();
548
549 // This should have already been checked.
550 assert(in_fss_1.size() == in_fss_2.size());
551
552 for (const auto &ifs : in_fss_1) {
553 const std::string &name = ifs->name();
554
555 // Find matching output sideset
556 typename std::vector<Ioss::SideSet *>::const_iterator it;
557 for (it = in_fss_2.begin(); it != in_fss_2.end(); ++it) {
558 if (name == (*it)->name()) {
559 break;
560 }
561 }
562
563 if (it == in_fss_2.end()) {
564 fmt::print(Ioss::WarnOut(), NOTFOUND_2, "SIDESET", name);
565 continue;
566 }
567
568 {
569 std::ostringstream buf;
570 fmt::print(buf, MESH_FIELD_VALUE_MISMATCH, "side sets");
571 rc = compare_field_data(ifs, (*it), data_pool, Ioss::Field::MESH, options, buf);
572 if (!rc) {
573 overall_result = false;
574 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
575 }
576 }
577
578 {
579 std::ostringstream buf;
580 fmt::print(buf, ATTRIBUTE_FIELD_VALUE_MISMATCH, "side sets");
581 rc = compare_field_data(ifs, (*it), data_pool, Ioss::Field::ATTRIBUTE, options, buf);
582 if (!rc) {
583 overall_result = false;
584 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
585 }
586 }
587 const auto &in_sbs_1 = ifs->get_side_blocks();
588 const auto &in_sbs_2 = (*it)->get_side_blocks();
589
590 // This should have already been checked.
591 assert(in_sbs_1.size() == in_sbs_2.size());
592
593 for (const auto &isb : in_sbs_1) {
594 const std::string &sbname = isb->name();
595
596 // Find matching output sideblock
597 typename std::vector<Ioss::SideBlock *>::const_iterator iter;
598 for (iter = in_sbs_2.begin(); iter != in_sbs_2.end(); ++iter) {
599 if (sbname == (*iter)->name()) {
600 break;
601 }
602 }
603 if (iter == in_sbs_2.end()) {
604 fmt::print(Ioss::WarnOut(), NOTFOUND_2, "SIDEBLOCK", name);
605 continue;
606 }
607
608 {
609 std::ostringstream buf;
610 fmt::print(buf, MESH_FIELD_VALUE_MISMATCH, "side blocks");
611 rc = compare_field_data(isb, (*iter), data_pool, Ioss::Field::MESH, options, buf);
612 if (!rc) {
613 overall_result = false;
614 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
615 }
616 }
617
618 {
619 std::ostringstream buf;
620 fmt::print(buf, ATTRIBUTE_FIELD_VALUE_MISMATCH, "side blocks");
621 rc = compare_field_data(isb, (*iter), data_pool, Ioss::Field::ATTRIBUTE, options, buf);
622 if (!rc) {
623 overall_result = false;
624 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
625 }
626 }
627 }
628 }
629 }
630
631 // This should have already been checked
632 assert(input_region_1.property_exists("state_count") ==
633 input_region_2.property_exists("state_count"));
634
635 if (input_region_1.property_exists("state_count") &&
636 input_region_1.get_property("state_count").get_int() > 0) {
637
638 // For each 'TRANSIENT' field in the node blocks and element
639 // blocks, transfer to the output node and element blocks.
640 {
641 std::ostringstream buf;
642 fmt::print(buf, TRANSIENT_FIELD_VALUE_MISMATCH, "region");
643 rc = compare_fields(&input_region_1, &input_region_2, Ioss::Field::REDUCTION, buf);
644 if (!rc) {
645 overall_result = false;
646 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
647 }
648 }
649 {
650 std::ostringstream buf;
651 fmt::print(buf, TRANSIENT_FIELD_VALUE_MISMATCH, "node blocks");
652 rc = compare_fields(input_region_1.get_node_blocks(), input_region_2.get_node_blocks(),
653 Ioss::Field::TRANSIENT, buf);
654 if (!rc) {
655 overall_result = false;
656 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
657 }
658 }
659 {
660 std::ostringstream buf;
661 fmt::print(buf, TRANSIENT_FIELD_VALUE_MISMATCH, "edge blocks");
662 rc = compare_fields(input_region_1.get_edge_blocks(), input_region_2.get_edge_blocks(),
663 Ioss::Field::TRANSIENT, buf);
664 if (!rc) {
665 overall_result = false;
666 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
667 }
668 }
669
670 {
671 std::ostringstream buf;
672 fmt::print(buf, TRANSIENT_FIELD_VALUE_MISMATCH, "face blocks");
673 rc = compare_fields(input_region_1.get_face_blocks(), input_region_2.get_face_blocks(),
674 Ioss::Field::TRANSIENT, buf);
675 if (!rc) {
676 overall_result = false;
677 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
678 }
679 }
680
681 {
682 std::ostringstream buf;
683 fmt::print(buf, TRANSIENT_FIELD_VALUE_MISMATCH, "element blocks");
684 rc = compare_fields(input_region_1.get_element_blocks(),
685 input_region_2.get_element_blocks(), Ioss::Field::TRANSIENT, buf);
686 if (!rc) {
687 overall_result = false;
688 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
689 }
690 }
691
692 {
693 std::ostringstream buf;
694 fmt::print(buf, TRANSIENT_FIELD_VALUE_MISMATCH, "structured blocks");
695 rc = compare_fields(input_region_1.get_structured_blocks(),
696 input_region_2.get_structured_blocks(), Ioss::Field::TRANSIENT, buf);
697 if (!rc) {
698 overall_result = false;
699 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
700 }
701 }
702
703 {
704 std::ostringstream buf;
705 fmt::print(buf, TRANSIENT_FIELD_VALUE_MISMATCH, "node sets");
706 rc = compare_fields(input_region_1.get_nodesets(), input_region_2.get_nodesets(),
707 Ioss::Field::TRANSIENT, buf);
708 if (!rc) {
709 overall_result = false;
710 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
711 }
712 }
713
714 {
715 std::ostringstream buf;
716 fmt::print(buf, TRANSIENT_FIELD_VALUE_MISMATCH, "edge sets");
717 rc = compare_fields(input_region_1.get_edgesets(), input_region_2.get_edgesets(),
718 Ioss::Field::TRANSIENT, buf);
719 if (!rc) {
720 overall_result = false;
721 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
722 }
723 }
724
725 {
726 std::ostringstream buf;
727 fmt::print(buf, TRANSIENT_FIELD_VALUE_MISMATCH, "face sets");
728 rc = compare_fields(input_region_1.get_facesets(), input_region_2.get_facesets(),
729 Ioss::Field::TRANSIENT, buf);
730 if (!rc) {
731 overall_result = false;
732 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
733 }
734 }
735
736 {
737 std::ostringstream buf;
738 fmt::print(buf, TRANSIENT_FIELD_VALUE_MISMATCH, "element sets");
739 rc = compare_fields(input_region_1.get_elementsets(), input_region_2.get_elementsets(),
740 Ioss::Field::TRANSIENT, buf);
741 if (!rc) {
742 overall_result = false;
743 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
744 }
745 }
746 // Side Sets
747 {
748 const auto &in_sss_1 = input_region_1.get_sidesets();
749 const auto &in_sss_2 = input_region_2.get_sidesets();
750 for (const auto &iss : in_sss_1) {
751 const std::string &name = iss->name();
752
753 // Find matching output sideset
754 typename std::vector<Ioss::SideSet *>::const_iterator it;
755 for (it = in_sss_2.begin(); it != in_sss_2.end(); ++it) {
756 if (name == (*it)->name()) {
757 break;
758 }
759 }
760 if (it == in_sss_2.end()) {
761 // fmt::print(Ioss::WarnOut(), NOTFOUND_2, "SIDESET", name);
762 continue;
763 }
764
765 {
766 {
767 std::ostringstream buf;
768 fmt::print(buf, TRANSIENT_FIELD_VALUE_MISMATCH, "side sets");
769 rc = compare_fields(iss, (*it), Ioss::Field::TRANSIENT, buf);
770 if (!rc) {
771 overall_result = false;
772 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
773 }
774 }
775 const auto &in_sbs_1 = iss->get_side_blocks();
776 const auto &in_sbs_2 = (*it)->get_side_blocks();
777 if (in_sbs_1.size() != in_sbs_2.size()) {
778 fmt::print(Ioss::WarnOut(), COUNT_MISMATCH, "SIDEBLOCK", in_sbs_1.size(),
779 in_sbs_2.size());
780 continue;
781 }
782
783 for (const auto &isb : in_sbs_1) {
784 // Find matching output sideblock
785 const std::string &sbname = isb->name();
786
787 typename std::vector<Ioss::SideBlock *>::const_iterator iter;
788 for (iter = in_sbs_2.begin(); iter != in_sbs_2.end(); ++iter) {
789 if (sbname == (*iter)->name()) {
790 break;
791 }
792 }
793 if (iter == in_sbs_2.end()) {
794 // fmt::print(Ioss::WarnOut(), NOTFOUND_2, "SIDEBLOCK", sbname);
795 continue;
796 }
797
798 {
799 std::ostringstream buf;
800 fmt::print(buf, TRANSIENT_FIELD_VALUE_MISMATCH, "side blocks");
801 rc = compare_fields(isb, (*iter), Ioss::Field::TRANSIENT, buf);
802 if (!rc) {
803 overall_result = false;
804 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
805 }
806 }
807 }
808 }
809 }
810 }
811
812 int in_step_count_1 = input_region_1.get_property("state_count").get_int();
813 int in_step_count_2 = input_region_2.get_property("state_count").get_int();
814
815 for (int istep = 1; istep <= in_step_count_1; istep++) {
816 double in_time_1 = input_region_1.get_state_time(istep);
817
818 if (in_time_1 < options.minimum_time) {
819 continue;
820 }
821 if (in_time_1 > options.maximum_time) {
822 break;
823 }
824
825 if (istep > in_step_count_2) {
826 break;
827 }
828
829 input_region_1.begin_state(istep);
830 input_region_2.begin_state(istep);
831
832 {
833 std::ostringstream buf;
834 fmt::print(buf, TRANSIENT_FIELD_STEP_VALUE_MISMATCH, "region", istep);
835 rc = compare_field_data(&input_region_1, &input_region_2, data_pool,
836 Ioss::Field::REDUCTION, options, buf);
837 if (!rc) {
838 overall_result = false;
839 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
840 }
841 }
842 // This should have already been checked
843 assert(input_region_1.mesh_type() == input_region_2.mesh_type());
844
845 if (input_region_1.mesh_type() != Ioss::MeshType::STRUCTURED) {
846 {
847 std::ostringstream buf;
848 fmt::print(buf, TRANSIENT_FIELD_STEP_VALUE_MISMATCH, "node blocks", istep);
849 rc = compare_field_data(input_region_1.get_node_blocks(),
850 input_region_2.get_node_blocks(), data_pool,
851 Ioss::Field::TRANSIENT, options, buf);
852 if (!rc) {
853 overall_result = false;
854 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
855 }
856 }
857 }
858 {
859 std::ostringstream buf;
860 fmt::print(buf, TRANSIENT_FIELD_STEP_VALUE_MISMATCH, "edge blocks", istep);
861 rc =
862 compare_field_data(input_region_1.get_edge_blocks(), input_region_2.get_edge_blocks(),
863 data_pool, Ioss::Field::TRANSIENT, options, buf);
864 if (!rc) {
865 overall_result = false;
866 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
867 }
868 }
869 {
870 std::ostringstream buf;
871 fmt::print(buf, TRANSIENT_FIELD_STEP_VALUE_MISMATCH, "face blocks", istep);
872 rc =
873 compare_field_data(input_region_1.get_face_blocks(), input_region_2.get_face_blocks(),
874 data_pool, Ioss::Field::TRANSIENT, options, buf);
875 if (!rc) {
876 overall_result = false;
877 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
878 }
879 }
880 {
881 std::ostringstream buf;
882 fmt::print(buf, TRANSIENT_FIELD_STEP_VALUE_MISMATCH, "element blocks", istep);
883 rc = compare_field_data(input_region_1.get_element_blocks(),
884 input_region_2.get_element_blocks(), data_pool,
885 Ioss::Field::TRANSIENT, options, buf);
886 if (!rc) {
887 overall_result = false;
888 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
889 }
890 }
891 {
892 std::ostringstream buf;
893 fmt::print(buf, TRANSIENT_FIELD_STEP_VALUE_MISMATCH, "structured blocks", istep);
894 rc = compare_field_data(input_region_1.get_structured_blocks(),
895 input_region_2.get_structured_blocks(), data_pool,
896 Ioss::Field::TRANSIENT, options, buf);
897 if (!rc) {
898 overall_result = false;
899 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
900 }
901 }
902 {
903 std::ostringstream buf;
904 fmt::print(buf, TRANSIENT_FIELD_STEP_VALUE_MISMATCH, "node sets", istep);
905 rc = compare_field_data(input_region_1.get_nodesets(), input_region_2.get_nodesets(),
906 data_pool, Ioss::Field::TRANSIENT, options, buf);
907 if (!rc) {
908 overall_result = false;
909 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
910 }
911 }
912 {
913 std::ostringstream buf;
914 fmt::print(buf, TRANSIENT_FIELD_STEP_VALUE_MISMATCH, "edge sets", istep);
915 rc = compare_field_data(input_region_1.get_edgesets(), input_region_2.get_edgesets(),
916 data_pool, Ioss::Field::TRANSIENT, options, buf);
917 if (!rc) {
918 overall_result = false;
919 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
920 }
921 }
922 {
923 std::ostringstream buf;
924 fmt::print(buf, TRANSIENT_FIELD_STEP_VALUE_MISMATCH, "face sets", istep);
925 rc = compare_field_data(input_region_1.get_facesets(), input_region_2.get_facesets(),
926 data_pool, Ioss::Field::TRANSIENT, options, buf);
927 if (!rc) {
928 overall_result = false;
929 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
930 }
931 }
932 {
933 std::ostringstream buf;
934 fmt::print(buf, TRANSIENT_FIELD_STEP_VALUE_MISMATCH, "element sets", istep);
935 rc =
936 compare_field_data(input_region_1.get_elementsets(), input_region_2.get_elementsets(),
937 data_pool, Ioss::Field::TRANSIENT, options, buf);
938 if (!rc) {
939 overall_result = false;
940 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
941 }
942 }
943 // Side Sets
944 const auto &in_sss_1 = input_region_1.get_sidesets();
945 const auto &in_sss_2 = input_region_2.get_sidesets();
946
947 // This should have already been checked
948 assert(in_sss_1.size() == in_sss_2.size());
949
950 for (const auto &iss : in_sss_1) {
951 const std::string &name = iss->name();
952
953 // Find matching output sideset
954 typename std::vector<Ioss::SideSet *>::const_iterator it;
955 for (it = in_sss_2.begin(); it != in_sss_2.end(); ++it) {
956 if (name == (*it)->name()) {
957 break;
958 }
959 }
960
961 if (it == in_sss_2.end()) {
962 // fmt::print(Ioss::WarnOut(), NOTFOUND_2, "SIDESET", name);
963 continue;
964 }
965
966 {
967 {
968 std::ostringstream buf;
969 fmt::print(buf, TRANSIENT_FIELD_VALUE_MISMATCH, "side sets");
970 rc = compare_field_data(iss, (*it), data_pool, Ioss::Field::TRANSIENT, options, buf);
971 if (!rc) {
972 overall_result = false;
973 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
974 }
975 }
976 const auto &in_sbs_1 = iss->get_side_blocks();
977 const auto &in_sbs_2 = (*it)->get_side_blocks();
978 if (in_sbs_1.size() != in_sbs_2.size()) {
979 fmt::print(Ioss::WarnOut(), COUNT_MISMATCH, "SIDEBLOCK", in_sbs_1.size(),
980 in_sbs_2.size());
981 continue;
982 }
983
984 for (const auto &isb : in_sbs_1) {
985 // Find matching output sideblock
986 const std::string &sbname = isb->name();
987
988 typename std::vector<Ioss::SideBlock *>::const_iterator iter;
989 for (iter = in_sbs_2.begin(); iter != in_sbs_2.end(); ++iter) {
990 if (sbname == (*iter)->name()) {
991 break;
992 }
993 }
994 if (iter == in_sbs_2.end()) {
995 // fmt::print(Ioss::WarnOut(), NOTFOUND_2, "SIDESET", name);
996 continue;
997 }
998
999 {
1000 std::ostringstream buf;
1001 fmt::print(buf, TRANSIENT_FIELD_VALUE_MISMATCH, "side sets");
1002 rc = compare_field_data(isb, (*iter), data_pool, Ioss::Field::TRANSIENT, options,
1003 buf);
1004 if (!rc) {
1005 overall_result = false;
1006 fmt::print(Ioss::OUTPUT(), "{}", buf.str());
1007 }
1008 }
1009 }
1010 }
1011 }
1012 }
1013 }
1014
1015 Ioss::Utils::clear(data_pool.data);
1016
1017 return overall_result;
1018 }
1019
1020 bool compare_properties(const Ioss::GroupingEntity *ige_1, const Ioss::GroupingEntity *ige_2,
1021 std::ostringstream &buf)
1022 {
1023 bool overall_result = true;
1024
1025 Ioss::NameList ige_properties_1 = ige_1->property_describe();
1026
1027 for (const auto &property : ige_properties_1) {
1028 if (!ige_2->property_exists(property)) {
1029 // BASED on existing code in transfer_properties(), different databases can result
1030 // in a different set of properties without affecting their equivalence. As a result,
1031 // we'll skip properties that they don't have in common.
1032 continue;
1033 }
1034
1035 if (property == "database_name") {
1036 // IGNORE the database name. This is generally the filename; we don't care whether
1037 // the filenames match.
1038 continue;
1039 }
1040 if (property == "base_filename") {
1041 // IGNORE the base_filename. This is generally the base portion of the filename; we don't
1042 // care whether the filenames match.
1043 continue;
1044 }
1045
1046 // ALLOW the regions to have different names (when copying between databases, io_shell
1047 // will create "region_1" (input) and "region_2" (output))
1048 if (ige_1->type() == Ioss::REGION && property == "name") {
1049 continue;
1050 }
1051
1052 const Ioss::Property &ige_property_1 = ige_1->get_property(property);
1053 const Ioss::Property &ige_property_2 = ige_2->get_property(property);
1054 if (ige_property_1 != ige_property_2) {
1055 if (ige_property_1.get_type() == Ioss::Property::STRING) {
1056 auto p1_value = ige_property_1.get_string();
1057 auto p2_value = ige_property_2.get_string();
1058 fmt::print(buf, "\tPROPERTY value mismatch [STRING] ({}): ('{}' vs '{}')\n", property,
1059 p1_value, p2_value);
1060 }
1061 else if (ige_property_1.get_type() == Ioss::Property::INTEGER) {
1062 fmt::print(buf, "\tPROPERTY value mismatch [INTEGER] ({}): ({} vs {})\n", property,
1063 ige_property_1.get_int(), ige_property_2.get_int());
1064 }
1065 else {
1066 fmt::print(buf, "PROPERTY value mismatch ({}): unsupported type\n", property);
1067 }
1068
1069 overall_result = false;
1070 }
1071 }
1072
1073 return overall_result;
1074 }
1075
1076 bool compare_change_sets(const Ioss::Region &input_region_1, const Ioss::Region &input_region_2,
1077 IOSS_MAYBE_UNUSED std::ostringstream &buf)
1078 {
1079 bool overall_result = true;
1080 auto cs1_count = input_region_1.get_database()->num_internal_change_set();
1081 auto cs2_count = input_region_2.get_database()->num_internal_change_set();
1082 if (cs1_count != cs2_count) {
1083 fmt::print(Ioss::WarnOut(), COUNT_MISMATCH, "CHANGE SETS", cs1_count, cs2_count);
1084 overall_result = false;
1085 }
1086
1087 auto cs1_names = input_region_1.get_database()->internal_change_set_describe();
1088 auto cs2_names = input_region_2.get_database()->internal_change_set_describe();
1089
1090 for (const auto &cs1_name : cs1_names) {
1091 auto it = std::find(cs2_names.cbegin(), cs2_names.cend(), cs1_name);
1092 if (it == cs2_names.cend()) {
1093 // CHANGE_SET was not found
1094 fmt::print(Ioss::WarnOut(), NOTFOUND_2, "CHANGE SET", cs1_name);
1095 overall_result = false;
1096 }
1097 }
1098
1099 for (const auto &cs2_name : cs2_names) {
1100 auto it = std::find(cs1_names.cbegin(), cs1_names.cend(), cs2_name);
1101 if (it == cs1_names.cend()) {
1102 // CHANGE_SET was not found
1103 fmt::print(Ioss::WarnOut(), NOTFOUND_1, "CHANGE SET", cs2_name);
1104 overall_result = false;
1105 }
1106 }
1107 return overall_result;
1108 }
1109
1110 bool compare_qa_info(const Ioss::Region &input_region_1, const Ioss::Region &input_region_2,
1111 std::ostringstream &buf)
1112 {
1113 bool overall_result = true;
1114
1115 const Ioss::NameList &in_information_records_1 = input_region_1.get_information_records();
1116 const Ioss::NameList &in_information_records_2 = input_region_2.get_information_records();
1117
1118 if (in_information_records_1.size() != in_information_records_2.size()) {
1119 fmt::print(Ioss::WarnOut(), COUNT_MISMATCH, "INFORMATION RECORD",
1120 in_information_records_1.size(), in_information_records_2.size());
1121 }
1122
1123 for (const auto &information_record : in_information_records_1) {
1124 auto it = std::find(in_information_records_2.begin(), in_information_records_2.end(),
1125 information_record);
1126 if (it == in_information_records_2.end()) {
1127 // INFORMATION RECORD was not found
1128 fmt::print(Ioss::WarnOut(), NOTFOUND_2, "INFORMATION RECORD", information_record);
1129 }
1130 }
1131
1132 for (const auto &information_record : in_information_records_2) {
1133 auto it = std::find(in_information_records_1.begin(), in_information_records_1.end(),
1134 information_record);
1135 if (it == in_information_records_1.end()) {
1136 // INFORMATION RECORD was not found
1137 fmt::print(Ioss::WarnOut(), NOTFOUND_1, "INFORMATION RECORD", information_record);
1138 }
1139 }
1140
1141 // Each QA record consists of four strings. For now, require identical ordering
1142 // (i.e., records in the same order) for equality.
1143 const Ioss::NameList &in_qa_1 = input_region_1.get_qa_records();
1144 const Ioss::NameList &in_qa_2 = input_region_2.get_qa_records();
1145
1146 bool printed = false;
1147 if (in_qa_1.size() != in_qa_2.size()) {
1148 fmt::print(Ioss::WarnOut(), COUNT_MISMATCH, "QA RECORD", in_qa_1.size(), in_qa_2.size());
1149 printed = true;
1150 }
1151
1152 // CHECK for missing QA records and COMPARE existing records
1153 for (const auto &in_qa_record_1 : in_qa_1) {
1154 auto it = std::find(in_qa_2.begin(), in_qa_2.end(), in_qa_record_1);
1155 if (it == in_qa_2.end()) {
1156 // QA RECORD was not found
1157 fmt::print(Ioss::WarnOut(), NOTFOUND_2, "QA RECORD", in_qa_record_1);
1158 printed = true;
1159 continue;
1160 }
1161
1162 if (in_qa_record_1 != *it) {
1163 fmt::print(buf, VALUE_MISMATCH, "QA RECORD", in_qa_record_1, (*it));
1164 printed = true;
1165 overall_result = false;
1166 }
1167 }
1168
1169 for (const auto &in_qa_record_2 : in_qa_2) {
1170 auto it = std::find(in_qa_1.begin(), in_qa_1.end(), in_qa_record_2);
1171 if (it == in_qa_1.end()) {
1172 // QA RECORD was not found
1173 fmt::print(Ioss::WarnOut(), NOTFOUND_1, "QA RECORD", in_qa_record_2);
1174 printed = true;
1175 }
1176 }
1177
1178 if (printed) {
1179 fmt::print(Ioss::WarnOut(false), "\n");
1180 }
1181 return overall_result;
1182 }
1183
1184 template <typename T>
1185 bool compare_entities(const std::vector<T *> &in_sets_1, const std::vector<T *> &in_sets_2,
1186 const std::string &uc_type, const std::string &type)
1187 {
1188 bool overall_result = true;
1189
1190 if (in_sets_1.size() != in_sets_2.size()) {
1191 fmt::print(Ioss::WarnOut(), COUNT_MISMATCH, uc_type, in_sets_1.size(), in_sets_2.size());
1192 return false;
1193 }
1194
1195 if (!in_sets_1.empty()) {
1196 bool name_not_found = false;
1197 for (const auto &in_set_1 : in_sets_1) {
1198 const auto &name = in_set_1->name();
1199 // find a set in `in_sets_2` with the same name.
1200 // if found, compare for equality...
1201 bool found = false;
1202 for (const auto &in_set_2 : in_sets_2) {
1203 if (in_set_2->name() == name) {
1204 found = true;
1205 if (!in_set_1->equal(*in_set_2)) {
1206 overall_result = false;
1207 }
1208 break;
1209 }
1210 }
1211 if (!found) {
1212 name_not_found = true;
1213 fmt::print(Ioss::WarnOut(), NOTFOUND_2, type, in_set_1->name());
1214 overall_result = false;
1215 }
1216 }
1217 if (name_not_found) {
1218 // If get here, then there is at least one entity in set 1 which is not in set 2.
1219 // Since set_1.size() == set_2.size(), then there is at least one entity in set 2 which is
1220 // not in set_1. Find it/them and print out the namns...
1221 for (const auto &in_set_2 : in_sets_2) {
1222 const auto &name = in_set_2->name();
1223 // find a set in `in_sets_1` with the same name.
1224 bool found = false;
1225 for (const auto &in_set_1 : in_sets_1) {
1226 if (in_set_1->name() == name) {
1227 found = true;
1228 break;
1229 }
1230 }
1231 if (!found) {
1232 fmt::print(Ioss::WarnOut(), NOTFOUND_1, type, in_set_2->name());
1233 overall_result = false;
1234 }
1235 }
1236 }
1237 }
1238
1239 return overall_result;
1240 }
1241
1242 bool compare_nodeblock(const Ioss::Region &input_region_1, const Ioss::Region &input_region_2)
1243 {
1244 const Ioss::NodeBlockContainer &in_nbs_1 = input_region_1.get_node_blocks();
1245 const Ioss::NodeBlockContainer &in_nbs_2 = input_region_2.get_node_blocks();
1246 return compare_entities(in_nbs_1, in_nbs_2, "NODEBLOCK", "nodeblock");
1247 }
1248
1249 bool compare_elementblocks(const Ioss::Region &input_region_1, const Ioss::Region &input_region_2)
1250 {
1251 const auto &in_ebs_1 = input_region_1.get_element_blocks();
1252 const auto &in_ebs_2 = input_region_2.get_element_blocks();
1253 return compare_entities(in_ebs_1, in_ebs_2, "ELEMENTBLOCK", "element block");
1254 }
1255
1256 bool compare_edgeblocks(const Ioss::Region &input_region_1, const Ioss::Region &input_region_2)
1257 {
1258 const auto &in_ebs_1 = input_region_1.get_edge_blocks();
1259 const auto &in_ebs_2 = input_region_2.get_edge_blocks();
1260 return compare_entities(in_ebs_1, in_ebs_2, "EDGEBLOCK", "edge block");
1261 }
1262
1263 bool compare_faceblocks(const Ioss::Region &input_region_1, const Ioss::Region &input_region_2)
1264 {
1265 const auto &in_fbs_1 = input_region_1.get_face_blocks();
1266 const auto &in_fbs_2 = input_region_2.get_face_blocks();
1267 return compare_entities(in_fbs_1, in_fbs_2, "FACEBLOCK", "face block");
1268 }
1269
1270 bool compare_structuredblocks(const Ioss::Region &input_region_1,
1271 const Ioss::Region &input_region_2)
1272 {
1273 bool overall_result = true;
1274
1275 const auto &in_blocks_1 = input_region_1.get_structured_blocks();
1276 const auto &in_blocks_2 = input_region_2.get_structured_blocks();
1277
1278 if (in_blocks_1.size() != in_blocks_2.size()) {
1279 fmt::print(Ioss::WarnOut(), COUNT_MISMATCH, "STRUCTUREDBLOCK", in_blocks_1.size(),
1280 in_blocks_2.size());
1281 return false;
1282 }
1283
1284 for (const auto &in_block_1 : in_blocks_1) {
1285 const auto &name = in_block_1->name();
1286 bool found = false;
1287 for (const auto &in_block_2 : in_blocks_2) {
1288 if (in_block_2->name() == name) {
1289 found = true;
1290 if (!in_block_1->equal(*in_block_2)) {
1291 overall_result = false;
1292 }
1293 const auto &nb1 = in_block_1->get_node_block();
1294 const auto &nb2 = in_block_2->get_node_block();
1295 if (!nb1.equal(nb2)) {
1296 overall_result = false;
1297 }
1298 break;
1299 }
1300 }
1301 if (!found) {
1302 fmt::print(Ioss::WarnOut(), NOTFOUND_2, "", in_block_1->name());
1303 overall_result = false;
1304 }
1305 }
1306 return overall_result;
1307 }
1308
1309 bool compare_nodesets(const Ioss::Region &input_region_1, const Ioss::Region &input_region_2)
1310 {
1311 const auto &in_nss_1 = input_region_1.get_nodesets();
1312 const auto &in_nss_2 = input_region_2.get_nodesets();
1313 return compare_entities(in_nss_1, in_nss_2, "NODESET", "nodeset");
1314 }
1315
1316 bool compare_edgesets(const Ioss::Region &input_region_1, const Ioss::Region &input_region_2)
1317 {
1318 const auto &in_ess_1 = input_region_1.get_edgesets();
1319 const auto &in_ess_2 = input_region_2.get_edgesets();
1320 return compare_entities(in_ess_1, in_ess_2, "EDGESET", "edgeset");
1321 }
1322
1323 bool compare_facesets(const Ioss::Region &input_region_1, const Ioss::Region &input_region_2)
1324 {
1325 const auto &in_fss_1 = input_region_1.get_facesets();
1326 const auto &in_fss_2 = input_region_2.get_facesets();
1327 return compare_entities(in_fss_1, in_fss_2, "FACESET", "faceset");
1328 }
1329
1330 bool compare_elemsets(const Ioss::Region &input_region_1, const Ioss::Region &input_region_2)
1331 {
1332 const auto &in_ess_1 = input_region_1.get_elementsets();
1333 const auto &in_ess_2 = input_region_2.get_elementsets();
1334 return compare_entities(in_ess_1, in_ess_2, "ELEMSET", "elemset");
1335 }
1336
1337 bool compare_sidesets(const Ioss::Region &input_region_1, const Ioss::Region &input_region_2)
1338 {
1339 const auto &in_sss_1 = input_region_1.get_sidesets();
1340 const auto &in_sss_2 = input_region_2.get_sidesets();
1341 return compare_entities(in_sss_1, in_sss_2, "SIDESET", "sideset");
1342 }
1343
1344 bool compare_commsets(const Ioss::Region &input_region_1, const Ioss::Region &input_region_2)
1345 {
1346 const auto &in_css_1 = input_region_1.get_commsets();
1347 const auto &in_css_2 = input_region_2.get_commsets();
1348 return compare_entities(in_css_1, in_css_2, "COMMSET", "commset");
1349 }
1350
1351 bool compare_assemblies(const Ioss::Region &input_region_1, const Ioss::Region &input_region_2)
1352 {
1353 const auto &in_assem_1 = input_region_1.get_assemblies();
1354 const auto &in_assem_2 = input_region_2.get_assemblies();
1355 return compare_entities(in_assem_1, in_assem_2, "ASSEMBLY", "assembly");
1356 }
1357
1358 bool compare_coordinate_frames(const Ioss::Region &input_region_1,
1359 const Ioss::Region &input_region_2)
1360 {
1361 bool overall_result = true;
1362
1363 const auto &in_cfs_1 = input_region_1.get_coordinate_frames();
1364 const auto &in_cfs_2 = input_region_2.get_coordinate_frames();
1365
1366 if (in_cfs_1.size() != in_cfs_2.size()) {
1367 fmt::print(Ioss::WarnOut(), COUNT_MISMATCH, "COORDINATE FRAME", in_cfs_1.size(),
1368 in_cfs_2.size());
1369 return false;
1370 }
1371
1372 for (const auto &in_cf_1 : in_cfs_1) {
1373 bool found = false;
1374 for (const auto &in_cf_2 : in_cfs_2) {
1375 if (in_cf_1.id() == in_cf_2.id()) {
1376 found = true;
1377 if (!in_cf_1.equal(in_cf_2)) {
1378 overall_result = false;
1379 }
1380 break;
1381 }
1382 }
1383 if (!found) {
1384 fmt::print(Ioss::WarnOut(), NOTFOUND_2, "COORDINATE FRAME", in_cf_1.id());
1385 overall_result = false;
1386 }
1387 }
1388 return overall_result;
1389 }
1390
1391 template <typename T>
1392 bool compare_fields(const std::vector<T *> &in_entities_1, const std::vector<T *> &in_entities_2,
1393 Ioss::Field::RoleType role, std::ostringstream &buf)
1394 {
1395 bool overall_result = true;
1396
1397 if (in_entities_1.size() != in_entities_2.size()) {
1398 std::string type = "ENTITY";
1399 if (!in_entities_1.empty()) {
1400 type = in_entities_1[0]->type_string();
1401 }
1402 else {
1403 type = in_entities_2[0]->type_string();
1404 }
1405 fmt::print(Ioss::WarnOut(), COUNT_MISMATCH, type, in_entities_1.size(), in_entities_2.size());
1406 return false;
1407 }
1408
1409 for (const auto &in_entity_1 : in_entities_1) {
1410 const std::string &name = in_entity_1->name();
1411
1412 typename std::vector<T *>::const_iterator it;
1413 for (it = in_entities_2.begin(); it != in_entities_2.end(); ++it) {
1414 if (name == (*it)->name()) {
1415 break;
1416 }
1417 }
1418 if (it == in_entities_2.end()) {
1419 fmt::print(Ioss::WarnOut(), NOTFOUND_2, in_entity_1->type_string(), name);
1420 overall_result = false;
1421 continue;
1422 }
1423
1424 overall_result &= compare_fields(in_entity_1, (*it), role, buf);
1425 }
1426
1427 return overall_result;
1428 }
1429
1430 bool compare_fields(const std::vector<Ioss::StructuredBlock *> &in_entities_1,
1431 const std::vector<Ioss::StructuredBlock *> &in_entities_2,
1432 Ioss::Field::RoleType role, std::ostringstream &buf)
1433 {
1434 bool overall_result = true;
1435
1436 if (in_entities_1.size() != in_entities_2.size()) {
1437 std::string type = "ENTITY";
1438 if (!in_entities_1.empty()) {
1439 type = in_entities_1[0]->type_string();
1440 }
1441 else {
1442 type = in_entities_2[0]->type_string();
1443 }
1444 fmt::print(Ioss::WarnOut(), COUNT_MISMATCH, type, in_entities_1.size(), in_entities_2.size());
1445 return false;
1446 }
1447
1448 for (const auto &in_entity_1 : in_entities_1) {
1449 const std::string &name = in_entity_1->name();
1450
1451 typename std::vector<Ioss::StructuredBlock *>::const_iterator it;
1452 for (it = in_entities_2.begin(); it != in_entities_2.end(); ++it) {
1453 if (name == (*it)->name()) {
1454 break;
1455 }
1456 }
1457 if (it == in_entities_2.end()) {
1458 fmt::print(Ioss::WarnOut(), NOTFOUND_2, in_entity_1->type_string(), name);
1459 overall_result = false;
1460 continue;
1461 }
1462
1463 overall_result &= compare_fields(in_entity_1, (*it), role, buf);
1464
1465 if (role == Ioss::Field::TRANSIENT) {
1466 const auto &nb1 = in_entity_1->get_node_block();
1467 const auto &nb2 = (*it)->get_node_block();
1468 overall_result &= compare_fields(&nb1, &nb2, role, buf);
1469 }
1470 }
1471 return overall_result;
1472 }
1473
1474 bool compare_fields(const Ioss::GroupingEntity *ige_1, const Ioss::GroupingEntity *ige_2,
1475 Ioss::Field::RoleType role, std::ostringstream &buf)
1476 {
1477 // Check for transient fields...
1478 Ioss::NameList in_fields_1 = ige_1->field_describe(role);
1479 Ioss::NameList in_fields_2 = ige_2->field_describe(role);
1480
1481 if (in_fields_1.size() != in_fields_2.size()) {
1482 fmt::print(Ioss::WarnOut(), COUNT_MISMATCH, "FIELD", in_fields_1.size(), in_fields_2.size());
1483 return false;
1484 }
1485
1486 bool result = true;
1487 // Iterate through results fields and transfer to output
1488 // database... If a prefix is specified, only transfer fields
1489 // whose names begin with the prefix
1490 for (const auto &field_name : in_fields_1) {
1491 const Ioss::Field &ige_field_1 = ige_1->get_field(field_name);
1492 const Ioss::Field &ige_field_2 = ige_2->get_field(field_name);
1493 if (!ige_field_1.equal(ige_field_2)) {
1494 fmt::print(buf, "\n\tFIELD ({}) mismatch", field_name);
1495 result = false;
1496 }
1497 }
1498 return result;
1499 }
1500
1501 template <typename T1, typename T2>
1502 bool compare_field_data(const std::vector<T1 *> &in_entities_1,
1503 const std::vector<T2 *> &in_entities_2, Ioss::DataPool &pool,
1504 Ioss::Field::RoleType role, const Ioss::MeshCopyOptions &options,
1505 std::ostringstream &buf)
1506 {
1507 bool overall_result = true;
1508
1509 if (in_entities_1.size() != in_entities_2.size()) {
1510 std::string type = "ENTITY";
1511 if (!in_entities_1.empty()) {
1512 type = in_entities_1[0]->type_string();
1513 }
1514 else {
1515 type = in_entities_2[0]->type_string();
1516 }
1517 fmt::print(Ioss::WarnOut(), COUNT_MISMATCH, type, in_entities_1.size(), in_entities_2.size());
1518 return false;
1519 }
1520
1521 for (const auto &in_entity_1 : in_entities_1) {
1522 const auto &name = in_entity_1->name();
1523
1524 auto it = in_entities_2.begin();
1525 for (; it != in_entities_2.end(); ++it) {
1526 if (name == (*it)->name()) {
1527 break;
1528 }
1529 }
1530 if (it == in_entities_2.end()) {
1531 // fmt::print(Ioss::WarnOut(), NOTFOUND_2, in_entity_1->type_string(), name);
1532 overall_result = false;
1533 continue;
1534 }
1535
1536 overall_result &= compare_field_data(in_entity_1, (*it), pool, role, options, buf);
1537 }
1538
1539 return overall_result;
1540 }
1541
1542 bool compare_field_data(const std::vector<Ioss::StructuredBlock *> &in_entities_1,
1543 const std::vector<Ioss::StructuredBlock *> &in_entities_2,
1544 Ioss::DataPool &pool, Ioss::Field::RoleType role,
1545 const Ioss::MeshCopyOptions &options, std::ostringstream &buf)
1546 {
1547 bool overall_result = true;
1548
1549 if (in_entities_1.size() != in_entities_2.size()) {
1550 std::string type = "ENTITY";
1551 if (!in_entities_1.empty()) {
1552 type = in_entities_1[0]->type_string();
1553 }
1554 else {
1555 type = in_entities_2[0]->type_string();
1556 }
1557 fmt::print(Ioss::WarnOut(), COUNT_MISMATCH, type, in_entities_1.size(), in_entities_2.size());
1558 return false;
1559 }
1560
1561 for (const auto &in_entity_1 : in_entities_1) {
1562 const std::string &name = in_entity_1->name();
1563
1564 std::vector<Ioss::StructuredBlock *>::const_iterator it;
1565 for (it = in_entities_2.begin(); it != in_entities_2.end(); ++it) {
1566 if (name == (*it)->name()) {
1567 break;
1568 }
1569 }
1570 if (it == in_entities_2.end()) {
1571 // fmt::print(Ioss::WarnOut(), NOTFOUND_2, in_entity_1->type_string(), name);
1572 overall_result = false;
1573 continue;
1574 }
1575
1576 overall_result &= compare_field_data(in_entity_1, (*it), pool, role, options, buf);
1577
1578 if (role == Ioss::Field::TRANSIENT) {
1579 const auto &nb1 = in_entity_1->get_node_block();
1580 const auto &nb2 = (*it)->get_node_block();
1581 overall_result &= compare_field_data(&nb1, &nb2, pool, role, options, buf);
1582 }
1583 }
1584
1585 return overall_result;
1586 }
1587
1588 bool compare_field_data(const Ioss::GroupingEntity *ige_1, const Ioss::GroupingEntity *ige_2,
1589 Ioss::DataPool &pool, Ioss::Field::RoleType role,
1590 const Ioss::MeshCopyOptions &options, std::ostringstream &buf,
1591 const std::string &prefix)
1592 {
1593 bool overall_result = true;
1594
1595 // Iterate through the `role` fields of the input
1596 // database and compare to second database.
1597 Ioss::NameList in_state_fields_1 = ige_1->field_describe(role);
1598
1599 for (const auto &field_name : in_state_fields_1) {
1600 // All of the 'Ioss::EntityBlock' derived classes have a
1601 // 'connectivity' field, but it is only interesting on the
1602 // Ioss::ElementBlock class. On the other classes, it just
1603 // generates overhead...
1604 if (field_name == "connectivity" && ige_1->type() != Ioss::ELEMENTBLOCK) {
1605 assert(ige_2->type() != Ioss::ELEMENTBLOCK);
1606 continue;
1607 }
1608 if (field_name == "ids" && ige_1->type() == Ioss::COMMSET) {
1609 assert(ige_2->type() == Ioss::COMMSET);
1610 continue;
1611 }
1612 if (Ioss::Utils::substr_equal(prefix, field_name)) {
1613 if (ige_2->field_exists(field_name)) {
1614 overall_result &=
1615 compare_field_data_internal(ige_1, ige_2, pool, field_name, options, buf);
1616 }
1617 }
1618 }
1619
1620 return overall_result;
1621 }
1622
1623 template <typename T1, typename T2>
1624 bool compare_field_data(T1 *data1, T2 *data2, size_t count, size_t component_count,
1625 const std::string &field_name, const std::string &entity_name,
1626 std::ostringstream &buf)
1627 {
1628 int width = Ioss::Utils::number_width(count - 1);
1629 bool first = true;
1630 for (size_t i = 0; i < count * component_count; i++) {
1631 if (data1[i] != data2[i]) {
1632 auto idx = i / component_count;
1633 auto cmp = i % component_count;
1634 if (first) {
1635 fmt::print(buf,
1636 "\n\tFIELD ({}) on {} -- mismatch at [index.component]:\n\t\t[{:{}}.{}]: "
1637 "{}\tvs. {}",
1638 field_name, entity_name, idx + 1, width, cmp, data1[i], data2[i]);
1639 first = false;
1640 }
1641 else {
1642 fmt::print(buf, "\n\t\t[{:{}}.{}]: {}\tvs. {}", idx + 1, width, cmp, data1[i], data2[i]);
1643 }
1644 }
1645 }
1646 return first;
1647 }
1648
1649 template <>
1650 bool compare_field_data(double *data1, double *data2, size_t count, size_t component_count,
1651 const std::string &field_name, const std::string &entity_name,
1652 std::ostringstream &buf)
1653 {
1654 int width = Ioss::Utils::number_width(count - 1);
1655 bool first = true;
1656 for (size_t i = 0; i < count * component_count; i++) {
1657 if (data1[i] != data2[i]) {
1658 double abs_data1 = std::abs(data1[i]);
1659 double abs_data2 = std::abs(data2[i]);
1660 if (abs_data1 > tol_floor || abs_data2 > tol_floor) {
1661 auto idx = i / component_count;
1662 auto cmp = i % component_count;
1663 auto abs_diff = std::abs(data1[i] - data2[i]);
1664 auto max = std::max(abs_data1, abs_data2);
1665 auto rel_diff = max != 0.0 ? std::abs(data1[i] - data2[i]) / max : 0.0;
1666 if (abs_diff >= abs_tolerance && rel_diff >= rel_tolerance) {
1667 if (first) {
1668 fmt::print(buf,
1669 "\n\tFIELD ({}) on {} -- mismatch at [index.component]:\n\t\t[{:{}}.{}]: "
1670 "{:20.13e}\tvs. {:20.13e}\tabs: {:12.5e},\trel: {:12.5e}",
1671 field_name, entity_name, idx + 1, width, cmp, data1[i], data2[i], abs_diff,
1672 rel_diff);
1673 first = false;
1674 }
1675 else {
1676 fmt::print(
1677 buf, "\n\t\t[{:{}}.{}]: {:20.13e}\tvs. {:20.13e}\tabs: {:12.5e},\trel: {:12.5e}",
1678 idx + 1, width, cmp, data1[i], data2[i], abs_diff, rel_diff);
1679 }
1680 }
1681 }
1682 }
1683 }
1684 return first;
1685 }
1686
1687 bool compare_field_data_internal(const Ioss::GroupingEntity *ige_1,
1688 const Ioss::GroupingEntity *ige_2, Ioss::DataPool &in_pool,
1689 const std::string &field_name,
1690 const Ioss::MeshCopyOptions &options, std::ostringstream &buf)
1691 {
1692 if (field_name == "mesh_model_coordinates_x") {
1693 return true;
1694 }
1695 if (field_name == "mesh_model_coordinates_y") {
1696 return true;
1697 }
1698 if (field_name == "mesh_model_coordinates_z") {
1699 return true;
1700 }
1701 if (field_name == "connectivity_raw") {
1702 return true;
1703 }
1704 if (field_name == "element_side_raw") {
1705 return true;
1706 }
1707 if (field_name == "ids_raw") {
1708 return true;
1709 }
1710 if (field_name == "implicit_ids") {
1711 return true;
1712 }
1713 if (field_name == "node_connectivity_status") {
1714 return true;
1715 }
1716 if (field_name == "owning_processor") {
1717 return true;
1718 }
1719 if (field_name == "entity_processor_raw") {
1720 return true;
1721 }
1722 if (field_name == "ids" && ige_1->type() == Ioss::SIDEBLOCK) {
1723 return true;
1724 }
1725 if (field_name == "ids" && ige_1->type() == Ioss::STRUCTUREDBLOCK) {
1726 return true;
1727 }
1728 if (field_name == "cell_ids" && ige_1->type() == Ioss::STRUCTUREDBLOCK) {
1729 return true;
1730 }
1731 if (field_name == "cell_node_ids" && ige_1->type() == Ioss::STRUCTUREDBLOCK) {
1732 return true;
1733 }
1734
1735 size_t icount = ige_1->get_field(field_name).raw_count();
1736 size_t ocount = ige_2->get_field(field_name).raw_count();
1737
1738 if (icount != ocount) {
1739 fmt::print(buf, "\n\tFIELD count mismatch for field '{}', ({} vs. {}) on {}", field_name,
1740 icount, ocount, ige_1->name());
1741 return false;
1742 }
1743
1744 size_t isize = ige_1->get_field(field_name).get_size();
1745 size_t osize = ige_2->get_field(field_name).get_size();
1746
1747 Ioss::DataPool in_pool_2;
1748 if (options.data_storage_type == 1 || options.data_storage_type == 2) {
1749 if (in_pool.data.size() < isize) {
1750 in_pool.data.resize(isize);
1751 }
1752 if (in_pool_2.data.size() < osize) {
1753 in_pool_2.data.resize(osize);
1754 }
1755 }
1756
1757 assert(in_pool.data.size() >= isize);
1758 assert(in_pool_2.data.size() >= osize);
1759
1760 switch (options.data_storage_type) {
1761 case 1: {
1762 ige_1->get_field_data(field_name, Data(in_pool.data), isize);
1763 ige_2->get_field_data(field_name, Data(in_pool_2.data), osize);
1764 const Ioss::Field &field = ige_1->get_field(field_name);
1765 const Ioss::Field &field2 = ige_2->get_field(field_name);
1766
1767 switch (field.get_type()) {
1768 case Ioss::Field::REAL:
1769 return compare_field_data(
1770 (double *)Data(in_pool.data), (double *)Data(in_pool_2.data), field.raw_count(),
1771 field.get_component_count(Ioss::Field::InOut::OUTPUT), field_name, ige_1->name(), buf);
1772 case Ioss::Field::INTEGER:
1773 switch (field2.get_type()) {
1774 case Ioss::Field::INTEGER:
1775 return compare_field_data((int *)Data(in_pool.data), (int *)Data(in_pool_2.data),
1776 field.raw_count(),
1777 field.get_component_count(Ioss::Field::InOut::OUTPUT),
1778 field_name, ige_1->name(), buf);
1779 case Ioss::Field::INT64:
1780 return compare_field_data((int *)Data(in_pool.data), (int64_t *)Data(in_pool_2.data),
1781 field.raw_count(),
1782 field.get_component_count(Ioss::Field::InOut::OUTPUT),
1783 field_name, ige_1->name(), buf);
1784 default:
1785 fmt::print(Ioss::WarnOut(), "Field data_storage type {} not recognized for field {}.",
1786 field.type_string(), field_name);
1787 return false;
1788 }
1789 case Ioss::Field::INT64:
1790 switch (field2.get_type()) {
1791 case Ioss::Field::INTEGER:
1792 return compare_field_data((int64_t *)Data(in_pool.data), (int *)Data(in_pool_2.data),
1793 field.raw_count(),
1794 field.get_component_count(Ioss::Field::InOut::OUTPUT),
1795 field_name, ige_1->name(), buf);
1796 case Ioss::Field::INT64:
1797 return compare_field_data((int64_t *)Data(in_pool.data), (int64_t *)Data(in_pool_2.data),
1798 field.raw_count(),
1799 field.get_component_count(Ioss::Field::InOut::OUTPUT),
1800 field_name, ige_1->name(), buf);
1801 default:
1802 fmt::print(Ioss::WarnOut(), "Field data_storage type {} not recognized for field {}.",
1803 field.type_string(), field_name);
1804 return false;
1805 }
1806 default:
1807 fmt::print(Ioss::WarnOut(), "Field data_storage type {} not recognized for field {}.",
1808 field.type_string(), field_name);
1809 return false;
1810 }
1811 }
1812 default:
1813 if (field_name == "mesh_model_coordinates") {
1814 fmt::print(Ioss::WarnOut(), "data_storage option not recognized.");
1815 }
1816 }
1817 return false;
1818 }
1819 } // namespace