92 if (
sPtr->ent == ent) {
95 .insert(boost::shared_ptr<SideNumber>(
new SideNumber(ent, 0, 0, 0)))
104 .insert(boost::shared_ptr<SideNumber>(
new SideNumber(ent, 0, 0, 0)))
111 int side_number, sense, offset;
112 rval = moab.side_number(
sPtr->ent, ent, side_number, sense, offset);
115 if (side_number == -1 ||
rval != MB_SUCCESS) {
118 THROW_MESSAGE(
"Huston we have problem, vertex (specified by ent) is not "
119 "part of prism, that is impossible (top tip: check your "
126 rval = moab.get_connectivity(
sPtr->ent, conn, num_nodes,
true);
128 assert(num_nodes == 6);
131 rval = moab.get_connectivity(ent, conn_ent, num_nodes,
true);
147 if (num_nodes == 3) {
148 int sense_p1_map[3][3] = {{0, 1, 2}, {1, 2, 0}, {2, 0, 1}};
149 int sense_m1_map[3][3] = {{0, 2, 1}, {1, 0, 2}, {2, 1, 0}};
150 EntityHandle *conn0_3_ptr = std::find(face3, &face3[3], conn_ent[0]);
151 if (conn0_3_ptr != &face3[3]) {
152 offset = std::distance(face3, conn0_3_ptr);
153 if (face3[sense_p1_map[offset][0]] == conn_ent[0] &&
154 face3[sense_p1_map[offset][1]] == conn_ent[1] &&
155 face3[sense_p1_map[offset][2]] == conn_ent[2]) {
157 .insert(boost::shared_ptr<SideNumber>(
158 new SideNumber(ent, 3, 1, offset)))
161 }
else if (face3[sense_m1_map[offset][0]] == conn_ent[0] &&
162 face3[sense_m1_map[offset][1]] == conn_ent[1] &&
163 face3[sense_m1_map[offset][2]] == conn_ent[2]) {
165 .insert(boost::shared_ptr<SideNumber>(
166 new SideNumber(ent, 3, -1, offset)))
171 EntityHandle *conn0_4_ptr = std::find(face4, &face4[3], conn_ent[0]);
172 if (conn0_4_ptr != &face4[3]) {
173 offset = std::distance(face4, conn0_4_ptr);
174 if (face4[sense_p1_map[offset][0]] == conn_ent[0] &&
175 face4[sense_p1_map[offset][1]] == conn_ent[1] &&
176 face4[sense_p1_map[offset][2]] == conn_ent[2]) {
178 .insert(boost::shared_ptr<SideNumber>(
179 new SideNumber(ent, 4, 1, 3 + offset)))
182 }
else if (face4[sense_m1_map[offset][0]] == conn_ent[0] &&
183 face4[sense_m1_map[offset][1]] == conn_ent[1] &&
184 face4[sense_m1_map[offset][2]] == conn_ent[2]) {
186 .insert(boost::shared_ptr<SideNumber>(
187 new SideNumber(ent, 4, -1, 3 + offset)))
191 std::cerr << conn_ent[0] <<
" " << conn_ent[1] <<
" " << conn_ent[2]
193 std::cerr << face3[0] <<
" " << face3[1] <<
" " << face3[2]
195 std::cerr << face4[0] <<
" " << face4[1] <<
" " << face4[2]
197 std::cerr << offset << std::endl;
204 if (num_nodes == 2) {
208 {conn[0], conn[1]} , {conn[1], conn[2]} ,
209 {conn[2], conn[0]} , {conn[3], conn[4]} ,
210 {conn[4], conn[5]} , {conn[5], conn[3]}
212 for (
int ee = 0; ee < 6; ee++) {
213 if (((conn_ent[0] == edges[ee][0]) &&
214 (conn_ent[1] == edges[ee][1])) ||
215 ((conn_ent[0] == edges[ee][1]) &&
216 (conn_ent[1] == edges[ee][0]))) {
221 std::find(face4, &face4[3], conn_ent[0]);
222 offset = std::distance(face4, conn0_4_ptr) + 3;
225 std::find(face3, &face3[3], conn_ent[0]);
226 offset = std::distance(face3, conn0_3_ptr);
229 if ((conn_ent[0] == edges[ee][1]) && (conn_ent[1] == edges[ee][0]))
232 .insert(boost::shared_ptr<SideNumber>(
233 new SideNumber(ent, side_number, sense, offset)))
268 std::ostringstream sss;
270 <<
" " << MBEDGE <<
" " << MBTRI << std::endl;
274 .insert(boost::shared_ptr<SideNumber>(
275 new SideNumber(ent, side_number, sense, offset)))