35 const ArraySideGIDs& sideGIDs,
36 const shards::CellTopology& cell)
38 unsigned cell_dim = cell.getDimension();
43 bool found_local_side =
false;
45 while ( (side < cell.getSideCount()) && (!found_local_side) ) {
47 const shards::CellTopology
48 side_topo(cell.getCellTopologyData(cell.getDimension()-1, side));
50 unsigned num_side_nodes =
51 cell.getCellTopologyData()->side[side].topology->node_count;
54 std::list<unsigned> tmp_side_gid_list;
55 for (
unsigned node = 0; node < num_side_nodes; ++node)
56 tmp_side_gid_list.push_back(cellGIDs[cell.getNodeMap(cell_dim - 1,
59 bool side_matches =
true;
61 while ( side_matches && (node < num_side_nodes) ) {
63 std::list<unsigned>::iterator search =
64 std::find(tmp_side_gid_list.begin(), tmp_side_gid_list.end(),
67 if (search == tmp_side_gid_list.end())
74 found_local_side =
true;
81 TEUCHOS_TEST_FOR_EXCEPTION(!found_local_side, std::runtime_error,
82 "Failed to find side!");
101 const ArraySideGIDs& subcellGIDs,
102 const shards::CellTopology& cell,
unsigned subcell_dim)
104 unsigned local_subcell;
105 bool found_local_subcell =
false;
106 unsigned subcell = 0;
107 while ( (subcell < cell.getSubcellCount(subcell_dim)) && (!found_local_subcell) ) {
109 unsigned num_subcell_nodes =
110 cell.getCellTopologyData()->subcell[subcell_dim][subcell].topology->node_count;
112 std::list<unsigned> tmp_subcell_gid_list;
113 for (
unsigned node = 0; node < num_subcell_nodes; ++node)
114 tmp_subcell_gid_list.push_back(cellGIDs[cell.getNodeMap(subcell_dim,
117 bool subcell_matches =
true;
119 while ( subcell_matches && (node < num_subcell_nodes) ) {
121 std::list<unsigned>::iterator search =
122 std::find(tmp_subcell_gid_list.begin(), tmp_subcell_gid_list.end(),
125 if (search == tmp_subcell_gid_list.end())
126 subcell_matches =
false;
131 if (subcell_matches) {
132 found_local_subcell =
true;
133 local_subcell = subcell;
139 TEUCHOS_TEST_FOR_EXCEPTION(!found_local_subcell, std::runtime_error,
140 "Failed to find subcell!");
142 return local_subcell;
165 const std::vector<ArraySubcellGIDs> & subcellGIDs,
166 const shards::CellTopology& cell,
unsigned subcell_dim,
167 std::vector<unsigned> & subcellMap)
169 subcellMap.resize(subcellGIDs.size());
173 typename std::vector<ArraySubcellGIDs>::const_iterator subcellIter;
174 for(subcellIter=subcellGIDs.begin();subcellIter!=subcellGIDs.end();++subcellIter) {
178 subcellMap[localSubcell] = index;