35 #include <boost/core/ignore_unused.hpp>
64 m_session->LoadParameter(
"AdvectionJacFlag", ntmp, 1);
67 m_session->LoadParameter(
"ViscousJacFlag", ntmp, 1);
80 std::string SolverType =
"Newton";
81 if (
m_session->DefinesSolverInfo(
"NonlinSysIterSolver"))
83 SolverType =
m_session->GetSolverInfo(
"NonlinSysIterSolver");
86 "NekNonlinSys '" + SolverType +
"' is not defined.\n");
108 m_fields[0]->GetLocTraceToTraceMap();
110 locTraceToTraceMap->CalcLocTracePhysToTraceIDMap(
m_fields[0]->GetTrace(),
112 for (
int i = 1; i < nvariables; i++)
114 m_fields[i]->GetLocTraceToTraceMap()->SetLocTracePhysToTraceIDMap(
115 locTraceToTraceMap->GetLocTracephysToTraceIDMap());
154 boost::ignore_unused(flag);
155 unsigned int nvariables =
m_fields.size();
156 unsigned int npoints =
m_fields[0]->GetNcoeffs();
160 for (
int i = 0; i < nvariables; ++i)
162 int offset = i * npoints;
163 in2D[i] = inarray + offset;
164 out2D[i] = out + offset;
165 source2D[i] = source + offset;
180 unsigned int nvariable = inarray.size();
181 unsigned int ncoeffs = inarray[nvariable - 1].size();
182 unsigned int npoints =
m_fields[0]->GetNpoints();
186 for (
int i = 0; i < nvariable; ++i)
189 m_fields[i]->BwdTrans(inarray[i], inpnts[i]);
202 for (
int i = 0; i < nvariable; ++i)
210 for (
int i = 0; i < nvariable; ++i)
212 Vmath::Vsub(ncoeffs, out[i], 1, source[i], 1, out[i], 1);
227 int nvariables = inarray.size();
241 for (
int i = 0; i < nvariables; ++i)
245 m_fields[i]->GetFwdBwdTracePhys(inarray[i], Fwd[i], Bwd[i]);
256 for (
int i = 0; i < nvariables; ++i)
269 x->ApplyCoeff(
m_fields, inarray, outarray, time);
274 int nElements =
m_fields[0]->GetExpSize();
283 for (
int n = 0; n < nElements; ++n)
285 nq =
m_fields[0]->GetExp(n)->GetNcoeffs();
286 offset =
m_fields[0]->GetCoeff_Offset(n);
288 for (
int i = 0; i < nvariables; ++i)
291 tmp = outarray[i] + offset, 1);
306 int nvariables = inarray.size();
318 unsigned int nvariables = inpnts.size();
319 unsigned int ncoeffs =
m_fields[0]->GetNcoeffs();
320 unsigned int ntotal = nvariables * ncoeffs;
329 for (
int i = 0; i < nvariables; ++i)
331 int noffset = i * ncoeffs;
332 tmpArray = inarray + noffset;
333 m_fields[i]->FwdTrans(inpnts[i], tmpArray);
338 for (
int i = 0; i < nvariables; ++i)
340 int noffset = i * ncoeffs;
341 tmpArray = out + noffset;
342 m_fields[i]->BwdTrans(tmpArray, outpnt[i]);
351 boost::ignore_unused(inpnts);
356 unsigned int ntotal = inarray.size();
366 m_nonlinsol->SetupNekNonlinSystem(ntotal, inarray, inarray, 0);
378 unsigned int nvariables =
m_fields.size();
379 unsigned int ntotal = inarray.size();
380 unsigned int npoints = ntotal / nvariables;
382 unsigned int nTotalGlobal = ntotal;
384 unsigned int nTotalDOF = nTotalGlobal / nvariables;
390 for (
int i = 0; i < nvariables; ++i)
392 int offset = i * npoints;
394 Vmath::Dot(npoints, inarray + offset, inarray + offset);
398 for (
int i = 0; i < nvariables; ++i)
403 for (
int i = 2; i < nvariables - 1; ++i)
407 for (
int i = 2; i < nvariables - 1; ++i)
412 for (
int i = 0; i < nvariables; ++i)
418 for (
int i = 0; i < nvariables; ++i)
442 for (
int i = 0; i < nvariables; i++)
470 template <
typename DataType,
typename TypeNekBlkMatSharedPtr>
478 if (StdMatDataDBB.size() == 0)
483 int nSpaceDim =
m_graph->GetSpaceDimension();
484 int nvariable = inarray.size();
485 int npoints =
m_fields[0]->GetTotPoints();
486 int nVar2 = nvariable * nvariable;
487 std::shared_ptr<LocalRegions::ExpansionVector> expvect =
489 int nTotElmt = (*expvect).size();
500 for (
int i = 0; i < 3; i++)
504 normal3D[0][0] = 1.0;
505 normal3D[1][1] = 1.0;
506 normal3D[2][2] = 1.0;
512 nvariable - 1, nvariable, 0.0);
549 int nElmtCoefOld = -1;
550 for (
int ne = 0; ne < nTotElmt; ne++)
552 int nElmtCoef = (*expvect)[ne]->GetNcoeffs();
553 int nElmtCoef2 = nElmtCoef * nElmtCoef;
554 int nElmtPnt = (*expvect)[ne]->GetTotPoints();
558 int nQuotPlus = nQuot;
565 if (nElmtPnt > PntJacCons[0].size() || nElmtCoef > nElmtCoefOld)
567 nElmtCoefOld = nElmtCoef;
568 for (
int ndir = 0; ndir < 3; ndir++)
580 PntJacConsStd[ndir] =
582 for (
int i = 0; i < nElmtPnt; i++)
588 for (
int ndir1 = 0; ndir1 <
m_spacedim; ndir1++)
590 PntJacDerv[ndir][ndir1] =
592 PntJacDervStd[ndir][ndir1] =
596 for (
int i = 0; i < nElmtPnt; i++)
598 PntJacDerv[ndir][ndir1][i] =
600 PntJacDervStd[ndir][ndir1][i] =
608 for (
int j = 0; j < nvariable; j++)
610 locVars[j] = inarray[j] + noffset;
615 for (
int nFluxDir = 0; nFluxDir < nSpaceDim; nFluxDir++)
617 normals = normal3D[nFluxDir];
619 wspMat, PntJacCons[nFluxDir]);
625 for (
int j = 0; j < nSpaceDim; j++)
627 for (
int k = 0; k < nvariable; k++)
629 locDerv[j][k] = qfield[j][k] + noffset;
632 locmu = mu + noffset;
633 locDmuDT = DmuDT + noffset;
634 for (
int nFluxDir = 0; nFluxDir < nSpaceDim; nFluxDir++)
636 normals = normal3D[nFluxDir];
638 locDerv, locmu, locDmuDT, normals,
639 wspMatDrv, PntJacCons[nFluxDir]);
645 locmu = mu + noffset;
646 for (
int nFluxDir = 0; nFluxDir < nSpaceDim; nFluxDir++)
649 for (
int nDervDir = 0; nDervDir < nSpaceDim; nDervDir++)
652 nvariable, nElmtPnt, nDervDir, locVars, locmu,
653 normalPnt, wspMatDrv, PntJacDerv[nFluxDir][nDervDir]);
659 for (
int n = 0; n < nvariable; n++)
661 for (
int m = 0; m < nvariable; m++)
663 int nVarOffset = m + n * nvariable;
664 GmatxData = gmtxarray[m][n]->GetBlock(ne, ne)->GetPtr();
666 for (
int ndStd0 = 0; ndStd0 <
m_spacedim; ndStd0++)
672 for (
int i = 0; i < nElmtPnt; i++)
674 tmppnts[i] = PntJacCons[ndir][i][nVarOffset];
676 (*expvect)[ne]->AlignVectorToCollapsedDir(ndir, tmppnts,
680 Vmath::Vadd(nElmtPnt, ConsCurv[nd], 1, ConsStdd[nd], 1,
687 (*expvect)[ne]->MultiplyByQuadratureMetric(
688 ConsStdd[ndir], ConsStdd[ndir]);
689 for (
int i = 0; i < nElmtPnt; i++)
691 PntJacConsStd[ndir][i][nVarOffset] =
692 DataType(ConsStdd[ndir][i]);
700 for (
int m = 0; m < nvariable; m++)
702 for (
int n = 0; n < nvariable; n++)
704 int nVarOffset = m + n * nvariable;
705 for (
int ndStd0 = 0; ndStd0 <
m_spacedim; ndStd0++)
707 for (
int ndStd1 = 0; ndStd1 <
m_spacedim; ndStd1++)
709 Vmath::Zero(nElmtPnt, DervStdd[ndStd0][ndStd1], 1);
716 for (
int i = 0; i < nElmtPnt; i++)
719 PntJacDerv[nd0][nd1][i][nVarOffset];
722 (*expvect)[ne]->AlignVectorToCollapsedDir(
723 nd0, tmppnts, ConsCurv);
726 (*expvect)[ne]->AlignVectorToCollapsedDir(
727 nd1, ConsCurv[nd], DervCurv[nd]);
730 for (
int ndStd0 = 0; ndStd0 <
m_spacedim; ndStd0++)
736 DervCurv[ndStd0][ndStd1], 1,
737 DervStdd[ndStd0][ndStd1], 1,
738 DervStdd[ndStd0][ndStd1], 1);
747 (*expvect)[ne]->MultiplyByQuadratureMetric(
750 for (
int i = 0; i < nElmtPnt; i++)
752 PntJacDervStd[nd0][nd1][i][nVarOffset] =
753 -DataType(DervStdd[nd0][nd1][i]);
765 for (
int i = 0; i < nElmtPnt; i++)
768 &StdMatDataDBB[ne][ndir][i][0], 1,
769 &PntJacConsStd[ndir][i][0], 1, &MatData[0],
780 for (
int i = 0; i < nElmtPnt; i++)
783 &StdMatDataDBDB[ne][nd0][nd1][i][0], 1,
784 &PntJacDervStd[nd0][nd1][i][0], 1,
785 &MatData[0], nElmtCoef2Paded);
793 for (
int n = 0; n < nvariable; n++)
795 for (
int m = 0; m < nvariable; m++)
797 int nVarOffset = m + n * nvariable;
798 GmatxData = gmtxarray[m][n]->GetBlock(ne, ne)->GetPtr();
800 tmpA = MatData + nVarOffset * nElmtCoef2Paded, 1,
807 template <
typename DataType>
811 std::shared_ptr<LocalRegions::ExpansionVector> expvect =
813 int nTotElmt = (*expvect).size();
818 vector<DNekMatSharedPtr> VectStdDerivBase0;
819 vector<TensorOfArray3D<DataType>> VectStdDerivBase_Base;
820 vector<TensorOfArray4D<DataType>> VectStdDervBase_DervBase;
824 for (
int ne = 0; ne < nTotElmt; ne++)
827 stdExp = (*expvect)[ne]->GetStdExp();
829 stdExp->DetShapeType(), *stdExp);
830 MatStdDerivBase0 = stdExp->GetStdMatrix(matkey);
832 int nTotStdExp = VectStdDerivBase0.size();
833 int nFoundStdExp = -1;
834 for (
int i = 0; i < nTotStdExp; i++)
836 if ((*VectStdDerivBase0[i]) == (*MatStdDerivBase0))
841 if (nFoundStdExp >= 0)
843 StdMatDataDBB[ne] = VectStdDerivBase_Base[nFoundStdExp];
844 StdMatDataDBDB[ne] = VectStdDervBase_DervBase[nFoundStdExp];
848 int nElmtCoef = (*expvect)[ne]->GetNcoeffs();
849 int nElmtCoef2 = nElmtCoef * nElmtCoef;
850 int nElmtPnt = (*expvect)[ne]->GetTotPoints();
854 int nQuotPlus = nQuot;
861 ArrayStdMat[0] = MatStdDerivBase0;
866 ArrayStdMat[1] = stdExp->GetStdMatrix(matkey);
871 stdExp->DetShapeType(),
873 ArrayStdMat[2] = stdExp->GetStdMatrix(matkey);
878 ArrayStdMatData[nd0] = ArrayStdMat[nd0]->GetPtr();
882 stdExp->DetShapeType(), *stdExp);
892 for (
int i = 0; i < nElmtPnt; i++)
895 for (
int nc1 = 0; nc1 < nElmtCoef; nc1++)
897 int noffset = nc1 * nElmtCoef;
898 for (
int nc0 = 0; nc0 < nElmtCoef; nc0++)
900 tmpStdDBB[nd0][i][nc0 + noffset] = DataType(
901 ArrayStdMatData[nd0][i * nElmtCoef + nc0] *
902 BwdMatData[i * nElmtCoef + nc1]);
910 tmpStdDBDB[nd0][nd1] =
912 for (
int i = 0; i < nElmtPnt; i++)
914 tmpStdDBDB[nd0][nd1][i] =
916 for (
int nc1 = 0; nc1 < nElmtCoef; nc1++)
918 int noffset = nc1 * nElmtCoef;
919 for (
int nc0 = 0; nc0 < nElmtCoef; nc0++)
921 tmpStdDBDB[nd0][nd1][i][nc0 + noffset] =
924 [i * nElmtCoef + nc0] *
926 [i * nElmtCoef + nc1]);
932 VectStdDerivBase0.push_back(MatStdDerivBase0);
933 VectStdDerivBase_Base.push_back(tmpStdDBB);
934 VectStdDervBase_DervBase.push_back(tmpStdDBDB);
936 StdMatDataDBB[ne] = tmpStdDBB;
937 StdMatDataDBDB[ne] = tmpStdDBDB;
942 template <
typename DataType,
typename TypeNekBlkMatSharedPtr>
952 int nvariables = inarray.size();
956 GetTraceJac(inarray, qfield, TraceJac, TraceJacDeriv, TraceJacDerivSign,
966 gmtxarray, tmpJac, tmpSign);
971 template <
typename DataType,
typename TypeNekBlkMatSharedPtr>
974 TypeNekBlkMatSharedPtr &gmtVar,
const DataType &tmpDataType)
976 boost::ignore_unused(tmpDataType);
978 int n1d = gmtxarray.size();
979 int n2d = gmtxarray[0].size();
980 int nConvectiveFields = n1d;
982 ASSERTL0(n1d == n2d,
"ElmtVarInvMtrx requires n1d==n2d");
987 gmtxarray[0][0]->GetBlockSizes(rowSizes, colSizes);
988 int nTotElmt = rowSizes.size();
989 int nElmtCoef = rowSizes[0] - 1;
994 TypeNekBlkMatSharedPtr tmpGmtx;
999 for (
int nelmt = 0; nelmt < nTotElmt; nelmt++)
1001 int nrows = gmtxarray[0][0]->GetBlock(nelmt, nelmt)->GetRows();
1002 int ncols = gmtxarray[0][0]->GetBlock(nelmt, nelmt)->GetColumns();
1003 ASSERTL0(nrows == ncols,
"ElmtVarInvMtrx requires nrows==ncols");
1007 if (nElmtCoef0 != nElmtCoef)
1009 nElmtCoef0 = nElmtCoef;
1010 int nElmtCoefVar = nElmtCoef0 * nConvectiveFields;
1011 blocksize = nElmtCoefVar * nElmtCoefVar;
1012 tmprow[0] = nElmtCoefVar;
1014 GMatData = tmpGmtx->GetBlock(0, 0)->GetPtr();
1017 for (
int n = 0; n < nConvectiveFields; n++)
1019 for (
int m = 0; m < nConvectiveFields; m++)
1021 ElmtMatData = gmtxarray[m][n]->GetBlock(nelmt, nelmt)->GetPtr();
1023 for (
int ncl = 0; ncl < nElmtCoef; ncl++)
1026 (n * nElmtCoef + ncl) * nConvectiveFields * nElmtCoef +
1028 int Eoffset = ncl * nElmtCoef;
1030 Vmath::Vcopy(nElmtCoef, tmpArray1 = ElmtMatData + Eoffset,
1031 1, tmpArray2 = GMatData + Goffset, 1);
1036 tmpGmtx->GetBlock(0, 0)->Invert();
1038 for (
int m = 0; m < nConvectiveFields; m++)
1040 for (
int n = 0; n < nConvectiveFields; n++)
1042 ElmtMatData = gmtxarray[m][n]->GetBlock(nelmt, nelmt)->GetPtr();
1044 for (
int ncl = 0; ncl < nElmtCoef; ncl++)
1047 (n * nElmtCoef + ncl) * nConvectiveFields * nElmtCoef +
1049 int Eoffset = ncl * nElmtCoef;
1051 Vmath::Vcopy(nElmtCoef, tmpArray1 = GMatData + Goffset, 1,
1052 tmpArray2 = ElmtMatData + Eoffset, 1);
1056 ElmtMatData = gmtVar->GetBlock(nelmt, nelmt)->GetPtr();
1062 template <
typename DataType,
typename TypeNekBlkMatSharedPtr>
1071 boost::ignore_unused(TraceJacDeriv, TraceJacDerivSign);
1073 int nvariables = inarray.size();
1080 TypeNekBlkMatSharedPtr FJac, BJac;
1083 if (TraceJac.size() > 0)
1103 for (
int i = 0; i < nvariables; ++i)
1107 m_fields[i]->GetFwdBwdTracePhys(inarray[i], Fwd[i], Bwd[i]);
1115 TraceIPSymJacArray);
1121 template <
typename DataType,
typename TypeNekBlkMatSharedPtr>
1123 const int nConvectiveFields,
1130 TypeNekBlkMatSharedPtr &FJac, TypeNekBlkMatSharedPtr &BJac,
1133 boost::ignore_unused(TraceIPSymJacArray);
1136 int nvariables = nConvectiveFields;
1145 for (
int i = 0; i < nvariables; i++)
1157 for (
int i = 0; i < nvariables; ++i)
1163 fields[0]->GetTraceMap();
1168 for (
int nd = 0; nd < nDim; ++nd)
1172 for (
int i = 0; i < nConvectiveFields; ++i)
1177 fields[i]->GetFwdBwdTracePhys(qfield[nd][i], qFwd[nd][i],
1178 qBwd[nd][i],
true,
true,
false);
1179 TraceMap->GetAssemblyCommDG()->PerformExchange(qFwd[nd][i],
1186 PenaltyFactor2, fields, AdvVel, inarray, time,
1187 qfield, Fwd, Bwd, qFwd, qBwd, MuVarTrace,
1188 nonZeroIndex, numflux);
1190 int nFields = nvariables;
1195 for (
int i = 0; i < nFields; i++)
1204 for (
int i = 0; i < nFields; i++)
1214 for (
int i = 0; i < nFields; i++)
1218 Vmath::Sadd(nTracePts, epsvar, Fwd[i], 1, plusFwd[i], 1);
1222 for (
int i = 0; i < nFields; i++)
1229 x->Apply(FwdBnd, tmpinarry, time);
1233 for (
int j = 0; j < nFields; j++)
1235 m_fields[j]->FillBwdWithBoundCond(plusFwd[j], plusBwd[j]);
1239 PenaltyFactor2, fields, AdvVel, inarray, time,
1240 qfield, plusFwd, plusBwd, qFwd, qBwd, MuVarTrace,
1241 nonZeroIndex, plusflux);
1243 for (
int n = 0; n < nFields; n++)
1245 Vmath::Vsub(nTracePts, plusflux[n], 1, numflux[n], 1, Jacvect[n],
1247 Vmath::Smul(nTracePts, oepsvar, Jacvect[n], 1, Jacvect[n], 1);
1249 for (
int j = 0; j < nTracePts; j++)
1251 tmpMatData = FJac->GetBlock(j, j)->GetPtr();
1252 for (
int n = 0; n < nFields; n++)
1254 tmpMatData[n + i * nFields] = DataType(Jacvect[n][j]);
1264 for (
int i = 0; i < nFields; i++)
1271 x->Apply(FwdBnd, tmpinarry, time);
1275 for (
int i = 0; i < nFields; i++)
1280 for (
int i = 0; i < nFields; i++)
1285 Vmath::Sadd(nTracePts, epsvar, Bwd[i], 1, plusBwd[i], 1);
1287 for (
int j = 0; j < nFields; j++)
1289 m_fields[j]->FillBwdWithBoundCond(Fwd[j], plusBwd[j]);
1293 PenaltyFactor2, fields, AdvVel, inarray, time,
1294 qfield, Fwd, plusBwd, qFwd, qBwd, MuVarTrace,
1295 nonZeroIndex, plusflux);
1297 for (
int n = 0; n < nFields; n++)
1299 Vmath::Vsub(nTracePts, plusflux[n], 1, numflux[n], 1, Jacvect[n],
1301 Vmath::Smul(nTracePts, oepsvar, Jacvect[n], 1, Jacvect[n], 1);
1303 for (
int j = 0; j < nTracePts; j++)
1305 tmpMatData = BJac->GetBlock(j, j)->GetPtr();
1306 for (
int n = 0; n < nFields; n++)
1308 tmpMatData[n + i * nFields] = DataType(Jacvect[n][j]);
1317 const int nConvectiveFields,
const int nDim,
const int nPts,
1318 const int nTracePts,
const NekDouble PenaltyFactor2,
1330 boost::ignore_unused(nDim, nPts, PenaltyFactor2, time, qFwd, qBwd,
1341 for (
int i = 0; i < nConvectiveFields; i++)
1350 for (
int i = 0; i < nConvectiveFields; i++)
1355 m_diffusion->DiffuseTraceFlux(fields, inarray, qfield,
1357 vFwd, vBwd, nonZeroIndex);
1358 for (
int i = 0; i < nConvectiveFields; i++)
1360 Vmath::Vsub(nTracePts, traceflux[i], 1, visflux[i], 1, traceflux[i],
1395 TraceJacDerivSign, TraceIPSymJacArray);
1407 TraceJacDerivArray);
1411 const int nConvectiveFields,
const int nElmtPnt,
1418 boost::ignore_unused(nConvectiveFields, nElmtPnt, locVars, locDerv, locmu,
1419 locDmuDT, normals, wspMat, PntJacArray);
1423 template <
typename DataType,
typename TypeNekBlkMatSharedPtr>
1426 const NekDouble dtlamda,
const DataType tmpDataType)
1428 boost::ignore_unused(tmpDataType);
1431 std::shared_ptr<LocalRegions::ExpansionVector> pexp = explist->GetExp();
1432 int nTotElmt = (*pexp).size();
1433 int nConvectiveFields =
m_fields.size();
1438 Vmath::Fill(nTotElmt, Negdtlamda, pseudotimefactor, 1);
1441 for (
int m = 0; m < nConvectiveFields; m++)
1443 for (
int n = 0; n < nConvectiveFields; n++)
1445 for (
int nelmt = 0; nelmt < nTotElmt; nelmt++)
1447 GMatData = gmtxarray[m][n]->GetBlock(nelmt, nelmt)->GetPtr();
1448 DataType factor = DataType(pseudotimefactor[nelmt]);
1461 for (
int nelmt = 0; nelmt < nTotElmt; nelmt++)
1466 explist->GetExp(nelmt)->DetShapeType();
1468 if (tmp.size() != nelmtcoef || (ElmtTypeNow != ElmtTypePrevious))
1471 stdExp = explist->GetExp(nelmt)->GetStdExp();
1473 stdExp->DetShapeType(), *stdExp);
1476 BwdMatData = BwdMat->GetPtr();
1478 if (nelmtcoef != tmp.size())
1482 nelmtcoef, nelmtcoef, 0.0);
1483 MassMatData = MassMat->GetPtr();
1484 MassMatDataDataType =
1488 ElmtTypePrevious = ElmtTypeNow;
1491 for (
int np = 0; np < nelmtcoef; np++)
1493 explist->GetExp(nelmt)->IProductWRTBase(BwdMatData + np * nelmtpnts,
1495 Vmath::Vcopy(nelmtcoef, tmp, 1, tmp2 = MassMatData + np * nelmtcoef,
1498 for (
int i = 0; i < MassMatData.size(); i++)
1500 MassMatDataDataType[i] = DataType(MassMatData[i]);
1503 for (
int m = 0; m < nConvectiveFields; m++)
1505 GMatData = gmtxarray[m][m]->GetBlock(nelmt, nelmt)->GetPtr();
1506 Vmath::Vadd(MassMatData.size(), MassMatDataDataType, 1, GMatData, 1,
1513 template <
typename DataType,
typename TypeNekBlkMatSharedPtr>
1520 boost::ignore_unused(TraceJacArray, TraceJacDeriv, TraceJacDerivArray);
1522 int nFwdBwd, nDiagBlks, nvar0Jac, nvar1Jac;
1526 nFwdBwd = TraceJac.size();
1527 TraceJac[0]->GetBlockSizes(rowSizes, colSizes);
1528 nDiagBlks = rowSizes.size();
1529 nvar0Jac = rowSizes[1] - rowSizes[0];
1530 nvar1Jac = colSizes[1] - colSizes[0];
1532 if (0 == TraceJacArray.size())
1535 for (
int nlr = 0; nlr < nFwdBwd; nlr++)
1538 for (
int m = 0; m < nvar0Jac; m++)
1540 TraceJacArray[nlr][m] =
1542 for (
int n = 0; n < nvar1Jac; n++)
1550 for (
int nlr = 0; nlr < nFwdBwd; nlr++)
1552 const TypeNekBlkMatSharedPtr tmpMat = TraceJac[nlr];
1567 boost::ignore_unused(explist, normals, nDervDir, inarray, ElmtJacArray,
1573 const int nConvectiveFields,
const int nElmtPnt,
const int nDervDir,
1579 boost::ignore_unused(nConvectiveFields, nElmtPnt, nDervDir, locVars, locmu,
1580 locnormal, wspMat, PntJacArray);
1591 boost::ignore_unused(explist, normals, nDervDir, inarray, ElmtJac);
1595 const int nConvectiveFields,
const int nElmtPnt,
1602 int matsize = nConvectiveFields * nConvectiveFields;
1606 for (
int npnt = 0; npnt < nElmtPnt; npnt++)
1608 for (
int j = 0; j < nConvectiveFields; j++)
1610 pointVar[j] = locVars[j][npnt];
1615 Vmath::Vcopy(matsize, wspMatData, 1, PntJacArray[npnt], 1);
1624 int nvariables = conservVar.size();
1625 const int nvariables3D = 5;
1629 efix_StegerWarming = 0.0;
1631 if (nvariables > expDim + 2)
1638 fluxJacData = fluxJac->GetPtr();
1640 if (nConvectiveFields == nvariables3D)
1652 PointFJac3DData = PointFJac3D->GetPtr();
1658 index[nvariables - 1] = 4;
1659 for (
int i = 0; i < nvariables - 1; i++)
1666 for (
int j = 0; j < nvariables; j++)
1669 PointFwd[nj] = conservVar[j];
1673 efix_StegerWarming, fsw);
1675 for (
int j = 0; j < nvariables; j++)
1678 for (
int k = 0; k < nvariables; k++)
1681 fluxJacData[j + k * nConvectiveFields] =
1682 PointFJac3DData[nj + nk * nvariables3D];
1705 boost::ignore_unused(flag);
1712 unsigned int nTotalGlobal = inarray.size();
1718 unsigned int ntotal = inarray.size();
1722 Vmath::Svtvp(ntotal, eps, inarray, 1, refsol, 1, solplus, 1);
1726 Vmath::Vsub(ntotal, resplus, 1, refres, 1, out, 1);
1732 template <
typename DataType,
typename TypeNekBlkMatSharedPtr>
1738 BlkMat->GetBlockSizes(rowSizes, colSizes);
1739 int nDiagBlks = rowSizes.size();
1740 int nvar0 = rowSizes[1] - rowSizes[0];
1741 int nvar1 = colSizes[1] - colSizes[0];
1745 for (
int i = 0; i < nDiagBlks; i++)
1747 ElmtMatData = BlkMat->GetBlock(i, i)->GetPtr();
1748 for (
int n = 0; n < nvar1; n++)
1750 int noffset = n * nvar0;
1751 for (
int m = 0; m < nvar0; m++)
1753 MatArray[m][n][i] = ElmtMatData[m + noffset];
1759 template <
typename DataType,
typename TypeNekBlkMatSharedPtr>
1762 const DataType valu)
1765 int n1d = gmtxarray.size();
1767 for (
int n1 = 0; n1 < n1d; ++n1)
1773 template <
typename DataType,
typename TypeNekBlkMatSharedPtr>
1777 int n1d = gmtxarray.size();
1784 for (
int n1 = 0; n1 < n1d; ++n1)
1786 gmtxarray[n1]->GetBlockSizes(rowSizes, colSizes);
1787 int nelmts = rowSizes.size();
1789 for (
int i = 0; i < nelmts; ++i)
1791 loc_mat_arr = gmtxarray[n1]->GetBlock(i, i)->GetPtr();
1793 int nrows = gmtxarray[n1]->GetBlock(i, i)->GetRows();
1794 int ncols = gmtxarray[n1]->GetBlock(i, i)->GetColumns();
1812 const int nvariables3D = 5;
1815 NekDouble a, a2, h, h0, v2, vn, eps, eps2;
1818 NekDouble l1, l4, l5, al1, al4, al5, x1, x2, x3, y1;
1819 NekDouble c1, d1, c2, d2, c3, d3, c4, d4, c5, d5;
1836 NekDouble eL = (EL - 0.5 * (rhouL * vx + rhovL * vy + rhowL * vz)) / rhoL;
1838 ps =
m_varConv->Geteos()->GetPressure(rhoL, eL);
1842 v2 = vx * vx + vy * vy + vz * vz;
1843 a2 = gama * ps / ro;
1852 vn = nx * vx + ny * vy + nz * vz;
1853 sn = std::max(
sqrt(nx * nx + ny * ny + nz * nz), sml_ssf);
1867 al1 =
sqrt(l1 * l1 + eps2);
1868 al4 =
sqrt(l4 * l4 + eps2);
1869 al5 =
sqrt(l5 * l5 + eps2);
1871 l1 = 0.5 * (fExactorSplt * l1 + fsw * al1);
1872 l4 = 0.5 * (fExactorSplt * l4 + fsw * al4);
1873 l5 = 0.5 * (fExactorSplt * l5 + fsw * al5);
1875 x1 = 0.5 * (l4 + l5);
1876 x2 = 0.5 * (l4 - l5);
1883 int nVar1 = nvariables3D;
1884 int nVar2 = 2 * nvariables3D;
1885 int nVar3 = 3 * nvariables3D;
1886 int nVar4 = 4 * nvariables3D;
1887 FJacData[nVar0] = c1 * y1 - d1 * vna + l1;
1888 FJacData[nVar1] = -c1 * vx + d1 * nxa;
1889 FJacData[nVar2] = -c1 * vy + d1 * nya;
1890 FJacData[nVar3] = -c1 * vz + d1 * nza;
1891 FJacData[nVar4] = c1;
1892 c2 = c1 * vx + d1 * nxa * ae;
1893 d2 = x3 * nxa + d1 * vx;
1894 FJacData[1 + nVar0] = c2 * y1 - d2 * vna;
1895 FJacData[1 + nVar1] = -c2 * vx + d2 * nxa + l1;
1896 FJacData[1 + nVar2] = -c2 * vy + d2 * nya;
1897 FJacData[1 + nVar3] = -c2 * vz + d2 * nza;
1898 FJacData[1 + nVar4] = c2;
1899 c3 = c1 * vy + d1 * nya * ae;
1900 d3 = x3 * nya + d1 * vy;
1901 FJacData[2 + nVar0] = c3 * y1 - d3 * vna;
1902 FJacData[2 + nVar1] = -c3 * vx + d3 * nxa;
1903 FJacData[2 + nVar2] = -c3 * vy + d3 * nya + l1;
1904 FJacData[2 + nVar3] = -c3 * vz + d3 * nza;
1905 FJacData[2 + nVar4] = c3;
1906 c4 = c1 * vz + d1 * nza * ae;
1907 d4 = x3 * nza + d1 * vz;
1908 FJacData[3 + nVar0] = c4 * y1 - d4 * vna;
1909 FJacData[3 + nVar1] = -c4 * vx + d4 * nxa;
1910 FJacData[3 + nVar2] = -c4 * vy + d4 * nya;
1911 FJacData[3 + nVar3] = -c4 * vz + d4 * nza + l1;
1912 FJacData[3 + nVar4] = c4;
1913 c5 = c1 * h0 + d1 * vna * ae;
1914 d5 = x3 * vna + d1 * h0;
1915 FJacData[4 + nVar0] = c5 * y1 - d5 * vna;
1916 FJacData[4 + nVar1] = -c5 * vx + d5 * nxa;
1917 FJacData[4 + nVar2] = -c5 * vy + d5 * nya;
1918 FJacData[4 + nVar3] = -c5 * vz + d5 * nza;
1919 FJacData[4 + nVar4] = c5 + l1;
#define ASSERTL0(condition, msg)
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
size_type size() const
Returns the array's size.
virtual bool v_UpdateTimeStepCheck() override
void DoDiffusionCoeff(const Array< OneD, const Array< OneD, NekDouble >> &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray, const Array< OneD, const Array< OneD, NekDouble >> &pFwd, const Array< OneD, const Array< OneD, NekDouble >> &pBwd)
Add the diffusions terms to the right-hand side Similar to DoDiffusion() but with outarray in coeffic...
void CalcVolJacStdMat(TensorOfArray4D< DataType > &StdMatDataDBB, TensorOfArray5D< DataType > &StdMatDataDBDB)
void ElmtVarInvMtrx(Array< OneD, Array< OneD, TypeNekBlkMatSharedPtr >> &gmtxarray, TypeNekBlkMatSharedPtr &gmtVar, const DataType &tmpDatatype)
void DoAdvectionCoeff(const Array< OneD, const Array< OneD, NekDouble >> &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray, const NekDouble time, const Array< OneD, const Array< OneD, NekDouble >> &pFwd, const Array< OneD, const Array< OneD, NekDouble >> &pBwd)
Compute the advection terms for the right-hand side.
virtual void v_DoDiffusionCoeff(const Array< OneD, const Array< OneD, NekDouble >> &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray, const Array< OneD, const Array< OneD, NekDouble >> &pFwd, const Array< OneD, const Array< OneD, NekDouble >> &pBwd)
LibUtilities::NekNonlinSysSharedPtr m_nonlinsol
void AddMatNSBlkDiagVol(const Array< OneD, const Array< OneD, NekDouble >> &inarray, const Array< OneD, const TensorOfArray2D< NekDouble >> &qfield, Array< OneD, Array< OneD, TypeNekBlkMatSharedPtr >> &gmtxarray, TensorOfArray4D< DataType > &StdMatDataDBB, TensorOfArray5D< DataType > &StdMatDataDBDB)
void PointFluxJacobianPoint(const Array< OneD, NekDouble > &Fwd, const Array< OneD, NekDouble > &normals, DNekMatSharedPtr &FJac, const NekDouble efix, const NekDouble fsw)
NekDouble m_jacobiFreeEps
void PreconCoeff(const Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const bool &flag)
void MultiplyElmtInvMassPlusSource(Array< OneD, Array< OneD, TypeNekBlkMatSharedPtr >> &gmtxarray, const NekDouble dtlamda, const DataType tmpDataType)
void NonlinSysEvaluatorCoeff1D(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out, const bool &flag)
void CalcRefValues(const Array< OneD, const NekDouble > &inarray)
virtual void v_GetFluxDerivJacDirctn(const MultiRegions::ExpListSharedPtr &explist, const Array< OneD, const Array< OneD, NekDouble >> &normals, const int nDervDir, const Array< OneD, const Array< OneD, NekDouble >> &inarray, TensorOfArray5D< NekDouble > &ElmtJacArray, const int nFluxDir)
void GetFluxVectorJacDirElmt(const int nConvectiveFields, const int nElmtPnt, const Array< OneD, const Array< OneD, NekDouble >> &locVars, const Array< OneD, NekDouble > &normals, DNekMatSharedPtr &wspMat, Array< OneD, Array< OneD, NekDouble >> &PntJacArray)
void Fill2DArrayOfBlkDiagonalMat(Array< OneD, Array< OneD, TypeNekBlkMatSharedPtr >> &gmtxarray, const DataType valu)
void DoImplicitSolveCoeff(const Array< OneD, const Array< OneD, NekDouble >> &inpnts, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out, const NekDouble time, const NekDouble lambda)
void CalcTraceNumericalFlux(const int nConvectiveFields, const int nDim, const int nPts, const int nTracePts, const NekDouble PenaltyFactor2, const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, const Array< OneD, NekDouble >> &AdvVel, const Array< OneD, const Array< OneD, NekDouble >> &inarray, const NekDouble time, TensorOfArray3D< NekDouble > &qfield, const Array< OneD, const Array< OneD, NekDouble >> &vFwd, const Array< OneD, const Array< OneD, NekDouble >> &vBwd, const Array< OneD, const TensorOfArray2D< NekDouble >> &qFwd, const Array< OneD, const TensorOfArray2D< NekDouble >> &qBwd, const Array< OneD, NekDouble > &MuVarTrace, Array< OneD, int > &nonZeroIndex, Array< OneD, Array< OneD, NekDouble >> &traceflux)
Array< OneD, Array< OneD, NekDouble > > m_solutionPhys
void AllocateNekBlkMatDig(SNekBlkMatSharedPtr &mat, const Array< OneD, unsigned int > nrow, const Array< OneD, unsigned int > ncol)
TensorOfArray4D< NekSingle > m_stdSMatDataDBB
void NonlinSysEvaluatorCoeff(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out, const bool &flag=true, const Array< OneD, const NekDouble > &source=NullNekDouble1DArray)
void TranSamesizeBlkDiagMatIntoArray(const TypeNekBlkMatSharedPtr &BlkMat, TensorOfArray3D< DataType > &MatArray)
void NumCalcRiemFluxJac(const int nConvectiveFields, const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, const Array< OneD, NekDouble >> &AdvVel, const Array< OneD, const Array< OneD, NekDouble >> &inarray, TensorOfArray3D< NekDouble > &qfield, const NekDouble &time, const Array< OneD, const Array< OneD, NekDouble >> &Fwd, const Array< OneD, const Array< OneD, NekDouble >> &Bwd, TypeNekBlkMatSharedPtr &FJac, TypeNekBlkMatSharedPtr &BJac, TensorOfArray5D< DataType > &TraceIPSymJacArray)
PreconCfsOpSharedPtr m_preconCfs
NekDouble m_newtonAbsoluteIteTol
virtual ~CFSImplicit()
Destructor for CFSImplicit class.
void DoOdeRhsCoeff(const Array< OneD, const Array< OneD, NekDouble >> &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray, const NekDouble time)
Compute the right-hand side.
void GetTraceJac(const Array< OneD, const Array< OneD, NekDouble >> &inarray, TensorOfArray3D< NekDouble > &qfield, Array< OneD, TypeNekBlkMatSharedPtr > &TraceJac, Array< OneD, TypeNekBlkMatSharedPtr > &TraceJacDeriv, Array< OneD, Array< OneD, DataType >> &TraceJacDerivSign, TensorOfArray5D< DataType > &TraceIPSymJacArray)
void GetFluxVectorJacPoint(const int nConvectiveFields, const Array< OneD, NekDouble > &conservVar, const Array< OneD, NekDouble > &normals, DNekMatSharedPtr &fluxJac)
bool m_updateShockCaptPhys
TensorOfArray5D< NekSingle > m_stdSMatDataDBDB
void GetFluxDerivJacDirctnElmt(const int nConvectiveFields, const int nElmtPnt, const int nDervDir, const Array< OneD, const Array< OneD, NekDouble >> &locVars, const Array< OneD, NekDouble > &locmu, const Array< OneD, const Array< OneD, NekDouble >> &locnormal, DNekMatSharedPtr &wspMat, Array< OneD, Array< OneD, NekDouble >> &PntJacArray)
void MatrixMultiplyMatrixFreeCoeff(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out, const bool &flag=false)
virtual void v_MinusDiffusionFluxJacPoint(const int nConvectiveFields, const int nElmtPnt, const Array< OneD, const Array< OneD, NekDouble >> &locVars, const TensorOfArray3D< NekDouble > &locDerv, const Array< OneD, NekDouble > &locmu, const Array< OneD, NekDouble > &locDmuDT, const Array< OneD, NekDouble > &normals, DNekMatSharedPtr &wspMat, Array< OneD, Array< OneD, NekDouble >> &PntJacArray)
void CalcPreconMatBRJCoeff(const Array< OneD, const Array< OneD, NekDouble >> &inarray, Array< OneD, Array< OneD, SNekBlkMatSharedPtr >> &gmtxarray, SNekBlkMatSharedPtr &gmtVar, Array< OneD, SNekBlkMatSharedPtr > &TraceJac, Array< OneD, SNekBlkMatSharedPtr > &TraceJacDeriv, Array< OneD, Array< OneD, NekSingle >> &TraceJacDerivSign, TensorOfArray4D< NekSingle > &TraceJacArray, TensorOfArray4D< NekSingle > &TraceJacDerivArray, TensorOfArray5D< NekSingle > &TraceIPSymJacArray)
void TransTraceJacMatToArray(const Array< OneD, TypeNekBlkMatSharedPtr > &TraceJac, const Array< OneD, TypeNekBlkMatSharedPtr > &TraceJacDeriv, TensorOfArray4D< DataType > &TraceJacArray, TensorOfArray4D< DataType > &TraceJacDerivArray)
void AddMatNSBlkDiagBnd(const Array< OneD, const Array< OneD, NekDouble >> &inarray, TensorOfArray3D< NekDouble > &qfield, TensorOfArray2D< TypeNekBlkMatSharedPtr > &gmtxarray, Array< OneD, TypeNekBlkMatSharedPtr > &TraceJac, Array< OneD, TypeNekBlkMatSharedPtr > &TraceJacDeriv, Array< OneD, Array< OneD, DataType >> &TraceJacDerivSign, TensorOfArray5D< DataType > &TraceIPSymJacArray)
void CalcPhysDeriv(const Array< OneD, const Array< OneD, NekDouble >> &inarray, TensorOfArray3D< NekDouble > &qfield)
void MinusDiffusionFluxJacPoint(const int nConvectiveFields, const int nElmtPnt, const Array< OneD, const Array< OneD, NekDouble >> &locVars, const TensorOfArray3D< NekDouble > &locDerv, const Array< OneD, NekDouble > &locmu, const Array< OneD, NekDouble > &locDmuDT, const Array< OneD, NekDouble > &normals, DNekMatSharedPtr &wspMat, Array< OneD, Array< OneD, NekDouble >> &PntJacArray)
void DoImplicitSolve(const Array< OneD, const Array< OneD, NekDouble >> &inpnts, Array< OneD, Array< OneD, NekDouble >> &outpnt, const NekDouble time, const NekDouble lambda)
void Fill1DArrayOfBlkDiagonalMat(Array< OneD, TypeNekBlkMatSharedPtr > &gmtxarray, const DataType valu)
void InitialiseNonlinSysSolver()
virtual void v_InitObject(bool DeclareFields=true) override
Initialization object for CFSImplicit class.
void CalcMuDmuDT(const Array< OneD, const Array< OneD, NekDouble >> &inarray, Array< OneD, NekDouble > &mu, Array< OneD, NekDouble > &DmuDT)
virtual void v_GetFluxDerivJacDirctnElmt(const int nConvectiveFields, const int nElmtPnt, const int nDervDir, const Array< OneD, const Array< OneD, NekDouble >> &locVars, const Array< OneD, NekDouble > &locmu, const Array< OneD, const Array< OneD, NekDouble >> &locnormal, DNekMatSharedPtr &wspMat, Array< OneD, Array< OneD, NekDouble >> &PntJacArray)
NekDouble m_bndEvaluateTime
SolverUtils::DiffusionSharedPtr m_diffusion
virtual void v_InitObject(bool DeclareFields=true) override
Initialization object for CompressibleFlowSystem class.
std::vector< CFSBndCondSharedPtr > m_bndConds
void GetElmtTimeStep(const Array< OneD, const Array< OneD, NekDouble >> &inarray, Array< OneD, NekDouble > &tstep)
Calculate the maximum timestep on each element subject to CFL restrictions.
void DoOdeProjection(const Array< OneD, const Array< OneD, NekDouble >> &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray, const NekDouble time)
Compute the projection and call the method for imposing the boundary conditions in case of discontinu...
VariableConverterSharedPtr m_varConv
std::vector< SolverUtils::ForcingSharedPtr > m_forcing
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
NekDouble m_NonlinIterTolRelativeL2
int m_NekNonlinSysMaxIterations
NekDouble m_LinSysRelativeTolInNonlin
int m_NekLinSysMaxIterations
void DefineNekSysResEval(FuncPointerT func, ObjectPointerT obj)
void DefineNekSysLhsEval(FuncPointerT func, ObjectPointerT obj)
void DefineNekSysPrecon(FuncPointerT func, ObjectPointerT obj)
void DefineImplicitSolve(FuncPointerT func, ObjectPointerT obj)
void AccumulateRegion(std::string, int iolevel=0)
Accumulate elapsed time for a region.
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
void DefineCalcPreconMatBRJCoeff(FuncPointerT func, ObjectPointerT obj)
SolverUtils::AdvectionSharedPtr m_advObject
Advection term.
int m_spacedim
Spatial dimension (>= expansion dim).
SpatialDomains::MeshGraphSharedPtr m_graph
Pointer to graph defining mesh.
LibUtilities::CommSharedPtr m_comm
Communicator.
NekDouble m_timestep
Time step size.
NekDouble m_time
Current time of simulation.
SOLVER_UTILS_EXPORT int GetTraceTotPoints()
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
NekDouble m_fintime
Finish time of the simulation.
NekDouble m_lastCheckTime
NekDouble m_checktime
Time between checkpoints.
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
enum HomogeneousType m_HomogeneousType
SOLVER_UTILS_EXPORT int GetNpoints()
SOLVER_UTILS_EXPORT int GetNcoeffs()
SOLVER_UTILS_EXPORT int GetPhys_Offset(int n)
SOLVER_UTILS_EXPORT int GetTotPoints()
Base class for unsteady solvers.
LibUtilities::TimeIntegrationSchemeOperators m_ode
The time integration scheme operators to use.
NekDouble m_TimeIntegLambda
coefff of spacial derivatives(rhs or m_F in GLM) in calculating the residual of the whole equation(us...
bool m_explicitAdvection
Indicates if explicit or implicit treatment of advection is used.
bool m_explicitDiffusion
Indicates if explicit or implicit treatment of diffusion is used.
bool m_flagImplicitSolver
Array< OneD, NekDouble > m_magnitdEstimat
estimate the magnitude of each conserved varibles
bool m_flagUpdatePreconMat
static void Ger(const int &m, const int &n, const double &alpha, const double *x, const int &incx, const double *y, const int &incy, double *a, const int &lda)
BLAS level 2: Matrix vector multiply A = alpha*x*y**T + A where A[m x n].
NekNonlinSysFactory & GetNekNonlinSysFactory()
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< AssemblyMapDG > AssemblyMapDGSharedPtr
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
std::shared_ptr< LocTraceToTraceMap > LocTraceToTraceMapSharedPtr
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
The above copyright notice and this permission notice shall be included.
std::shared_ptr< SNekBlkMat > SNekBlkMatSharedPtr
static Array< OneD, Array< OneD, NekDouble > > NullNekDoubleArrayOfArray
static Array< OneD, Array< OneD, Array< OneD, NekDouble > > > NullNekDoubleTensorOfArray3D
static Array< OneD, NekDouble > NullNekDouble1DArray
std::shared_ptr< DNekMat > DNekMatSharedPtr
PreconCfsOpFactory & GetPreconCfsOpFactory()
Declaration of the boundary condition factory singleton.
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.
T Dot(int n, const T *w, const T *x)
dot (vector times vector): z = w*x
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = 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 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 Sadd(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Add scalar y = alpha + x.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
void Vsub(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Subtract vector z = x-y.
scalarT< T > abs(scalarT< T > in)
scalarT< T > sqrt(scalarT< T > in)