48 std::map<std::string, Range> slave_surface_map, master_surface_map;
50 auto fill_surface_map = [&](
auto &surface_map, std::string surface_name) {
54 if (it->getName().compare(0, surface_name.size(), surface_name) == 0) {
58 std::string key = it->getName().substr(surface_name.size());
60 surface_map.insert(std::pair<std::string, Range>(key, tris));
63 "Contact surface name %s used more than once",
64 it->getName().c_str());
72 CHKERR fill_surface_map(slave_surface_map,
"MORTAR_SLAVE");
73 CHKERR fill_surface_map(master_surface_map,
"MORTAR_MASTER");
75 for (
const auto &[key, slave_range] : slave_surface_map) {
76 auto master_search = master_surface_map.find(key);
77 if (master_search != master_surface_map.end()) {
78 contact_surface_pairs.push_back(
79 std::pair<Range, Range>(slave_range, master_search->second));
80 master_surface_map.erase(master_search);
84 "Cannot find pairing contact surface MORTAR_MASTER%s for existing "
85 "surface MORTAR_SLAVE%s",
86 key.c_str(), key.c_str());
90 if (!master_surface_map.empty()) {
91 std::string key = master_surface_map.begin()->first;
94 "Cannot find pairing contact surface MORTAR_SLAVE%s for existing "
95 "surface MORTAR_MASTER%s",
96 key.c_str(), key.c_str());