46using namespace LibUtilities;
56 "LowEnergy Preconditioning");
66 const std::shared_ptr<GlobalLinSys> &plinsys,
78 "Solver type not valid");
80 std::shared_ptr<MultiRegions::ExpList> expList =
81 ((
m_linsys.lock())->GetLocMat()).lock();
85 locExpansion = expList->GetExp(0);
87 int nDim = locExpansion->GetShapeDimension();
89 ASSERTL0(nDim == 3,
"Preconditioner type only valid in 3D");
117 std::shared_ptr<MultiRegions::ExpList> expList =
118 ((
m_linsys.lock())->GetLocMat()).lock();
125 int nVerts, nEdges, nFaces;
126 int eid, fid, n, cnt, nmodes, nedgemodes, nfacemodes;
130 int vMap1, vMap2, sign1, sign2;
131 int m, v, eMap1, eMap2, fMap1, fMap2;
132 int offset, globalrow, globalcol, nCoeffs;
138 expList->GetPeriodicEntities(periodicVerts, periodicEdges, periodicFaces);
156 int nDirBnd = asmMap->GetNumGlobalDirBndCoeffs();
157 int nNonDirVerts = asmMap->GetNumNonDirVertexModes();
161 nNonDirVerts, nNonDirVerts, zero, vertstorage);
167 int n_exp = expList->GetNumElmts();
168 int nNonDirEdgeIDs = asmMap->GetNumNonDirEdges();
169 int nNonDirFaceIDs = asmMap->GetNumNonDirFaces();
173 map<int, int> uniqueEdgeMap;
174 map<int, int> uniqueFaceMap;
181 expList->GetBndCondExpansions();
184 &bndConditions = expList->GetBndConditions();
191 for (i = 0; i < extradiredges.size(); ++i)
193 meshEdgeId = extradiredges[i];
194 edgeDirMap.insert(meshEdgeId);
198 for (i = 0; i < bndCondExp.size(); i++)
201 for (j = 0; j < bndCondExp[i]->GetNumElmts(); j++)
204 std::dynamic_pointer_cast<LocalRegions::Expansion2D>(
205 bndCondExp[i]->GetExp(j));
206 if (bndConditions[i]->GetBoundaryConditionType() ==
209 for (k = 0; k < bndCondFaceExp->GetNtraces(); k++)
211 meshEdgeId = bndCondFaceExp->GetGeom()->GetEid(k);
212 if (edgeDirMap.count(meshEdgeId) == 0)
214 edgeDirMap.insert(meshEdgeId);
217 meshFaceId = bndCondFaceExp->GetGeom()->GetGlobalID();
218 faceDirMap.insert(meshFaceId);
226 int nlocalNonDirEdges = 0;
227 int nlocalNonDirFaces = 0;
228 int ntotalentries = 0;
230 map<int, int> EdgeSize;
231 map<int, int> FaceSize;
232 map<int, pair<int, int>> FaceModes;
235 for (n = 0; n < n_exp; ++n)
240 for (j = 0; j < nEdges; ++j)
242 int nEdgeInteriorCoeffs = locExpansion->GetEdgeNcoeffs(j) - 2;
246 if (EdgeSize.count(meshEdgeId) == 0)
248 EdgeSize[meshEdgeId] = nEdgeInteriorCoeffs;
252 EdgeSize[meshEdgeId] =
253 min(EdgeSize[meshEdgeId], nEdgeInteriorCoeffs);
257 nFaces = locExpansion->GetNtraces();
258 for (j = 0; j < nFaces; ++j)
260 int nFaceInteriorCoeffs = locExpansion->GetTraceIntNcoeffs(j);
261 meshFaceId = locExpansion->GetGeom3D()->GetFid(j);
263 if (FaceSize.count(meshFaceId) == 0)
265 FaceSize[meshFaceId] = nFaceInteriorCoeffs;
268 locExpansion->GetTraceNumModes(j, m0, m1,
269 locExpansion->GetTraceOrient(j));
270 FaceModes[meshFaceId] = pair<int, int>(m0, m1);
274 if (nFaceInteriorCoeffs < FaceSize[meshFaceId])
276 FaceSize[meshFaceId] = nFaceInteriorCoeffs;
278 locExpansion->GetTraceNumModes(
279 j, m0, m1, locExpansion->GetTraceOrient(j));
280 FaceModes[meshFaceId] = pair<int, int>(m0, m1);
286 bool verbose = expList->GetSession()->DefinesCmdLineArgument(
"verbose");
290 if (vComm->GetSize() > 1)
292 int EdgeSizeLen = EdgeSize.size();
293 int FaceSizeLen = FaceSize.size();
297 map<int, int>::iterator it;
301 for (it = EdgeSize.begin(); it != EdgeSize.end(); ++it, ++cnt)
303 FacetMap[cnt] = it->first;
304 maxid = max(it->first, maxid);
305 FacetLen[cnt] = it->second;
311 for (it = FaceSize.begin(); it != FaceSize.end(); ++it, ++cnt)
313 FacetMap[cnt] = it->first + maxid;
314 FacetLen[cnt] = it->second;
323 for (it = EdgeSize.begin(); it != EdgeSize.end(); ++it, ++cnt)
325 it->second = (int)FacetLen[cnt];
328 for (it = FaceSize.begin(); it != FaceSize.end(); ++it, ++cnt)
330 it->second = (int)FacetLen[cnt];
337 int matrixlocation = 0;
340 for (
auto &pIt : periodicEdges)
342 meshEdgeId = pIt.first;
344 if (edgeDirMap.count(meshEdgeId) == 0)
346 dof = EdgeSize[meshEdgeId];
347 if (uniqueEdgeMap.count(meshEdgeId) == 0 && dof > 0)
349 bool SetUpNewEdge =
true;
351 for (i = 0; i < pIt.second.size(); ++i)
353 if (!pIt.second[i].isLocal)
358 int meshEdgeId2 = pIt.second[i].id;
359 if (edgeDirMap.count(meshEdgeId2) == 0)
361 if (uniqueEdgeMap.count(meshEdgeId2) != 0)
364 uniqueEdgeMap[meshEdgeId] =
365 uniqueEdgeMap[meshEdgeId2];
366 SetUpNewEdge =
false;
371 edgeDirMap.insert(meshEdgeId);
372 SetUpNewEdge =
false;
378 uniqueEdgeMap[meshEdgeId] = matrixlocation;
379 globaloffset[matrixlocation] += ntotalentries;
380 modeoffset[matrixlocation] = dof * dof;
381 ntotalentries += dof * dof;
382 nblks[matrixlocation++] = dof;
388 for (cnt = n = 0; n < n_exp; ++n)
392 for (j = 0; j < locExpansion->GetNedges(); ++j)
394 meshEdgeId = locExpansion->
GetGeom()->GetEid(j);
395 dof = EdgeSize[meshEdgeId];
396 maxEdgeDof = (dof > maxEdgeDof ? dof : maxEdgeDof);
398 if (edgeDirMap.count(meshEdgeId) == 0)
400 if (uniqueEdgeMap.count(meshEdgeId) == 0 && dof > 0)
403 uniqueEdgeMap[meshEdgeId] = matrixlocation;
405 globaloffset[matrixlocation] += ntotalentries;
406 modeoffset[matrixlocation] = dof * dof;
407 ntotalentries += dof * dof;
408 nblks[matrixlocation++] = dof;
410 nlocalNonDirEdges += dof * dof;
418 for (
auto &pIt : periodicFaces)
420 meshFaceId = pIt.first;
422 if (faceDirMap.count(meshFaceId) == 0)
424 dof = FaceSize[meshFaceId];
426 if (uniqueFaceMap.count(meshFaceId) == 0 && dof > 0)
428 bool SetUpNewFace =
true;
430 if (pIt.second[0].isLocal)
432 int meshFaceId2 = pIt.second[0].id;
434 if (faceDirMap.count(meshFaceId2) == 0)
436 if (uniqueFaceMap.count(meshFaceId2) != 0)
439 uniqueFaceMap[meshFaceId] =
440 uniqueFaceMap[meshFaceId2];
441 SetUpNewFace =
false;
446 faceDirMap.insert(meshFaceId);
447 SetUpNewFace =
false;
453 uniqueFaceMap[meshFaceId] = matrixlocation;
455 modeoffset[matrixlocation] = dof * dof;
456 globaloffset[matrixlocation] += ntotalentries;
457 ntotalentries += dof * dof;
458 nblks[matrixlocation++] = dof;
464 for (cnt = n = 0; n < n_exp; ++n)
468 for (j = 0; j < locExpansion->GetNtraces(); ++j)
470 meshFaceId = locExpansion->
GetGeom()->GetFid(j);
472 dof = FaceSize[meshFaceId];
473 maxFaceDof = (dof > maxFaceDof ? dof : maxFaceDof);
475 if (faceDirMap.count(meshFaceId) == 0)
477 if (uniqueFaceMap.count(meshFaceId) == 0 && dof > 0)
479 uniqueFaceMap[meshFaceId] = matrixlocation;
480 modeoffset[matrixlocation] = dof * dof;
481 globaloffset[matrixlocation] += ntotalentries;
482 ntotalentries += dof * dof;
483 nblks[matrixlocation++] = dof;
485 nlocalNonDirFaces += dof * dof;
496 nlocalNonDirEdges + nlocalNonDirFaces, -1);
502 int matrixoffset = 0;
504 int uniEdgeOffset = 0;
508 for (n = 0; n < n_exp; ++n)
510 for (j = 0; j < locExpansion->GetNedges(); ++j)
516 uniEdgeOffset = max(meshEdgeId, uniEdgeOffset);
521 vComm->AllReduce(uniEdgeOffset,
ReduceMax);
522 uniEdgeOffset = uniEdgeOffset * maxEdgeDof * maxEdgeDof;
524 for (n = 0; n < n_exp; ++n)
529 for (j = 0; j < locExpansion->GetNedges(); ++j)
532 meshEdgeId = locExpansion->
GetGeom()->GetEid(j);
534 nedgemodes = EdgeSize[meshEdgeId];
536 if (edgeDirMap.count(meshEdgeId) == 0 && nedgemodes > 0)
539 int edgeOffset = globaloffset[uniqueEdgeMap[meshEdgeId]];
542 int uniOffset = meshEdgeId;
543 auto pIt = periodicEdges.find(meshEdgeId);
544 if (pIt != periodicEdges.end())
546 for (
int l = 0; l < pIt->second.size(); ++l)
548 uniOffset = min(uniOffset, pIt->second[l].id);
551 uniOffset = uniOffset * maxEdgeDof * maxEdgeDof;
553 for (k = 0; k < nedgemodes * nedgemodes; ++k)
555 vGlobal = edgeOffset + k;
556 localToGlobalMatrixMap[matrixoffset + k] = vGlobal;
557 BlockToUniversalMap[vGlobal] = uniOffset + k + 1;
559 matrixoffset += nedgemodes * nedgemodes;
566 for (j = 0; j < locExpansion->GetNtraces(); ++j)
569 meshFaceId = locExpansion->GetGeom()->GetFid(j);
571 nfacemodes = FaceSize[meshFaceId];
574 if (faceDirMap.count(meshFaceId) == 0 && nfacemodes > 0)
577 int faceOffset = globaloffset[uniqueFaceMap[meshFaceId]];
579 int uniOffset = meshFaceId;
581 auto pIt = periodicFaces.find(meshFaceId);
582 if (pIt != periodicFaces.end())
584 uniOffset = min(uniOffset, pIt->second[0].id);
586 uniOffset = uniOffset * maxFaceDof * maxFaceDof;
588 for (k = 0; k < nfacemodes * nfacemodes; ++k)
590 vGlobal = faceOffset + k;
592 localToGlobalMatrixMap[matrixoffset + k] = vGlobal;
594 BlockToUniversalMap[vGlobal] =
595 uniOffset + uniEdgeOffset + k + 1;
597 matrixoffset += nfacemodes * nfacemodes;
604 map<int, int>::iterator it;
606 n_blks[0] = nNonDirVerts;
607 for (i = 1, it = nblks.begin(); it != nblks.end(); ++it)
609 n_blks[i++] = it->second;
618 for (cnt = n = 0; n < n_exp; ++n)
630 nVerts = locExpansion->GetGeom()->GetNumVerts();
631 nEdges = locExpansion->GetGeom()->GetNumEdges();
632 nFaces = locExpansion->GetGeom()->GetNumFaces();
635 loc_mat = (
m_linsys.lock())->GetStaticCondBlock(n);
638 bnd_mat = loc_mat->GetBlock(0, 0);
641 offset = bnd_mat->GetRows();
645 DNekMat Sloc(nCoeffs, nCoeffs);
650 for (
int i = 0; i < nCoeffs; ++i)
652 for (
int j = 0; j < nCoeffs; ++j)
656 Sloc.SetValue(i, j, val);
665 for (v = 0; v < nVerts; ++v)
667 vMap1 = locExpansion->GetVertexMap(v);
670 globalrow = asmMap->GetLocalToGlobalBndMap(cnt + vMap1) - nDirBnd;
674 for (m = 0; m < nVerts; ++m)
676 vMap2 = locExpansion->GetVertexMap(m);
681 asmMap->GetLocalToGlobalBndMap(cnt + vMap2) - nDirBnd;
684 if (globalcol == globalrow)
687 sign1 = asmMap->GetLocalToGlobalBndSign(cnt + vMap1);
688 sign2 = asmMap->GetLocalToGlobalBndSign(cnt + vMap2);
690 vertArray[globalrow] +=
691 sign1 * sign2 * RSRT(vMap1, vMap2);
693 meshVertId = locExpansion->GetGeom()->GetVid(v);
695 auto pIt = periodicVerts.find(meshVertId);
696 if (pIt != periodicVerts.end())
698 for (k = 0; k < pIt->second.size(); ++k)
700 meshVertId = min(meshVertId, pIt->second[k].id);
704 VertBlockToUniversalMap[globalrow] = meshVertId + 1;
711 for (eid = 0; eid < nEdges; ++eid)
717 nedgemodes = EdgeSize[meshEdgeId];
723 nedgemodes, nedgemodes, zero, storage);
726 locExpansion->GetEdgeInverseBoundaryMap(eid);
728 if (edgeDirMap.count(meshEdgeId) == 0)
730 for (v = 0; v < nedgemodesloc; ++v)
732 eMap1 = edgemodearray[v];
733 sign1 = asmMap->GetLocalToGlobalBndSign(cnt + eMap1);
740 for (m = 0; m < nedgemodesloc; ++m)
742 eMap2 = edgemodearray[m];
746 asmMap->GetLocalToGlobalBndSign(cnt + eMap2);
749 sign1 * sign2 * RSRT(eMap1, eMap2);
754 BlockArray[matrixoffset + v * nedgemodes + m] =
759 matrixoffset += nedgemodes * nedgemodes;
765 for (fid = 0; fid < nFaces; ++fid)
771 nfacemodes = FaceSize[meshFaceId];
776 nfacemodes, nfacemodes, zero, storage);
778 if (faceDirMap.count(meshFaceId) == 0)
782 locExpansion->GetTraceOrient(fid);
784 auto pIt = periodicFaces.find(meshFaceId);
785 if (pIt != periodicFaces.end())
787 if (meshFaceId == min(meshFaceId, pIt->second[0].id))
790 faceOrient, pIt->second[0].orient);
794 facemodearray = locExpansion->GetTraceInverseBoundaryMap(
795 fid, faceOrient, FaceModes[meshFaceId].first,
796 FaceModes[meshFaceId].second);
798 for (v = 0; v < nfacemodes; ++v)
800 fMap1 = facemodearray[v];
802 sign1 = asmMap->GetLocalToGlobalBndSign(cnt + fMap1);
805 "Something is wrong since we "
806 "shoudl only be extracting modes for "
807 "lowest order expansion");
809 for (m = 0; m < nfacemodes; ++m)
811 fMap2 = facemodearray[m];
815 asmMap->GetLocalToGlobalBndSign(cnt + fMap2);
818 "Something is wrong since "
819 "we shoudl only be extracting modes for "
820 "lowest order expansion");
825 sign1 * sign2 * RSRT(fMap1, fMap2);
829 BlockArray[matrixoffset + v * nfacemodes + m] =
833 matrixoffset += nfacemodes * nfacemodes;
851 Vmath::Assmb(BlockArray.size(), BlockArray, localToGlobalMatrixMap,
861 for (
int i = 0; i < nNonDirVerts; ++i)
863 VertBlk->SetValue(i, i, 1.0 / vertArray[i]);
874 for (
int loc = 0;
loc < n_blks.size() - 1; ++
loc)
876 nmodes = n_blks[1 +
loc];
880 for (v = 0; v < nmodes; ++v)
882 for (m = 0; m < nmodes; ++m)
884 NekDouble Value = GlobalBlock[offset + v * nmodes + m];
885 gmat->SetValue(v, m, Value);
889 offset += modeoffset[
loc];
893 int totblks =
m_BlkMat->GetNumberOfBlockRows();
894 for (i = 1; i < totblks; ++i)
896 unsigned int nmodes =
m_BlkMat->GetNumberOfRowsInBlockRow(i);
920 ASSERTL0(isLocal ==
false,
"PreconditionerLowEnergy is only currently "
921 "set up for Global iteratives sovles");
924 int nNonDir = nGlobal - nDir;
941 std::shared_ptr<MultiRegions::ExpList> expList =
942 ((
m_linsys.lock())->GetLocMat()).lock();
945 map<int, int> EdgeSize;
949 std::map<ShapeType, DNekScalMatSharedPtr> maxRmat;
950 map<ShapeType, LocalRegions::Expansion3DSharedPtr> maxElmt;
951 map<ShapeType, Array<OneD, unsigned int>> vertMapMaxR;
952 map<ShapeType, Array<OneD, Array<OneD, unsigned int>>> edgeMapMaxR;
961 int n_exp = expList->GetNumElmts();
967 nbdry_size, nbdry_size, blkmatStorage);
969 nbdry_size, nbdry_size, blkmatStorage);
979 for (n = 0; n < n_exp; ++n)
985 int nbndcoeffs = locExp->NumBndryCoeffs();
989 rmat =
ExtractLocMat(locExp, maxRmat[eltype], maxElmt[eltype],
990 vertMapMaxR[eltype], edgeMapMaxR[eltype]);
992 m_RBlk->SetBlock(n, n, rmat);
1000 m_sameBlock.push_back(pair<int, int>(1, nbndcoeffs));
1009 for (
int i = 0; i < 3; ++i)
1011 if (locExpSav->GetBasis(i) != locExp->GetBasis(i))
1020 m_RBlk->SetBlock(n, n, rmat);
1024 (pair<int, int>(
m_sameBlock[offset].first + 1, nbndcoeffs));
1028 rmat =
ExtractLocMat(locExp, maxRmat[eltype], maxElmt[eltype],
1029 vertMapMaxR[eltype], edgeMapMaxR[eltype]);
1032 m_RBlk->SetBlock(n, n, rmat);
1039 m_sameBlock.push_back(pair<int, int>(1, nbndcoeffs));
1057 int nLocBndDofs =
m_locToGloMap.lock()->GetNumLocalBndCoeffs();
1074 Blas::Dgemm(
'N',
'N', nbndcoeffs, nexp, nbndcoeffs, 1.0,
1075 &(R.GetBlock(cnt1, cnt1)->GetPtr()[0]), nbndcoeffs,
1076 pLocalIn.get() + cnt, nbndcoeffs, 0.0, pInOut.get() + cnt,
1078 cnt += nbndcoeffs * nexp;
1095 int nLocBndDofs =
m_locToGloMap.lock()->GetNumLocalBndCoeffs();
1097 ASSERTL1(pInOut.size() >= nLocBndDofs,
1098 "Output array is not greater than the nLocBndDofs");
1112 Blas::Dgemm(
'T',
'N', nbndcoeffs, nexp, nbndcoeffs, 1.0,
1113 &(R.GetBlock(cnt1, cnt1)->GetPtr()[0]), nbndcoeffs,
1114 pLocalIn.get() + cnt, nbndcoeffs, 0.0, pInOut.get() + cnt,
1116 cnt += nbndcoeffs * nexp;
1133 int nLocBndDofs =
m_locToGloMap.lock()->GetNumLocalBndCoeffs();
1135 ASSERTL1(pInput.size() >= nLocBndDofs,
1136 "Input array is smaller than nLocBndDofs");
1137 ASSERTL1(pOutput.size() >= nLocBndDofs,
1138 "Output array is smaller than nLocBndDofs");
1152 Blas::Dgemm(
'N',
'N', nbndcoeffs, nexp, nbndcoeffs, 1.0,
1153 &(invR.GetBlock(cnt1, cnt1)->GetPtr()[0]), nbndcoeffs,
1154 pLocalIn.get() + cnt, nbndcoeffs, 0.0, pOutput.get() + cnt,
1156 cnt += nbndcoeffs * nexp;
1171 int nLocBndDofs =
m_locToGloMap.lock()->GetNumLocalBndCoeffs();
1173 ASSERTL1(pInput.size() >= nLocBndDofs,
1174 "Input array is less than nLocBndDofs");
1175 ASSERTL1(pOutput.size() >= nLocBndDofs,
1176 "Output array is less than nLocBndDofs");
1190 Blas::Dgemm(
'T',
'N', nbndcoeffs, nexp, nbndcoeffs, 1.0,
1191 &(invR.GetBlock(cnt1, cnt1)->GetPtr()[0]), nbndcoeffs,
1192 pLocalIn.get() + cnt, nbndcoeffs, 0.0, pOutput.get() + cnt,
1194 cnt += nbndcoeffs * nexp;
1207 int n,
int bndoffset,
const std::shared_ptr<DNekScalMat> &loc_mat)
1209 std::shared_ptr<MultiRegions::ExpList> expList =
1210 ((
m_linsys.lock())->GetLocMat()).lock();
1213 locExpansion = expList->GetExp(n);
1214 unsigned int nbnd = locExpansion->NumBndryCoeffs();
1231 for (
int i = 0; i < nbnd; ++i)
1233 for (
int j = 0; j < nbnd; ++j)
1237 Sloc.SetValue(i, j, val);
1258 unsigned int nLocBnd = asmMap->GetNumLocalBndCoeffs();
1269 asmMap->GetLocalToGlobalBndSign();
1271 for (i = 0; i < nLocBnd; ++i)
1288 const int three = 3;
1289 const int nVerts = 6;
1290 const double point[][3] = {
1295 {0, -1,
sqrt(
double(3))},
1296 {0, 1,
sqrt(
double(3))},
1301 for (
int i = 0; i < nVerts; ++i)
1304 three, i, point[i][0], point[i][1], point[i][2]);
1306 const int nEdges = 9;
1307 const int vertexConnectivity[][2] = {{0, 1}, {1, 2}, {3, 2}, {0, 3}, {0, 4},
1308 {1, 4}, {2, 5}, {3, 5}, {4, 5}};
1312 for (
int i = 0; i < nEdges; ++i)
1315 for (
int j = 0; j < 2; ++j)
1317 vertsArray[j] = verts[vertexConnectivity[i][j]];
1320 i, three, vertsArray);
1327 const int nFaces = 5;
1329 const int quadEdgeConnectivity[][4] = {
1330 {0, 1, 2, 3}, {1, 6, 8, 5}, {3, 7, 8, 4}};
1332 const int quadId[] = {0, -1, 1, -1, 2};
1335 const int triEdgeConnectivity[][3] = {{0, 5, 4}, {2, 6, 7}};
1337 const int triId[] = {-1, 0, -1, 1, -1};
1341 for (
int f = 0; f < nFaces; ++f)
1343 if (f == 1 || f == 3)
1347 for (
int j = 0; j < 3; ++j)
1349 edgeArray[j] = edges[triEdgeConnectivity[i][j]];
1359 for (
int j = 0; j < 4; ++j)
1361 edgeArray[j] = edges[quadEdgeConnectivity[i][j]];
1385 const int nVerts = 5;
1386 const double point[][3] = {{-1, -1, 0},
1390 {0, 0,
sqrt(
double(2))}};
1393 const int three = 3;
1395 for (
int i = 0; i < nVerts; ++i)
1398 three, i, point[i][0], point[i][1], point[i][2]);
1400 const int nEdges = 8;
1401 const int vertexConnectivity[][2] = {{0, 1}, {1, 2}, {2, 3}, {3, 0},
1402 {0, 4}, {1, 4}, {2, 4}, {3, 4}};
1406 for (
int i = 0; i < nEdges; ++i)
1409 for (
int j = 0; j < 2; ++j)
1411 vertsArray[j] = verts[vertexConnectivity[i][j]];
1414 i, three, vertsArray);
1421 const int nFaces = 5;
1423 const int quadEdgeConnectivity[][4] = {{0, 1, 2, 3}};
1426 const int triEdgeConnectivity[][3] = {
1427 {0, 5, 4}, {1, 6, 5}, {2, 7, 6}, {3, 4, 7}};
1431 for (
int f = 0; f < nFaces; ++f)
1436 for (
int j = 0; j < 4; ++j)
1438 edgeArray[j] = edges[quadEdgeConnectivity[f][j]];
1449 for (
int j = 0; j < 3; ++j)
1451 edgeArray[j] = edges[triEdgeConnectivity[i][j]];
1476 const int three = 3;
1477 const int nVerts = 4;
1478 const double point[][3] = {{-1, -1 /
sqrt(
double(3)), -1 /
sqrt(
double(6))},
1479 {1, -1 /
sqrt(
double(3)), -1 /
sqrt(
double(6))},
1480 {0, 2 /
sqrt(
double(3)), -1 /
sqrt(
double(6))},
1481 {0, 0, 3 /
sqrt(
double(6))}};
1483 std::shared_ptr<SpatialDomains::PointGeom> verts[4];
1484 for (i = 0; i < nVerts; ++i)
1487 three, i, point[i][0], point[i][1], point[i][2]);
1495 const int nEdges = 6;
1496 const int vertexConnectivity[][2] = {{0, 1}, {1, 2}, {0, 2},
1497 {0, 3}, {1, 3}, {2, 3}};
1501 for (i = 0; i < nEdges; ++i)
1503 std::shared_ptr<SpatialDomains::PointGeom> vertsArray[2];
1504 for (j = 0; j < 2; ++j)
1506 vertsArray[j] = verts[vertexConnectivity[i][j]];
1510 i, three, vertsArray);
1517 const int nFaces = 4;
1518 const int edgeConnectivity[][3] = {
1519 {0, 1, 2}, {0, 4, 3}, {1, 5, 4}, {2, 5, 3}};
1523 for (i = 0; i < nFaces; ++i)
1526 for (j = 0; j < 3; ++j)
1528 edgeArray[j] = edges[edgeConnectivity[i][j]];
1551 const int three = 3;
1553 const int nVerts = 8;
1554 const double point[][3] = {{0, 0, 0}, {1, 0, 0}, {1, 1, 0}, {0, 1, 0},
1555 {0, 0, 1}, {1, 0, 1}, {1, 1, 1}, {0, 1, 1}};
1559 for (
int i = 0; i < nVerts; ++i)
1562 three, i, point[i][0], point[i][1], point[i][2]);
1570 const int nEdges = 12;
1571 const int vertexConnectivity[][2] = {{0, 1}, {1, 2}, {2, 3}, {0, 3},
1572 {0, 4}, {1, 5}, {2, 6}, {3, 7},
1573 {4, 5}, {5, 6}, {6, 7}, {4, 7}};
1577 for (
int i = 0; i < nEdges; ++i)
1580 for (
int j = 0; j < 2; ++j)
1582 vertsArray[j] = verts[vertexConnectivity[i][j]];
1585 i, three, vertsArray);
1592 const int nFaces = 6;
1593 const int edgeConnectivity[][4] = {{0, 1, 2, 3}, {0, 5, 8, 4},
1594 {1, 6, 9, 5}, {2, 7, 10, 6},
1595 {3, 7, 11, 4}, {8, 9, 10, 11}};
1599 for (
int i = 0; i < nFaces; ++i)
1602 for (
int j = 0; j < 4; ++j)
1604 edgeArray[j] = edges[edgeConnectivity[i][j]];
1623 std::map<ShapeType, DNekScalMatSharedPtr> &maxRmat,
1624 map<ShapeType, LocalRegions::Expansion3DSharedPtr> &maxElmt,
1628 std::shared_ptr<MultiRegions::ExpList> expList =
1629 ((
m_linsys.lock())->GetLocMat()).lock();
1637 map<ShapeType, Array<OneD, Array<OneD, unsigned int>>> faceMapMaxR;
1640 int nummodesmax = 0;
1643 for (
int n = 0; n < expList->GetNumElmts(); ++n)
1645 locExp = expList->GetExp(n);
1647 nummodesmax = max(nummodesmax, locExp->GetBasisNumModes(0));
1648 nummodesmax = max(nummodesmax, locExp->GetBasisNumModes(1));
1649 nummodesmax = max(nummodesmax, locExp->GetBasisNumModes(2));
1651 Shapes[locExp->DetShapeType()] = 1;
1654 vComm->AllReduce(nummodesmax,
ReduceMax);
1698 HexBa, HexBb, HexBc, hexgeom);
1703 HexExp->GetInverseBoundaryMaps(vmap, emap, fmap);
1711 maxRmat[
eHexahedron] = HexExp->GetLocMatrix(HexR);
1712 HexExp->DropLocMatrix(HexR);
1722 PointsKey(nummodesmax, eGaussRadauMAlpha1Beta0));
1724 PointsKey(nummodesmax, eGaussRadauMAlpha2Beta0));
1730 TetBa, TetBb, TetBc, tetgeom);
1734 TetExp->GetInverseBoundaryMaps(vmap, emap, fmap);
1743 TetExp->DropLocMatrix(TetR);
1748 edgeMapMaxR, faceMapMaxR);
1762 PointsKey(nummodesmax, eGaussRadauMAlpha2Beta0));
1768 PyrBa, PyrBb, PyrBc, pyrgeom);
1773 PyrExp->GetInverseBoundaryMaps(vmap, emap, fmap);
1780 SetUpPyrMaxRMat(nummodesmax, PyrExp, maxRmat, vertMapMaxR, edgeMapMaxR,
1795 PointsKey(nummodesmax, eGaussRadauMAlpha1Beta0));
1801 PrismBa, PrismBb, PrismBc, prismgeom);
1802 maxElmt[
ePrism] = PrismExp;
1805 PrismExp->GetInverseBoundaryMaps(vmap, emap, fmap);
1806 vertMapMaxR[
ePrism] = vmap;
1807 edgeMapMaxR[
ePrism] = emap;
1809 faceMapMaxR[
ePrism] = fmap;
1814 edgeMapMaxR, faceMapMaxR,
false);
1821 maxRmat[
ePrism] = PrismExp->GetLocMatrix(PrismR);
1822 PrismExp->DropLocMatrix(
1828 edgeMapMaxR, faceMapMaxR,
true);
1836 std::map<ShapeType, DNekScalMatSharedPtr> &maxRmat,
1841 int nRows = PyrExp->NumBndryCoeffs();
1848 for (
int i = 0; i < nRows; ++i)
1850 newmat->SetValue(i, i, 1.0);
1858 const int nadjedge[] = {3, 3, 3, 3, 4};
1859 const int VEHexVert[][4] = {{0, 0, 0, -1},
1864 const int VEHexEdge[][4] = {{0, 3, 4, -1},
1869 const int VEPyrEdge[][4] = {{0, 3, 4, -1},
1876 for (
int v = 0; v < 5; ++v)
1878 for (
int e = 0; e < nadjedge[v]; ++e)
1880 for (
int i = 0; i < nummodesmax - 2; ++i)
1887 newmat->SetValue(vertMapMaxR[
ePyramid][v],
1888 edgeMapMaxR[
ePyramid][VEPyrEdge[v][e]][i],
1895 nfacemodes = (nummodesmax - 2) * (nummodesmax - 2);
1897 for (
int v = 0; v < 4; ++v)
1899 for (
int i = 0; i < nfacemodes; ++i)
1903 newmat->SetValue(vertMapMaxR[
ePyramid][v],
1908 const int nadjface[] = {2, 2, 2, 2, 4};
1909 const int VFTetVert[][4] = {{0, 0, -1, -1},
1914 const int VFTetFace[][4] = {{1, 3, -1, -1},
1919 const int VFPyrFace[][4] = {{1, 4, -1, -1},
1926 nfacemodes = (nummodesmax - 3) * (nummodesmax - 2) / 2;
1927 for (
int v = 0; v < 5; ++v)
1929 for (
int f = 0; f < nadjface[v]; ++f)
1931 for (
int i = 0; i < nfacemodes; ++i)
1936 newmat->SetValue(vertMapMaxR[
ePyramid][v],
1937 faceMapMaxR[
ePyramid][VFPyrFace[v][f]][i],
1945 nfacemodes = (nummodesmax - 2) * (nummodesmax - 2);
1946 for (
int e = 0; e < 4; ++e)
1948 for (
int i = 0; i < nummodesmax - 2; ++i)
1950 for (
int j = 0; j < nfacemodes; ++j)
1955 val = (*maxRmat[
eHexahedron])(edgemapid, facemapid);
1956 newmat->SetValue(edgeMapMaxR[
ePyramid][e][i],
1962 const int nadjface1[] = {1, 1, 1, 1, 2, 2, 2, 2};
1963 const int EFTetEdge[][2] = {{0, -1}, {1, -1}, {0, -1}, {2, -1},
1964 {3, 3}, {4, 4}, {5, 5}, {3, 5}};
1965 const int EFTetFace[][2] = {{1, -1}, {2, -1}, {1, -1}, {3, -1},
1966 {1, 3}, {1, 2}, {2, 3}, {1, 3}};
1967 const int EFPyrFace[][2] = {{1, -1}, {2, -1}, {3, -1}, {4, -1},
1968 {1, 4}, {1, 2}, {2, 3}, {3, 4}};
1971 nfacemodes = (nummodesmax - 3) * (nummodesmax - 2) / 2;
1972 for (
int e = 0; e < 8; ++e)
1974 for (
int f = 0; f < nadjface1[e]; ++f)
1976 for (
int i = 0; i < nummodesmax - 2; ++i)
1978 for (
int j = 0; j < nfacemodes; ++j)
1986 newmat->SetValue(edgeMapMaxR[
ePyramid][e][i],
1987 faceMapMaxR[
ePyramid][EFPyrFace[e][f]][j],
2001 std::map<ShapeType, DNekScalMatSharedPtr> &maxRmat,
2007 int nRows = TetExp->NumBndryCoeffs();
2014 for (
int i = 0; i < nRows; ++i)
2016 for (
int j = 0; j < nRows; ++j)
2019 newmat->SetValue(i, j, val);
2028 const int VEHexVert[][4] = {{0, 0, 0}, {1, 1, 1}, {2, 2, 2}, {4, 5, 6}};
2029 const int VEHexEdge[][4] = {{0, 3, 4}, {0, 1, 5}, {1, 2, 6}, {4, 5, 6}};
2030 const int VETetEdge[][4] = {{0, 2, 3}, {0, 1, 4}, {1, 2, 5}, {3, 4, 5}};
2033 for (
int v = 0; v < 4; ++v)
2035 for (
int e = 0; e < 3; ++e)
2037 for (
int i = 0; i < nummodesmax - 2; ++i)
2059 std::map<ShapeType, DNekScalMatSharedPtr> &maxRmat,
2065 int nRows = PrismExp->NumBndryCoeffs();
2076 for (
int i = 0; i < nRows; ++i)
2078 for (
int j = 0; j < nRows; ++j)
2080 val = (*maxRmat[
ePrism])(i, j);
2081 newmat->SetValue(i, j, val);
2086 const int VETetVert[][2] = {{0, 0}, {1, 1}, {1, 1},
2087 {0, 0}, {3, 3}, {3, 3}};
2088 const int VETetEdge[][2] = {{0, 3}, {0, 4}, {0, 4},
2089 {0, 3}, {3, 4}, {4, 3}};
2090 const int VEPrismEdge[][2] = {{0, 4}, {0, 5}, {2, 6},
2091 {2, 7}, {4, 5}, {6, 7}};
2094 for (
int v = 0; v < 6; ++v)
2096 for (
int e = 0; e < 2; ++e)
2098 for (
int i = 0; i < nummodesmax - 2; ++i)
2105 newmat->SetValue(vertMapMaxR[
ePrism][v],
2106 edgeMapMaxR[
ePrism][VEPrismEdge[v][e]][i],
2115 for (
int i = 0; i < nRows; ++i)
2117 newmat->SetValue(i, i, 1.0);
2127 const int VEHexVert[][3] = {{0, 0, 0}, {1, 1, 1}, {2, 2, 2},
2128 {3, 3, 3}, {4, 5, 5}, {6, 7, 7}};
2129 const int VEHexEdge[][3] = {{0, 3, 4}, {0, 1, 5}, {1, 2, 6},
2130 {2, 3, 7}, {4, 5, 9}, {6, 7, 11}};
2131 const int VEPrismEdge[][3] = {{0, 3, 4}, {0, 1, 5}, {1, 2, 6},
2132 {2, 3, 7}, {4, 5, 8}, {6, 7, 8}};
2135 for (
int v = 0; v < 6; ++v)
2137 for (
int e = 0; e < 3; ++e)
2139 for (
int i = 0; i < nummodesmax - 2; ++i)
2146 newmat->SetValue(vertMapMaxR[
ePrism][v],
2147 edgeMapMaxR[
ePrism][VEPrismEdge[v][e]][i],
2154 const int VFHexVert[][2] = {{0, 0}, {1, 1}, {4, 5},
2155 {2, 2}, {3, 3}, {6, 7}};
2156 const int VFHexFace[][2] = {{0, 4}, {0, 2}, {4, 2},
2157 {0, 2}, {0, 4}, {2, 4}};
2159 const int VQFPrismVert[][2] = {{0, 0}, {1, 1}, {4, 4},
2160 {2, 2}, {3, 3}, {5, 5}};
2161 const int VQFPrismFace[][2] = {{0, 4}, {0, 2}, {4, 2},
2162 {0, 2}, {0, 4}, {2, 4}};
2164 nfacemodes = (nummodesmax - 2) * (nummodesmax - 2);
2166 for (
int v = 0; v < 6; ++v)
2168 for (
int f = 0; f < 2; ++f)
2170 for (
int i = 0; i < nfacemodes; ++i)
2175 newmat->SetValue(vertMapMaxR[
ePrism][VQFPrismVert[v][f]],
2176 faceMapMaxR[
ePrism][VQFPrismFace[v][f]][i],
2183 const int nadjface[] = {1, 2, 1, 2, 1, 1, 1, 1, 2};
2184 const int EFHexEdge[][2] = {{0, -1}, {1, 1}, {2, -1}, {3, 3}, {4, -1},
2185 {5, -1}, {6, -1}, {7, -1}, {9, 11}};
2186 const int EFHexFace[][2] = {{0, -1}, {0, 2}, {0, -1}, {0, 4}, {4, -1},
2187 {2, -1}, {2, -1}, {4, -1}, {2, 4}};
2188 const int EQFPrismEdge[][2] = {{0, -1}, {1, 1}, {2, -1},
2189 {3, 3}, {4, -1}, {5, -1},
2190 {6, -1}, {7, -1}, {8, 8}};
2191 const int EQFPrismFace[][2] = {{0, -1}, {0, 2}, {0, -1},
2192 {0, 4}, {4, -1}, {2, -1},
2193 {2, -1}, {4, -1}, {2, 4}};
2196 nfacemodes = (nummodesmax - 2) * (nummodesmax - 2);
2197 for (
int e = 0; e < 9; ++e)
2199 for (
int f = 0; f < nadjface[e]; ++f)
2201 for (
int i = 0; i < nummodesmax - 2; ++i)
2203 for (
int j = 0; j < nfacemodes; ++j)
2210 val = (*maxRmat[
eHexahedron])(edgemapid, facemapid);
2213 edgeMapMaxR[
ePrism][EQFPrismEdge[e][f]][i];
2215 faceMapMaxR[
ePrism][EQFPrismFace[e][f]][j];
2216 newmat->SetValue(edgemapid1, facemapid1, val);
2223 const int VFTetVert[] = {0, 1, 3, 1, 0, 3};
2224 const int VFTetFace[] = {1, 1, 1, 1, 1, 1};
2225 const int VTFPrismVert[] = {0, 1, 4, 2, 3, 5};
2226 const int VTFPrismFace[] = {1, 1, 1, 3, 3, 3};
2229 nfacemodes = (nummodesmax - 3) * (nummodesmax - 2) / 2;
2230 for (
int v = 0; v < 6; ++v)
2232 for (
int i = 0; i < nfacemodes; ++i)
2238 newmat->SetValue(vertMapMaxR[
ePrism][VTFPrismVert[v]],
2239 faceMapMaxR[
ePrism][VTFPrismFace[v]][i], val);
2244 const int EFTetEdge[] = {0, 3, 4, 0, 4, 3};
2245 const int EFTetFace[] = {1, 1, 1, 1, 1, 1};
2246 const int ETFPrismEdge[] = {0, 4, 5, 2, 6, 7};
2247 const int ETFPrismFace[] = {1, 1, 1, 3, 3, 3};
2251 nfacemodes = (nummodesmax - 3) * (nummodesmax - 2) / 2;
2252 for (
int e = 0; e < 6; ++e)
2254 for (
int i = 0; i < nummodesmax - 2; ++i)
2256 for (
int j = 0; j < nfacemodes; ++j)
2258 int edgemapid = edgeMapMaxR[
eTetrahedron][EFTetEdge[e]][i];
2259 int facemapid = faceMapMaxR[
eTetrahedron][EFTetFace[e]][j];
2262 newmat->SetValue(edgeMapMaxR[
ePrism][ETFPrismEdge[e]][i],
2263 faceMapMaxR[
ePrism][ETFPrismFace[e]][j], val);
2270 maxRmat[
ePrism] = PrismR;
2281 int nRows = locExp->NumBndryCoeffs();
2289 locExp->GetInverseBoundaryMaps(vlocmap, elocmap, flocmap);
2292 for (
int i = 0; i < nRows; ++i)
2295 newmat->SetValue(i, i, val);
2298 int nverts = locExp->GetNverts();
2299 int nedges = locExp->GetNedges();
2300 int nfaces = locExp->GetNtraces();
2303 for (
int e = 0; e < nedges; ++e)
2305 int nEdgeInteriorCoeffs = locExp->GetEdgeNcoeffs(e) - 2;
2307 for (
int v = 0; v < nverts; ++v)
2309 for (
int i = 0; i < nEdgeInteriorCoeffs; ++i)
2311 val = (*maxRmat)(vmap[v], emap[e][i]);
2312 newmat->SetValue(vlocmap[v], elocmap[e][i], val);
2317 for (
int f = 0; f < nfaces; ++f)
2324 int nFaceInteriorCoeffs = locExp->GetTraceIntNcoeffs(f);
2326 locExp->GetTraceNumModes(f, m0, m1, FwdOrient);
2329 maxExp->GetTraceInverseBoundaryMap(f, FwdOrient, m0, m1);
2332 for (
int v = 0; v < nverts; ++v)
2334 for (
int i = 0; i < nFaceInteriorCoeffs; ++i)
2336 val = (*maxRmat)(vmap[v], fmapRmat[i]);
2337 newmat->SetValue(vlocmap[v], flocmap[f][i], val);
2342 for (
int e = 0; e < nedges; ++e)
2344 int nEdgeInteriorCoeffs = locExp->GetEdgeNcoeffs(e) - 2;
2346 for (
int j = 0; j < nEdgeInteriorCoeffs; ++j)
2348 for (
int i = 0; i < nFaceInteriorCoeffs; ++i)
2350 val = (*maxRmat)(emap[e][j], fmapRmat[i]);
2351 newmat->SetValue(elocmap[e][j], flocmap[f][i], val);
#define ASSERTL0(condition, msg)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
#define sign(a, b)
return the sign(b)*a
Describes the specification for a Basis.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
Defines a specification for a set of points.
SpatialDomains::GeometrySharedPtr GetGeom() const
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
Describe a linear system.
const StdRegions::ConstFactorMap & GetConstFactors() const
Returns all the constants.
StdRegions::MatrixType GetMatrixType() const
Return the matrix type.
const std::weak_ptr< GlobalLinSys > m_linsys
std::weak_ptr< AssemblyMap > m_locToGloMap
Array< OneD, NekDouble > m_variablePmask
void v_DoTransformCoeffsFromLowEnergy(Array< OneD, NekDouble > &pInOut) override
transform the solution coeffiicents from low energy back to the original coefficient space.
SpatialDomains::HexGeomSharedPtr CreateRefHexGeom(void)
Sets up the reference hexahedral element needed to construct a low energy basis.
void ReSetPrismMaxRMat(int nummodesmax, LocalRegions::PrismExpSharedPtr &PirsmExp, ShapeToDNekMap &maxRmat, ShapeToIntArrayMap &vertMapMaxR, ShapeToIntArrayArrayMap &edgeMapMaxR, ShapeToIntArrayArrayMap &faceMapMaxR, bool UseTetOnly)
std::vector< std::pair< int, int > > m_sameBlock
DNekBlkMatSharedPtr m_InvRBlk
void v_DoTransformCoeffsToLowEnergy(const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput) override
Multiply by the block tranposed inverse transformation matrix (R^T)^{-1} which is equivlaent to trans...
DNekScalMatSharedPtr v_TransformedSchurCompl(int n, int offset, const std::shared_ptr< DNekScalMat > &loc_mat) override
Set up the transformed block matrix system.
static std::string className
Name of class.
void SetupBlockTransformationMatrix(void)
DNekBlkMatSharedPtr m_RBlk
DNekMatSharedPtr ExtractLocMat(LocalRegions::Expansion3DSharedPtr &locExp, DNekScalMatSharedPtr &maxRmat, LocalRegions::Expansion3DSharedPtr &expMax, Array< OneD, unsigned int > &vertMapMaxR, Array< OneD, Array< OneD, unsigned int > > &edgeMapMaxR)
void v_BuildPreconditioner() override
Construct the low energy preconditioner from .
void ReSetTetMaxRMat(int nummodesmax, LocalRegions::TetExpSharedPtr &TetExp, ShapeToDNekMap &maxRmat, ShapeToIntArrayMap &vertMapMaxR, ShapeToIntArrayArrayMap &edgeMapMaxR, ShapeToIntArrayArrayMap &faceMapMaxR)
static PreconditionerSharedPtr create(const std::shared_ptr< GlobalLinSys > &plinsys, const std::shared_ptr< AssemblyMap > &pLocToGloMap)
Creates an instance of this class.
PreconditionerLowEnergy(const std::shared_ptr< GlobalLinSys > &plinsys, const AssemblyMapSharedPtr &pLocToGloMap)
SpatialDomains::TetGeomSharedPtr CreateRefTetGeom(void)
Sets up the reference tretrahedral element needed to construct a low energy basis.
void v_InitObject() override
void v_DoTransformBasisFromLowEnergy(const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput) override
Multiply by the block inverse transformation matrix This transforms the bassi from Low Energy to orig...
void v_DoTransformBasisToLowEnergy(Array< OneD, NekDouble > &pInOut) override
Transform the basis vector to low energy space.
SpatialDomains::PrismGeomSharedPtr CreateRefPrismGeom(void)
Sets up the reference prismatic element needed to construct a low energy basis.
void SetUpReferenceElements(ShapeToDNekMap &maxRmat, ShapeToExpMap &maxElmt, ShapeToIntArrayMap &vertMapMaxR, ShapeToIntArrayArrayMap &edgeMapMaxR)
Loop expansion and determine different variants of the transformation matrix.
void v_DoPreconditioner(const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput, const bool &isLocal=false) override
void SetUpPyrMaxRMat(int nummodesmax, LocalRegions::PyrExpSharedPtr &PyrExp, ShapeToDNekMap &maxRmat, ShapeToIntArrayMap &vertMapMaxR, ShapeToIntArrayArrayMap &edgeMapMaxR, ShapeToIntArrayArrayMap &faceMapMaxR)
void CreateVariablePMask(void)
DNekBlkMatSharedPtr m_BlkMat
SpatialDomains::PyrGeomSharedPtr CreateRefPyrGeom(void)
Sets up the reference prismatic element needed to construct a low energy basis mapping arrays.
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
int NumBndryCoeffs(void) const
LibUtilities::ShapeType DetShapeType() const
This function returns the shape of the expansion domain.
static void Dgemm(const char &transa, const char &transb, const int &m, const int &n, const int &k, const double &alpha, const double *a, const int &lda, const double *b, const int &ldb, const double &beta, double *c, const int &ldc)
BLAS level 3: Matrix-matrix multiply C = A x B where op(A)[m x k], op(B)[k x n], C[m x n] DGEMM perfo...
static void Gather(Nektar::Array< OneD, NekDouble > pU, gs_op pOp, gs_data *pGsh, Nektar::Array< OneD, NekDouble > pBuffer=NullNekDouble1DArray)
Performs a gather-scatter operation of the provided values.
static gs_data * Init(const Nektar::Array< OneD, long > pId, const LibUtilities::CommSharedPtr &pComm, bool verbose=true)
Initialise Gather-Scatter map.
static void Free(gs_data *pGsh)
Deallocates GSLib mapping data without finalising MPI.
@ eGaussLobattoLegendre
1D Gauss-Lobatto-Legendre quadrature points
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
@ eModified_B
Principle Modified Functions .
@ eModified_C
Principle Modified Functions .
@ eModifiedPyr_C
Principle Modified Functions.
@ eModified_A
Principle Modified Functions .
std::shared_ptr< PrismExp > PrismExpSharedPtr
std::shared_ptr< Expansion > ExpansionSharedPtr
std::shared_ptr< HexExp > HexExpSharedPtr
std::shared_ptr< Expansion2D > Expansion2DSharedPtr
std::shared_ptr< PyrExp > PyrExpSharedPtr
std::shared_ptr< Expansion3D > Expansion3DSharedPtr
std::shared_ptr< TetExp > TetExpSharedPtr
PreconFactory & GetPreconFactory()
std::shared_ptr< AssemblyMap > AssemblyMapSharedPtr
std::map< int, std::vector< PeriodicEntity > > PeriodicMap
StdRegions::Orientation DeterminePeriodicFaceOrient(StdRegions::Orientation faceOrient, StdRegions::Orientation perFaceOrient)
Determine relative orientation between two faces.
std::shared_ptr< QuadGeom > QuadGeomSharedPtr
std::shared_ptr< PrismGeom > PrismGeomSharedPtr
std::shared_ptr< HexGeom > HexGeomSharedPtr
std::shared_ptr< SegGeom > SegGeomSharedPtr
std::shared_ptr< PyrGeom > PyrGeomSharedPtr
std::shared_ptr< TetGeom > TetGeomSharedPtr
std::shared_ptr< PointGeom > PointGeomSharedPtr
std::shared_ptr< Geometry2D > Geometry2DSharedPtr
std::shared_ptr< TriGeom > TriGeomSharedPtr
@ eDir1FwdDir1_Dir2FwdDir2
std::vector< double > z(NPUPPER)
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
std::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
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 Assmb(int n, const T *x, const int *y, T *z)
Assemble z[y[i]] += x[i]; z should be zero'd first.
scalarT< T > sqrt(scalarT< T > in)