15 namespace panzer_stk {
19 const std::string& side_b_name,
22 const bool print_debug =
false;
25 std::vector<stk::mesh::EntityId> gids_a;
27 std::vector<stk::mesh::Entity> nodes_a;
28 stk::mesh::Part* part_a = mesh.
getSideset(side_a_name);
30 "panzer::checkSidesetOverlap: Unknown side set name \"" << side_a_name <<
"\"");
31 stk::mesh::Selector selector_a = *part_a & mesh.
getMetaData()->locally_owned_part();
32 const bool sort_by_gid =
true;
33 stk::mesh::get_selected_entities(selector_a,mesh.
getBulkData()->buckets(mesh.
getNodeRank()),nodes_a,sort_by_gid);
35 gids_a.resize(nodes_a.size());
37 for (
auto&& node : nodes_a) {
44 std::vector<stk::mesh::EntityId> gids_b;
46 std::vector<stk::mesh::Entity> nodes_b;
47 stk::mesh::Part* part_b = mesh.
getSideset(side_b_name);
49 "panzer::checkSidesetOverlap: Unknown side set name \"" << side_b_name <<
"\"");
50 stk::mesh::Selector selector_b = *part_b;
51 const bool sort_by_gid =
true;
52 stk::mesh::get_selected_entities(selector_b,mesh.
getBulkData()->buckets(mesh.
getNodeRank()),nodes_b,sort_by_gid);
54 gids_b.resize(nodes_b.size());
56 for (
auto&& node : nodes_b) {
63 std::sort(gids_b.begin(),gids_b.end());
69 os <<
"gids_a.size()=" << gids_a.size() << std::endl;
70 for (
auto&& gid : gids_a)
71 os <<
"gid_a=" << gid << std::endl;
72 os <<
"gids_b.size()=" << gids_b.size() << std::endl;
73 for (
auto&& gid : gids_b)
74 os <<
"gid_b=" << gid << std::endl;
80 int has_local_overlap = 0;
81 for (
auto&& a : gids_a) {
82 if (std::binary_search(gids_b.begin(),gids_b.end(),a)) {
83 has_local_overlap = 1;
bool checkSidesetOverlap(const std::string &side_a_name, const std::string &side_b_name, const panzer_stk::STK_Interface &mesh)
Returns true if the sidesets overlap.
basic_FancyOStream & setShowProcRank(const bool showProcRank)
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
stk::mesh::Part * getSideset(const std::string &name) const
Teuchos::RCP< stk::mesh::BulkData > getBulkData() const
Teuchos::RCP< stk::mesh::MetaData > getMetaData() const
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
get the comm associated with this mesh
stk::mesh::EntityRank getNodeRank() const