43 #include <boost/config.hpp> 44 #include <boost/graph/adjacency_list.hpp> 45 #include <boost/graph/cuthill_mckee_ordering.hpp> 46 #include <boost/graph/properties.hpp> 47 #include <boost/graph/bandwidth.hpp> 53 namespace MultiRegions
71 AssemblyMapCG::AssemblyMapCG(
73 const std::string variable):
76 pSession->LoadParameter(
84 const bool checkIfSystemSingular,
90 set<int> &extraDirVerts,
91 set<int> &extraDirEdges,
92 int &firstNonDirGraphVertId,
99 int meshVertId, meshEdgeId, meshFaceId;
100 int meshVertId2, meshEdgeId2;
110 for(i = 0; i < bndCondExp.num_elements(); i++)
112 if (bndConditions[0][i]->GetBoundaryConditionType() ==
120 for(k = 0; k < bndConditions.num_elements(); ++k)
122 if (bndConditions[k][i]->GetBoundaryConditionType() ==
127 if (bndConditions[k][i]->GetBoundaryConditionType() !=
136 for (j = 0; j < bndCondExp[i]->GetNumElmts(); ++j)
139 for (k = 0; k < bndExp->GetNverts(); ++k)
141 if (vMaxVertId < bndExp->GetGeom()->GetVid(k))
143 vMaxVertId = bndExp->
GetGeom()->GetVid(k);
150 if(cnt == bndConditions.num_elements())
152 for(j = 0; j < bndCondExp[i]->GetNumElmts(); j++)
154 bndExp = bndCondExp[i]->GetExp(j);
156 for (k = 0; k < bndExp->GetNverts(); k++)
158 meshVertId = bndExp->GetGeom()->GetVid(k);
159 if (graph[0].count(meshVertId) == 0)
161 graph[0][meshVertId] = graphVertId++;
165 for (k = 0; k < bndExp->GetNedges(); k++)
167 meshEdgeId = bndExp->GetGeom()->GetEid(k);
168 if (graph[1].count(meshEdgeId) == 0)
170 graph[1][meshEdgeId] = graphVertId++;
175 meshFaceId = bndExp->GetGeom()->GetGlobalID();
176 const int bndDim = bndExp->GetNumBases();
177 if (graph[bndDim].count(meshFaceId) == 0)
179 graph[bndDim][meshFaceId] = graphVertId++;
214 int n = vComm->GetSize();
215 int p = vComm->GetRank();
217 if(vComm->IsSerial())
231 vertcounts[
p] = graph[0].size();
232 edgecounts[
p] = graph[1].size();
236 for (i = 1; i < n; ++i)
238 vertoffsets[i] = vertoffsets[i-1] + vertcounts[i-1];
239 edgeoffsets[i] = edgeoffsets[i-1] + edgecounts[i-1];
250 for (
auto &it : graph[0])
252 vertlist[vertoffsets[
p] + i++] = it.first;
257 for (
auto &it : graph[1])
259 edgelist[edgeoffsets[
p] + i++] = it.first;
267 map<int, int> extraDirVertIds, extraDirEdgeIds;
277 for (i = 0; i < n; ++i)
284 for(j = 0; j < locExpVector.size(); j++)
286 exp = locExpVector[j];
288 for(k = 0; k < exp->GetNverts(); k++)
290 meshVertId = exp->GetGeom()->GetVid(k);
291 if(graph[0].count(meshVertId) == 0)
293 for (l = 0; l < vertcounts[i]; ++l)
295 if (vertlist[vertoffsets[i]+l] == meshVertId)
297 extraDirVertIds[meshVertId] = i;
298 graph[0][meshVertId] = graphVertId++;
305 for(k = 0; k < exp->GetNedges(); k++)
307 meshEdgeId = exp->GetGeom()->GetEid(k);
308 if(graph[1].count(meshEdgeId) == 0)
310 for (l = 0; l < edgecounts[i]; ++l)
312 if (edgelist[edgeoffsets[i]+l] == meshEdgeId)
314 extraDirEdgeIds[meshEdgeId] = i;
315 graph[1][meshEdgeId] = graphVertId++;
316 nExtraDirichlet += exp->GetEdgeNcoeffs(k)-2;
328 for (
auto &it : extraDirEdgeIds)
330 meshEdgeId = it.first;
340 for (i = 0; i < n; ++i)
348 vertcounts[
p] = extraDirVertIds.size();
349 edgecounts[
p] = extraDirEdgeIds.size();
355 vertoffsets[0] = edgeoffsets[0] = 0;
357 for (i = 1; i < n; ++i)
359 vertoffsets[i] = vertoffsets[i-1] + vertcounts[i-1];
360 edgeoffsets[i] = edgeoffsets[i-1] + edgecounts[i-1];
369 for (
auto &it : extraDirVertIds)
371 vertids [vertoffsets[
p]+i] = it.first;
372 vertprocs[vertoffsets[
p]+i] = it.second;
377 for (
auto &it : extraDirEdgeIds)
379 edgeids [edgeoffsets[
p]+i] = it.first;
380 edgeprocs[edgeoffsets[
p]+i] = it.second;
391 for (i = 0; i < nTotVerts; ++i)
393 if (p == vertprocs[i])
395 extraDirVerts.insert(vertids[i]);
400 for (i = 0; i < nTotEdges; ++i)
402 if (p == edgeprocs[i])
404 extraDirEdges.insert(edgeids[i]);
415 bcminvertid[
p] = vMaxVertId;
430 if (
m_session->DefinesParameter(
"SingularVertex"))
432 m_session->LoadParameter(
"SingularVertex", meshVertId);
434 else if (vMaxVertId == -1)
437 meshVertId = locExpVector[0]->GetGeom()->GetVid(0);
443 meshVertId = bcminvertid[
p];
446 if (graph[0].count(meshVertId) == 0)
448 graph[0][meshVertId] = graphVertId++;
464 for (i = 0; i < locExpVector.size(); ++i)
466 for (j = 0; j < locExpVector[i]->GetNverts(); ++j)
468 if (locExpVector[i]->GetGeom()->GetVid(j) !=
474 if (graph[0].count(meshVertId) == 0)
476 graph[0][meshVertId] =
492 if (graph[0].count(meshVertId) == 0)
498 gId = graph[0][meshVertId];
501 for (
auto &pIt : periodicVerts)
508 if (pIt.first == meshVertId)
510 gId = gId < 0 ? graphVertId++ : gId;
511 graph[0][meshVertId] = gId;
513 for (i = 0; i < pIt.second.size(); ++i)
515 if (pIt.second[i].isLocal)
517 graph[0][pIt.second[i].id] = graph[0][meshVertId];
524 for (i = 0; i < pIt.second.size(); ++i)
526 if (pIt.second[i].id == meshVertId)
535 gId = gId < 0 ? graphVertId++ : gId;
536 graph[0][pIt.first] = gId;
538 for (i = 0; i < pIt.second.size(); ++i)
540 if (pIt.second[i].isLocal)
542 graph[0][pIt.second[i].id] = graph[0][pIt.first];
552 firstNonDirGraphVertId = graphVertId;
554 typedef boost::adjacency_list<
555 boost::setS, boost::vecS, boost::undirectedS> BoostGraph;
556 BoostGraph boostGraphObj;
558 vector<map<int,int> > tempGraph(3);
559 map<int, int> vwgts_map;
564 int tempGraphVertId = 0;
565 int localVertOffset = 0;
566 int localEdgeOffset = 0;
567 int localFaceOffset = 0;
585 map<int,int> EdgeSize;
586 map<int,int> FaceSize;
589 for(i = 0; i < locExpVector.size(); ++i)
591 exp = locExpVector[i];
592 nTotalVerts += exp->GetNverts();
593 nTotalEdges += exp->GetNedges();
594 nTotalFaces += exp->GetNfaces();
596 nEdges = exp->GetNedges();
597 for(j = 0; j < nEdges; ++j)
599 meshEdgeId = exp->GetGeom()->GetEid(j);
600 if (EdgeSize.count(meshEdgeId) > 0)
602 EdgeSize[meshEdgeId] =
603 min(EdgeSize[meshEdgeId],
604 exp->GetEdgeNcoeffs(j) - 2);
608 EdgeSize[meshEdgeId] = exp->GetEdgeNcoeffs(j) - 2;
612 nFaces = exp->GetNfaces();
614 for(j = 0; j < nFaces; ++j)
616 meshFaceId = exp->GetGeom()->GetFid(j);
617 if (FaceSize.count(meshFaceId) > 0)
619 FaceSize[meshFaceId] =
620 min(FaceSize[meshFaceId],
621 exp->GetFaceIntNcoeffs(j));
625 FaceSize[meshFaceId] = exp->GetFaceIntNcoeffs(j);
627 FaceSize[meshFaceId] = exp->GetFaceIntNcoeffs(j);
632 for (
auto &pIt : periodicVerts)
634 meshVertId = pIt.first;
637 if (graph[0].count(pIt.first) != 0)
639 for (i = 0; i < pIt.second.size(); ++i)
641 meshVertId2 = pIt.second[i].id;
642 if (graph[0].count(meshVertId2) == 0 &&
643 pIt.second[i].isLocal)
645 graph[0][meshVertId2] =
646 graph[0][meshVertId];
653 bool isDirichlet =
false;
654 for (i = 0; i < pIt.second.size(); ++i)
656 if (!pIt.second[i].isLocal)
661 meshVertId2 = pIt.second[i].id;
662 if (graph[0].count(meshVertId2) > 0)
671 graph[0][meshVertId] =
672 graph[0][pIt.second[i].id];
674 for (j = 0; j < pIt.second.size(); ++j)
676 meshVertId2 = pIt.second[i].id;
677 if (j == i || !pIt.second[j].isLocal ||
678 graph[0].count(meshVertId2) > 0)
683 graph[0][meshVertId2] =
684 graph[0][pIt.second[i].id];
691 for (i = 0; i < pIt.second.size(); ++i)
693 if (!pIt.second[i].isLocal)
698 if (tempGraph[0].count(pIt.second[i].id) > 0)
704 if (i == pIt.second.size())
706 boost::add_vertex(boostGraphObj);
707 tempGraph[0][meshVertId] = tempGraphVertId++;
712 tempGraph[0][meshVertId] = tempGraph[0][pIt.second[i].id];
723 for(i = 0; i < locExpVector.size(); ++i)
725 exp = locExpVector[i];
727 nVerts = exp->GetNverts();
728 for(j = 0; j < nVerts; ++j)
730 meshVertId = exp->GetGeom()->GetVid(j);
731 if(graph[0].count(meshVertId) == 0)
733 if(tempGraph[0].count(meshVertId) == 0)
735 boost::add_vertex(boostGraphObj);
736 tempGraph[0][meshVertId] = tempGraphVertId++;
739 localVerts[localVertOffset+vertCnt++] = tempGraph[0][meshVertId];
740 vwgts_map[ tempGraph[0][meshVertId] ] = 1;
744 localVertOffset+=nVerts;
748 for (
auto &pIt : periodicEdges)
750 meshEdgeId = pIt.first;
753 if (graph[1].count(pIt.first) != 0)
755 for (i = 0; i < pIt.second.size(); ++i)
757 meshEdgeId2 = pIt.second[i].id;
758 if (graph[1].count(meshEdgeId2) == 0 &&
759 pIt.second[i].isLocal)
761 graph[1][meshEdgeId2] =
762 graph[1][meshEdgeId];
769 bool isDirichlet =
false;
770 for (i = 0; i < pIt.second.size(); ++i)
772 if (!pIt.second[i].isLocal)
777 meshEdgeId2 = pIt.second[i].id;
778 if (graph[1].count(meshEdgeId2) > 0)
787 graph[1][meshEdgeId] =
788 graph[1][pIt.second[i].id];
790 for (j = 0; j < pIt.second.size(); ++j)
792 meshEdgeId2 = pIt.second[i].id;
793 if (j == i || !pIt.second[j].isLocal ||
794 graph[1].count(meshEdgeId2) > 0)
799 graph[1][meshEdgeId2] =
800 graph[1][pIt.second[i].id];
807 for (i = 0; i < pIt.second.size(); ++i)
809 if (!pIt.second[i].isLocal)
814 if (tempGraph[1].count(pIt.second[i].id) > 0)
820 if (i == pIt.second.size())
822 boost::add_vertex(boostGraphObj);
823 tempGraph[1][meshEdgeId] = tempGraphVertId++;
829 tempGraph[1][meshEdgeId] = tempGraph[1][pIt.second[i].id];
833 int nEdgeIntCoeffs, nFaceIntCoeffs;
836 for(i = 0; i < locExpVector.size(); ++i)
838 exp = locExpVector[i];
840 nEdges = exp->GetNedges();
842 for(j = 0; j < nEdges; ++j)
844 meshEdgeId = exp->GetGeom()->GetEid(j);
845 nEdgeIntCoeffs = EdgeSize[meshEdgeId];
846 if(graph[1].count(meshEdgeId) == 0)
848 if(tempGraph[1].count(meshEdgeId) == 0)
850 boost::add_vertex(boostGraphObj);
851 tempGraph[1][meshEdgeId] = tempGraphVertId++;
856 localEdges[localEdgeOffset+edgeCnt++] = tempGraph[1][meshEdgeId];
857 vwgts_map[ tempGraph[1][meshEdgeId] ] = nEdgeIntCoeffs;
861 localEdgeOffset+=nEdges;
865 for (
auto &pIt : periodicFaces)
867 if (!pIt.second[0].isLocal)
870 meshFaceId = pIt.first;
871 ASSERTL0(graph[2].count(meshFaceId) == 0,
872 "This periodic boundary edge has been specified before");
873 boost::add_vertex(boostGraphObj);
874 tempGraph[2][meshFaceId] = tempGraphVertId++;
875 nFaceIntCoeffs = FaceSize[meshFaceId];
879 else if (pIt.first < pIt.second[0].id)
881 ASSERTL0(graph[2].count(pIt.first) == 0,
882 "This periodic boundary face has been specified before");
883 ASSERTL0(graph[2].count(pIt.second[0].id) == 0,
884 "This periodic boundary face has been specified before");
886 boost::add_vertex(boostGraphObj);
887 tempGraph[2][pIt.first] = tempGraphVertId;
888 tempGraph[2][pIt.second[0].id] = tempGraphVertId++;
889 nFaceIntCoeffs = FaceSize[pIt.first];
896 for(i = 0; i < locExpVector.size(); ++i)
898 exp = locExpVector[i];
899 nFaces = exp->GetNfaces();
901 for(j = 0; j < nFaces; ++j)
903 nFaceIntCoeffs = exp->GetFaceIntNcoeffs(j);
904 meshFaceId = exp->GetGeom()->GetFid(j);
905 if(graph[2].count(meshFaceId) == 0)
907 if(tempGraph[2].count(meshFaceId) == 0)
909 boost::add_vertex(boostGraphObj);
910 tempGraph[2][meshFaceId] = tempGraphVertId++;
915 localFaces[localFaceOffset+faceCnt++] = tempGraph[2][meshFaceId];
916 vwgts_map[ tempGraph[2][meshFaceId] ] = nFaceIntCoeffs;
921 localFaceOffset+=nFaces;
927 for(i = 0; i < locExpVector.size(); ++i)
929 exp = locExpVector[i];
930 nVerts = exp->GetNverts();
931 nEdges = exp->GetNedges();
932 nFaces = exp->GetNfaces();
939 for(j = 0; j < nVerts; j++)
941 if(localVerts[j+localVertOffset]==-1)
946 for(k = 0; k < nVerts; k++)
948 if(localVerts[k+localVertOffset]==-1)
954 boost::add_edge( (
size_t) localVerts[j+localVertOffset],
955 (
size_t) localVerts[k+localVertOffset],boostGraphObj);
959 for(k = 0; k < nEdges; k++)
961 if(localEdges[k+localEdgeOffset]==-1)
965 boost::add_edge( (
size_t) localVerts[j+localVertOffset],
966 (
size_t) localEdges[k+localEdgeOffset],boostGraphObj);
969 for(k = 0; k < nFaces; k++)
971 if(localFaces[k+localFaceOffset]==-1)
975 boost::add_edge( (
size_t) localVerts[j+localVertOffset],
976 (
size_t) localFaces[k+localFaceOffset],boostGraphObj);
981 for(j = 0; j < nEdges; j++)
983 if(localEdges[j+localEdgeOffset]==-1)
988 for(k = 0; k < nEdges; k++)
990 if(localEdges[k+localEdgeOffset]==-1)
996 boost::add_edge( (
size_t) localEdges[j+localEdgeOffset],
997 (
size_t) localEdges[k+localEdgeOffset],boostGraphObj);
1001 for(k = 0; k < nVerts; k++)
1003 if(localVerts[k+localVertOffset]==-1)
1007 boost::add_edge( (
size_t) localEdges[j+localEdgeOffset],
1008 (
size_t) localVerts[k+localVertOffset],boostGraphObj);
1011 for(k = 0; k < nFaces; k++)
1013 if(localFaces[k+localFaceOffset]==-1)
1017 boost::add_edge( (
size_t) localEdges[j+localEdgeOffset],
1018 (
size_t) localFaces[k+localFaceOffset],boostGraphObj);
1023 for(j = 0; j < nFaces; j++)
1025 if(localFaces[j+localFaceOffset]==-1)
1030 for(k = 0; k < nFaces; k++)
1032 if(localFaces[k+localFaceOffset]==-1)
1038 boost::add_edge( (
size_t) localFaces[j+localFaceOffset],
1039 (
size_t) localFaces[k+localFaceOffset],boostGraphObj);
1043 for(k = 0; k < nVerts; k++)
1045 if(localVerts[k+localVertOffset]==-1)
1049 boost::add_edge( (
size_t) localFaces[j+localFaceOffset],
1050 (
size_t) localVerts[k+localVertOffset],boostGraphObj);
1053 for(k = 0; k < nEdges; k++)
1055 if(localEdges[k+localEdgeOffset]==-1)
1059 boost::add_edge( (
size_t) localFaces[j+localFaceOffset],
1060 (
size_t) localEdges[k+localEdgeOffset],boostGraphObj);
1064 localVertOffset+=nVerts;
1065 localEdgeOffset+=nEdges;
1066 localFaceOffset+=nFaces;
1076 vector<long> procVerts, procEdges, procFaces;
1077 set <int> foundVerts, foundEdges, foundFaces;
1082 for(i = cnt = 0; i < locExpVector.size(); ++i)
1085 exp = locExpVector[elmtid];
1086 for (j = 0; j < exp->GetNverts(); ++j)
1088 int vid = exp->GetGeom()->GetVid(j)+1;
1089 if (foundVerts.count(vid) == 0)
1091 procVerts.push_back(vid);
1092 foundVerts.insert(vid);
1096 for (j = 0; j < exp->GetNedges(); ++j)
1098 int eid = exp->GetGeom()->GetEid(j)+1;
1100 if (foundEdges.count(eid) == 0)
1102 procEdges.push_back(eid);
1103 foundEdges.insert(eid);
1107 for (j = 0; j < exp->GetNfaces(); ++j)
1109 int fid = exp->GetGeom()->GetFid(j)+1;
1111 if (foundFaces.count(fid) == 0)
1113 procFaces.push_back(fid);
1114 foundFaces.insert(fid);
1119 int unique_verts = foundVerts.size();
1120 int unique_edges = foundEdges.size();
1121 int unique_faces = foundFaces.size();
1123 bool verbose =
m_session->DefinesCmdLineArgument(
"verbose");
1137 if (unique_edges > 0)
1145 if (unique_faces > 0)
1155 for (i = 0; i < unique_verts; ++i)
1159 if (graph[0].count(procVerts[i]-1) == 0)
1161 partVerts.insert(tempGraph[0][procVerts[i]-1]);
1166 for (i = 0; i < unique_edges; ++i)
1170 if (graph[1].count(procEdges[i]-1) == 0)
1172 partVerts.insert(tempGraph[1][procEdges[i]-1]);
1177 for (i = 0; i < unique_faces; ++i)
1181 if (graph[2].count(procFaces[i]-1) == 0)
1183 partVerts.insert(tempGraph[2][procFaces[i]-1]);
1189 for (
auto &pIt : periodicVerts)
1191 if (graph[0].count(pIt.first) == 0)
1193 partVerts.insert(tempGraph[0][pIt.first]);
1196 for (
auto &pIt : periodicEdges)
1198 if (graph[1].count(pIt.first) == 0)
1200 partVerts.insert(tempGraph[1][pIt.first]);
1203 for (
auto &pIt : periodicFaces)
1205 if (graph[2].count(pIt.first) == 0)
1207 partVerts.insert(tempGraph[2][pIt.first]);
1212 int nGraphVerts = tempGraphVertId;
1216 ASSERTL1(vwgts_map.size()==nGraphVerts,
"Non matching dimensions");
1217 for(i = 0; i < nGraphVerts; ++i)
1219 vwgts[i] = vwgts_map[i];
1250 boostGraphObj, perm, iperm, bottomUpGraph,
1251 partVerts, mdswitch);
1257 "Unrecognised solution type: " + std::string(
1283 for(
auto &mapIt : tempGraph[0])
1285 graph[0][mapIt.first] = iperm[mapIt.second] + graphVertId;
1287 for(
auto &mapIt : tempGraph[1])
1289 graph[1][mapIt.first] = iperm[mapIt.second] + graphVertId;
1291 for(
auto &mapIt : tempGraph[2])
1293 graph[2][mapIt.first] = iperm[mapIt.second] + graphVertId;
1304 const int numLocalCoeffs,
1308 const bool checkIfSystemSingular,
1309 const std::string variable,
1316 int p, q, numModes0, numModes1;
1319 int meshVertId, meshEdgeId, meshEdgeId2, meshFaceId, meshFaceId2;
1321 int nEdgeInteriorCoeffs;
1322 int firstNonDirGraphVertId;
1335 bool verbose =
m_session->DefinesCmdLineArgument(
"verbose");
1342 vector<map<int, int> > faceModes(2);
1343 map<int, LibUtilities::ShapeType> faceType;
1345 set<int> extraDirVerts, extraDirEdges;
1350 for (i = 0; i < locExpVector.size(); ++i)
1352 exp = locExpVector[i];
1354 for(j = 0; j < exp->GetNverts(); ++j)
1356 dofs[0][exp->GetGeom()->GetVid(j)] = 1;
1359 for(j = 0; j < exp->GetNedges(); ++j)
1361 if (dofs[1].count(exp->GetGeom()->GetEid(j)) > 0)
1363 if (dofs[1][exp->GetGeom()->GetEid(j)] !=
1364 exp->GetEdgeNcoeffs(j)-2)
1370 "CG with variable order only available with modal expansion");
1372 dofs[1][exp->GetGeom()->GetEid(j)] =
1373 min(dofs[1][exp->GetGeom()->GetEid(j)],
1374 exp->GetEdgeNcoeffs(j)-2);
1378 dofs[1][exp->GetGeom()->GetEid(j)] =
1379 exp->GetEdgeNcoeffs(j) - 2;
1383 for(j = 0; j < exp->GetNfaces(); ++j)
1385 faceOrient = exp->GetGeom()->GetForient(j);
1386 meshFaceId = exp->GetGeom()->GetFid(j);
1387 exp->GetFaceNumModes(j, faceOrient, numModes0, numModes1);
1389 if (faceModes[0].count(meshFaceId) > 0)
1391 faceModes[0][meshFaceId] =
1392 min(faceModes[0][meshFaceId], numModes0);
1394 faceModes[1][meshFaceId] =
1395 min(faceModes[1][meshFaceId], numModes1);
1399 faceModes[0][meshFaceId] = numModes0;
1400 faceModes[1][meshFaceId] = numModes1;
1404 geom = std::dynamic_pointer_cast<SpatialDomains::
1405 Geometry3D> (exp->GetGeom());
1406 faceType[meshFaceId] =
1407 geom->GetFace(j)->GetShapeType();
1413 for (
auto &pIt : periodicEdges)
1415 for (i = 0; i < pIt.second.size(); ++i)
1417 meshEdgeId2 = pIt.second[i].id;
1418 if (dofs[1].count(meshEdgeId2) == 0)
1420 dofs[1][meshEdgeId2] = 1e6;
1424 for (
auto &pIt : periodicFaces)
1426 for (i = 0; i < pIt.second.size(); ++i)
1428 meshFaceId2 = pIt.second[i].id;
1429 if (faceModes[0].count(meshFaceId2) == 0)
1431 faceModes[0][meshFaceId2] = 1e6;
1432 faceModes[1][meshFaceId2] = 1e6;
1444 for(
auto &dofIt : dofs[1])
1446 edgeId [i ] = dofIt.first + 1;
1447 edgeDof[i++] = (
NekDouble) dofIt.second;
1452 for (i = 0; i < dofs[1].size(); i++)
1454 dofs[1][edgeId[i]-1] = (int) (edgeDof[i]+0.5);
1457 for (
auto &pIt : periodicEdges)
1459 meshEdgeId = pIt.first;
1460 for (i = 0; i < pIt.second.size(); ++i)
1462 meshEdgeId2 = pIt.second[i].id;
1463 if (dofs[1][meshEdgeId2] < dofs[1][meshEdgeId])
1465 dofs[1][meshEdgeId] = dofs[1][meshEdgeId2];
1475 for(
auto dofIt = faceModes[0].begin(), dofIt2 = faceModes[1].begin();
1476 dofIt != faceModes[0].end(); dofIt++, dofIt2++, i++)
1478 faceId[i] = dofIt->first+1;
1486 for (i=0; i < faceModes[0].size(); i++)
1488 faceModes[0][faceId[i]-1] = (int) (faceP[i]+0.5);
1489 faceModes[1][faceId[i]-1] = (int) (faceQ[i]+0.5);
1492 for (
auto &pIt : periodicFaces)
1494 meshFaceId = pIt.first;
1495 for (i = 0; i < pIt.second.size(); ++i)
1497 meshFaceId2 = pIt.second[i].id;
1498 if (faceModes[0][meshFaceId2] < faceModes[0][meshFaceId])
1500 faceModes[0][meshFaceId] = faceModes[0][meshFaceId2];
1502 if (faceModes[1][meshFaceId2] < faceModes[1][meshFaceId])
1504 faceModes[1][meshFaceId] = faceModes[1][meshFaceId2];
1510 for (i=0; i < faceModes[0].size(); i++)
1512 P = faceModes[0][faceId[i]-1];
1513 Q = faceModes[1][faceId[i]-1];
1517 dofs[2][faceId[i]-1] =
1524 dofs[2][faceId[i]-1] =
1535 int nExtraDirichlet;
1538 "MDSwitch", mdswitch, 10);
1542 checkIfSystemSingular, periodicVerts, periodicEdges,
1543 periodicFaces, graph, bottomUpGraph, extraDirVerts,
1544 extraDirEdges, firstNonDirGraphVertId,
1545 nExtraDirichlet, mdswitch);
1559 graph[0].size() + graph[1].size() + graph[2].size() + 1);
1561 graphVertOffset[0] = 0;
1563 for(i = 0; i < locExpVector.size(); ++i)
1565 exp = locExpVector[i];
1567 for(j = 0; j < exp->GetNverts(); ++j)
1569 meshVertId = exp->GetGeom()->GetVid(j);
1570 graphVertOffset[graph[0][meshVertId]+1] = 1;
1573 for(j = 0; j < exp->GetNedges(); ++j)
1575 nEdgeInteriorCoeffs = exp->GetEdgeNcoeffs(j) - 2;
1576 meshEdgeId = exp->GetGeom()->GetEid(j);
1577 graphVertOffset[graph[1][meshEdgeId]+1]
1578 = dofs[1][meshEdgeId];
1580 bType = exp->GetEdgeBasisType(j);
1584 if(nEdgeInteriorCoeffs &&
1592 for(j = 0; j < exp->GetNfaces(); ++j)
1594 meshFaceId = exp->GetGeom()->GetFid(j);
1595 graphVertOffset[graph[2][meshFaceId]+1] = dofs[2][meshFaceId];
1599 for(i = 1; i < graphVertOffset.num_elements(); i++)
1601 graphVertOffset[i] += graphVertOffset[i-1];
1625 locExpVector[i]->NumBndryCoeffs();
1626 m_numLocalIntCoeffsPerPatch[i] = (
unsigned int)
1627 locExpVector[i]->GetNcoeffs() -
1628 locExpVector[i]->NumBndryCoeffs();
1643 for(i = 0; i < locExpVector.size(); ++i)
1645 exp = locExpVector[i];
1647 for(j = 0; j < exp->GetNverts(); ++j)
1649 meshVertId = exp->GetGeom()->GetVid(j);
1653 graphVertOffset[graph[0][meshVertId]];
1656 for(j = 0; j < exp->GetNedges(); ++j)
1658 nEdgeInteriorCoeffs = exp->GetEdgeNcoeffs(j)-2;
1659 edgeOrient = exp->GetGeom()->GetEorient(j);
1660 meshEdgeId = exp->GetGeom()->GetEid(j);
1662 auto pIt = periodicEdges.find(meshEdgeId);
1667 if (pIt != periodicEdges.end())
1669 pair<int, StdRegions::Orientation> idOrient =
1671 meshEdgeId, edgeOrient, pIt->second);
1672 edgeOrient = idOrient.second;
1675 exp->GetEdgeInteriorMap(j,edgeOrient,edgeInteriorMap,edgeInteriorSign);
1678 for(k = 0; k < dofs[1][meshEdgeId]; ++k)
1681 graphVertOffset[graph[1][meshEdgeId]]+k;
1683 for(k = dofs[1][meshEdgeId]; k < nEdgeInteriorCoeffs; ++k)
1691 for(k = 0; k < dofs[1][meshEdgeId]; ++k)
1696 for(k = dofs[1][meshEdgeId]; k < nEdgeInteriorCoeffs; ++k)
1703 for(j = 0; j < exp->GetNfaces(); ++j)
1705 faceOrient = exp->GetGeom()->GetForient(j);
1706 meshFaceId = exp->GetGeom()->GetFid(j);
1708 auto pIt = periodicFaces.find(meshFaceId);
1710 if (pIt != periodicFaces.end() &&
1711 meshFaceId == min(meshFaceId, pIt->second[0].id))
1716 exp->GetFaceInteriorMap(j,faceOrient,faceInteriorMap,faceInteriorSign);
1719 exp->GetFaceNumModes(j, faceOrient, numModes0, numModes1);
1720 switch(faceType[meshFaceId])
1726 for( q = 2; q < numModes1; q++)
1728 for( p = 2; p < numModes0; p++)
1730 if( (p < faceModes[0][meshFaceId]) &&
1731 (q < faceModes[1][meshFaceId]))
1734 graphVertOffset[graph[2][meshFaceId]]+k;
1759 for( p = 2; p < numModes0; p++)
1761 for( q = 1; q < numModes1-
p; q++)
1763 if( (p < faceModes[0][meshFaceId]) &&
1764 (p+q < faceModes[1][meshFaceId]))
1767 graphVertOffset[graph[2][meshFaceId]]+k;
1789 ASSERTL0(
false,
"Shape not recognised");
1798 for(i = 0; i < bndCondExp.num_elements(); i++)
1800 if (bndConditions[i]->GetBoundaryConditionType() ==
1806 set<int> foundExtraVerts, foundExtraEdges;
1807 for(j = 0; j < bndCondExp[i]->GetNumElmts(); j++)
1809 bndExp = bndCondExp[i]->GetExp(j);
1810 cnt = offset + bndCondExp[i]->GetCoeff_Offset(j);
1811 for(k = 0; k < bndExp->GetNverts(); k++)
1813 meshVertId = bndExp->GetGeom()->GetVid(k);
1814 m_bndCondCoeffsToGlobalCoeffsMap[cnt+bndExp->GetVertexMap(k)] = graphVertOffset[graph[0][meshVertId]];
1816 if (bndConditions[i]->GetBoundaryConditionType() !=
1822 auto iter = extraDirVerts.find(meshVertId);
1823 if (iter != extraDirVerts.end() &&
1824 foundExtraVerts.count(meshVertId) == 0)
1826 int loc = bndCondExp[i]->GetCoeff_Offset(j) +
1827 bndExp->GetVertexMap(k);
1828 int gid = graphVertOffset[
1829 graph[0][meshVertId]];
1832 foundExtraVerts.insert(meshVertId);
1836 for(k = 0; k < bndExp->GetNedges(); k++)
1838 nEdgeInteriorCoeffs = bndExp->GetEdgeNcoeffs(k)-2;
1839 edgeOrient = bndExp->GetGeom()->GetEorient(k);
1840 meshEdgeId = bndExp->GetGeom()->GetEid(k);
1842 auto pIt = periodicEdges.find(meshEdgeId);
1847 if (pIt != periodicEdges.end())
1849 pair<int, StdRegions::Orientation> idOrient =
1851 meshEdgeId, edgeOrient, pIt->second);
1852 edgeOrient = idOrient.second;
1855 bndExp->GetEdgeInteriorMap(
1856 k,edgeOrient,edgeInteriorMap,edgeInteriorSign);
1858 for(l = 0; l < dofs[1][meshEdgeId]; ++l)
1860 m_bndCondCoeffsToGlobalCoeffsMap[cnt+edgeInteriorMap[l]] =
1861 graphVertOffset[graph[1][meshEdgeId]]+l;
1863 for(l = dofs[1][meshEdgeId]; l < nEdgeInteriorCoeffs; ++l)
1865 m_bndCondCoeffsToGlobalCoeffsMap[cnt+edgeInteriorMap[l]] =
1866 graphVertOffset[graph[1][meshEdgeId]];
1872 for(l = 0; l < dofs[1][meshEdgeId]; ++l)
1876 for(l = dofs[1][meshEdgeId]; l < nEdgeInteriorCoeffs; ++l)
1882 if (bndConditions[i]->GetBoundaryConditionType() !=
1888 auto iter = extraDirEdges.find(meshEdgeId);
1889 if (iter != extraDirEdges.end() &&
1890 foundExtraEdges.count(meshEdgeId) == 0 &&
1891 nEdgeInteriorCoeffs > 0)
1893 for(l = 0; l < dofs[1][meshEdgeId]; ++l)
1895 int loc = bndCondExp[i]->GetCoeff_Offset(j) +
1897 int gid = graphVertOffset[
1898 graph[1][meshEdgeId]]+l;
1902 for(l = dofs[1][meshEdgeId]; l < nEdgeInteriorCoeffs; ++l)
1904 int loc = bndCondExp[i]->GetCoeff_Offset(j) +
1906 int gid = graphVertOffset[
1907 graph[1][meshEdgeId]];
1911 foundExtraEdges.insert(meshEdgeId);
1915 meshFaceId = bndExp->GetGeom()->GetGlobalID();
1917 for(k = 0; k < bndExp->GetNcoeffs(); k++)
1919 if(m_bndCondCoeffsToGlobalCoeffsMap[cnt+k] == -1)
1921 m_bndCondCoeffsToGlobalCoeffsMap[cnt+k] =
1922 graphVertOffset[graph[bndExp->GetNumBases()][meshFaceId]]+intDofCnt;
1927 offset += bndCondExp[i]->GetNcoeffs();
1971 for (i = 0; i < Tit.second.size(); ++i)
1973 valence[std::get<1>(Tit.second[i])] = 1.0;
1980 for (
auto &Tit : m_extraDirDofs)
1982 for (i = 0; i < Tit.second.size(); ++i)
1984 std::get<2>(Tit.second.at(i)) /=
1985 valence[std::get<1>(Tit.second.at(i))];
1999 graph[0].size() + graph[1].size() + graph[2].size()
2000 - firstNonDirGraphVertId);
2002 for (i = 0; i < locExpVector.size(); ++i)
2004 exp = locExpVector[i];
2006 for (j = 0; j < exp->GetNverts(); ++j)
2008 meshVertId = exp->GetGeom()->GetVid(j);
2010 if (graph[0][meshVertId] >= firstNonDirGraphVertId)
2012 vwgts_perm[graph[0][meshVertId] -
2013 firstNonDirGraphVertId] =
2014 dofs[0][meshVertId];
2018 for (j = 0; j < exp->GetNedges(); ++j)
2020 meshEdgeId = exp->GetGeom()->GetEid(j);
2022 if (graph[1][meshEdgeId] >= firstNonDirGraphVertId)
2024 vwgts_perm[graph[1][meshEdgeId] -
2025 firstNonDirGraphVertId] =
2026 dofs[1][meshEdgeId];
2030 for (j = 0; j < exp->GetNfaces(); ++j)
2032 meshFaceId = exp->GetGeom()->GetFid(j);
2034 if (graph[2][meshFaceId] >= firstNonDirGraphVertId)
2036 vwgts_perm[graph[2][meshFaceId] -
2037 firstNonDirGraphVertId] =
2038 dofs[2][meshFaceId];
2043 bottomUpGraph->ExpandGraphWithVertexWeights(vwgts_perm);
2092 const vector<PeriodicEntity> &periodicEdges)
2094 int minId = periodicEdges[0].id;
2098 for (k = 1; k < periodicEdges.size(); ++k)
2100 if (periodicEdges[k].
id < minId)
2102 minId = min(minId, periodicEdges[k].
id);
2107 minId = min(minId, meshEdgeId);
2109 if (meshEdgeId != minId)
2119 return make_pair(minId, edgeOrient);
2145 int tmp1 = (int)faceOrient - 5;
2146 int tmp2 = (int)perFaceOrient - 5;
2148 int flipDir1Map [8] = {2,3,0,1,6,7,4,5};
2149 int flipDir2Map [8] = {1,0,3,2,5,4,7,6};
2150 int transposeMap[8] = {4,5,6,7,0,2,1,3};
2155 tmp1 = transposeMap[tmp1];
2159 if (tmp2 == 2 || tmp2 == 3 || tmp2 == 6 || tmp2 == 7)
2161 tmp1 = flipDir1Map[tmp1];
2167 tmp1 = flipDir2Map[tmp1];
2201 int maxBndGlobalId = 0;
2212 const bool verbose = locExp.
GetSession()->DefinesCmdLineArgument(
"verbose");
2220 for(i = 0; i < locExpVector.size(); ++i)
2222 exp = locExpVector[i];
2223 nVert += exp->GetNverts();
2224 nEdge += exp->GetNedges();
2225 nFace += exp->GetNfaces();
2227 for(j = 0; j < exp->GetNedges(); ++j)
2229 dof = exp->GetEdgeNcoeffs(j)-2;
2230 maxEdgeDof = (dof > maxEdgeDof ? dof : maxEdgeDof);
2232 for(j = 0; j < exp->GetNfaces(); ++j)
2234 dof = exp->GetFaceIntNcoeffs(j);
2235 maxFaceDof = (dof > maxFaceDof ? dof : maxFaceDof);
2237 exp->GetInteriorMap(interiorMap);
2238 dof = interiorMap.num_elements();
2239 maxIntDof = (dof > maxIntDof ? dof : maxIntDof);
2251 for(i = 0; i < locExpVector.size(); ++i)
2253 exp = locExpVector[i];
2257 for(j = 0; j < exp->GetNverts(); ++j)
2259 meshVertId = exp->GetGeom()->GetVid(j);
2262 auto pIt = perVerts.find(meshVertId);
2263 if (pIt != perVerts.end())
2265 for (k = 0; k < pIt->second.size(); ++k)
2267 meshVertId = min(meshVertId, pIt->second[k].id);
2273 maxBndGlobalId = (vGlobalId > maxBndGlobalId ? vGlobalId : maxBndGlobalId);
2277 for(j = 0; j < exp->GetNedges(); ++j)
2279 meshEdgeId = exp->GetGeom()->GetEid(j);
2280 auto pIt = perEdges.find(meshEdgeId);
2281 edgeOrient = exp->GetGeom()->GetEorient(j);
2283 if (pIt != perEdges.end())
2285 pair<int, StdRegions::Orientation> idOrient =
2287 meshEdgeId, edgeOrient, pIt->second);
2288 meshEdgeId = idOrient.first;
2289 edgeOrient = idOrient.second;
2292 exp->GetEdgeInteriorMap(j,edgeOrient,edgeInteriorMap,edgeInteriorSign);
2293 dof = exp->GetEdgeNcoeffs(j)-2;
2297 for(k = 0, l = 0; k < dof; ++k)
2308 = nVert + meshEdgeId * maxEdgeDof + l + 1;
2310 maxBndGlobalId = (vGlobalId > maxBndGlobalId ? vGlobalId : maxBndGlobalId);
2316 for(j = 0; j < exp->GetNfaces(); ++j)
2318 faceOrient = exp->GetGeom()->GetForient(j);
2320 meshFaceId = exp->GetGeom()->GetFid(j);
2322 auto pIt = perFaces.find(meshFaceId);
2323 if (pIt != perFaces.end())
2325 if(meshFaceId == min(meshFaceId, pIt->second[0].id))
2329 meshFaceId = min(meshFaceId, pIt->second[0].id);
2333 exp->GetFaceInteriorMap(j,faceOrient,faceInteriorMap,faceInteriorSign);
2334 dof = exp->GetFaceIntNcoeffs(j);
2336 for(k = 0, l = 0; k < dof; ++k)
2347 = nVert + nEdge*maxEdgeDof + meshFaceId * maxFaceDof
2351 maxBndGlobalId = (vGlobalId > maxBndGlobalId ? vGlobalId : maxBndGlobalId);
2357 exp->GetInteriorMap(interiorMap);
2358 dof = interiorMap.num_elements();
2359 elementId = (exp->GetGeom())->GetGlobalID();
2360 for (k = 0; k < dof; ++k)
2364 = nVert + nEdge*maxEdgeDof + nFace*maxFaceDof + elementId*maxIntDof + k + 1;
2385 m_globalToUniversalMapUnique[i] = (tmp[i] >= 0 ? 1 : 0);
2389 m_globalToUniversalBndMapUnique[i] = (tmp2[i] >= 0 ? 1 : 0);
2408 const std::shared_ptr<LocalRegions::ExpansionVector> exp
2410 int nelmts = exp->size();
2411 const bool verbose = locexp.
GetSession()->DefinesCmdLineArgument(
"verbose");
2416 returnval->m_solnType = solnType;
2417 returnval->m_preconType =
eNull;
2418 returnval->m_maxStaticCondLevel = 0;
2419 returnval->m_signChange =
false;
2420 returnval->m_comm =
m_comm;
2423 for (i = 0; i < nelmts; ++i)
2425 nverts += (*exp)[i]->GetNverts();
2428 returnval->m_numLocalCoeffs = nverts;
2439 for (i = 0; i < nelmts; ++i)
2441 for (j = 0; j < (*exp)[i]->GetNverts(); ++j)
2443 returnval->m_localToGlobalMap[cnt] =
2444 returnval->m_localToGlobalBndMap[cnt] =
2446 GlobCoeffs[returnval->m_localToGlobalMap[cnt]] = 1;
2449 if ((returnval->m_localToGlobalMap[cnt]) <
2452 returnval->m_numLocalDirBndCoeffs++;
2456 cnt1 += (*exp)[i]->GetNcoeffs();
2463 if (GlobCoeffs[i] != -1)
2465 GlobCoeffs[i] = cnt++;
2470 returnval->m_numGlobalCoeffs = cnt;
2475 if (GlobCoeffs[i] != -1)
2477 returnval->m_numGlobalDirBndCoeffs++;
2486 int nglocoeffs = returnval->m_numGlobalCoeffs;
2487 returnval->m_globalToUniversalMap
2489 returnval->m_globalToUniversalMapUnique
2493 for (i = 0; i < nverts; ++i)
2495 cnt = returnval->m_localToGlobalMap[i];
2496 returnval->m_localToGlobalMap[i] = GlobCoeffs[cnt];
2498 returnval->m_globalToUniversalMap[GlobCoeffs[cnt]] =
2504 for (
unsigned int i = 0; i < nglocoeffs; ++i)
2506 tmp[i] = returnval->m_globalToUniversalMap[i];
2508 returnval->m_gsh =
Gs::Init(tmp, vCommRow, verbose);
2510 for (
unsigned int i = 0; i < nglocoeffs; ++i)
2512 returnval->m_globalToUniversalMapUnique[i]
2513 = (tmp[i] >= 0 ? 1 : 0);
2518 for (i = 0; i < nverts; ++i)
2520 cnt = returnval->m_localToGlobalMap[i];
2521 returnval->m_localToGlobalMap[i] = GlobCoeffs[cnt];
2554 for(j = 0; j < locSize; j++)
2569 bwidth = (bwidth>(maxId-minId))?bwidth:(maxId-minId);
2635 if(global.data() == loc.data())
2674 if(global.data() == loc.data())
2706 if(global.data() == loc.data())
#define ASSERTL0(condition, msg)
std::size_t hash_range(Iter first, Iter last)
bool m_systemSingular
Flag indicating if the system is singular or not.
bool m_signChange
Flag indicating if modes require sign reversal.
AssemblyMapCG(const LibUtilities::SessionReaderSharedPtr &pSession, const std::string variable="DefaultVar")
Default constructor.
int getNumberOfBndCoefficients(int Na, int Nb)
int m_numGlobalBndCoeffs
Total number of global boundary coefficients.
Principle Modified Functions .
std::shared_ptr< Geometry3D > Geometry3DSharedPtr
void MultiLevelBisectionReordering(const BoostGraph &graph, Array< OneD, int > &perm, Array< OneD, int > &iperm, BottomUpSubStructuredGraphSharedPtr &substructgraph, std::set< int > partVerts, int mdswitch)
LibUtilities::CommSharedPtr m_comm
Communicator.
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.
std::shared_ptr< AssemblyMapCG > AssemblyMapCGSharedPtr
int m_maxStaticCondLevel
Maximum static condensation level.
void Gathr(int n, const T *x, const int *y, T *z)
Gather vector z[i] = x[y[i]].
Principle Modified Functions .
static void Finalise(gs_data *pGsh)
Deallocates the GSLib mapping data.
Array< OneD, int > m_globalToUniversalMapUnique
Integer map of unique process coeffs to universal space (signed)
SpatialDomains::GeometrySharedPtr GetGeom() const
T Vmax(int n, const T *x, const int incx)
Return the maximum element in x – called vmax to avoid conflict with max.
Array< OneD, int > m_extraDirEdges
Extra dirichlet edges in parallel.
void SetUpUniversalC0ContMap(const ExpList &locExp, const PeriodicMap &perVerts=NullPeriodicMap, const PeriodicMap &perEdges=NullPeriodicMap, const PeriodicMap &perFaces=NullPeriodicMap)
int CreateGraph(const ExpList &locExp, const BndCondExp &bndCondExp, const Array< OneD, const BndCond > &bndConditions, const bool checkIfSystemSingular, const PeriodicMap &periodicVerts, const PeriodicMap &periodicEdges, const PeriodicMap &periodicFaces, DofGraph &graph, BottomUpSubStructuredGraphSharedPtr &bottomUpGraph, std::set< int > &extraDirVerts, std::set< int > &extraDirEdges, int &firstNonDirGraphVertId, int &nExtraDirichlet, int mdswitch=1)
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
int m_numNonDirVertexModes
Number of non Dirichlet vertex modes.
Principle Modified Functions .
std::tuple< int, int, NekDouble > ExtraDirDof
Array< OneD, int > m_globalToUniversalMap
Integer map of process coeffs to universal space.
int m_numNonDirEdges
Number of Dirichlet edges.
virtual void v_GlobalToLocal(const Array< OneD, const NekDouble > &global, Array< OneD, NekDouble > &loc) const
int m_numLocalCoeffs
Total number of local coefficients.
void CuthillMckeeReordering(const BoostGraph &graph, Array< OneD, int > &perm, Array< OneD, int > &iperm)
void UniversalAssemble(Array< OneD, NekDouble > &pGlobal) const
int m_numLocalBndCondCoeffs
Number of local boundary condition coefficients.
std::map< int, std::vector< ExtraDirDof > > m_extraDirDofs
Map indicating degrees of freedom which are Dirichlet but whose value is stored on another processor...
const std::shared_ptr< LocalRegions::ExpansionVector > GetExp() const
This function returns the vector of elements in the expansion.
int Imax(int n, const T *x, const int incx)
Return the index of the maximum element in x.
void CalculateFullSystemBandWidth()
Calculate the bandwith of the full matrix system.
std::vector< ExpansionSharedPtr > ExpansionVector
std::shared_ptr< AssemblyMap > AssemblyMapSharedPtr
Array< OneD, int > m_localToGlobalMap
Integer map of local coeffs to global space.
virtual const Array< OneD, const int > & v_GetLocalToGlobalMap()
AssemblyMapSharedPtr m_nextLevelLocalToGlobalMap
Map from the patches of the previous level to the patches of the current level.
virtual int v_GetNumNonDirFaces() const
Base class for constructing local to global mapping of degrees of freedom.
static gs_data * Init(const Nektar::Array< OneD, long > pId, const LibUtilities::CommSharedPtr &pComm, bool verbose=true)
Initialise Gather-Scatter map.
const char *const GlobalSysSolnTypeMap[]
int m_numNonDirFaceModes
Number of non Dirichlet face modes.
size_t m_hash
Hash for map.
Base class for all multi-elemental spectral/hp expansions.
Array< OneD, unsigned int > m_numLocalBndCoeffsPerPatch
The number of bnd dofs per patch.
GlobalSysSolnType m_solnType
The solution type of the global system.
Array< OneD, NekDouble > m_bndCondCoeffsToGlobalCoeffsSign
Integer map of bnd cond coeffs to global coefficients.
virtual AssemblyMapSharedPtr v_LinearSpaceMap(const ExpList &locexp, GlobalSysSolnType solnType)
Construct an AssemblyMapCG object which corresponds to the linear space of the current object...
int m_numGlobalDirBndCoeffs
Number of Global Dirichlet Boundary Coefficients.
Principle Modified Functions .
StdRegions::Orientation DeterminePeriodicFaceOrient(StdRegions::Orientation faceOrient, StdRegions::Orientation perFaceOrient)
Determine relative orientation between two faces.
int m_numDirFaces
Number of Dirichlet faces.
virtual int v_GetFullSystemBandWidth() const
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
void Scatr(int n, const T *x, const int *y, T *z)
Scatter vector z[y[i]] = x[i].
int getNumberOfCoefficients(int Na, int Nb)
static void Unique(const Nektar::Array< OneD, long > pId, const LibUtilities::CommSharedPtr &pComm)
Updates pId to negate all-but-one references to each universal ID.
void UniversalAssembleBnd(Array< OneD, NekDouble > &pGlobal) const
void Assmb(int n, const T *x, const int *y, T *z)
Assemble z[y[i]] += x[i]; z should be zero'd first.
virtual int v_GetNumDirEdges() const
Array< OneD, unsigned int > m_numLocalIntCoeffsPerPatch
The number of int dofs per patch.
std::map< int, std::vector< PeriodicEntity > > PeriodicMap
int m_lowestStaticCondLevel
Lowest static condensation level.
void CalculateBndSystemBandWidth()
Calculates the bandwidth of the boundary system.
Array< OneD, int > m_localToGlobalBndMap
Integer map of local boundary coeffs to global space.
int m_numLocalDirBndCoeffs
Number of Local Dirichlet Boundary Coefficients.
No Solution type specified.
virtual const Array< OneD, const int > & v_GetExtraDirEdges()
int getNumberOfBndCoefficients(int Na, int Nb)
virtual void v_UniversalAssemble(Array< OneD, NekDouble > &pGlobal) const
Array< OneD, int > m_bndCondCoeffsToGlobalCoeffsMap
Integer map of bnd cond coeffs to global coefficients.
std::shared_ptr< Expansion > ExpansionSharedPtr
std::vector< std::map< int, int > > DofGraph
int m_numLocalBndCoeffs
Number of local boundary coefficients.
int m_numDirEdges
Number of Dirichlet edges.
void LocalToGlobal(const Array< OneD, const NekDouble > &loc, Array< OneD, NekDouble > &global, bool useComm=true) const
int m_staticCondLevel
The level of recursion in the case of multi-level static condensation.
virtual int v_GetNumDirFaces() const
Array< OneD, NekDouble > m_localToGlobalBndSign
Integer sign of local boundary coeffs to global space.
Array< OneD, NekDouble > m_localToGlobalSign
Integer sign of local coeffs to global space.
void Assemble(const Array< OneD, const NekDouble > &loc, Array< OneD, NekDouble > &global) const
int getNumberOfCoefficients(int Na, int Nb)
int m_numNonDirEdgeModes
Number of non Dirichlet edge modes.
virtual int v_GetNumNonDirVertexModes() const
LibUtilities::SessionReaderSharedPtr m_session
Session object.
virtual int v_GetNumNonDirFaceModes() const
virtual int v_GetNumNonDirEdgeModes() const
Array< OneD, int > m_globalToUniversalBndMap
Integer map of process coeffs to universal space.
Array< OneD, int > m_globalToUniversalBndMapUnique
Integer map of unique process coeffs to universal space (signed)
virtual ~AssemblyMapCG()
Destructor.
virtual int v_GetNumNonDirEdges() const
int m_numGlobalCoeffs
Total number of global coefficients.
pair< int, StdRegions::Orientation > DeterminePeriodicEdgeOrientId(int meshEdgeId, StdRegions::Orientation edgeOrient, const vector< PeriodicEntity > &periodicEdges)
Determine orientation of an edge to its periodic equivalents, as well as the ID of the representative...
int m_numNonDirFaces
Number of Dirichlet faces.
int GetCoeff_Offset(int n) const
Get the start offset position for a global list of m_coeffs correspoinding to element n...
virtual const Array< OneD, const int > & v_GetGlobalToUniversalMapUnique()
T Vsum(int n, const T *x, const int incx)
Subtract return sum(x)
void Zero(int n, T *x, const int incx)
Zero vector.
virtual const Array< OneD, const int > & v_GetGlobalToUniversalMap()
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
int m_fullSystemBandWidth
Bandwith of the full matrix system (no static condensation).
std::shared_ptr< BottomUpSubStructuredGraph > BottomUpSubStructuredGraphSharedPtr
std::shared_ptr< SessionReader > SessionReaderSharedPtr
Array< OneD, DataType > & GetPtr()
int m_numPatches
The number of patches (~elements) in the current level.
virtual void v_LocalToGlobal(const Array< OneD, const NekDouble > &loc, Array< OneD, NekDouble > &global, bool useComm) const
void GlobalToLocal(const Array< OneD, const NekDouble > &global, Array< OneD, NekDouble > &loc) const
void NoReordering(const BoostGraph &graph, Array< OneD, int > &perm, Array< OneD, int > &iperm)
virtual const Array< OneD, NekDouble > & v_GetLocalToGlobalSign() const
std::shared_ptr< LibUtilities::SessionReader > GetSession() const
Returns the session object.
virtual void v_Assemble(const Array< OneD, const NekDouble > &loc, Array< OneD, NekDouble > &global) const