38 #include <loki/Singleton.h>
64 Loki::NoDestroy > Type;
65 return Type::Instance();
69 unsigned int pNumNodes,
70 unsigned int pGotNodes)
75 if (pNumNodes != pGotNodes)
77 cerr <<
"Number of modes mismatch for type "
78 << pConf.
m_e <<
"! Should be " << pNumNodes
79 <<
" but got " << pGotNodes <<
" nodes." << endl;
98 unsigned int i, nElmt = 0;
112 unsigned int nEnt = 0;
114 for (
unsigned int d = 0; d <=
m_expDim; ++d)
128 int i, n = c1->type.size();
130 if (n != c2->type.size())
135 for (i = 0; i < n; ++i)
137 if (c1->type[i] != c2->type[i])
142 if (c1->field[i] != c2->field[i] || c1->value[i] != c2->value[i])
169 os << n->m_x <<
" " << n->m_y <<
" " << n->m_z;
179 return ( ((*(p1->m_n1) == *(p2->m_n1)) && (*(p1->m_n2) == *(p2->m_n2)))
180 || ((*(p1->m_n2) == *(p2->m_n1)) && (*(p1->m_n1) == *(p2->m_n2))));
188 return p1->m_id < p2->m_id;
198 for (it1 = p1->m_vertexList.begin(); it1 != p1->m_vertexList.end(); ++it1)
200 if (
find(p2->m_vertexList.begin(), p2->m_vertexList.end(), *it1)
201 == p2->m_vertexList.end())
215 return p1->m_id < p2->m_id;
232 for (
unsigned int i = 0; i <
m_edge.size(); ++i)
234 if (
m_edge[i]->m_n1 == vOld)
238 else if (
m_edge[i]->m_n2 == vOld)
243 for (
unsigned int i = 0; i <
m_face.size(); ++i)
246 for (
unsigned int j = 0; j <
m_face[i]->m_vertexList.size(); ++j)
248 if (
m_face[i]->m_vertexList[j] == vOld)
250 m_face[i]->m_vertexList[j] = pNew;
253 for (
unsigned int j = 0; j <
m_face[i]->m_edgeList.size(); ++j)
255 if (
m_face[i]->m_edgeList[j]->m_n1 == vOld)
257 m_face[i]->m_edgeList[j]->m_n1 = pNew;
259 else if (
m_face[i]->m_edgeList[j]->m_n2 == vOld)
261 m_face[i]->m_edgeList[j]->m_n2 = pNew;
280 for (
unsigned int i = 0; i <
m_face.size(); ++i)
282 for (
unsigned int j = 0; j <
m_face[i]->m_edgeList.size(); ++j)
284 if (
m_face[i]->m_edgeList[j] == vOld)
286 m_face[i]->m_edgeList[j] = pNew;
312 for (i = 0; i <
m_edge.size(); ++i)
314 int edgeOrder =
m_edge[i]->GetNodeCount()-1;
333 #if 0 // turn this option off since causes problem with InputNekpp.cpp
347 st <<
" " <<
m_tag <<
"[" << vId;
352 vId = (*it)->GetId();
355 if (prevId > -1 && vId == prevId + 1)
388 vector<NodeSharedPtr> pNodeList,
389 vector<int> pTagList)
390 :
Element(pConf, GetNumNodes(pConf), pNodeList.size())
414 vector<NodeSharedPtr> pNodeList,
415 vector<int> pTagList)
416 :
Element(pConf, GetNumNodes(pConf), pNodeList.size())
424 for (
int i = 0; i < 2; ++i) {
427 vector<NodeSharedPtr> edgeNodes;
429 for (
int j = 0; j<n; ++j) {
430 edgeNodes.push_back(pNodeList[2+j]);
433 m_edge.push_back(boost::shared_ptr<Edge>(
443 p[0] =
m_vertex[0]->GetGeom(coordDim);
444 p[1] =
m_vertex[1]->GetGeom(coordDim);
446 if (
m_edge[0]->m_edgeNodes.size() > 0)
452 c->m_points.push_back(p[0]);
453 for (
int i = 0; i <
m_edge[0]->m_edgeNodes.size(); ++i)
455 c->m_points.push_back(
m_edge[0]->m_edgeNodes[i]->
GetGeom(coordDim));
457 c->m_points.push_back(p[1]);
487 vector<NodeSharedPtr> pNodeList,
488 vector<int> pTagList)
489 :
Element(pConf, GetNumNodes(pConf), pNodeList.size())
500 map<pair<int,int>,
int> edgeNodeMap;
502 edgeNodeMap[pair<int,int>(1,2)] = 4;
503 edgeNodeMap[pair<int,int>(2,3)] = 4 + n;
504 edgeNodeMap[pair<int,int>(3,1)] = 4 + 2*n;
509 for (
int i = 0; i < 3; ++i) {
512 sum += (pNodeList[o]->m_x - pNodeList[i]->m_x) *
513 (pNodeList[o]->m_y + pNodeList[i]->m_y);
517 for (it = edgeNodeMap.begin(); it != edgeNodeMap.end(); ++it)
519 vector<NodeSharedPtr> edgeNodes;
521 for (
int j = it->second; j < it->second + n; ++j) {
522 edgeNodes.push_back(pNodeList[j-1]);
526 pNodeList[it->first.second-1],
553 for (
int i = 0; i < 3; ++i)
555 edges[i] =
m_edge [i]->GetGeom(coordDim);
556 verts[i] =
m_vertex[i]->GetGeom(coordDim);
578 return (n+1)+2*(n-1)+1;
580 return (n+1)*(n+2)/2;
623 int nqtot = tri->GetTotPoints();
624 Array<OneD, NekDouble> alloc(6*nqtot);
625 Array<OneD, NekDouble> xi(alloc);
626 Array<OneD, NekDouble> yi(alloc+ nqtot);
627 Array<OneD, NekDouble> zi(alloc+2*nqtot);
628 Array<OneD, NekDouble> xo(alloc+3*nqtot);
629 Array<OneD, NekDouble> yo(alloc+4*nqtot);
630 Array<OneD, NekDouble> zo(alloc+5*nqtot);
631 Array<OneD, NekDouble> tmp;
633 tri->GetCoords(xi, yi, zi);
635 for (i = 0; i < 3; ++i)
637 Array<OneD, NekDouble> coeffs(nodalTri->GetNcoeffs());
638 tri->FwdTrans(alloc+i*nqtot, coeffs);
640 nodalTri->ModalToNodal(coeffs, tmp=alloc+(i+3)*nqtot);
645 for (i = 0; i < 3; ++i)
647 int pos = 3 + i*(order-1);
648 m_edge[i]->m_edgeNodes.clear();
649 for (j = 0; j < order-1; ++j)
651 m_edge[i]->m_edgeNodes.push_back(
657 int pos = 3 + 3*(order-1);
658 for (i = pos; i < (order+1)*(order+2)/2; ++i)
678 vector<NodeSharedPtr> pNodeList,
679 vector<int> pTagList)
680 :
Element(pConf, GetNumNodes(pConf), pNodeList.size())
690 map<pair<int,int>,
int> edgeNodeMap;
692 edgeNodeMap[pair<int,int>(1,2)] = 5;
693 edgeNodeMap[pair<int,int>(2,3)] = 5 + n;
694 edgeNodeMap[pair<int,int>(3,4)] = 5 + 2*n;
695 edgeNodeMap[pair<int,int>(4,1)] = 5 + 3*n;
700 for (
int i = 0; i < 4; ++i) {
703 sum += (pNodeList[o]->m_x - pNodeList[i]->m_x) *
704 (pNodeList[o]->m_y + pNodeList[i]->m_y);
708 for (it = edgeNodeMap.begin(); it != edgeNodeMap.end(); ++it)
710 vector<NodeSharedPtr> edgeNodes;
712 for (
int j = it->second; j < it->second + n; ++j) {
713 edgeNodes.push_back(pNodeList[j-1]);
717 pNodeList[it->first.second-1],
755 int nqtot = quad->GetTotPoints();
756 Array<OneD, NekDouble> alloc(3*nqtot);
757 Array<OneD, NekDouble> x (alloc );
758 Array<OneD, NekDouble> y (alloc+1*nqtot);
759 Array<OneD, NekDouble> z (alloc+2*nqtot);
761 quad->GetCoords(x, y, z);
765 int edgeMap[4][2] = {{0,1},{order,order+1},
766 {nqtot-1,-1},{order*(order+1),-order-1}};
768 for (
int i = 0; i < 4; ++i)
770 int pos = edgeMap[i][0] + edgeMap[i][1];
771 m_edge[i]->m_edgeNodes.clear();
777 for (
int j = 1; j < order; ++j, pos += edgeMap[i][1])
780 m_edge[i]->m_edgeNodes.push_back(
787 for (
int i = 1; i < order; ++i)
789 int pos = i*(order+1);
790 for (
int j = 1; j < order; ++j)
809 for (
int i = 0; i < 4; ++i)
811 edges[i] =
m_edge [i]->GetGeom(coordDim);
812 verts[i] =
m_vertex[i]->GetGeom(coordDim);
848 vector<NodeSharedPtr> pNodeList,
849 vector<int> pTagList)
859 map<pair<int,int>,
int> edgeNodeMap;
861 edgeNodeMap[pair<int,int>(1,2)] = 5;
862 edgeNodeMap[pair<int,int>(2,3)] = 5 + n;
863 edgeNodeMap[pair<int,int>(1,3)] = 5 + 2*n;
864 edgeNodeMap[pair<int,int>(1,4)] = 5 + 3*n;
865 edgeNodeMap[pair<int,int>(2,4)] = 5 + 4*n;
866 edgeNodeMap[pair<int,int>(3,4)] = 5 + 5*n;
869 for (
int i = 0; i < 4; ++i) {
875 for (it = edgeNodeMap.begin(); it != edgeNodeMap.end(); ++it)
877 vector<NodeSharedPtr> edgeNodes;
879 for (
int j = it->second; j < it->second + n; ++j) {
880 edgeNodes.push_back(pNodeList[j-1]);
884 pNodeList[it->first.second-1],
887 m_edge.back()->m_id = eid++;
898 int face_ids[4][3] = {
899 {0,1,2},{0,1,3},{1,2,3},{0,2,3}};
900 int face_edges[4][3];
902 for (
int j = 0; j < 4; ++j)
904 vector<NodeSharedPtr> faceVertices;
905 vector<EdgeSharedPtr> faceEdges;
906 vector<NodeSharedPtr> faceNodes;
907 for (
int k = 0; k < 3; ++k)
909 faceVertices.push_back(
m_vertex[face_ids[j][k]]);
912 for (
unsigned int i = 0; i <
m_edge.size(); ++i)
914 if ( ((*(
m_edge[i]->m_n1)==*a) && (*(
m_edge[i]->m_n2)==*b))
915 || ((*(
m_edge[i]->m_n1)==*b) && (*(
m_edge[i]->m_n2) == *a)) )
917 face_edges[j][k] = i;
918 faceEdges.push_back(
m_edge[i]);
926 int N = 4 + 6*n + j*n*(n-1)/2;
927 for (
int i = 0; i < n*(n-1)/2; ++i)
929 faceNodes.push_back(pNodeList[N+i]);
936 vector<EdgeSharedPtr> tmp(6);
937 tmp[0] =
m_edge[face_edges[0][0]];
938 tmp[1] =
m_edge[face_edges[0][1]];
939 tmp[2] =
m_edge[face_edges[0][2]];
940 tmp[3] =
m_edge[face_edges[1][2]];
941 tmp[4] =
m_edge[face_edges[1][1]];
942 tmp[5] =
m_edge[face_edges[2][1]];
951 for (
int i = 0; i < 4; ++i)
953 tfaces[i] = boost::dynamic_pointer_cast
970 return (n+1)*(n+2)*(n+3)/6;
972 return 4*(n+1)*(n+2)/2-6*(n+1)+4;
1004 Array<OneD, NekDouble> x, y, z;
1006 nodalTet->GetNodalPoints(x,y,z);
1032 int nqtot = tet->GetTotPoints();
1033 Array<OneD, NekDouble> alloc(6*nqtot);
1034 Array<OneD, NekDouble> xi(alloc);
1035 Array<OneD, NekDouble> yi(alloc+ nqtot);
1036 Array<OneD, NekDouble> zi(alloc+2*nqtot);
1037 Array<OneD, NekDouble> xo(alloc+3*nqtot);
1038 Array<OneD, NekDouble> yo(alloc+4*nqtot);
1039 Array<OneD, NekDouble> zo(alloc+5*nqtot);
1040 Array<OneD, NekDouble> tmp;
1042 tet->GetCoords(xi, yi, zi);
1044 for (i = 0; i < 3; ++i)
1046 Array<OneD, NekDouble> coeffs(nodalTet->GetNcoeffs());
1047 tet->FwdTrans(alloc+i*nqtot, coeffs);
1049 nodalTet->ModalToNodal(coeffs, tmp=alloc+(i+3)*nqtot);
1054 for (i = 0; i < 6; ++i)
1056 int pos = 4 + i*(order-1);
1057 m_edge[i]->m_edgeNodes.clear();
1058 for (j = 0; j < order-1; ++j)
1060 m_edge[i]->m_edgeNodes.push_back(
1066 for (i = 0; i < 4; ++i)
1068 int pos = 4 + 6*(order-1) + i*(order-2)*(order-1)/2;
1069 m_face[i]->m_faceNodes.clear();
1070 for (j = 0; j < (order-2)*(order-1)/2; ++j)
1072 m_face[i]->m_faceNodes.push_back(
1078 int pos = 4 + 6*(order-1) + 4*(order-2)*(order-1)/2;
1079 for (i = pos; i < (order+1)*(order+2)*(order+3)/6; ++i)
1101 return boost::hash_range(p.
nid.begin(), p.
nid.end());
1104 typedef boost::unordered_set<struct TetOrient, TetOrientHash>
TetOrientSet;
1108 if (a.
nid.size() != b.
nid.size())
1113 for (
int i = 0; i < a.
nid.size(); ++i)
1115 if (a.
nid[i] != b.
nid[i])
1139 static int face_ids[4][3] = {
1140 {0,1,2},{0,1,3},{1,2,3},{0,2,3}};
1147 for (
int i = 0; i < 4; ++i)
1149 vector<int> nodes(3);
1151 nodes[0] =
m_vertex[face_ids[i][0]]->m_id;
1152 nodes[1] =
m_vertex[face_ids[i][1]]->m_id;
1153 nodes[2] =
m_vertex[face_ids[i][2]]->m_id;
1155 sort(nodes.begin(), nodes.end());
1157 faces.insert(faceNodes);
1177 double vol = cx*(ay*bz-az*by)+cy*(az*bx-ax*bz)+cz*(ax*by-ay*bx);
1180 if (fabs(vol) <= 1e-10)
1182 cerr <<
"Warning: degenerate tetrahedron, volume = " << vol << endl;
1194 for (
int i = 0; i < 4; ++i)
1196 vector<int> nodes(3);
1198 nodes[0] =
m_vertex[face_ids[i][0]]->m_id;
1199 nodes[1] =
m_vertex[face_ids[i][1]]->m_id;
1200 nodes[2] =
m_vertex[face_ids[i][2]]->m_id;
1201 sort(nodes.begin(), nodes.end());
1205 it = faces.find(faceNodes);
1217 vector<NodeSharedPtr> pNodeList,
1218 vector<int> pTagList)
1219 :
Element(pConf, GetNumNodes(pConf), pNodeList.size())
1227 map<pair<int,int>,
int> edgeNodeMap;
1229 edgeNodeMap[pair<int,int>(1,2)] = 6;
1230 edgeNodeMap[pair<int,int>(2,3)] = 6 + n;
1231 edgeNodeMap[pair<int,int>(4,3)] = 6 + 2*n;
1232 edgeNodeMap[pair<int,int>(1,4)] = 6 + 3*n;
1233 edgeNodeMap[pair<int,int>(1,5)] = 6 + 4*n;
1234 edgeNodeMap[pair<int,int>(2,5)] = 6 + 5*n;
1235 edgeNodeMap[pair<int,int>(3,5)] = 6 + 6*n;
1236 edgeNodeMap[pair<int,int>(4,5)] = 6 + 7*n;
1239 for (
int i = 0; i < 5; ++i)
1246 for (it = edgeNodeMap.begin(); it != edgeNodeMap.end(); ++it)
1248 vector<NodeSharedPtr> edgeNodes;
1251 for (
int j = it->second; j < it->second + n; ++j)
1253 edgeNodes.push_back(pNodeList[j-1]);
1258 pNodeList[it->first.second-1],
1261 m_edge.back()->m_id = eid++;
1265 int face_ids[5][4] = {
1266 {0,1,2,3}, {0,1,4,-1}, {1,2,4,-1}, {3,2,4,-1}, {0,3,4,-1}
1268 int face_edges[5][4];
1270 for (
int j = 0; j < 5; ++j)
1272 vector<NodeSharedPtr> faceVertices;
1273 vector<EdgeSharedPtr> faceEdges;
1274 vector<NodeSharedPtr> faceNodes;
1275 int nEdge = j > 0 ? 3 : 4;
1277 for (
int k = 0; k < nEdge; ++k)
1279 faceVertices.push_back(
m_vertex[face_ids[j][k]]);
1282 for (
unsigned int i = 0; i <
m_edge.size(); ++i)
1287 faceEdges.push_back(
m_edge[i]);
1288 face_edges[j][k] = i;
1296 int facenodes = j == 0 ? n*n : n*(n-1)/2;
1297 faceoffset += facenodes;
1298 int N = 6 + 9*n + faceoffset;
1299 for (
int i = 0; i < facenodes; ++i)
1301 faceNodes.push_back(pNodeList[N+i]);
1308 vector<EdgeSharedPtr> tmp(8);
1309 tmp[0] =
m_edge[face_edges[0][0]];
1310 tmp[1] =
m_edge[face_edges[0][1]];
1311 tmp[2] =
m_edge[face_edges[0][2]];
1312 tmp[3] =
m_edge[face_edges[0][3]];
1313 tmp[4] =
m_edge[face_edges[1][2]];
1314 tmp[5] =
m_edge[face_edges[1][1]];
1315 tmp[6] =
m_edge[face_edges[3][1]];
1316 tmp[7] =
m_edge[face_edges[3][2]];
1324 for (
int i = 0; i < 5; ++i)
1326 faces[i] =
m_face[i]->GetGeom(coordDim);
1351 vector<NodeSharedPtr> pNodeList,
1352 vector<int> pTagList)
1353 :
Element(pConf, GetNumNodes(pConf), pNodeList.size())
1363 map<pair<int,int>,
int> edgeNodeMap;
1367 edgeNodeMap[pair<int,int>(1,2)] = 7;
1368 edgeNodeMap[pair<int,int>(2,3)] = 7 + n;
1369 edgeNodeMap[pair<int,int>(4,3)] = 7 + 2*n;
1370 edgeNodeMap[pair<int,int>(1,4)] = 7 + 3*n;
1371 edgeNodeMap[pair<int,int>(1,5)] = 7 + 4*n;
1372 edgeNodeMap[pair<int,int>(2,5)] = 7 + 5*n;
1373 edgeNodeMap[pair<int,int>(3,6)] = 7 + 6*n;
1374 edgeNodeMap[pair<int,int>(4,6)] = 7 + 7*n;
1375 edgeNodeMap[pair<int,int>(5,6)] = 7 + 8*n;
1378 for (
int i = 0; i < 6; ++i)
1385 for (it = edgeNodeMap.begin(); it != edgeNodeMap.end(); ++it)
1387 vector<NodeSharedPtr> edgeNodes;
1389 for (
int j = it->second; j < it->second + n; ++j) {
1390 edgeNodes.push_back(pNodeList[j-1]);
1394 new Edge(pNodeList[it->first.first-1],
1395 pNodeList[it->first.second-1],
1398 m_edge.back()->m_id = eid++;
1407 int face_ids[5][4] = {
1408 {0,1,2,3},{0,1,4,-1},{1,2,5,4},{3,2,5,-1},{0,3,5,4}};
1409 int face_edges[5][4];
1411 for (
int j = 0; j < 5; ++j)
1413 vector<NodeSharedPtr> faceVertices;
1414 vector<EdgeSharedPtr> faceEdges;
1415 vector<NodeSharedPtr> faceNodes;
1416 int nEdge = 3 - (j % 2 - 1);
1418 for (
int k = 0; k < nEdge; ++k)
1420 faceVertices.push_back(
m_vertex[face_ids[j][k]]);
1423 for (
unsigned int i = 0; i <
m_edge.size(); ++i)
1428 faceEdges.push_back(
m_edge[i]);
1429 face_edges[j][k] = i;
1437 int facenodes = j%2==0 ? n*n : n*(n-1)/2;
1438 faceoffset += facenodes;
1439 int N = 6 + 9*n + faceoffset;
1440 for (
int i = 0; i < facenodes; ++i)
1442 faceNodes.push_back(pNodeList[N+i]);
1450 vector<EdgeSharedPtr> tmp(9);
1451 tmp[0] =
m_edge[face_edges[0][0]];
1452 tmp[1] =
m_edge[face_edges[0][1]];
1453 tmp[2] =
m_edge[face_edges[0][2]];
1454 tmp[3] =
m_edge[face_edges[0][3]];
1455 tmp[4] =
m_edge[face_edges[1][2]];
1456 tmp[5] =
m_edge[face_edges[1][1]];
1457 tmp[6] =
m_edge[face_edges[2][1]];
1458 tmp[7] =
m_edge[face_edges[3][2]];
1459 tmp[8] =
m_edge[face_edges[4][2]];
1470 return (n+1)*(n+1)*(n+2)/2;
1472 return 3*(n+1)*(n+1)+2*(n+1)*(n+2)/2-9*(n+1)+6;
1482 for (
int i = 0; i < 5; ++i)
1484 faces[i] =
m_face[i]->GetGeom(coordDim);
1520 Array<OneD, NekDouble> x, y, z;
1521 nodalPrism->GetNodalPoints(x,y,z);
1547 int nqtot = prism->GetTotPoints();
1548 Array<OneD, NekDouble> alloc(6*nqtot);
1549 Array<OneD, NekDouble> xi(alloc);
1550 Array<OneD, NekDouble> yi(alloc+ nqtot);
1551 Array<OneD, NekDouble> zi(alloc+2*nqtot);
1552 Array<OneD, NekDouble> xo(alloc+3*nqtot);
1553 Array<OneD, NekDouble> yo(alloc+4*nqtot);
1554 Array<OneD, NekDouble> zo(alloc+5*nqtot);
1555 Array<OneD, NekDouble> tmp;
1557 prism->GetCoords(xi, yi, zi);
1559 for (i = 0; i < 3; ++i)
1561 Array<OneD, NekDouble> coeffs(nodalPrism->GetNcoeffs());
1562 prism->FwdTrans(alloc+i*nqtot, coeffs);
1564 nodalPrism->ModalToNodal(coeffs, tmp=alloc+(i+3)*nqtot);
1569 for (i = 0; i < 9; ++i)
1571 pos = 6 + i*(order-1);
1572 m_edge[i]->m_edgeNodes.clear();
1573 for (j = 0; j < order-1; ++j)
1575 m_edge[i]->m_edgeNodes.push_back(
1581 pos = 6 + 9*(order-1);
1582 for (i = 0; i < 5; ++i)
1584 int facesize = i % 2 ? (order-2)*(order-1)/2 : (order-1)*(order-1);
1585 m_face[i]->m_faceNodes.clear();
1586 for (j = 0; j < facesize; ++j)
1588 m_face[i]->m_faceNodes.push_back(
1595 for (i = pos; i < (order+1)*(order+1)*(order+2)/2; ++i)
1632 for (
int i = 0; i < 6; ++i)
1638 gid[0] = gid[3] = max(gid[0], gid[3]);
1639 gid[1] = gid[2] = max(gid[1], gid[2]);
1640 gid[4] = gid[5] = max(gid[4], gid[5]);
1642 for (
int i = 1; i < 6; ++i)
1644 if (gid[0] < gid[i])
1646 swap(gid[i], gid[0]);
1647 swap(lid[i], lid[0]);
1651 if (lid[0] == 4 || lid[0] == 5)
1655 else if (lid[0] == 1 || lid[0] == 2)
1658 vector<NodeSharedPtr> vertexmap(6);
1668 else if (lid[0] == 0 || lid[0] == 3)
1671 vector<NodeSharedPtr> vertexmap(6);
1683 cerr <<
"Warning: possible prism orientation problem." << endl;
1695 vector<NodeSharedPtr> pNodeList,
1696 vector<int> pTagList)
1697 :
Element(pConf, GetNumNodes(pConf), pNodeList.size())
1706 map<pair<int,int>,
int> edgeNodeMap;
1708 edgeNodeMap[pair<int,int>(1,2)] = 9;
1709 edgeNodeMap[pair<int,int>(1,4)] = 9 + n;
1710 edgeNodeMap[pair<int,int>(1,5)] = 9 + 2*n;
1711 edgeNodeMap[pair<int,int>(2,3)] = 9 + 3*n;
1712 edgeNodeMap[pair<int,int>(2,6)] = 9 + 4*n;
1713 edgeNodeMap[pair<int,int>(3,4)] = 9 + 5*n;
1714 edgeNodeMap[pair<int,int>(3,7)] = 9 + 6*n;
1715 edgeNodeMap[pair<int,int>(4,8)] = 9 + 7*n;
1716 edgeNodeMap[pair<int,int>(5,6)] = 9 + 8*n;
1717 edgeNodeMap[pair<int,int>(5,8)] = 9 + 9*n;
1718 edgeNodeMap[pair<int,int>(6,7)] = 9 + 10*n;
1719 edgeNodeMap[pair<int,int>(7,8)] = 9 + 11*n;
1722 for (
int i = 0; i < 8; ++i) {
1727 for (it = edgeNodeMap.begin(); it != edgeNodeMap.end(); ++it)
1729 vector<NodeSharedPtr> edgeNodes;
1731 for (
int j = it->second; j < it->second + n; ++j) {
1732 edgeNodes.push_back(pNodeList[j-1]);
1736 pNodeList[it->first.second-1],
1742 int face_ids[6][4] = {
1743 {0,1,2,3},{0,1,5,4},{1,2,6,5},{2,3,7,6},{3,0,4,7},{4,5,6,7}};
1744 for (
int j = 0; j < 6; ++j)
1746 vector<NodeSharedPtr> faceVertices;
1747 vector<EdgeSharedPtr> faceEdges;
1748 vector<NodeSharedPtr> faceNodes;
1749 for (
int k = 0; k < 4; ++k)
1751 faceVertices.push_back(
m_vertex[face_ids[j][k]]);
1754 for (
unsigned int i = 0; i <
m_edge.size(); ++i)
1756 if ( ((*(
m_edge[i]->m_n1)==*a) && (*(
m_edge[i]->m_n2)==*b))
1757 || ((*(
m_edge[i]->m_n1)==*b) && (*(
m_edge[i]->m_n2) == *a)) )
1759 faceEdges.push_back(
m_edge[i]);
1767 int N = 8 + 12*n + j*n*n;
1768 for (
int i = 0; i < n*n; ++i)
1770 faceNodes.push_back(pNodeList[N+i]);
1783 for (
int i = 0; i < 6; ++i)
1785 faces[i] = boost::dynamic_pointer_cast
1802 return (n+1)*(n+1)*(n+1);
1804 return 6*(n+1)*(n+1)-12*(n+1)+8;