本文整理汇总了C++中ExoII_Read::Free_Elmt_Map方法的典型用法代码示例。如果您正苦于以下问题:C++ ExoII_Read::Free_Elmt_Map方法的具体用法?C++ ExoII_Read::Free_Elmt_Map怎么用?C++ ExoII_Read::Free_Elmt_Map使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExoII_Read
的用法示例。
在下文中一共展示了ExoII_Read::Free_Elmt_Map方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Compare_Maps
//.........这里部分代码省略.........
size_t num_nodes1 = file1.Num_Nodes();
size_t num_elmts1 = file1.Num_Elmts();
//size_t num_nodes2 = file2.Num_Nodes();
//size_t num_elmts2 = file2.Num_Elmts();
// NOTE: file1 maps are already loaded...
file2.Load_Node_Map();
file2.Load_Elmt_Map();
const INT *node_id_map1 = file1.Get_Node_Map();
const INT *elem_id_map1 = file1.Get_Elmt_Map();
const INT *node_id_map2 = file2.Get_Node_Map();
const INT *elem_id_map2 = file2.Get_Elmt_Map();
bool diff = false;
size_t warn_count = 0;
if (node_map != nullptr) {
// There is a map between file1 and file2, but all nodes are
// used in both files.
for (size_t i=0; i < num_nodes1; i++) {
if (node_id_map1[i] != node_id_map2[node_map[i]]) {
if (!(node_id_map2[node_map[i]] == 0 && partial_flag)) { // Don't output diff if non-matched and partial
std::cout << "exodiff: WARNING .. The local node " << i+1 << " with global id " << node_id_map1[i]
<< " in file1 has the global id " << node_id_map2[node_map[i]]
<< " in file2.\n";
diff = true;
warn_count++;
if (warn_count > 100) {
std::cout << "exodiff: WARNING .. Too many warnings, skipping remainder...\n";
break;
}
}
}
}
} else {
// No node mapping between file1 and file2 -- do a straight compare.
for (size_t i=0; i < num_nodes1; i++) {
if (node_id_map1[i] != node_id_map2[i]) {
if (!(node_id_map2[i] == 0 && partial_flag)) { // Don't output diff if non-matched and partial
std::cout << "exodiff: WARNING .. The local node " << i+1 << " with global id " << node_id_map1[i]
<< " in file1 has the global id " << node_id_map2[i]
<< " in file2.\n";
diff = true;
warn_count++;
if (warn_count > 100) {
std::cout << "exodiff: WARNING .. Too many warnings, skipping remainder...\n";
break;
}
}
}
}
}
warn_count = 0;
if (elmt_map != nullptr) {
// There is a map between file1 and file2, but all elements are
// used in both files.
for (size_t i=0; i < num_elmts1; i++) {
if (elem_id_map1[i] != elem_id_map2[elmt_map[i]]) {
if (!(elem_id_map2[elmt_map[i]] == 0 && partial_flag)) { // Don't output diff if non-matched and partial
std::cout << "exodiff: WARNING .. The local element " << i+1 << " with global id " << elem_id_map1[i]
<< " in file1 has the global id " << elem_id_map2[elmt_map[i]]
<< " in file2.\n";
diff = true;
warn_count++;
if (warn_count > 100) {
std::cout << "exodiff: WARNING .. Too many warnings, skipping remainder...\n";
break;
}
}
}
}
} else {
// No element mapping between file1 and file2 -- do a straight compare.
for (size_t i=0; i < num_elmts1; i++) {
if (elem_id_map1[i] != elem_id_map2[i]) {
if (!(elem_id_map2[i] == 0 && partial_flag)) { // Don't output diff if non-matched and partial
std::cout << "exodiff: WARNING .. The local element " << i+1 << " with global id " << elem_id_map1[i]
<< " in file1 has the global id " << elem_id_map2[i]
<< " in file2.\n";
diff = true;
warn_count++;
if (warn_count > 100) {
std::cout << "exodiff: WARNING .. Too many warnings, skipping remainder...\n";
break;
}
}
}
}
}
file2.Free_Node_Map();
file2.Free_Elmt_Map();
if (diff) std::cout << std::endl;
return diff;
}