56 int nquad_f = FaceExp->GetNumPoints(0) * FaceExp->GetNumPoints(1);
57 int order_f = FaceExp->GetNcoeffs();
91 if ((x = varcoeffs.find(VarCoeff[0])) != varcoeffs.end())
93 GetPhysFaceVarCoeffsFromElement(face,FaceExp,x->second,varcoeff_work);
94 Vmath::Vmul(nquad_f,varcoeff_work,1,FaceExp->GetPhys(),1,FaceExp->UpdatePhys(),1);
101 FaceExp->IProductWRTBase(facePhys, outcoeff);
103 for (i = 0; i < order_f; ++i)
105 outarray[(*map)[i].index] += (*map)[i].sign * tau * outcoeff[i];
114 for (n = 0; n < coordim; ++n)
129 Vmath::Vmul(nquad_f, ncdotMF_f, 1, facePhys, 1, inval, 1);
133 Vmath::Vmul(nquad_f, normals[n], 1, facePhys, 1, inval, 1);
137 const NekDouble *data = invMass.GetRawPtr();
150 FaceExp->IProductWRTBase(inval, outcoeff);
153 for (i = 0; i < ncoeffs; ++i)
156 for (j = 0; j < order_f; ++j)
158 tmpcoeff[i] += scale * data[i + (*map)[j].index * ncoeffs] *
159 (*map)[j].sign * outcoeff[j];
167 GetMF(n, coordim, varcoeffs);
177 Coeffs = Coeffs + Dmat * Tmpcoeff;
182 Coeffs = Coeffs + Dmat * Tmpcoeff;
219 for (
unsigned int i = 0; i < FaceExp->GetNcoeffs(); ++i)
221 facetmp[i] = tmp[emap[i]];
225 FaceExp->BwdTrans(facetmp, outarray);
239 int order_f, nquad_f;
243 for (f = 0; f < nfaces; ++f)
245 order_f = FaceExp[f]->GetNcoeffs();
246 nquad_f = FaceExp[f]->GetNumPoints(0) * FaceExp[f]->GetNumPoints(1);
253 for (i = 0; i < order_f; ++i)
255 faceCoeffs[i] = inarray[i + cnt];
259 FaceExp[f]->BwdTrans(faceCoeffs, facePhys);
276 StdRegions::VarCoeffMap::const_iterator x;
282 Vmath::Vmul(nquad_f, ncdotMF_f, 1, facePhys, 1, facePhys, 1);
286 Vmath::Vmul(nquad_f, normals[dir], 1, facePhys, 1, facePhys, 1);
303 for (f = 0; f < nfaces; ++f)
305 nquad_f = FaceExp[f]->GetNumPoints(0) * FaceExp[f]->GetNumPoints(1);
311 FaceExp[f]->BwdTrans(faceCoeffs[f], facePhys);
313 Vmath::Vmul(nquad_f, normals[dir], 1, facePhys, 1, facePhys, 1);
328 int order_f = FaceExp->GetNcoeffs();
336 FaceExp->IProductWRTBase(facePhys, coeff);
339 for (i = 0; i < order_f; ++i)
341 outarray[(*map)[i].index] += (*map)[i].sign * coeff[i];
367 ASSERTL1((*map1).size() == (*map2).size(),
368 "There is an error with the GetTraceToElementMap");
370 for (j = 0; j < (*map1).size(); ++j)
373 for (k = 0; k < (*map2).size(); ++k)
376 if ((*map1)[j].index == (*map2)[k].index && k != j)
380 if ((*map1)[j].
sign != (*map2)[k].
sign)
400 for (i = 0; i < nfaces; ++i)
413 "Geometric information is not set up");
446 "Need to specify eFactorGJP to construct "
451 factor /= MassMat.Scale();
453 int ntot = MassMat.GetRows() * MassMat.GetColumns();
456 MassMat.GetRawPtr(), 1, &NDTraceMat->GetPtr()[0], 1);
459 MassMat.Scale(), NDTraceMat);
526 int rows = deriv0.GetRows();
527 int cols = deriv1.GetColumns();
531 (*WeakDeriv) = df[3 * dir][0] * deriv0 +
532 df[3 * dir + 1][0] * deriv1 +
533 df[3 * dir + 2][0] * deriv2;
578 int rows = lap00.GetRows();
579 int cols = lap00.GetColumns();
584 (*lap) = gmat[0][0] * lap00 + gmat[4][0] * lap11 +
586 gmat[3][0] * (lap01 +
Transpose(lap01)) +
587 gmat[6][0] * (lap02 +
Transpose(lap02)) +
625 int rows = LapMat.GetRows();
626 int cols = LapMat.GetColumns();
632 (*helm) = LapMat + factor * MassMat;
637 if (!massVarcoeffs.empty())
641 if (!lapVarcoeffs.empty())
657 "Need to specify eFactorGJP to construct "
658 "a HelmholtzGJP matrix");
662 factor /= HelmMat.Scale();
664 int ntot = HelmMat.GetRows() * HelmMat.GetColumns();
667 HelmMat.GetRawPtr(), 1, &NDTraceMat->GetPtr()[0], 1);
670 HelmMat.Scale(), NDTraceMat);
696 int rows = MassMat.GetRows();
697 int cols = MassMat.GetColumns();
703 (*adr) = -lambda * MassMat + AdvMat;
709 if (!massVarcoeffs.empty())
751 int rows = LapMat.GetRows();
752 int cols = LapMat.GetColumns();
758 (*adr) = LapMat - lambda * MassMat + AdvMat;
764 if (!massVarcoeffs.empty())
768 if (!lapVarcoeffs.empty())
816 "Need to specify eFactorGJP to construct "
817 "a LinearAdvectionDiffusionReactionGJP matrix");
819 int rows = LapMat.GetRows();
820 int cols = LapMat.GetColumns();
827 LapMat - lambda * MassMat + AdvMat + gjpfactor * NDTraceMat;
971 "Matrix construction is not implemented for variable "
972 "coefficients at the moment");
983 "HybridDGHelmholtz matrix not set up "
984 "for non boundary-interior expansions");
1012 StdRegions::VarCoeffMap::const_iterator x;
1015 for (i = 0; i < coordim; ++i)
1022 GetMF(i, coordim, varcoeffs);
1043 Mat = Mat + Dmat * invMass *
Transpose(Dmat);
1048 Mat = Mat + Dmat * invMass *
Transpose(Dmat);
1073 Mat = Mat + lambdaval * Mass;
1076 for (i = 0; i < nfaces; ++i)
1079 order_f = FaceExp->GetNcoeffs();
1086 "HDGHelmholtz needs setting up for variable P");
1106 for (j = 0; j < order_f; ++j)
1108 for (k = 0; k < order_f; ++k)
1110 Mat((*map)[j].index, (*map)[k].index) +=
1111 tau * (*map)[j].sign * (*map)[k].sign * eMass(j, k);
1151 for (i = 0; i < nfaces; ++i)
1161 for (j = 0; j < nface; ++j)
1165 face_lambda[j] = 1.0;
1170 FaceExp->BwdTrans(face_lambda, tmp);
1177 for (k = 0; k < ncoeffs; ++k)
1179 Umat(k, bndry_cnt) = Ulam[k];
1262 for (i = 0; i < nfaces; ++i)
1284 ASSERTL0(
false,
"Direction not known");
1290 StdRegions::VarCoeffMap::const_iterator x;
1297 GetMF(dir, coordim, varcoeffs);
1326 for (j = 0; j < nbndry; ++j)
1332 for (k = 0; k < ncoeffs; ++k)
1334 Ulam[k] = lamToU(k, j);
1352 &(Qmat.GetPtr())[0] + j * ncoeffs, 1);
1360 int order_f, nquad_f;
1406 for (i = 0; i < nfaces; ++i)
1412 for (i = 0; i < nbndry; ++i)
1420 for (f = 0; f < nfaces; ++f)
1422 order_f = FaceExp[f]->GetNcoeffs();
1423 nquad_f = FaceExp[f]->GetNumPoints(0) *
1424 FaceExp[f]->GetNumPoints(1);
1448 for (j = 0; j < order_f; ++j)
1451 (*map)[j].sign * (*LamToQ[0])((*map)[j].index, i);
1454 FaceExp[f]->BwdTrans(faceCoeffs, facePhys);
1470 0, f, FaceExp[f], normals, varcoeffs);
1472 Vmath::Vmul(nquad_f, ncdotMF, 1, facePhys, 1, work, 1);
1476 Vmath::Vmul(nquad_f, normals[0], 1, facePhys, 1, work,
1481 for (j = 0; j < order_f; ++j)
1484 (*map)[j].sign * (*LamToQ[1])((*map)[j].index, i);
1487 FaceExp[f]->BwdTrans(faceCoeffs, facePhys);
1503 1, f, FaceExp[f], normals, varcoeffs);
1505 Vmath::Vvtvp(nquad_f, ncdotMF, 1, facePhys, 1, work, 1,
1510 Vmath::Vvtvp(nquad_f, normals[1], 1, facePhys, 1, work,
1515 for (j = 0; j < order_f; ++j)
1518 (*map)[j].sign * (*LamToQ[2])((*map)[j].index, i);
1521 FaceExp[f]->BwdTrans(faceCoeffs, facePhys);
1537 2, f, FaceExp[f], normals, varcoeffs);
1539 Vmath::Vvtvp(nquad_f, ncdotMF, 1, facePhys, 1, work, 1,
1544 Vmath::Vvtvp(nquad_f, normals[2], 1, facePhys, 1, work,
1550 for (j = 0; j < order_f; ++j)
1553 (*map)[j].sign * LamToU((*map)[j].index, i) -
1557 FaceExp[f]->BwdTrans(faceCoeffs, facePhys);
1569 Vmath::Svtvp(nquad_f, -tau, facePhys, 1, work, 1, work, 1);
1572 FaceExp[f]->IProductWRTBase(work, faceCoeffs);
1576 for (j = 0; j < order_f; ++j)
1578 BndMat(cnt + j, i) = faceCoeffs[j];
1594 LapMat.GetRows(), LapMat.GetColumns());
1625 for (
int d = 0; d < ncoords; ++d)
1633 for (
int t = 0; t < ntraces; ++t)
1636 tracepts[t] = traceExp[t]->GetTotPoints();
1637 maxtpts = (maxtpts > tracepts[t]) ? maxtpts : tracepts[t];
1643 for (
int t = 0; t < ntraces; ++t)
1654 for (
int t = 0; t < ntraces; ++t)
1661 traceExp[t]->GetBasis(0)->GetBasisKey();
1663 traceExp[t]->GetBasis(1)->GetBasisKey();
1665 (fromkey0 != tokey0) || (fromkey1 != tokey1);
1672 for (
int d = 0; d < ncoords; ++d)
1689 tmp = dphidn[t] + i * tracepts[t], 1,
1690 tmp1 = dphidn[t] + i * tracepts[t], 1);
1695 for (
int t = 0; t < ntraces; ++t)
1697 int nt = tracepts[t];
1703 "Cannot find TraceWeights in key");
1712 dphidn[t] + j * nt, 1, val, 1);
1714 Mat(i, j) + scale * traceExp[t]->Integral(val);
1722 for (
int j = 0; j < i; ++j)
1724 Mat(i, j) = Mat(j, i);
1731 "This matrix type cannot be generated from this class");
1756 int nquad0 =
m_base[0]->GetNumPoints();
1757 int nquad1 =
m_base[1]->GetNumPoints();
1758 int nquad2 =
m_base[2]->GetNumPoints();
1759 int ntot = nquad0 * nquad1 * nquad2;
1772 Vmath::Vmul(ntot, &df[0][0], 1, &Diff0[0], 1, &out_d0[0], 1);
1773 Vmath::Vvtvp(ntot, &df[1][0], 1, &Diff1[0], 1, &out_d0[0], 1,
1775 Vmath::Vvtvp(ntot, &df[2][0], 1, &Diff2[0], 1, &out_d0[0], 1,
1781 Vmath::Vmul(ntot, &df[3][0], 1, &Diff0[0], 1, &out_d1[0], 1);
1782 Vmath::Vvtvp(ntot, &df[4][0], 1, &Diff1[0], 1, &out_d1[0], 1,
1784 Vmath::Vvtvp(ntot, &df[5][0], 1, &Diff2[0], 1, &out_d1[0], 1,
1790 Vmath::Vmul(ntot, &df[6][0], 1, &Diff0[0], 1, &out_d2[0], 1);
1791 Vmath::Vvtvp(ntot, &df[7][0], 1, &Diff1[0], 1, &out_d2[0], 1,
1793 Vmath::Vvtvp(ntot, &df[8][0], 1, &Diff2[0], 1, &out_d2[0], 1,
1801 Vmath::Smul(ntot, df[0][0], &Diff0[0], 1, &out_d0[0], 1);
1802 Blas::Daxpy(ntot, df[1][0], &Diff1[0], 1, &out_d0[0], 1);
1803 Blas::Daxpy(ntot, df[2][0], &Diff2[0], 1, &out_d0[0], 1);
1808 Vmath::Smul(ntot, df[3][0], &Diff0[0], 1, &out_d1[0], 1);
1809 Blas::Daxpy(ntot, df[4][0], &Diff1[0], 1, &out_d1[0], 1);
1810 Blas::Daxpy(ntot, df[5][0], &Diff2[0], 1, &out_d1[0], 1);
1815 Vmath::Smul(ntot, df[6][0], &Diff0[0], 1, &out_d2[0], 1);
1816 Blas::Daxpy(ntot, df[7][0], &Diff1[0], 1, &out_d2[0], 1);
1817 Blas::Daxpy(ntot, df[8][0], &Diff2[0], 1, &out_d2[0], 1);
1828 int nquad0 =
m_base[0]->GetNumPoints();
1829 int nquad1 =
m_base[1]->GetNumPoints();
1830 int nquad2 =
m_base[2]->GetNumPoints();
1831 int ntot = nquad0 * nquad1 * nquad2;
1843 Vmath::Vmul(ntot, &dfdir[0][0], 1, &Diff0[0], 1, &outarray[0], 1);
1844 Vmath::Vvtvp(ntot, &dfdir[1][0], 1, &Diff1[0], 1, &outarray[0], 1,
1846 Vmath::Vvtvp(ntot, &dfdir[2][0], 1, &Diff2[0], 1, &outarray[0], 1,
1860 const bool CollDir0 =
m_base[0]->Collocation();
1861 const bool CollDir1 =
m_base[1]->Collocation();
1862 const bool CollDir2 =
m_base[2]->Collocation();
1872 Vmath::Vmul(nqtot, jac, 1, inarray, 1, outarray, 1);
1876 Vmath::Smul(nqtot, jac[0], inarray, 1, outarray, 1);
1883 m_base[2]->GetBdata(), inarray, outarray, jac,
1884 Deformed, CollDir0, CollDir1, CollDir2);
1913 if (faceExp->GetRightAdjacentElementExp())
1915 if (faceExp->GetRightAdjacentElementExp()
1930 int order_e = (*map).size();
1931 int n_coeffs = FaceExp->GetNcoeffs();
1935 if (n_coeffs != order_e)
1937 FaceExp->FwdTrans(Fn, faceCoeffs);
1939 int NumModesElementMax = FaceExp->GetBasis(0)->GetNumModes();
1940 int NumModesElementMin =
m_base[0]->GetNumModes();
1942 FaceExp->ReduceOrderCoeffs(NumModesElementMin, faceCoeffs, faceCoeffs);
1945 FaceExp->DetShapeType(), *FaceExp);
1946 FaceExp->MassMatrixOp(faceCoeffs, faceCoeffs, masskey);
1949 int offset1 = 0, offset2 = 0;
1953 for (i = 0; i < NumModesElementMin; ++i)
1955 for (j = 0; j < NumModesElementMin; ++j)
1957 faceCoeffs[offset1 + j] = faceCoeffs[offset2 + j];
1959 offset1 += NumModesElementMin;
1960 offset2 += NumModesElementMax;
1964 for (i = NumModesElementMin; i < NumModesElementMax; ++i)
1966 for (j = NumModesElementMin; j < NumModesElementMax; ++j)
1968 faceCoeffs[i * NumModesElementMax + j] = 0.0;
1977 int offset1 = 0, offset2 = 0;
1979 for (i = 0; i < NumModesElementMin; ++i)
1981 for (j = 0; j < NumModesElementMin - i; ++j)
1983 faceCoeffs[offset1 + j] = faceCoeffs[offset2 + j];
1985 offset1 += NumModesElementMin - i;
1986 offset2 += NumModesElementMax - i;
1992 FaceExp->IProductWRTBase(Fn, faceCoeffs);
1997 for (i = 0; i < order_e; ++i)
1999 outarray[(*map)[i].index] -= (*map)[i].sign * faceCoeffs[i];
2004 for (i = 0; i < order_e; ++i)
2006 outarray[(*map)[i].index] += (*map)[i].sign * faceCoeffs[i];
2042 Out_d = InvMass * Coeffs;
2050 "Not set up for non boundary-interior expansions");
2051 ASSERTL1(inoutmat->GetRows() == inoutmat->GetColumns(),
2052 "Assuming that input matrix was square");
2057 int order_f = faceExp->GetNcoeffs();
2070 DNekScalMat &facemat = *faceExp->GetLocMatrix(mkey);
2087 int rows = inoutmat->GetRows();
2095 int nfvert = faceExp->GetNverts();
2102 GetLinStdExp()->GetTraceToElementMap(face, linmap, linsign,
2111 for (i = 0; i < nfvert; ++i)
2113 fmap = faceExp->GetVertexMap(i,
true);
2117 map[fmap] = linmap[i];
2128 for (i = 0; i < order_f; ++i)
2130 for (j = 0; j < nbndry; ++j)
2132 if (map[i] == bmap[j])
2138 ASSERTL1(j != nbndry,
"Did not find number in map");
2157 ASSERTL1((*map1).size() == (*map2).size(),
2158 "There is an error with the GetTraceToElementMap");
2160 for (i = 0; i < face; ++i)
2165 for (i = 0; i < (*map1).size(); ++i)
2169 for (j = 0; j < (*map2).size(); ++j)
2171 if ((*map1)[i].index == (*map2)[j].index)
2178 ASSERTL2(idx >= 0,
"Index not found");
2180 sign[i] = (*map2)[idx].sign;
2185 ASSERTL0(
false,
"Could not identify matrix type from dimension");
2188 for (i = 0; i < order_f; ++i)
2191 for (j = 0; j < order_f; ++j)
2194 (*inoutmat)(id1, id2) += facemat(i, j) *
sign[i] *
sign[j];
2205 int nVerts, vid1, vid2, vMap1, vMap2;
2212 DNekMat &VertexMat = (*vertexmatrix);
2214 for (vid1 = 0; vid1 < nVerts; ++vid1)
2218 for (vid2 = 0; vid2 < nVerts; ++vid2)
2221 VertexValue = (*r_bnd)(vMap1, vMap2);
2222 VertexMat.SetValue(vid1, vid2, VertexValue);
2226 return vertexmatrix;
2233 int eid, fid, vid, n, i;
2266 int nConnectedEdges = 3;
2267 int nConnectedFaces = 3;
2278 nBndCoeffs, nBndCoeffs, 0.0, storage);
2280 DNekMat &R = (*transformationmatrix);
2285 for (vid = 0; vid < nVerts; ++vid)
2295 int nedgemodesconnected =
2301 int nfacemodesconnected =
2310 for (eid = 0; eid < nConnectedEdges; ++eid)
2312 MatEdgeLocation[eid] =
2314 nmodes = MatEdgeLocation[eid].size();
2319 &edgemodearray[offset], 1);
2328 for (fid = 0; fid < nConnectedFaces; ++fid)
2330 MatFaceLocation[fid] =
2332 nmodes = MatFaceLocation[fid].size();
2337 &facemodearray[offset], 1);
2344 DNekMat &Sveft = (*vertexedgefacetransformmatrix);
2348 DNekMat &Svef = (*vertexedgefacecoupling);
2351 for (n = 0; n < nedgemodesconnected; ++n)
2354 VertexEdgeFaceValue = (*r_bnd)(
GetVertexMap(vid), edgemodearray[n]);
2357 Svef.SetValue(0, n, VertexEdgeFaceValue);
2361 for (n = 0; n < nfacemodesconnected; ++n)
2364 VertexEdgeFaceValue = (*r_bnd)(
GetVertexMap(vid), facemodearray[n]);
2367 Svef.SetValue(0, n + nedgemodesconnected, VertexEdgeFaceValue);
2381 DNekMat &Sefef = (*edgefacecoupling);
2386 for (m = 0; m < nedgemodesconnected; ++m)
2388 for (n = 0; n < nedgemodesconnected; ++n)
2391 EdgeEdgeValue = (*r_bnd)(edgemodearray[n], edgemodearray[m]);
2394 Sefef.SetValue(n, m, EdgeEdgeValue);
2399 for (n = 0; n < nfacemodesconnected; ++n)
2401 for (m = 0; m < nfacemodesconnected; ++m)
2404 FaceFaceValue = (*r_bnd)(facemodearray[n], facemodearray[m]);
2406 Sefef.SetValue(nedgemodesconnected + n, nedgemodesconnected + m,
2412 for (n = 0; n < nedgemodesconnected; ++n)
2414 for (m = 0; m < nfacemodesconnected; ++m)
2417 FaceFaceValue = (*r_bnd)(edgemodearray[n], facemodearray[m]);
2420 Sefef.SetValue(n, nedgemodesconnected + m, FaceFaceValue);
2422 FaceFaceValue = (*r_bnd)(facemodearray[m], edgemodearray[n]);
2425 Sefef.SetValue(nedgemodesconnected + m, n, FaceFaceValue);
2435 Sveft = -Svef * Sefef;
2439 for (n = 0; n < edgemodearray.size(); ++n)
2441 R.SetValue(
GetVertexMap(vid), edgemodearray[n], Sveft(0, n));
2445 for (n = 0; n < facemodearray.size(); ++n)
2448 Sveft(0, n + nedgemodesconnected));
2471 int efCol, efRow, nedgemodes;
2474 nConnectedFaces = 2;
2483 for (eid = 0; eid < nEdges; ++eid)
2494 DNekMat &Mef = (*efedgefacecoupling);
2500 DNekMat &Meff = (*effacefacecoupling);
2506 DNekMat &Meft = (*edgefacetransformmatrix);
2508 int nfacemodesconnected =
2520 Vmath::Vcopy(nedgemodes, &inedgearray[0], 1, &edgemodearray[0], 1);
2526 for (fid = 0; fid < nConnectedFaces; ++fid)
2528 MatFaceLocation[fid] =
2530 nmodes = MatFaceLocation[fid].size();
2535 &facemodearray[offset], 1);
2541 for (n = 0; n < nedgemodes; ++n)
2543 for (m = 0; m < nfacemodesconnected; ++m)
2546 EdgeFaceValue = (*r_bnd)(edgemodearray[n], facemodearray[m]);
2549 Mef.SetValue(n, m, EdgeFaceValue);
2554 for (n = 0; n < nfacemodesconnected; ++n)
2556 for (m = 0; m < nfacemodesconnected; ++m)
2559 FaceFaceValue = (*r_bnd)(facemodearray[n], facemodearray[m]);
2562 Meff.SetValue(n, m, FaceFaceValue);
2576 for (n = 0; n < Meft.GetRows(); ++n)
2578 for (m = 0; m < Meft.GetColumns(); ++m)
2580 R.SetValue(edgemodearray[n], facemodearray[m], Meft(n, m));
2585 for (i = 0; i < R.GetRows(); ++i)
2587 R.SetValue(i, i, 1.0);
2593 return transformationmatrix;
2614 int i, j, n, eid = 0, fid = 0;
2626 DNekMat &InvR = (*inversetransformationmatrix);
2634 int nedgemodestotal = 0;
2635 int nfacemodestotal = 0;
2637 for (eid = 0; eid < nEdges; ++eid)
2640 nedgemodestotal += nedgemodes;
2643 for (fid = 0; fid < nFaces; ++fid)
2646 nfacemodestotal += nfacemodes;
2655 for (eid = 0; eid < nEdges; ++eid)
2663 Vmath::Vcopy(nedgemodes, &edgearray[0], 1, &edgemodearray[offset],
2667 offset += nedgemodes;
2673 for (fid = 0; fid < nFaces; ++fid)
2681 Vmath::Vcopy(nfacemodes, &facearray[0], 1, &facemodearray[offset],
2685 offset += nfacemodes;
2689 for (i = 0; i < nVerts; ++i)
2691 for (j = 0; j < nedgemodestotal; ++j)
2696 for (j = 0; j < nfacemodestotal; ++j)
2700 for (n = 0; n < nedgemodestotal; ++n)
2702 MatrixValue = InvR.GetValue(
GetVertexMap(i), facemodearray[j]) +
2704 R(edgemodearray[n], facemodearray[j]);
2705 InvR.SetValue(
GetVertexMap(i), facemodearray[j], MatrixValue);
2711 for (i = 0; i < nedgemodestotal; ++i)
2713 for (j = 0; j < nfacemodestotal; ++j)
2715 InvR.SetValue(edgemodearray[i], facemodearray[j],
2716 -R(edgemodearray[i], facemodearray[j]));
2720 for (i = 0; i < nCoeffs; ++i)
2722 InvR.SetValue(i, i, 1.0);
2725 return inversetransformationmatrix;
2739 map<int, int> invmap;
2740 for (j = 0; j < nBndCoeffs; ++j)
2742 invmap[bmap[j]] = j;
2758 for (n = 0; n < nEdgeCoeffs; ++n)
2760 edgemaparray[n] = invmap[maparray[n]];
2763 return edgemaparray;
2779 map<int, int> reversemap;
2780 for (j = 0; j < bmap.size(); ++j)
2782 reversemap[bmap[j]] = j;
2798 fOrient = faceOrient;
2814 ASSERTL1(P1 <= locP1,
"Expect value of passed P1 to "
2815 "be lower or equal to face num modes");
2824 ASSERTL1(P2 <= locP2,
"Expect value of passed P2 to "
2825 "be lower or equal to face num modes");
2828 switch (
GetGeom3D()->GetFace(fid)->GetShapeType())
2832 if (((P1 - 3) > 0) && ((P2 - 3) > 0))
2839 for (n = 0; n < P1 - 3; ++n)
2841 for (
int m = 0; m < P2 - 3 - n; ++m, ++cnt)
2843 facemaparray[cnt] = reversemap[maparray[cnt1 + m]];
2845 cnt1 += locP2 - 3 - n;
2852 if (((P1 - 2) > 0) && ((P2 - 2) > 0))
2859 for (n = 0; n < P2 - 2; ++n)
2861 for (
int m = 0; m < P1 - 2; ++m, ++cnt)
2863 facemaparray[cnt] = reversemap[maparray[cnt1 + m]];
2872 ASSERTL0(
false,
"Invalid shape type.");
2877 return facemaparray;
2896 map<int, int> reversemap;
2897 for (j = 0; j < bmap.size(); ++j)
2899 reversemap[bmap[j]] = j;
2904 for (n = 0; n < nverts; ++n)
2907 vmap[n] = reversemap[id];
2913 for (
int eid = 0; eid < nedges; ++eid)
2927 for (n = 0; n < nEdgeCoeffs; ++n)
2929 edgemaparray[n] = reversemap[maparray[n]];
2931 emap[eid] = edgemaparray;
2937 for (
int fid = 0; fid < nfaces; ++fid)
2951 for (n = 0; n < nFaceCoeffs; ++n)
2953 facemaparray[n] = reversemap[maparray[n]];
2956 fmap[fid] = facemaparray;
2997 FaceExp->GetNumPoints(id0),
2998 FaceExp->GetNumPoints(id1),
true);
3022 Vmath::Gathr(
static_cast<int>(faceids.size()), inarray, faceids.data(),
3040 m_base[dir0]->GetPointsKey(),
m_base[dir1]->GetPointsKey(),
3041 o_tmp.data(), FaceExp->GetBasis(id0)->GetPointsKey(),
3042 FaceExp->GetBasis(id1)->GetPointsKey(), outarray.data());
3069 const int nq0,
const int nq1,
bool Forwards)
3075 if (out.data() != in.data())
3078 std::memcpy(out.data(), in.data(),
3087 for (
int j = 0; j < nq1; j++)
3097 for (
int j = 0; j < nq1; j++)
3099 for (
int i = 0; i < nq0; ++i)
3101 out[j * nq0 + i] = intmp[nq0 * (nq1 - 1 - j) + i];
3110 for (
int j = 0; j < nq1; j++)
3112 for (
int i = 0; i < nq0; ++i)
3114 out[j * nq0 + i] = intmp[nq0 * nq1 - 1 - j * nq0 - i];
3125 for (
int i = 0; i < nq0; ++i)
3127 for (
int j = 0; j < nq1; ++j)
3129 out[i * nq1 + j] = intmp[i + j * nq0];
3135 for (
int j = 0; j < nq1; ++j)
3137 for (
int i = 0; i < nq0; ++i)
3139 out[j * nq0 + i] = intmp[i * nq1 + j];
3152 for (
int i = 0; i < nq0; ++i)
3154 for (
int j = 0; j < nq1; ++j)
3157 out[i * nq1 + j] = intmp[i + nq0 * (nq1 - 1) - j * nq0];
3165 for (
int j = 0; j < nq1; ++j)
3167 for (
int i = 0; i < nq0; ++i)
3169 out[j * nq0 + i] = intmp[nq1 - 1 - j + i * nq1];
3181 for (
int i = 0; i < nq0; ++i)
3183 for (
int j = 0; j < nq1; ++j)
3185 out[i * nq1 + j] = intmp[nq0 - 1 - i + j * nq0];
3191 for (
int j = 0; j < nq1; ++j)
3193 for (
int i = 0; i < nq0; ++i)
3195 out[j * nq0 + i] = intmp[nq0 * (nq1 - 1) - i * nq1 + j];
3207 for (
int i = 0; i < nq0; ++i)
3209 for (
int j = 0; j < nq1; ++j)
3211 out[i * nq1 + j] = intmp[nq0 * nq1 - 1 - i - j * nq0];
3217 for (
int j = 0; j < nq1; ++j)
3219 for (
int i = 0; i < nq0; ++i)
3221 out[j * nq0 + i] = intmp[nq0 * nq1 - 1 - j - i * nq1];
3228 ASSERTL0(
false,
"Unknow orientation");
3246 int nquad_f = FaceExp_f->GetNumPoints(0) * FaceExp_f->GetNumPoints(1);
3249 int nquad0 =
m_base[0]->GetNumPoints();
3250 int nquad1 =
m_base[1]->GetNumPoints();
3251 int nquad2 =
m_base[2]->GetNumPoints();
3252 int nqtot = nquad0 * nquad1 * nquad2;
3264 StdRegions::VarCoeffMap::const_iterator MFdir;
3269 for (
int k = 0; k < coordim; k++)
3271 MFdir = varcoeffs.find(MMFCoeffs[dir * 5 + k]);
3272 tmp = MFdir->second.GetValue();
3276 Vmath::Vvtvp(nquad_f, &tmp_f[0], 1, &normals[k][0], 1, &nFacecdotMF[0],
3277 1, &nFacecdotMF[0], 1);
3296 normal.
Mult(tn1, tn2);
3300 mag = 1.0 /
sqrt(mag);
3306 for (
int i = 0; i < nverts; ++i)
3317 h += fabs(normal.
dot(Dx));
3323 int dir0 = geom->
GetDir(traceid, 0);
3324 int dir1 = geom->
GetDir(traceid, 1);
3326 for (dirn = 0; dirn < 3; ++dirn)
3328 if ((dirn != dir0) && (dirn != dir1))
3351 if (d0factors.size() != ntrace)
3360 unsigned nq_max = 0;
3361 for (
int i = 0; i < ntrace; ++i)
3368 nq_face[i] = traceExp[i]->GetTotPoints();
3369 if (d0factors[i].size() != nq_face[i])
3375 nq_max =
max(nq_max, nq_face[i]);
3380 int ncoords = normals.find(0)->second.size();
3386 for (
int i = 0; i < 3; ++i)
3397 for (
unsigned i = 0; i < 3 * ncoords; ++i)
3400 Vmath::Vmul(nqtot, &(df[i][0]), 1, &(Jac[0]), 1, &(dfdj[i][0]), 1);
3403 for (
unsigned f = 0; f < ntrace; ++f)
3413 for (
int n = 0; n < ncoords; ++n)
3421 for (
int i = 0; i < nq_face[f]; ++i)
3424 fac[0][i] * normals.find(f)->second[n][i] * jac[i];
3426 fac[1][i] * normals.find(f)->second[n][i] * jac[i];
3428 fac[2][i] * normals.find(f)->second[n][i] * jac[i];
3435 for (
unsigned f = 0; f < ntrace; ++f)
3440 for (
int n = 0; n < ncoords; ++n)
3442 for (
int i = 0; i < nq_face[f]; ++i)
3445 df[3 * n][0] * normals.find(f)->second[n][i];
3447 df[3 * n + 1][0] * normals.find(f)->second[n][i];
3449 df[3 * n + 2][0] * normals.find(f)->second[n][i];
#define ASSERTL0(condition, msg)
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed to...
#define sign(a, b)
return the sign(b)*a
Describes the specification for a Basis.
void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Calculate the inner product of inarray with respect to the elements basis.
DNekMatSharedPtr v_BuildTransformationMatrix(const DNekScalMatSharedPtr &r_bnd, const StdRegions::MatrixType matrixType) override
void v_AddRobinMassMatrix(const int face, const Array< OneD, const NekDouble > &primCoeffs, DNekMatSharedPtr &inoutmat) override
void SetTraceToGeomOrientation(Array< OneD, NekDouble > &inout)
Align trace orientation with the geometry orientation.
void v_DGDeriv(const int dir, const Array< OneD, const NekDouble > &incoeffs, Array< OneD, ExpansionSharedPtr > &FaceExp, Array< OneD, Array< OneD, NekDouble > > &faceCoeffs, Array< OneD, NekDouble > &out_d) override
Evaluate coefficients of weak deriviative in the direction dir given the input coefficicents incoeffs...
StdRegions::Orientation v_GetTraceOrient(int face) override
void AddNormTraceInt(const int dir, Array< OneD, ExpansionSharedPtr > &FaceExp, Array< OneD, Array< OneD, NekDouble > > &faceCoeffs, Array< OneD, NekDouble > &outarray)
DNekScalMatSharedPtr CreateMatrix(const MatrixKey &mkey)
Array< OneD, unsigned int > GetTraceInverseBoundaryMap(int fid, StdRegions::Orientation faceOrient=StdRegions::eNoOrientation, int P1=-1, int P2=-1)
std::vector< bool > m_requireNeg
void GetInverseBoundaryMaps(Array< OneD, unsigned int > &vmap, Array< OneD, Array< OneD, unsigned int > > &emap, Array< OneD, Array< OneD, unsigned int > > &fmap)
Array< OneD, NekDouble > GetnFacecdotMF(const int dir, const int face, ExpansionSharedPtr &FaceExp_f, const Array< OneD, const Array< OneD, NekDouble > > &normals, const StdRegions::VarCoeffMap &varcoeffs)
void v_PhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2) override
Calculate the derivative of the physical points.
void v_GetLocTracePhysVals(const int face, const StdRegions::StdExpansionSharedPtr &FaceExp, const NekDouble *inarray, Array< OneD, NekDouble > &outarray) override
Extract the physical values along face face from inarray into outarray following the local elemental ...
DNekMatSharedPtr v_BuildInverseTransformationMatrix(const DNekScalMatSharedPtr &transformationmatrix) override
Build inverse and inverse transposed transformation matrix: and .
void AddFaceBoundaryInt(const int face, ExpansionSharedPtr &FaceExp, Array< OneD, NekDouble > &facePhys, Array< OneD, NekDouble > &outarray, const StdRegions::VarCoeffMap &varcoeffs=StdRegions::NullVarCoeffMap)
void GetPhysFaceVarCoeffsFromElement(const int face, ExpansionSharedPtr &FaceExp, const Array< OneD, const NekDouble > &varcoeff, Array< OneD, NekDouble > &outarray)
void v_TraceNormLen(const int traceid, NekDouble &h, NekDouble &p) override
SpatialDomains::Geometry3D * GetGeom3D() const
void v_NormVectorIProductWRTBase(const Array< OneD, const Array< OneD, NekDouble > > &Fvec, Array< OneD, NekDouble > &outarray) override
Array< OneD, unsigned int > GetEdgeInverseBoundaryMap(int eid)
DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey) override
void v_PhysDirectionalDeriv(const Array< OneD, const NekDouble > &inarray, const Array< OneD, const NekDouble > &direction, Array< OneD, NekDouble > &out) override
Physical derivative along a direction vector.
void v_GenTraceExp(const int traceid, ExpansionSharedPtr &exp) override
void v_AddFaceNormBoundaryInt(const int face, const ExpansionSharedPtr &FaceExp, const Array< OneD, const NekDouble > &Fn, Array< OneD, NekDouble > &outarray) override
void v_NormalTraceDerivFactors(Array< OneD, Array< OneD, NekDouble > > &d0factors, Array< OneD, Array< OneD, NekDouble > > &d1factors, Array< OneD, Array< OneD, NekDouble > > &d2factors) override
: This method gets all of the factors which are required as part of the Gradient Jump Penalty stabili...
void AddHDGHelmholtzFaceTerms(const NekDouble tau, const int edge, Array< OneD, NekDouble > &facePhys, const StdRegions::VarCoeffMap &dirForcing, Array< OneD, NekDouble > &outarray)
DNekMatSharedPtr v_BuildVertexMatrix(const DNekScalMatSharedPtr &r_bnd) override
void v_GetTracePhysVals(const int face, const StdRegions::StdExpansionSharedPtr &FaceExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, StdRegions::Orientation orient) override
Extract the physical values along face face from inarray into outarray following the face orientation...
void SetFaceToGeomOrientation(const int face, Array< OneD, NekDouble > &inout)
Align face orientation with the geometry orientation.
void v_ReOrientTracePhysVals(const StdRegions::Orientation orient, const Array< OneD, const NekDouble > &in, Array< OneD, NekDouble > &out, const int nq0, const int nq1, bool Forwards) override
void GetTracePhysMap(const int edge, Array< OneD, int > &outarray)
void DropLocMatrix(const LocalRegions::MatrixKey &mkey)
SpatialDomains::Geometry * GetGeom() const
DNekMatSharedPtr BuildVertexMatrix(const DNekScalMatSharedPtr &r_bnd)
SpatialDomains::Geometry * m_geom
void ComputeGmatcdotMF(const Array< TwoD, const NekDouble > &df, const Array< OneD, const NekDouble > &direction, Array< OneD, Array< OneD, NekDouble > > &dfdir)
Array< OneD, NekDouble > GetMFMag(const int dir, const StdRegions::VarCoeffMap &varcoeffs)
std::map< int, ExpansionWeakPtr > m_traceExp
ExpansionSharedPtr GetTraceExp(const int traceid)
StdRegions::Orientation GetTraceOrient(int trace)
const std::map< int, NormalVector > & GetTraceNormals(void)
IndexMapValuesSharedPtr GetIndexMap(const IndexMapKey &ikey)
DNekScalMatSharedPtr GetLocMatrix(const LocalRegions::MatrixKey &mkey)
Array< OneD, NekDouble > GetMFDiv(const int dir, const StdRegions::VarCoeffMap &varcoeffs)
void TraceNormLen(const int traceid, NekDouble &h, NekDouble &p)
StdRegions::StdExpansionSharedPtr GetLinStdExp(void) const
const NormalVector & GetTraceNormal(const int id)
Array< OneD, NekDouble > GetMF(const int dir, const int shapedim, const StdRegions::VarCoeffMap &varcoeffs)
SpatialDomains::GeomFactorsUniquePtr m_geomFactors
DNekMatSharedPtr BuildTransformationMatrix(const DNekScalMatSharedPtr &r_bnd, const StdRegions::MatrixType matrixType)
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
boost::call_traits< DataType >::const_reference x() const
boost::call_traits< DataType >::const_reference z() const
boost::call_traits< DataType >::const_reference y() const
Base class for shape geometry information.
int GetGlobalID(void) const
Get the ID of this object.
PointGeom * GetVertex(int i) const
Returns vertex i of this object.
int GetDir(const int i, const int j=0) const
Returns the element coordinate direction corresponding to a given face coordinate direction.
int GetVertexEdgeMap(int i, int j) const
Returns the standard element edge IDs that are connected to a given vertex.
int GetNumVerts() const
Get the number of vertices of this object.
int GetVertexFaceMap(int i, int j) const
Returns the standard element face IDs that are connected to a given vertex.
Geometry1D * GetEdge(int i) const
Returns edge i of this object.
Geometry2D * GetFace(int i) const
Returns face i of this object.
int GetEdgeFaceMap(int i, int j) const
Returns the standard element edge IDs that are connected to a given face.
int GetEdgeNormalToFaceVert(int i, int j) const
Returns the standard lement edge IDs that are normal to a given face vertex.
StdRegions::Orientation GetEorient(const int i) const
Returns the orientation of edge i with respect to the ordering of edges in the standard element.
StdRegions::Orientation GetForient(const int i) const
Returns the orientation of face i with respect to the ordering of faces in the standard element.
void Sub(PointGeom &a, PointGeom &b)
void Mult(PointGeom &a, PointGeom &b)
_this = a x b
NekDouble dot(PointGeom &a)
retun the dot product between this and input a
void UpdatePosition(NekDouble x, NekDouble y, NekDouble z)
bool v_IsCollocatedBasis() const final
int GetEdgeNcoeffs(const int i) const
This function returns the number of expansion coefficients belonging to the i-th edge.
int GetNedges() const
return the number of edges in 3D expansion
void v_MultiplyByStdQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
virtual void v_IProductWRTBaseKernel(const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const Array< OneD, NekDouble > &jac, const bool Deformed, bool CollDir0=false, bool CollDir1=false, bool CollDir2=false)=0
void GetEdgeInteriorToElementMap(const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation traceOrient=eForwards)
void GetBoundaryMap(Array< OneD, unsigned int > &outarray)
int GetNcoeffs(void) const
This function returns the total number of coefficients used in the expansion.
int GetTotPoints() const
This function returns the total number of quadrature points used in the element.
void FillMode(const int mode, Array< OneD, NekDouble > &outarray)
This function fills the array outarray with the mode-th mode of the expansion.
void DropLocStaticCondMatrix(const LocalRegions::MatrixKey &mkey)
int GetTraceNumPoints(const int i) const
This function returns the number of quadrature points belonging to the i-th trace.
int NumBndryCoeffs(void) const
DNekMatSharedPtr GetStdMatrix(const StdMatrixKey &mkey)
const LibUtilities::PointsKeyVector GetPointsKeys() const
int GetTraceIntNcoeffs(const int i) const
int NumDGBndryCoeffs(void) const
DNekScalBlkMatSharedPtr GetLocStaticCondMatrix(const LocalRegions::MatrixKey &mkey)
int GetVertexMap(const int localVertexId, bool useCoeffPacking=false)
void NormVectorIProductWRTBase(const Array< OneD, const NekDouble > &Fx, Array< OneD, NekDouble > &outarray)
void IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
this function calculates the inner product of a given function f with the different modes of the expa...
int GetNtraces() const
Returns the number of trace elements connected to this element.
int GetNverts() const
This function returns the number of vertices of the expansion domain.
void GetTraceToElementMap(const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation traceOrient=eForwards, int P=-1, int Q=-1)
LibUtilities::ShapeType DetShapeType() const
This function returns the shape of the expansion domain.
void GetTraceInteriorToElementMap(const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, const Orientation traceOrient=eForwards)
int GetTraceNcoeffs(const int i) const
This function returns the number of expansion coefficients belonging to the i-th trace.
DNekMatSharedPtr GenMatrix(const StdMatrixKey &mkey)
void GetTraceNumModes(const int tid, int &numModes0, int &numModes1, const Orientation traceOrient=eDir1FwdDir1_Dir2FwdDir2)
void FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
const LibUtilities::BasisKey GetTraceBasisKey(const int i, int k=-1, bool UseGLL=false) const
This function returns the basis key belonging to the i-th trace.
int GetBasisNumModes(const int dir) const
This function returns the number of expansion modes in the dir direction.
Array< OneD, LibUtilities::BasisSharedPtr > m_base
virtual void v_StdPhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2, Array< OneD, NekDouble > &out_d3)
bool IsBoundaryInteriorExpansion() const
bool HasVarCoeffForMatrixType(const StdRegions::MatrixType &mtype) const
LibUtilities::ShapeType GetShapeType() const
const Array< OneD, const NekDouble > & GetVarFactors(const StdRegions::ConstFactorType &type) const
const VarCoeffMap & GetVarCoeffs() const
MatrixType GetMatrixType() const
bool HasVarCoeff(const StdRegions::VarCoeffType &coeff) const
bool HasVarFactors(const StdRegions::ConstFactorType &type) const
const ConstFactorMap & GetConstFactors() const
const Array< OneD, const NekDouble > & GetVarCoeff(const StdRegions::VarCoeffType &coeff) const
NekDouble GetConstFactor(const ConstFactorType &factor) const
bool ConstFactorExists(const ConstFactorType &factor) const
static void Daxpy(const int &n, const double &alpha, const double *x, const int &incx, const double *y, const int &incy)
BLAS level 1: y = alpha x plus y.
constexpr int getNumberOfCoefficients(int Na, int Nb)
constexpr int getNumberOfCoefficients(int Na, int Nb)
void Interp2D(const BasisKey &fbasis0, const BasisKey &fbasis1, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, const BasisKey &tbasis1, Array< OneD, NekDouble > &to)
this function interpolates a 2D function evaluated at the quadrature points of the 2D basis,...
std::vector< PointsKey > PointsKeyVector
std::shared_ptr< Expansion > ExpansionSharedPtr
std::shared_ptr< IndexMapValues > IndexMapValuesSharedPtr
Array< OneD, Array< OneD, NekDouble > > NormalVector
@ eNoGeomType
No type defined.
@ eDeformed
Geometry is curved or has non-constant factors.
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
@ eLinearAdvectionReaction
@ eLinearAdvectionDiffusionReaction
@ eLinearAdvectionDiffusionReactionGJP
@ eInvLaplacianWithUnityMean
static ConstFactorMap NullConstFactorMap
@ eDir1BwdDir2_Dir2BwdDir1
@ eDir1FwdDir1_Dir2FwdDir2
@ eDir1BwdDir1_Dir2BwdDir2
@ eDir1BwdDir2_Dir2FwdDir1
@ eDir1FwdDir1_Dir2BwdDir2
@ eDir1BwdDir1_Dir2FwdDir2
@ eDir1FwdDir2_Dir2FwdDir1
@ eDir1FwdDir2_Dir2BwdDir1
static VarCoeffMap NullVarCoeffMap
std::map< StdRegions::VarCoeffType, VarCoeffEntry > VarCoeffMap
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
std::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
static DNekMatSharedPtr NullDNekMatSharedPtr
static Array< OneD, NekDouble > NullNekDouble1DArray
NekMatrix< InnerMatrixType, BlockMatrixTag > Transpose(NekMatrix< InnerMatrixType, BlockMatrixTag > &rhs)
std::shared_ptr< DNekMat > DNekMatSharedPtr
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
void Gathr(I n, const T *x, const I *y, T *z)
Gather vector z[i] = x[y[i]].
void Svtvp(int n, const T alpha, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Svtvp (scalar times vector plus vector): z = alpha*x + y.
void Neg(int n, T *x, const int incx)
Negate x = -x.
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
void Sdiv(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha/x.
void Zero(int n, T *x, const int incx)
Zero vector.
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
void Reverse(int n, const T *x, const int incx, T *y, const int incy)
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
scalarT< T > max(scalarT< T > lhs, scalarT< T > rhs)
scalarT< T > sqrt(scalarT< T > in)