47 using namespace LibUtilities;
49 namespace MultiRegions
54 string PreconditionerLowEnergy::className
57 PreconditionerLowEnergy::create,
58 "LowEnergy Preconditioning");
67 PreconditionerLowEnergy::PreconditionerLowEnergy(
68 const std::shared_ptr<GlobalLinSys> &plinsys,
82 std::shared_ptr<MultiRegions::ExpList>
83 expList=((
m_linsys.lock())->GetLocMat()).lock();
85 m_comm = expList->GetComm();
89 locExpansion = expList->GetExp(0);
91 int nDim = locExpansion->GetShapeDimension();
94 "Preconditioner type only valid in 3D");
123 std::shared_ptr<MultiRegions::ExpList>
124 expList=((
m_linsys.lock())->GetLocMat()).lock();
129 int nVerts, nEdges,nFaces;
130 int eid, fid, n, cnt, nmodes, nedgemodes, nfacemodes;
134 int vMap1, vMap2, sign1, sign2;
135 int m, v, eMap1, eMap2, fMap1, fMap2;
136 int offset, globalrow, globalcol, nCoeffs;
142 expList->GetPeriodicEntities(periodicVerts,periodicEdges,periodicFaces);
160 int nDirBnd = asmMap->GetNumGlobalDirBndCoeffs();
161 int nNonDirVerts = asmMap->GetNumNonDirVertexModes();
171 int n_exp = expList->GetNumElmts();
172 int nNonDirEdgeIDs=asmMap->GetNumNonDirEdges();
173 int nNonDirFaceIDs=asmMap->GetNumNonDirFaces();
177 map<int,int> uniqueEdgeMap;
178 map<int,int> uniqueFaceMap;
187 bndConditions = expList->GetBndConditions();
194 = asmMap->GetExtraDirEdges();
195 for(i=0; i<extradiredges.num_elements(); ++i)
197 meshEdgeId=extradiredges[i];
198 edgeDirMap.insert(meshEdgeId);
202 for(i = 0; i < bndCondExp.num_elements(); i++)
205 for(j = 0; j < bndCondExp[i]->GetNumElmts(); j++)
207 bndCondFaceExp = std::dynamic_pointer_cast<
209 if (bndConditions[i]->GetBoundaryConditionType() ==
212 for(k = 0; k < bndCondFaceExp->GetNedges(); k++)
215 if(edgeDirMap.count(meshEdgeId) == 0)
217 edgeDirMap.insert(meshEdgeId);
221 faceDirMap.insert(meshFaceId);
229 int nlocalNonDirEdges=0;
230 int nlocalNonDirFaces=0;
233 map<int,int> EdgeSize;
234 map<int,int> FaceSize;
235 map<int,pair<int,int> >FaceModes;
238 for(n = 0; n < n_exp; ++n)
240 locExpansion = expList->GetExp(n);
242 nEdges = locExpansion->GetNedges();
243 for(j = 0; j < nEdges; ++j)
245 int nEdgeInteriorCoeffs = locExpansion->GetEdgeNcoeffs(j) - 2;
247 ->GetGeom3D()->GetEid(j);
248 if(EdgeSize.count(meshEdgeId) == 0)
250 EdgeSize[meshEdgeId] = nEdgeInteriorCoeffs;
254 EdgeSize[meshEdgeId] = min(EdgeSize[meshEdgeId],
255 nEdgeInteriorCoeffs);
259 nFaces = locExpansion->GetNfaces();
260 for(j = 0; j < nFaces; ++j)
262 int nFaceInteriorCoeffs = locExpansion->GetFaceIntNcoeffs(j);
264 ->GetGeom3D()->GetFid(j);
265 if(FaceSize.count(meshFaceId) == 0)
267 FaceSize[meshFaceId] = nFaceInteriorCoeffs;
270 locExpansion->GetFaceNumModes(j,locExpansion->GetForient(j),m0,m1);
271 FaceModes[meshFaceId] = pair<int,int>(m0,m1);
275 if(nFaceInteriorCoeffs < FaceSize[meshFaceId])
277 FaceSize[meshFaceId] = nFaceInteriorCoeffs;
279 locExpansion->GetFaceNumModes(j,locExpansion->GetForient(j),m0,m1);
280 FaceModes[meshFaceId] = pair<int,int>(m0,m1);
287 expList->GetSession()->DefinesCmdLineArgument(
"verbose");
293 int EdgeSizeLen = EdgeSize.size();
294 int FaceSizeLen = FaceSize.size();
298 map<int,int>::iterator it;
302 for(it = EdgeSize.begin(); it!=EdgeSize.end(); ++it,++cnt)
304 FacetMap[cnt] = it->first;
305 maxid = max(it->first,maxid);
306 FacetLen[cnt] = it->second;
312 for(it = FaceSize.begin(); it!=FaceSize.end(); ++it,++cnt)
314 FacetMap[cnt] = it->first + maxid;
315 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;
352 for (i = 0; i < pIt.second.size(); ++i)
354 if (!pIt.second[i].isLocal)
359 int meshEdgeId2 = pIt.second[i].id;
360 if(edgeDirMap.count(meshEdgeId2)==0)
362 if(uniqueEdgeMap.count(meshEdgeId2)!=0)
365 uniqueEdgeMap[meshEdgeId] =
366 uniqueEdgeMap[meshEdgeId2];
367 SetUpNewEdge =
false;
372 edgeDirMap.insert(meshEdgeId);
373 SetUpNewEdge =
false;
379 uniqueEdgeMap[meshEdgeId]=matrixlocation;
380 globaloffset[matrixlocation]+=ntotalentries;
381 modeoffset[matrixlocation]=dof*dof;
382 ntotalentries+=dof*dof;
383 nblks [matrixlocation++] = dof;
389 for(cnt=n=0; n < n_exp; ++n)
391 locExpansion = expList->GetExp(n);
393 for (j = 0; j < locExpansion->GetNedges(); ++j)
396 dof = EdgeSize[meshEdgeId];
397 maxEdgeDof = (dof > maxEdgeDof ? dof : maxEdgeDof);
399 if(edgeDirMap.count(meshEdgeId)==0)
401 if(uniqueEdgeMap.count(meshEdgeId)==0 && dof > 0)
404 uniqueEdgeMap[meshEdgeId]=matrixlocation;
406 globaloffset[matrixlocation]+=ntotalentries;
407 modeoffset[matrixlocation]=dof*dof;
408 ntotalentries+=dof*dof;
409 nblks[matrixlocation++] = dof;
411 nlocalNonDirEdges+=dof*dof;
419 for (
auto &pIt : periodicFaces)
421 meshFaceId = pIt.first;
423 if(faceDirMap.count(meshFaceId)==0)
425 dof = FaceSize[meshFaceId];
427 if(uniqueFaceMap.count(meshFaceId) == 0 && dof > 0)
429 bool SetUpNewFace =
true;
431 if(pIt.second[0].isLocal)
433 int meshFaceId2 = pIt.second[0].id;
435 if(faceDirMap.count(meshFaceId2)==0)
437 if(uniqueFaceMap.count(meshFaceId2)!=0)
440 uniqueFaceMap[meshFaceId] =
441 uniqueFaceMap[meshFaceId2];
442 SetUpNewFace =
false;
447 faceDirMap.insert(meshFaceId);
448 SetUpNewFace =
false;
454 uniqueFaceMap[meshFaceId]=matrixlocation;
456 modeoffset[matrixlocation]=dof*dof;
457 globaloffset[matrixlocation]+=ntotalentries;
458 ntotalentries+=dof*dof;
459 nblks[matrixlocation++] = dof;
465 for(cnt=n=0; n < n_exp; ++n)
467 locExpansion = expList->GetExp(n);
469 for (j = 0; j < locExpansion->GetNfaces(); ++j)
472 GetGeom3D()->GetFid(j);
474 dof = FaceSize[meshFaceId];
475 maxFaceDof = (dof > maxFaceDof ? dof : maxFaceDof);
477 if(faceDirMap.count(meshFaceId)==0)
479 if(uniqueFaceMap.count(meshFaceId)==0 && dof > 0)
481 uniqueFaceMap[meshFaceId]=matrixlocation;
482 modeoffset[matrixlocation]=dof*dof;
483 globaloffset[matrixlocation]+=ntotalentries;
484 ntotalentries+=dof*dof;
485 nblks[matrixlocation++] = dof;
487 nlocalNonDirFaces+=dof*dof;
498 nlocalNonDirFaces,-1);
502 nlocalNonDirFaces,0.0);
506 int uniEdgeOffset = 0;
510 for(n=0; n < n_exp; ++n)
512 for(j = 0; j < locExpansion->GetNedges(); ++j)
515 ->GetGeom3D()->GetEid(j);
517 uniEdgeOffset = max(meshEdgeId, uniEdgeOffset);
523 uniEdgeOffset = uniEdgeOffset*maxEdgeDof*maxEdgeDof;
525 for(n=0; n < n_exp; ++n)
527 locExpansion = expList->GetExp(n);
530 for(j = 0; j < locExpansion->GetNedges(); ++j)
534 ->GetGeom3D()->GetEid(j);
536 nedgemodes = EdgeSize[meshEdgeId];
538 if(edgeDirMap.count(meshEdgeId)==0 && nedgemodes > 0)
541 int edgeOffset = globaloffset[uniqueEdgeMap[meshEdgeId]];
544 int uniOffset = meshEdgeId;
545 auto pIt = periodicEdges.find(meshEdgeId);
546 if (pIt != periodicEdges.end())
548 for (
int l = 0; l < pIt->second.size(); ++l)
550 uniOffset = min(uniOffset, pIt->second[l].id);
553 uniOffset = uniOffset*maxEdgeDof*maxEdgeDof;
555 for(k=0; k<nedgemodes*nedgemodes; ++k)
557 vGlobal=edgeOffset+k;
558 localToGlobalMatrixMap[matrixoffset+k]=vGlobal;
559 BlockToUniversalMap[vGlobal] = uniOffset + k + 1;
561 matrixoffset+=nedgemodes*nedgemodes;
568 for(j = 0; j < locExpansion->GetNfaces(); ++j)
572 ->GetGeom3D()->GetFid(j);
574 nfacemodes = FaceSize[meshFaceId];
577 if(faceDirMap.count(meshFaceId)==0 && nfacemodes > 0)
580 int faceOffset = globaloffset[uniqueFaceMap[meshFaceId]];
582 int uniOffset = meshFaceId;
584 auto pIt = periodicFaces.find(meshFaceId);
585 if (pIt != periodicFaces.end())
587 uniOffset = min(uniOffset, pIt->second[0].id);
589 uniOffset = uniOffset * maxFaceDof * maxFaceDof;
591 for(k=0; k<nfacemodes*nfacemodes; ++k)
593 vGlobal=faceOffset+k;
595 localToGlobalMatrixMap[matrixoffset+k]
598 BlockToUniversalMap[vGlobal] = uniOffset +
599 uniEdgeOffset + k + 1;
601 matrixoffset+=nfacemodes*nfacemodes;
608 map<int,int>::iterator it;
610 n_blks[0] = nNonDirVerts;
611 for(i =1, it = nblks.begin(); it != nblks.end(); ++it)
613 n_blks[i++] = it->second;
622 for(cnt=n=0; n < n_exp; ++n)
624 locExpansion = expList->GetExp(n);
625 nCoeffs=locExpansion->NumBndryCoeffs();
631 (nCoeffs, nCoeffs, zero, storage);
634 nVerts=locExpansion->GetGeom()->GetNumVerts();
635 nEdges=locExpansion->GetGeom()->GetNumEdges();
636 nFaces=locExpansion->GetGeom()->GetNumFaces();
639 loc_mat = (
m_linsys.lock())->GetStaticCondBlock(n);
642 bnd_mat=loc_mat->GetBlock(0,0);
645 offset = bnd_mat->GetRows();
656 for(
int i = 0; i < nCoeffs; ++i)
662 for(
int j = 0; j < nCoeffs; ++j)
668 val = S(i,j)*mask1*mask2;
669 Sloc.SetValue(i,j,val);
678 for (v=0; v<nVerts; ++v)
680 vMap1=locExpansion->GetVertexMap(v);
684 GetLocalToGlobalBndMap(cnt+vMap1)-nDirBnd;
688 for (m=0; m<nVerts; ++m)
690 vMap2=locExpansion->GetVertexMap(m);
695 GetLocalToGlobalBndMap(cnt+vMap2)-nDirBnd;
698 if (globalcol == globalrow)
702 GetLocalToGlobalBndSign(cnt + vMap1);
704 GetLocalToGlobalBndSign(cnt + vMap2);
707 += sign1*sign2*RSRT(vMap1,vMap2);
712 auto pIt = periodicVerts.find(meshVertId);
713 if (pIt != periodicVerts.end())
715 for (k = 0; k < pIt->second.size(); ++k)
717 meshVertId = min(meshVertId, pIt->second[k].id);
721 VertBlockToUniversalMap[globalrow]
729 for (eid=0; eid<nEdges; ++eid)
733 ->GetGeom3D()->GetEid(eid);
736 nedgemodes = EdgeSize[meshEdgeId];
739 nedgemodesloc = locExpansion->GetEdgeNcoeffs(eid)-2;
742 (nedgemodes,nedgemodes,zero,storage);
746 if(edgeDirMap.count(meshEdgeId)==0)
748 for (v=0; v<nedgemodesloc; ++v)
750 eMap1=edgemodearray[v];
752 GetLocalToGlobalBndSign(cnt + eMap1);
759 for (m=0; m<nedgemodesloc; ++m)
761 eMap2=edgemodearray[m];
765 GetLocalToGlobalBndSign(cnt + eMap2);
767 NekDouble globalEdgeValue = sign1*sign2*RSRT(eMap1,eMap2);
772 BlockArray[matrixoffset+v*nedgemodes+m]=globalEdgeValue;
776 matrixoffset+=nedgemodes*nedgemodes;
782 for (fid=0; fid<nFaces; ++fid)
785 ->GetGeom3D()->GetFid(fid);
787 nfacemodes = FaceSize[meshFaceId];
792 (nfacemodes,nfacemodes,zero,storage);
794 if(faceDirMap.count(meshFaceId) == 0)
798 locExpansion->GetForient(fid);
800 auto pIt = periodicFaces.find(meshFaceId);
801 if (pIt != periodicFaces.end())
803 if(meshFaceId == min(meshFaceId, pIt->second[0].id))
806 (faceOrient,pIt->second[0].orient);
810 facemodearray = locExpansion->GetFaceInverseBoundaryMap
811 (fid,faceOrient,FaceModes[meshFaceId].first,
812 FaceModes[meshFaceId].second);
814 for (v=0; v<nfacemodes; ++v)
816 fMap1=facemodearray[v];
819 GetLocalToGlobalBndSign(cnt + fMap1);
821 ASSERTL1(sign1 != 0,
"Something is wrong since we " 822 "shoudl only be extracting modes for " 823 "lowest order expansion");
825 for (m=0; m<nfacemodes; ++m)
827 fMap2=facemodearray[m];
831 GetLocalToGlobalBndSign(cnt + fMap2);
833 ASSERTL1(sign2 != 0,
"Something is wrong since " 834 "we shoudl only be extracting modes for " 835 "lowest order expansion");
844 BlockArray[matrixoffset+v*nfacemodes+m]=
848 matrixoffset+=nfacemodes*nfacemodes;
871 localToGlobalMatrixMap,
880 for (
int i = 0; i < nNonDirVerts; ++i)
882 VertBlk->SetValue(i,i,1.0/vertArray[i]);
893 for(
int loc=0;
loc<n_blks.num_elements()-1; ++
loc)
895 nmodes = n_blks[1+
loc];
897 (nmodes,nmodes,zero,storage);
899 for (v=0; v<nmodes; ++v)
901 for (m=0; m<nmodes; ++m)
903 NekDouble Value = GlobalBlock[offset+v*nmodes+m];
904 gmat->SetValue(v,m,Value);
909 offset+=modeoffset[
loc];
913 int totblks=
m_BlkMat->GetNumberOfBlockRows();
914 for (i=1; i< totblks; ++i)
916 unsigned int nmodes=
m_BlkMat->GetNumberOfRowsInBlockRow(i);
921 (nmodes,nmodes,zero,storage);
942 int nNonDir = nGlobal-nDir;
959 std::shared_ptr<MultiRegions::ExpList>
960 expList=((
m_linsys.lock())->GetLocMat()).lock();
963 map<int,int> EdgeSize;
967 std::map<ShapeType, DNekScalMatSharedPtr> maxRmat;
968 map<ShapeType, LocalRegions::ExpansionSharedPtr > maxElmt;
969 map<ShapeType, Array<OneD, unsigned int> > vertMapMaxR;
970 map<ShapeType, Array<OneD, Array<OneD, unsigned int> > > edgeMapMaxR;
980 int n_exp=expList->GetNumElmts();
998 for(n=0; n < n_exp; ++n)
1000 locExp = expList->GetExp(n);
1001 ShapeType eltype = locExp->DetShapeType();
1003 int nbndcoeffs = locExp->NumBndryCoeffs();
1009 vertMapMaxR[eltype],
1010 edgeMapMaxR[eltype]);
1012 m_RBlk->SetBlock(n, n, rmat);
1020 m_sameBlock.push_back(pair<int,int>(1,nbndcoeffs));
1029 for(
int i = 0; i < 3; ++i)
1031 if(locExpSav->GetBasis(i) != locExp->GetBasis(i))
1040 m_RBlk->SetBlock(n, n, rmat);
1044 (pair<int,int>(
m_sameBlock[offset].first+1,nbndcoeffs));
1050 vertMapMaxR[eltype],
1051 edgeMapMaxR[eltype]);
1054 m_RBlk->SetBlock(n, n, rmat);
1061 m_sameBlock.push_back(pair<int,int>(1,nbndcoeffs));
1081 int nGlobBndDofs = asmMap->GetNumGlobalBndCoeffs();
1082 int nDirBndDofs = asmMap->GetNumGlobalDirBndCoeffs();
1083 int nGlobHomBndDofs = nGlobBndDofs - nDirBndDofs;
1084 int nLocBndDofs = asmMap->GetNumLocalBndCoeffs();
1095 m_map = asmMap->GetLocalToGlobalBndMap();
1101 Vmath::Vcopy(nGlobBndDofs, pInOut.get(), 1, tmp.get(), 1);
1106 tmp.get(),
m_map.get(), pLocalIn.get());
1115 Blas::Dgemm(
'N',
'N', nbndcoeffs, nexp, nbndcoeffs,
1116 1.0, &(R.GetBlock(cnt1,cnt1)->GetPtr()[0]),
1117 nbndcoeffs,pLocalIn.get() + cnt, nbndcoeffs,
1118 0.0, pLocal.get() + cnt, nbndcoeffs);
1119 cnt += nbndcoeffs*nexp;
1124 asmMap->AssembleBnd(F_LocBnd,F_HomBnd, nDirBndDofs);
1140 int nGlobBndDofs = asmMap->GetNumGlobalBndCoeffs();
1141 int nDirBndDofs = asmMap->GetNumGlobalDirBndCoeffs();
1142 int nGlobHomBndDofs = nGlobBndDofs - nDirBndDofs;
1143 int nLocBndDofs = asmMap->GetNumLocalBndCoeffs();
1146 ASSERTL1(pInput.num_elements() >= nGlobHomBndDofs,
1147 "Input array is greater than the nGlobHomBndDofs");
1148 ASSERTL1(pOutput.num_elements() >= nGlobHomBndDofs,
1149 "Output array is greater than the nGlobHomBndDofs");
1159 m_map = asmMap->GetLocalToGlobalBndMap();
1166 Vmath::Vcopy(nGlobHomBndDofs, pInput.get(), 1, tmp.get()
1172 tmp.get(),
m_map.get(), pLocalIn.get());
1181 Blas::Dgemm(
'N',
'N', nbndcoeffs, nexp, nbndcoeffs,
1182 1.0, &(R.GetBlock(cnt1,cnt1)->GetPtr()[0]),
1183 nbndcoeffs,pLocalIn.get() + cnt, nbndcoeffs,
1184 0.0, pLocal.get() + cnt, nbndcoeffs);
1185 cnt += nbndcoeffs*nexp;
1190 asmMap->AssembleBnd(F_LocBnd,F_HomBnd,nDirBndDofs);
1207 int nGlobBndDofs = asmMap->GetNumGlobalBndCoeffs();
1208 int nDirBndDofs = asmMap->GetNumGlobalDirBndCoeffs();
1209 int nGlobHomBndDofs = nGlobBndDofs - nDirBndDofs;
1210 int nLocBndDofs = asmMap->GetNumLocalBndCoeffs();
1212 ASSERTL1(pInOut.num_elements() >= nGlobBndDofs,
1213 "Output array is greater than the nGlobBndDofs");
1223 m_map = asmMap->GetLocalToGlobalBndMap();
1228 asmMap->GlobalToLocalBnd(V_GlobHomBnd,V_LocBnd, nDirBndDofs);
1237 Blas::Dgemm(
'T',
'N', nbndcoeffs, nexp, nbndcoeffs,
1238 1.0, &(R.GetBlock(cnt1,cnt1)->GetPtr()[0]),
1239 nbndcoeffs,pLocalIn.get() + cnt, nbndcoeffs,
1240 0.0, pLocal.get() + cnt, nbndcoeffs);
1241 cnt += nbndcoeffs*nexp;
1249 asmMap->UniversalAssembleBnd(tmp);
1252 Vmath::Vcopy(nGlobBndDofs-nDirBndDofs, tmp.get() + nDirBndDofs, 1, pInOut.get() + nDirBndDofs, 1);
1264 int nGlobBndDofs = asmMap->GetNumGlobalBndCoeffs();
1265 int nDirBndDofs = asmMap->GetNumGlobalDirBndCoeffs();
1266 int nGlobHomBndDofs = nGlobBndDofs - nDirBndDofs;
1267 int nLocBndDofs = asmMap->GetNumLocalBndCoeffs();
1269 ASSERTL1(pInput.num_elements() >= nGlobHomBndDofs,
1270 "Input array is greater than the nGlobHomBndDofs");
1271 ASSERTL1(pOutput.num_elements() >= nGlobHomBndDofs,
1272 "Output array is greater than the nGlobHomBndDofs");
1283 m_map = asmMap->GetLocalToGlobalBndMap();
1290 Vmath::Vcopy(nGlobHomBndDofs, pInput.get(), 1, tmp.get() + nDirBndDofs, 1);
1295 tmp.get(),
m_map.get(), pLocalIn.get());
1304 Blas::Dgemm(
'N',
'N', nbndcoeffs, nexp, nbndcoeffs,
1305 1.0, &(invR.GetBlock(cnt1,cnt1)->GetPtr()[0]),
1306 nbndcoeffs,pLocalIn.get() + cnt, nbndcoeffs,
1307 0.0, pLocal.get() + cnt, nbndcoeffs);
1308 cnt += nbndcoeffs*nexp;
1314 asmMap->AssembleBnd(F_LocBnd,F_HomBnd,nDirBndDofs);
1327 int nGlobBndDofs = asmMap->GetNumGlobalBndCoeffs();
1328 int nDirBndDofs = asmMap->GetNumGlobalDirBndCoeffs();
1329 int nGlobHomBndDofs = nGlobBndDofs - nDirBndDofs;
1330 int nLocBndDofs = asmMap->GetNumLocalBndCoeffs();
1332 ASSERTL1(pInput.num_elements() >= nGlobHomBndDofs,
1333 "Input array is greater than the nGlobHomBndDofs");
1334 ASSERTL1(pOutput.num_elements() >= nGlobHomBndDofs,
1335 "Output array is greater than the nGlobHomBndDofs");
1346 m_map = asmMap->GetLocalToGlobalBndMap();
1349 asmMap->GlobalToLocalBnd(pInput,pLocalIn, nDirBndDofs);
1359 Blas::Dgemm(
'T',
'N', nbndcoeffs, nexp, nbndcoeffs,
1360 1.0, &(invR.GetBlock(cnt1,cnt1)->GetPtr()[0]),
1361 nbndcoeffs,pLocalIn.get() + cnt, nbndcoeffs,
1362 0.0, pLocal.get() + cnt, nbndcoeffs);
1363 cnt += nbndcoeffs*nexp;
1368 asmMap->AssembleBnd(pLocal,pOutput, nDirBndDofs);
1384 const std::shared_ptr<DNekScalMat > &loc_mat)
1386 std::shared_ptr<MultiRegions::ExpList>
1387 expList=((
m_linsys.lock())->GetLocMat()).lock();
1390 locExpansion = expList->GetExp(n);
1391 unsigned int nbnd=locExpansion->NumBndryCoeffs();
1410 for(
int i = 0; i < nbnd; ++i)
1416 for(
int j = 0; j < nbnd; ++j)
1422 val = S1(i,j)*mask1*mask2;
1423 Sloc.SetValue(i,j,val);
1445 unsigned int nGlobalBnd = asmMap->GetNumGlobalBndCoeffs();
1446 unsigned int nEntries = asmMap->GetNumLocalBndCoeffs();
1450 = asmMap->GetLocalToGlobalBndMap();
1453 = asmMap->GetLocalToGlobalBndSign();
1461 for (i = 0; i < nEntries; ++i)
1463 if(fabs(sign[i]) > 0.0)
1465 vCounts[vMap[i]] += 1.0;
1469 vCounts[vMap[i]] = 1.0;
1475 for (i = 0; i < nEntries; ++i)
1477 vCounts[vMap[i]] += 1.0;
1482 asmMap->UniversalAssembleBnd(vCounts);
1486 for (i = 0; i < nEntries; ++i)
1498 int nDirBnd = asmMap->GetNumGlobalDirBndCoeffs();
1499 int nGlobHomBnd = nGlobalBnd - nDirBnd;
1500 int nLocBnd = asmMap->GetNumLocalBndCoeffs();
1507 asmMap->GlobalToLocalBnd(tmp,loc, nDirBnd);
1524 const int nVerts = 6;
1525 const double point[][3] = {
1526 {-1,-1,0}, {1,-1,0}, {1,1,0},
1527 {-1,1,0}, {0,-1,sqrt(
double(3))}, {0,1,sqrt(
double(3))},
1532 for(
int i=0; i < nVerts; ++i)
1535 ( three, i, point[i][0], point[i][1], point[i][2] );
1537 const int nEdges = 9;
1538 const int vertexConnectivity[][2] = {
1539 {0,1}, {1,2}, {3,2}, {0,3}, {0,4},
1540 {1,4}, {2,5}, {3,5}, {4,5}
1545 for(
int i=0; i < nEdges; ++i){
1547 for(
int j=0; j<2; ++j)
1549 vertsArray[j] = verts[vertexConnectivity[i][j]];
1558 const int nFaces = 5;
1560 const int quadEdgeConnectivity[][4] = { {0,1,2,3}, {1,6,8,5}, {3,7,8,4} };
1562 const int quadId[] = { 0,-1,1,-1,2 };
1565 const int triEdgeConnectivity[][3] = { {0,5,4}, {2,6,7} };
1567 const int triId[] = { -1,0,-1,1,-1 };
1571 for(
int f = 0; f < nFaces; ++f){
1572 if(f == 1 || f == 3) {
1575 for(
int j = 0; j < 3; ++j){
1576 edgeArray[j] = edges[triEdgeConnectivity[i][j]];
1583 for(
int j=0; j < 4; ++j){
1584 edgeArray[j] = edges[quadEdgeConnectivity[i][j]];
1605 const int nVerts = 5;
1606 const double point[][3] = {
1607 {-1,-1,0}, {1,-1,0}, {1,1,0},
1608 {-1,1,0}, {0,0,sqrt(
double(2))}
1614 for(
int i=0; i < nVerts; ++i)
1617 ( three, i, point[i][0], point[i][1], point[i][2] );
1619 const int nEdges = 8;
1620 const int vertexConnectivity[][2] = {
1621 {0,1}, {1,2}, {2,3}, {3,0},
1622 {0,4}, {1,4}, {2,4}, {3,4}
1627 for(
int i=0; i < nEdges; ++i)
1630 for(
int j=0; j<2; ++j)
1632 vertsArray[j] = verts[vertexConnectivity[i][j]];
1641 const int nFaces = 5;
1643 const int quadEdgeConnectivity[][4] = {{0,1,2,3}};
1646 const int triEdgeConnectivity[][3] = { {0,5,4}, {1,6,5}, {2,7,6}, {3,4,7}};
1650 for(
int f = 0; f < nFaces; ++f)
1655 for(
int j=0; j < 4; ++j)
1657 edgeArray[j] = edges[quadEdgeConnectivity[f][j]];
1665 for(
int j = 0; j < 3; ++j)
1667 edgeArray[j] = edges[triEdgeConnectivity[i][j]];
1691 const int nVerts = 4;
1692 const double point[][3] = {
1693 {-1,-1/sqrt(
double(3)),-1/sqrt(
double(6))},
1694 {1,-1/sqrt(
double(3)),-1/sqrt(
double(6))},
1695 {0,2/sqrt(
double(3)),-1/sqrt(
double(6))},
1696 {0,0,3/sqrt(
double(6))}};
1698 std::shared_ptr<SpatialDomains::PointGeom> verts[4];
1699 for(i=0; i < nVerts; ++i)
1704 ( three, i, point[i][0], point[i][1], point[i][2] );
1712 const int nEdges = 6;
1713 const int vertexConnectivity[][2] = {
1714 {0,1},{1,2},{0,2},{0,3},{1,3},{2,3}
1719 for(i=0; i < nEdges; ++i)
1721 std::shared_ptr<SpatialDomains::PointGeom>
1725 vertsArray[j] = verts[vertexConnectivity[i][j]];
1736 const int nFaces = 4;
1737 const int edgeConnectivity[][3] = {
1738 {0,1,2}, {0,4,3}, {1,5,4}, {2,5,3}
1743 for(i=0; i < nFaces; ++i)
1746 for(j=0; j < 3; ++j)
1748 edgeArray[j] = edges[edgeConnectivity[i][j]];
1775 const int nVerts = 8;
1776 const double point[][3] = {
1777 {0,0,0}, {1,0,0}, {1,1,0}, {0,1,0},
1778 {0,0,1}, {1,0,1}, {1,1,1}, {0,1,1}
1783 for(
int i = 0; i < nVerts; ++i ) {
1786 point[i][1], point[i][2]);
1794 const int nEdges = 12;
1795 const int vertexConnectivity[][2] = {
1796 {0,1}, {1,2}, {2,3}, {0,3}, {0,4}, {1,5},
1797 {2,6}, {3,7}, {4,5}, {5,6}, {6,7}, {4,7}
1802 for(
int i = 0; i < nEdges; ++i ) {
1804 for(
int j = 0; j < 2; ++j ) {
1805 vertsArray[j] = verts[vertexConnectivity[i][j]];
1815 const int nFaces = 6;
1816 const int edgeConnectivity[][4] = {
1817 {0,1,2,3}, {0,5,8,4}, {1,6,9,5},
1818 {2,7,10,6}, {3,7,11,4}, {8,9,10,11}
1823 for(
int i = 0; i < nFaces; ++i ) {
1825 for(
int j = 0; j < 4; ++j ) {
1826 edgeArray[j] = edges[edgeConnectivity[i][j]];
1846 std::map<ShapeType, DNekScalMatSharedPtr> &maxRmat,
1847 map<ShapeType, LocalRegions::ExpansionSharedPtr > &maxElmt,
1852 std::shared_ptr<MultiRegions::ExpList>
1853 expList=((
m_linsys.lock())->GetLocMat()).lock();
1859 map<ShapeType, Array<OneD, Array<OneD, unsigned int> > > faceMapMaxR;
1862 int nummodesmax = 0;
1865 for(
int n = 0; n < expList->GetNumElmts(); ++n)
1867 locExp = expList->GetExp(n);
1869 nummodesmax = max(nummodesmax, locExp->GetBasisNumModes(0));
1870 nummodesmax = max(nummodesmax, locExp->GetBasisNumModes(1));
1871 nummodesmax = max(nummodesmax, locExp->GetBasisNumModes(2));
1873 Shapes[locExp->DetShapeType()] = 1;
1926 HexExp->GetInverseBoundaryMaps(vmap,emap,fmap);
1933 (PreconR, eHexahedron,
1935 maxRmat[
eHexahedron] = HexExp->GetLocMatrix(HexR);
1957 TetExp->GetInverseBoundaryMaps(vmap,emap,fmap);
1964 (PreconR, eTetrahedron,
1968 if((Shapes[ePyramid])||(Shapes[eHexahedron]))
1971 vertMapMaxR, edgeMapMaxR, faceMapMaxR);
1975 if(Shapes[ePyramid])
1996 PyrExp->GetInverseBoundaryMaps(vmap,emap,fmap);
2004 edgeMapMaxR,faceMapMaxR);
2023 maxElmt[
ePrism] = PrismExp;
2026 PrismExp->GetInverseBoundaryMaps(vmap,emap,fmap);
2027 vertMapMaxR[
ePrism] = vmap;
2028 edgeMapMaxR[
ePrism] = emap;
2030 faceMapMaxR[
ePrism] = fmap;
2032 if((Shapes[ePyramid])||(Shapes[eHexahedron]))
2035 vertMapMaxR, edgeMapMaxR,
2036 faceMapMaxR,
false);
2046 PrismExp->GetLocMatrix(PrismR);
2048 if(Shapes[eTetrahedron])
2051 vertMapMaxR, edgeMapMaxR,
2060 std::map<ShapeType, DNekScalMatSharedPtr> &maxRmat,
2065 int nRows = PyrExp->NumBndryCoeffs();
2072 for(
int i = 0; i < nRows; ++i)
2074 newmat->SetValue(i,i,1.0);
2082 const int nadjedge[] = {3,3,3,3,4};
2083 const int VEHexVert[][4] = {{0,0,0,-1},{1,1,1,-1},{2,2,2,-1},{3,3,3,-1},{4,5,6,7}};
2084 const int VEHexEdge[][4] = {{0,3,4,-1},{0,1,5,-1},{1,2,6,-1},{2,3,7,-1},{4,5,6,7}};
2085 const int VEPyrEdge[][4] = {{0,3,4,-1},{0,1,5,-1},{1,2,6,-1},{2,3,7,-1},{4,5,6,7}};
2088 for(
int v = 0; v < 5; ++v)
2090 for(
int e = 0; e < nadjedge[v]; ++e)
2092 for(
int i = 0; i < nummodesmax-2; ++i)
2099 newmat->SetValue(vertMapMaxR[
ePyramid][v],
2100 edgeMapMaxR[
ePyramid][VEPyrEdge[v][e]][i],val);
2106 nfacemodes = (nummodesmax-2)*(nummodesmax-2);
2108 for(
int v = 0; v < 4; ++v)
2110 for(
int i = 0; i < nfacemodes; ++i)
2114 newmat->SetValue(vertMapMaxR[
ePyramid][v],
2120 const int nadjface[] = {2,2,2,2,4};
2121 const int VFTetVert[][4] = {{0,0,-1,-1},{1,1,-1,-1},{2,2,-1,-1},{0,2,-1,-1},{3,3,3,3}};
2122 const int VFTetFace[][4] = {{1,3,-1,-1},{1,2,-1,-1},{2,3,-1,-1},{1,3,-1,-1},{1,2,1,2}};
2123 const int VFPyrFace[][4] = {{1,4,-1,-1},{1,2,-1,-1},{2,3,-1,-1},{3,4,-1,-1},{1,2,3,4}};
2126 nfacemodes = (nummodesmax-3)*(nummodesmax-2)/2;
2127 for(
int v = 0; v < 5; ++v)
2129 for(
int f = 0; f < nadjface[v]; ++f)
2131 for(
int i = 0; i < nfacemodes; ++i)
2135 newmat->SetValue(vertMapMaxR[
ePyramid][v],
2136 faceMapMaxR[
ePyramid][VFPyrFace[v][f]][i],val);
2144 nfacemodes = (nummodesmax-2)*(nummodesmax-2);
2145 for(
int e = 0; e < 4; ++e)
2147 for(
int i = 0; i < nummodesmax-2; ++i)
2149 for(
int j = 0; j < nfacemodes; ++j)
2154 val = (*maxRmat[
eHexahedron])(edgemapid,facemapid);
2155 newmat->SetValue(edgeMapMaxR[
ePyramid][e][i],
2162 const int nadjface1[] = {1,1,1,1,2,2,2,2};
2163 const int EFTetEdge[][2] = {{0,-1},{1,-1},{0,-1},{2,-1},{3,3},{4,4},{5,5},{3,5}};
2164 const int EFTetFace[][2] = {{1,-1},{2,-1},{1,-1},{3,-1},{1,3},{1,2},{2,3},{1,3}};
2165 const int EFPyrFace[][2] = {{1,-1},{2,-1},{3,-1},{4,-1},{1,4},{1,2},{2,3},{3,4}};
2168 nfacemodes = (nummodesmax-3)*(nummodesmax-2)/2;
2169 for(
int e = 0; e < 8; ++e)
2171 for(
int f = 0; f < nadjface1[e]; ++f)
2173 for(
int i = 0; i < nummodesmax-2; ++i)
2175 for(
int j = 0; j < nfacemodes; ++j)
2177 int edgemapid = edgeMapMaxR[
eTetrahedron][EFTetEdge[e][f]][i];
2178 int facemapid = faceMapMaxR[
eTetrahedron][EFTetFace[e][f]][j];
2181 newmat->SetValue(edgeMapMaxR[
ePyramid][e][i],
2182 faceMapMaxR[
ePyramid][EFPyrFace[e][f]][j],val);
2196 std::map<ShapeType, DNekScalMatSharedPtr> &maxRmat,
2201 boost::ignore_unused(faceMapMaxR);
2203 int nRows = TetExp->NumBndryCoeffs();
2210 for(
int i = 0; i < nRows; ++i)
2212 for(
int j = 0; j < nRows; ++j)
2215 newmat->SetValue(i,j,val);
2224 const int VEHexVert[][4] = {{0,0,0},{1,1,1},{2,2,2},{4,5,6}};
2225 const int VEHexEdge[][4] = {{0,3,4},{0,1,5},{1,2,6},{4,5,6}};
2226 const int VETetEdge[][4] = {{0,2,3},{0,1,4},{1,2,5},{3,4,5}};
2229 for(
int v = 0; v < 4; ++v)
2231 for(
int e = 0; e < 3; ++e)
2233 for(
int i = 0; i < nummodesmax-2; ++i)
2255 std::map<ShapeType, DNekScalMatSharedPtr> &maxRmat,
2261 int nRows = PrismExp->NumBndryCoeffs();
2273 for(
int i = 0; i < nRows; ++i)
2275 for(
int j = 0; j < nRows; ++j)
2277 val = (*maxRmat[
ePrism])(i,j);
2278 newmat->SetValue(i,j,val);
2283 const int VETetVert[][2] = {{0,0},{1,1},{1,1},{0,0},{3,3},{3,3}};
2284 const int VETetEdge[][2] = {{0,3},{0,4},{0,4},{0,3},{3,4},{4,3}};
2285 const int VEPrismEdge[][2] = {{0,4},{0,5},{2,6},{2,7},{4,5},{6,7}};
2288 for(
int v = 0; v < 6; ++v)
2290 for(
int e = 0; e < 2; ++e)
2292 for(
int i = 0; i < nummodesmax-2; ++i)
2300 SetValue(vertMapMaxR[
ePrism][v],
2301 edgeMapMaxR[
ePrism][VEPrismEdge[v][e]][i],
2311 for(
int i = 0; i < nRows; ++i)
2313 newmat->SetValue(i,i,1.0);
2324 const int VEHexVert[][3] = {{0,0,0},{1,1,1},{2,2,2},{3,3,3},
2326 const int VEHexEdge[][3] = {{0,3,4},{0,1,5},{1,2,6},{2,3,7},
2328 const int VEPrismEdge[][3] = {{0,3,4},{0,1,5},{1,2,6},{2,3,7},
2332 for(
int v = 0; v < 6; ++v)
2334 for(
int e = 0; e < 3; ++e)
2336 for(
int i = 0; i < nummodesmax-2; ++i)
2343 newmat->SetValue(vertMapMaxR[
ePrism][v],
2344 edgeMapMaxR[
ePrism][VEPrismEdge[v][e]][i],
2352 const int VFHexVert[][2] = {{0,0},{1,1},{4,5},{2,2},{3,3},{6,7}};
2353 const int VFHexFace[][2] = {{0,4},{0,2},{4,2},{0,2},{0,4},{2,4}};
2355 const int VQFPrismVert[][2] = {{0,0},{1,1},{4,4},{2,2},{3,3},{5,5}};
2356 const int VQFPrismFace[][2] = {{0,4},{0,2},{4,2},{0,2},{0,4},{2,4}};
2358 nfacemodes = (nummodesmax-2)*(nummodesmax-2);
2360 for(
int v = 0; v < 6; ++v)
2362 for(
int f = 0; f < 2; ++f)
2364 for(
int i = 0; i < nfacemodes; ++i)
2369 newmat->SetValue(vertMapMaxR[
ePrism][VQFPrismVert[v][f]],
2370 faceMapMaxR[
ePrism][VQFPrismFace[v][f]][i],val);
2376 const int nadjface[] = {1,2,1,2,1,1,1,1,2};
2377 const int EFHexEdge[][2] = {{0,-1},{1,1},{2,-1},{3,3},{4,-1},{5,-1},{6,-1},{7,-1},{9,11}};
2378 const int EFHexFace[][2] = {{0,-1},{0,2},{0,-1},{0,4},{4,-1},{2,-1},{2,-1},{4,-1},{2,4}};
2379 const int EQFPrismEdge[][2] = {{0,-1},{1,1},{2,-1},{3,3},{4,-1},{5,-1},{6,-1},{7,-1},{8,8}};
2380 const int EQFPrismFace[][2] = {{0,-1},{0,2},{0,-1},{0,4},{4,-1},{2,-1},{2,-1},{4,-1},{2,4}};
2383 nfacemodes = (nummodesmax-2)*(nummodesmax-2);
2384 for(
int e = 0; e < 9; ++e)
2386 for(
int f = 0; f < nadjface[e]; ++f)
2388 for(
int i = 0; i < nummodesmax-2; ++i)
2390 for(
int j = 0; j < nfacemodes; ++j)
2392 int edgemapid = edgeMapMaxR[
eHexahedron][EFHexEdge[e][f]][i];
2393 int facemapid = faceMapMaxR[
eHexahedron][EFHexFace[e][f]][j];
2395 val = (*maxRmat[
eHexahedron])(edgemapid,facemapid);
2397 int edgemapid1 = edgeMapMaxR[
ePrism][EQFPrismEdge[e][f]][i];
2398 int facemapid1 = faceMapMaxR[
ePrism][EQFPrismFace[e][f]][j];
2399 newmat->SetValue(edgemapid1, facemapid1, val);
2406 const int VFTetVert[] = {0,1,3,1,0,3};
2407 const int VFTetFace[] = {1,1,1,1,1,1};
2408 const int VTFPrismVert[] = {0,1,4,2,3,5};
2409 const int VTFPrismFace[] = {1,1,1,3,3,3};
2412 nfacemodes = (nummodesmax-3)*(nummodesmax-2)/2;
2413 for(
int v = 0; v < 6; ++v)
2415 for(
int i = 0; i < nfacemodes; ++i)
2421 newmat->SetValue(vertMapMaxR[
ePrism][VTFPrismVert[v]],
2422 faceMapMaxR[
ePrism][VTFPrismFace[v]][i],val);
2427 const int EFTetEdge[] = {0,3,4,0,4,3};
2428 const int EFTetFace[] = {1,1,1,1,1,1};
2429 const int ETFPrismEdge[] = {0,4,5,2,6,7};
2430 const int ETFPrismFace[] = {1,1,1,3,3,3};
2434 nfacemodes = (nummodesmax-3)*(nummodesmax-2)/2;
2435 for(
int e = 0; e < 6; ++e)
2437 for(
int i = 0; i < nummodesmax-2; ++i)
2439 for(
int j = 0; j < nfacemodes; ++j)
2441 int edgemapid = edgeMapMaxR[
eTetrahedron][EFTetEdge[e]][i];
2442 int facemapid = faceMapMaxR[
eTetrahedron][EFTetFace[e]][j];
2445 newmat->SetValue(edgeMapMaxR[
ePrism][ETFPrismEdge[e]][i],
2446 faceMapMaxR[
ePrism][ETFPrismFace[e]][j],val);
2454 maxRmat[
ePrism] = PrismR;
2467 int nRows = locExp->NumBndryCoeffs();
2475 locExp->GetInverseBoundaryMaps(vlocmap,elocmap,flocmap);
2478 for(
int i = 0; i < nRows; ++i)
2481 newmat->SetValue(i,i,val);
2484 int nverts = locExp->GetNverts();
2485 int nedges = locExp->GetNedges();
2486 int nfaces = locExp->GetNfaces();
2489 for(
int e = 0; e < nedges; ++e)
2491 int nEdgeInteriorCoeffs = locExp->GetEdgeNcoeffs(e) -2;
2493 for(
int v = 0; v < nverts; ++v)
2495 for(
int i = 0; i < nEdgeInteriorCoeffs; ++i)
2497 val = (*maxRmat)(vmap[v],emap[e][i]);
2498 newmat->SetValue(vlocmap[v],elocmap[e][i],val);
2503 for(
int f = 0; f < nfaces; ++f)
2509 int nFaceInteriorCoeffs = locExp->GetFaceIntNcoeffs(f);
2511 locExp->GetFaceNumModes(f,FwdOrient,m0,m1);
2514 GetFaceInverseBoundaryMap(f,FwdOrient, m0,m1);
2517 for(
int v = 0; v < nverts; ++v)
2519 for(
int i = 0; i < nFaceInteriorCoeffs; ++i)
2521 val = (*maxRmat)(vmap[v],fmapRmat[i]);
2522 newmat->SetValue(vlocmap[v],flocmap[f][i],val);
2527 for(
int e = 0; e < nedges; ++e)
2529 int nEdgeInteriorCoeffs = locExp->GetEdgeNcoeffs(e) -2;
2531 for(
int j = 0; j < nEdgeInteriorCoeffs; ++j)
2534 for(
int i = 0; i < nFaceInteriorCoeffs; ++i)
2536 val = (*maxRmat)(emap[e][j],fmapRmat[i]);
2537 newmat->SetValue(elocmap[e][j],flocmap[f][i],val);
LibUtilities::CommSharedPtr m_comm
virtual void v_DoPreconditioner(const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput)
std::vector< std::pair< int, int > > m_sameBlock
#define ASSERTL0(condition, msg)
virtual DNekScalMatSharedPtr v_TransformedSchurCompl(int n, int offset, const std::shared_ptr< DNekScalMat > &loc_mat)
Set up the transformed block matrix system.
Principle Modified Functions .
std::shared_ptr< Geometry2D > Geometry2DSharedPtr
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.
virtual void v_DoMultiplybyInverseTransposedTransformationMatrix(const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput)
Multiply by the block tranposed inverse transformation matrix.
void Gathr(int n, const T *x, const int *y, T *z)
Gather vector z[i] = x[y[i]].
#define sign(a, b)
return the sign(b)*a
Principle Modified Functions .
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
std::shared_ptr< TetGeom > TetGeomSharedPtr
Array< OneD, NekDouble > m_multiplicity
Array< OneD, NekDouble > m_locToGloSignMult
std::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
const std::weak_ptr< GlobalLinSys > m_linsys
DNekMatSharedPtr ExtractLocMat(StdRegions::StdExpansionSharedPtr &locExp, DNekScalMatSharedPtr &maxRmat, LocalRegions::ExpansionSharedPtr &expMax, Array< OneD, unsigned int > &vertMapMaxR, Array< OneD, Array< OneD, unsigned int > > &edgeMapMaxR)
std::shared_ptr< QuadGeom > QuadGeomSharedPtr
virtual void v_InitObject()
std::shared_ptr< HexExp > HexExpSharedPtr
void ReSetTetMaxRMat(int nummodesmax, LocalRegions::TetExpSharedPtr &TetExp, ShapeToDNekMap &maxRmat, ShapeToIntArrayMap &vertMapMaxR, ShapeToIntArrayArrayMap &edgeMapMaxR, ShapeToIntArrayArrayMap &faceMapMaxR)
const StdRegions::ConstFactorMap & GetConstFactors() const
Returns all the constants.
Principle Modified Functions .
PreconFactory & GetPreconFactory()
std::shared_ptr< TetExp > TetExpSharedPtr
void Sdiv(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha/y.
DNekBlkMatSharedPtr m_BlkMat
std::shared_ptr< DNekMat > DNekMatSharedPtr
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 A[m x n], B[n x k], C[m x k].
Gauss Radau pinned at x=-1, .
SpatialDomains::HexGeomSharedPtr CreateRefHexGeom(void)
Sets up the reference hexahedral element needed to construct a low energy basis.
std::shared_ptr< AssemblyMap > AssemblyMapSharedPtr
static gs_data * Init(const Nektar::Array< OneD, long > pId, const LibUtilities::CommSharedPtr &pComm, bool verbose=true)
Initialise Gather-Scatter map.
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
std::shared_ptr< TriGeom > TriGeomSharedPtr
virtual void v_BuildPreconditioner()
Construct the low energy preconditioner from .
StdRegions::MatrixType GetMatrixType() const
Return the matrix type.
Principle Modified Functions .
StdRegions::Orientation DeterminePeriodicFaceOrient(StdRegions::Orientation faceOrient, StdRegions::Orientation perFaceOrient)
Determine relative orientation between two faces.
DNekBlkMatSharedPtr m_RBlk
DNekBlkMatSharedPtr m_InvRBlk
void SetUpPyrMaxRMat(int nummodesmax, LocalRegions::PyrExpSharedPtr &PyrExp, ShapeToDNekMap &maxRmat, ShapeToIntArrayMap &vertMapMaxR, ShapeToIntArrayArrayMap &edgeMapMaxR, ShapeToIntArrayArrayMap &faceMapMaxR)
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
virtual void v_DoTransformToLowEnergy(Array< OneD, NekDouble > &pInOut, int offset)
Transform the solution vector vector to low energy.
SpatialDomains::PyrGeomSharedPtr CreateRefPyrGeom(void)
Sets up the reference prismatic element needed to construct a low energy basis mapping arrays...
NekMatrix< InnerMatrixType, BlockMatrixTag > Transpose(NekMatrix< InnerMatrixType, BlockMatrixTag > &rhs)
Defines a specification for a set of points.
void SetUpReferenceElements(ShapeToDNekMap &maxRmat, ShapeToExpMap &maxElmt, ShapeToIntArrayMap &vertMapMaxR, ShapeToIntArrayArrayMap &edgeMapMaxR)
Loop expansion and determine different variants of the transformation matrix.
void Assmb(int n, const T *x, const int *y, T *z)
Assemble z[y[i]] += x[i]; z should be zero'd first.
std::shared_ptr< PointGeom > PointGeomSharedPtr
std::map< int, std::vector< PeriodicEntity > > PeriodicMap
virtual void v_DoMultiplybyInverseTransformationMatrix(const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput)
Multiply by the block inverse transformation matrix.
Describe a linear system.
virtual void v_DoTransformFromLowEnergy(Array< OneD, NekDouble > &pInOut)
transform the solution vector from low energy back to the original basis.
std::shared_ptr< PyrExp > PyrExpSharedPtr
bg::model::point< double, 3, bg::cs::cartesian > point
SpatialDomains::TetGeomSharedPtr CreateRefTetGeom(void)
Sets up the reference tretrahedral element needed to construct a low energy basis.
std::shared_ptr< Expansion > ExpansionSharedPtr
std::shared_ptr< PyrGeom > PyrGeomSharedPtr
std::shared_ptr< PrismExp > PrismExpSharedPtr
std::shared_ptr< Expansion2D > Expansion2DSharedPtr
std::shared_ptr< T > as()
std::shared_ptr< HexGeom > HexGeomSharedPtr
Gauss Radau pinned at x=-1, .
void SetupBlockTransformationMatrix(void)
SpatialDomains::PrismGeomSharedPtr CreateRefPrismGeom(void)
Sets up the reference prismatic element needed to construct a low energy basis.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
std::shared_ptr< PrismGeom > PrismGeomSharedPtr
void CreateMultiplicityMap(void)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
std::shared_ptr< SegGeom > SegGeomSharedPtr
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
std::weak_ptr< AssemblyMap > m_locToGloMap
void ReSetPrismMaxRMat(int nummodesmax, LocalRegions::PrismExpSharedPtr &PirsmExp, ShapeToDNekMap &maxRmat, ShapeToIntArrayMap &vertMapMaxR, ShapeToIntArrayArrayMap &edgeMapMaxR, ShapeToIntArrayArrayMap &faceMapMaxR, bool UseTetOnly)
Describes the specification for a Basis.
1D Gauss-Lobatto-Legendre quadrature points
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.