48 namespace SpatialDomains
75 int order0, points0, order1, points1;
79 tmp.push_back(faces[0]->
GetXmap()->GetEdgeNcoeffs(0));
80 tmp.push_back(faces[0]->
GetXmap()->GetEdgeNcoeffs(2));
81 order0 = *max_element(tmp.begin(), tmp.end());
84 tmp.push_back(faces[0]->
GetXmap()->GetEdgeNumPoints(0));
85 tmp.push_back(faces[0]->
GetXmap()->GetEdgeNumPoints(2));
86 points0 = *max_element(tmp.begin(), tmp.end());
90 tmp.push_back(faces[0]->
GetXmap()->GetEdgeNcoeffs(1));
91 tmp.push_back(faces[0]->
GetXmap()->GetEdgeNcoeffs(3));
92 order0 = *max_element(tmp.begin(), tmp.end());
95 tmp.push_back(faces[0]->
GetXmap()->GetEdgeNumPoints(1));
96 tmp.push_back(faces[0]->
GetXmap()->GetEdgeNumPoints(3));
97 points0 = *max_element(tmp.begin(), tmp.end());
103 tmp.push_back(faces[0]->
GetXmap()->GetEdgeNcoeffs(1));
104 tmp.push_back(faces[0]->
GetXmap()->GetEdgeNcoeffs(3));
105 tmp.push_back(faces[2]->
GetXmap()->GetEdgeNcoeffs(2));
106 order1 = *max_element(tmp.begin(), tmp.end());
109 tmp.push_back(faces[0]->
GetXmap()->GetEdgeNumPoints(1));
110 tmp.push_back(faces[0]->
GetXmap()->GetEdgeNumPoints(3));
111 tmp.push_back(faces[2]->
GetXmap()->GetEdgeNumPoints(2));
112 points1 = *max_element(tmp.begin(), tmp.end());
117 tmp.push_back(faces[0]->
GetXmap()->GetEdgeNcoeffs(0));
118 tmp.push_back(faces[0]->
GetXmap()->GetEdgeNcoeffs(2));
119 tmp.push_back(faces[2]->
GetXmap()->GetEdgeNcoeffs(2));
120 order1 = *max_element(tmp.begin(), tmp.end());
123 tmp.push_back(faces[0]->
GetXmap()->GetEdgeNumPoints(0));
124 tmp.push_back(faces[0]->
GetXmap()->GetEdgeNumPoints(2));
125 tmp.push_back(faces[2]->
GetXmap()->GetEdgeNumPoints(2));
126 points1 = *max_element(tmp.begin(), tmp.end());
130 tmp.push_back(order0);
131 tmp.push_back(order1);
132 tmp.push_back(faces[1]->
GetXmap()->GetEdgeNcoeffs(1));
133 tmp.push_back(faces[1]->
GetXmap()->GetEdgeNcoeffs(2));
134 tmp.push_back(faces[3]->
GetXmap()->GetEdgeNcoeffs(1));
135 tmp.push_back(faces[3]->
GetXmap()->GetEdgeNcoeffs(2));
136 int order2 = *max_element(tmp.begin(), tmp.end());
139 tmp.push_back(points0);
140 tmp.push_back(points1);
141 tmp.push_back(faces[1]->
GetXmap()->GetEdgeNumPoints(1));
142 tmp.push_back(faces[1]->
GetXmap()->GetEdgeNumPoints(2));
143 tmp.push_back(faces[3]->
GetXmap()->GetEdgeNumPoints(1));
144 tmp.push_back(faces[3]->
GetXmap()->GetEdgeNumPoints(2));
149 int points2 = *max_element(tmp.begin(), tmp.end());
186 if (
m_xmap->GetBasisNumModes(0) != 2 ||
187 m_xmap->GetBasisNumModes(1) != 2 ||
188 m_xmap->GetBasisNumModes(2) != 2 )
219 const Array<OneD, const NekDouble> &coords,
220 Array<OneD, NekDouble> &Lcoords)
243 cp1030.
Mult(e10,e30);
244 cp3040.
Mult(e30,e40);
245 cp4010.
Mult(e40,e10);
259 Lcoords[0] = 2.0*beta - 1.0;
260 Lcoords[1] = 2.0*gamma - 1.0;
261 Lcoords[2] = 2.0*delta - 1.0;
266 "inverse mapping must be set up to use this call");
287 else if (faceidx == 1 || faceidx == 3)
307 for (f = 1; f < 5; f++)
309 int nEdges =
m_faces[f]->GetNumEdges();
311 for (i = 0; i < 4; i++)
313 for (j = 0; j < nEdges; j++)
326 std::ostringstream errstrm;
327 errstrm <<
"Connected faces do not share an edge. Faces ";
333 std::ostringstream errstrm;
334 errstrm <<
"Connected faces share more than one edge. Faces ";
342 for(i = 0; i < 3; i++)
344 for(j = 0; j < 3; j++)
356 std::ostringstream errstrm;
357 errstrm <<
"Connected faces do not share an edge. Faces ";
363 std::ostringstream errstrm;
364 errstrm <<
"Connected faces share more than one edge. Faces ";
370 for (f = 1; f < 4; f++)
373 for(i = 0; i <
m_faces[f]->GetNumEdges(); i++)
375 for(j = 0; j <
m_faces[f+1]->GetNumEdges(); j++)
388 std::ostringstream errstrm;
389 errstrm <<
"Connected faces do not share an edge. Faces ";
395 std::ostringstream errstrm;
396 errstrm <<
"Connected faces share more than one edge. Faces ";
420 std::ostringstream errstrm;
421 errstrm <<
"Connected edges do not share a vertex. Edges ";
427 for(
int i = 1; i < 3; i++)
439 std::ostringstream errstrm;
440 errstrm <<
"Connected edges do not share a vertex. Edges ";
441 errstrm <<
m_edges[i]->GetEid() <<
", " <<
m_edges[i-1]->GetEid();
457 for (
int i = 5; i < 8; ++i)
468 std::ostringstream errstrm;
469 errstrm <<
"Connected edges do not share a vertex. Edges ";
480 const unsigned int edgeVerts[
kNedges][2] =
481 { {0,1}, {1,2}, {3,2}, {0,3}, {0,4}, {1,4}, {2,4}, {3,4} };
496 ASSERTL0(
false,
"Could not find matching vertex for the edge");
510 Array<OneD,NekDouble> elementAaxis(
m_coordim);
511 Array<OneD,NekDouble> elementBaxis(
m_coordim);
517 Array<OneD,NekDouble> faceAaxis(
m_coordim);
518 Array<OneD,NekDouble> faceBaxis(
m_coordim);
522 unsigned int baseVertex;
533 const unsigned int faceVerts[
kNfaces][4] = {
544 unsigned int orientation;
550 elementAaxis_length = 0.0;
551 elementBaxis_length = 0.0;
552 faceAaxis_length = 0.0;
553 faceBaxis_length = 0.0;
558 baseVertex =
m_faces[f]->GetVid(0);
573 elementAaxis[i] = (*
m_verts[ faceVerts[f][1] ])[i] - (*
m_verts[ faceVerts[f][0] ])[i];
574 elementBaxis[i] = (*
m_verts[ faceVerts[f][2] ])[i] - (*
m_verts[ faceVerts[f][0] ])[i];
583 elementAaxis[i] = (*
m_verts[ faceVerts[f][1] ])[i] - (*
m_verts[ faceVerts[f][0] ])[i];
584 elementBaxis[i] = (*
m_verts[ faceVerts[f][3] ])[i] - (*
m_verts[ faceVerts[f][0] ])[i];
587 else if( baseVertex ==
m_verts[ faceVerts[f][1] ]->
GetVid() )
591 elementAaxis[i] = (*
m_verts[ faceVerts[f][1] ])[i] - (*
m_verts[ faceVerts[f][0] ])[i];
592 elementBaxis[i] = (*
m_verts[ faceVerts[f][2] ])[i] - (*
m_verts[ faceVerts[f][1] ])[i];
595 else if( baseVertex ==
m_verts[ faceVerts[f][2] ]->
GetVid() )
599 elementAaxis[i] = (*
m_verts[ faceVerts[f][2] ])[i] - (*
m_verts[ faceVerts[f][3] ])[i];
600 elementBaxis[i] = (*
m_verts[ faceVerts[f][2] ])[i] - (*
m_verts[ faceVerts[f][1] ])[i];
603 else if( baseVertex ==
m_verts[ faceVerts[f][3] ]->
GetVid() )
607 elementAaxis[i] = (*
m_verts[ faceVerts[f][2] ])[i] - (*
m_verts[ faceVerts[f][3] ])[i];
608 elementBaxis[i] = (*
m_verts[ faceVerts[f][3] ])[i] - (*
m_verts[ faceVerts[f][0] ])[i];
613 ASSERTL0(
false,
"Could not find matching vertex for the face");
621 int v =
m_faces[f]->GetNumVerts()-1;
625 elementAaxis_length += pow(elementAaxis[i],2);
626 elementBaxis_length += pow(elementBaxis[i],2);
627 faceAaxis_length += pow(faceAaxis[i],2);
628 faceBaxis_length += pow(faceBaxis[i],2);
631 elementAaxis_length = sqrt(elementAaxis_length);
632 elementBaxis_length = sqrt(elementBaxis_length);
633 faceAaxis_length = sqrt(faceAaxis_length);
634 faceBaxis_length = sqrt(faceBaxis_length);
640 dotproduct1 += elementAaxis[i]*faceAaxis[i];
650 if(dotproduct1 < 0.0)
658 dotproduct2 += elementBaxis[i]*faceBaxis[i];
663 if( dotproduct2 < 0.0 )
678 dotproduct1 += elementAaxis[i]*faceBaxis[i];
682 if (fabs(elementAaxis_length*faceBaxis_length
685 cout <<
"Warning: Prism axes not parallel" << endl;
690 if(dotproduct1 < 0.0)
699 dotproduct2 += elementBaxis[i]*faceAaxis[i];
703 if (fabs(elementBaxis_length*faceAaxis_length
706 cout <<
"Warning: Prism axes not parallel" << endl;
709 if( dotproduct2 < 0.0 )
715 orientation = orientation + 5;