48 namespace SpatialDomains
102 "Cannot call function with dim == 1");
104 int order0 = max(edges[0]->
GetBasis(0)->GetNumModes(),
105 edges[2]->
GetBasis(0)->GetNumModes());
106 int points0 = max(edges[0]->
GetBasis(0)->GetNumPoints(),
107 edges[2]->
GetBasis(0)->GetNumPoints());
108 int order1 = max(edges[1]->
GetBasis(0)->GetNumModes(),
109 edges[3]->
GetBasis(0)->GetNumModes());
110 int points1 = max(edges[1]->
GetBasis(0)->GetNumPoints(),
111 edges[3]->
GetBasis(0)->GetNumPoints());
130 Geometry2D(edges[0]->GetVertex(0)->GetCoordim()),
159 m_coordim = edges[0]->GetVertex(0)->GetCoordim();
161 "Cannot call function with dim == 1");
163 int order0 = max(edges[0]->
GetBasis(0)->GetNumModes(),
164 edges[2]->
GetBasis(0)->GetNumModes());
165 int points0 = max(edges[0]->
GetBasis(0)->GetNumPoints(),
166 edges[2]->
GetBasis(0)->GetNumPoints());
167 int order1 = max(edges[1]->
GetBasis(0)->GetNumModes(),
168 edges[3]->
GetBasis(0)->GetNumModes());
169 int points1 = max(edges[1]->
GetBasis(0)->GetNumPoints(),
170 edges[3]->
GetBasis(0)->GetNumPoints());
182 int npts = curve->m_points.size();
183 int nEdgePts = (int)sqrt(static_cast<NekDouble>(npts));
184 Array<OneD,NekDouble> tmp(npts);
191 "NUMPOINTS should be a square number");
196 "Number of edge points does not correspond "
197 "to number of face points.");
200 for (j = 0; j <
npts; ++j)
202 tmp[j] = (curve->m_points[j]->GetPtr())[i];
206 Array<OneD, NekDouble> tmp2(points0*points1);
223 Geometry2D(edges[0]->GetVertex(0)->GetCoordim()),
251 m_coordim = edges[0]->GetVertex(0)->GetCoordim();
253 "Cannot call function with dim == 1");
255 int order0 = max(edges[0]->
GetBasis(0)->GetNumModes(),
256 edges[2]->
GetBasis(0)->GetNumModes());
257 int points0 = max(edges[0]->
GetBasis(0)->GetNumPoints(),
258 edges[2]->
GetBasis(0)->GetNumPoints());
259 int order1 = max(edges[1]->
GetBasis(0)->GetNumModes(),
260 edges[3]->
GetBasis(0)->GetNumModes());
261 int points1 = max(edges[1]->
GetBasis(0)->GetNumPoints(),
262 edges[3]->
GetBasis(0)->GetNumPoints());
286 std::list<CompToElmt>::const_iterator def;
295 for (
int i = 0; i <
kNedges; i++)
315 const Array<OneD, const NekDouble> &Lcoord)
318 "Geometry is not in physical space");
320 Array<OneD, NekDouble> tmp(
m_xmap->GetTotPoints());
323 return m_xmap->PhysEvaluate(Lcoord, tmp);
341 int i, j, vmap[4] = {-1,-1,-1,-1};
342 NekDouble x, y, z, x1, y1, z1, cx = 0.0, cy = 0.0, cz = 0.0;
348 for (i = 0; i < 4; ++i)
350 cx += (*face2[i])(0) - (*face1[i])(0);
351 cy += (*face2[i])(1) - (*face1[i])(1);
352 cz += (*face2[i])(2) - (*face1[i])(2);
361 for (i = 0; i < 4; ++i)
366 for (j = 0; j < 4; ++j)
368 x1 = (*face2[j])(0)-cx;
369 y1 = (*face2[j])(1)-cy;
370 z1 = (*face2[j])(2)-cz;
371 if (sqrt((x1-x)*(x1-x)+(y1-y)*(y1-y)+(z1-z)*(z1-z)) < 1e-8)
381 if (vmap[1] == (vmap[0]+1) % 4)
418 ASSERTL0(
false,
"unable to determine face orientation");
447 std::list<CompToElmt>::const_iterator def;
485 return m_xmap->GetBasis(i);
494 ASSERTL1(i <= 3,
"edge is out of range");
496 if (i == 0 || i == 2)
498 return m_xmap->GetBasis(0);
502 return m_xmap->GetBasis(1);
536 if((
m_xmap->GetBasisNumModes(0) != 2)||
537 (
m_xmap->GetBasisNumModes(1) != 2))
608 Array<OneD, unsigned int> mapArray;
609 Array<OneD, int> signArray;
617 nEdgeCoeffs =
m_edges[i]->GetXmap()->GetNcoeffs();
621 for(k = 0; k < nEdgeCoeffs; k++)
624 = signArray[k]*(
m_edges[i]->GetCoeffs(j))[k];
637 Array<OneD,NekDouble> &Lcoords)
654 orth1.
Mult(norm,dv1);
655 orth2.
Mult(norm,dv2);
662 Lcoords[0] = xin.
dot(orth2)/dv1.
dot(orth2);
663 Lcoords[0] = 2*Lcoords[0]-1;
664 Lcoords[1] = xin.
dot(orth1)/dv2.
dot(orth1);
665 Lcoords[1] = 2*Lcoords[1]-1;
673 Array<OneD, NekDouble> ptsx(npts), ptsy(npts);
674 Array<OneD, NekDouble> tmpx(npts), tmpy(npts);
679 const Array<OneD, const NekDouble> za =
m_xmap->GetPoints(0);
680 const Array<OneD, const NekDouble> zb =
m_xmap->GetPoints(1);
690 Lcoords[0] = za[min_i%za.num_elements()];
691 Lcoords[1] = zb[min_i/za.num_elements()];
705 ASSERTL2((i >=0) && (i <= 3),
"Edge id must be between 0 and 3");
715 ASSERTL2((i >=0) && (i <= 3),
"Verted id must be between 0 and 3");
725 ASSERTL2((i >=0) && (i <= 3),
"Vertex id must be between 0 and 3");
735 ASSERTL2((i >=0) && (i <= 3),
"Edge id must be between 0 and 3");
745 ASSERTL2((i >=0) && (i <= 3),
"Edge id must be between 0 and 3");
755 ASSERTL2((i >=0) && (i <= 3),
"Edge id must be between 0 and 3");
784 for (i=0,edgeIter =
m_edges.begin(); edgeIter !=
m_edges.end(); ++edgeIter,++i)
786 if (*edgeIter == edge)
816 const Array<OneD, const NekDouble> &gloCoord,
NekDouble tol)
818 Array<OneD,NekDouble> locCoord(
GetCoordim(),0.0);
826 Array<OneD, NekDouble> &stdCoord,
834 Array<OneD, NekDouble> &stdCoord,
838 ASSERTL1(gloCoord.num_elements() >= 2,
839 "Two dimensional geometry expects at least two coordinates.");
842 if (stdCoord[0] >= -(1+tol) && stdCoord[1] >= -(1+tol)
843 && stdCoord[0] <= (1+tol) && stdCoord[1] <= (1+tol))