Nektar++
Loading...
Searching...
No Matches
AssemblyMapDG.cpp
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: AssemblyMapDG.cpp
4//
5// For more information, please see: http://www.nektar.info
6//
7// The MIT License
8//
9// Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10// Department of Aeronautics, Imperial College London (UK), and Scientific
11// Computing and Imaging Institute, University of Utah (USA).
12//
13// Permission is hereby granted, free of charge, to any person obtaining a
14// copy of this software and associated documentation files (the "Software"),
15// to deal in the Software without restriction, including without limitation
16// the rights to use, copy, modify, merge, publish, distribute, sublicense,
17// and/or sell copies of the Software, and to permit persons to whom the
18// Software is furnished to do so, subject to the following conditions:
19//
20// The above copyright notice and this permission notice shall be included
21// in all copies or substantial portions of the Software.
22//
23// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29// DEALINGS IN THE SOFTWARE.
30//
31// Description: Local to Global Base Class mapping routines
32//
33///////////////////////////////////////////////////////////////////////////////
34
39#include <LocalRegions/SegExp.h>
43
44#include <boost/algorithm/string.hpp>
45#include <boost/config.hpp>
46#include <boost/graph/adjacency_list.hpp>
47
48using namespace std;
49
51{
52AssemblyMapDG::AssemblyMapDG() : m_numDirichletBndPhys(0)
53{
54}
55
60
63 [[maybe_unused]] const SpatialDomains::MeshGraphSharedPtr &graph,
64 const ExpListSharedPtr &trace, const ExpList &locExp,
67 const PeriodicMap &periodicTrace, const std::string variable)
68 : AssemblyMap(pSession, locExp.GetComm(), variable)
69{
70 int i, j, k, cnt, id, id1, gid;
71 int order_e = 0;
72 int nTraceExp = trace->GetExpSize();
73 int nbnd = bndCondExp.size();
74
77 SpatialDomains::Geometry *traceGeom;
78
79 const LocalRegions::ExpansionVector expList = *(locExp.GetExp());
80 int nel = expList.size();
81
82 map<int, int> meshTraceId;
83
84 m_signChange = true;
85
86 // determine mapping from geometry edges to trace
87 for (i = 0; i < nTraceExp; ++i)
88 {
89 meshTraceId[trace->GetExp(i)->GetGeom()->GetGlobalID()] = i;
90 }
91
92 // Count total number of trace elements
93 cnt = 0;
94 for (i = 0; i < nel; ++i)
95 {
96 cnt += expList[i]->GetNtraces();
97 }
98
102
103 // set up trace expansions links;
104 for (cnt = i = 0; i < nel; ++i)
105 {
106 m_elmtToTrace[i] = tracemap + cnt;
107 exp = expList[i];
108
109 for (j = 0; j < exp->GetNtraces(); ++j)
110 {
111 id = exp->GetGeom()->GetTid(j);
112
113 if (meshTraceId.count(id) > 0)
114 {
115 m_elmtToTrace[i][j] =
116 trace->GetExp(meshTraceId.find(id)->second);
117 }
118 else
119 {
120 ASSERTL0(false, "Failed to find trace map");
121 }
122 }
123
124 cnt += exp->GetNtraces();
125 }
126
127 // Set up boundary mapping
128 cnt = 0;
129 for (i = 0; i < nbnd; ++i)
130 {
131 if (bndCond[i]->GetBoundaryConditionType() == SpatialDomains::ePeriodic)
132 {
133 continue;
134 }
135 cnt += bndCondExp[i]->GetExpSize();
136 }
137
138 set<int> dirTrace;
139
142
143 for (i = 0; i < bndCondExp.size(); ++i)
144 {
145 for (j = 0; j < bndCondExp[i]->GetExpSize(); ++j)
146 {
147 bndExp = bndCondExp[i]->GetExp(j);
148 traceGeom = bndExp->GetGeom();
149 id = traceGeom->GetGlobalID();
150
151 if (bndCond[i]->GetBoundaryConditionType() ==
153 {
154 m_numLocalDirBndCoeffs += bndExp->GetNcoeffs();
155 m_numDirichletBndPhys += bndExp->GetTotPoints();
156 dirTrace.insert(id);
157 }
158 }
159 }
160
161 // Set up integer mapping array and sign change for each degree of
162 // freedom + initialise some more data members.
165 m_numPatches = nel;
168
169 int nbndry = 0;
170 for (i = 0; i < nel; ++i) // count number of elements in array
171 {
172 int BndCoeffs = expList[i]->NumDGBndryCoeffs();
173 nbndry += BndCoeffs;
175 m_numLocalBndCoeffsPerPatch[i] = (unsigned int)BndCoeffs;
176 }
177
179 m_numLocalBndCoeffs = nbndry;
180 m_numLocalCoeffs = nbndry;
183
184 // Set up array for potential mesh optimsation
185 Array<OneD, int> traceElmtGid(nTraceExp, -1);
186 int nDir = 0;
187 cnt = 0;
188
189 // We are now going to construct a graph of the mesh which can be
190 // reordered depending on the type of solver we would like to use.
191 typedef boost::adjacency_list<boost::setS, boost::vecS, boost::undirectedS>
192 BoostGraph;
193
194 BoostGraph boostGraphObj;
195 int trace_id, trace_id1;
196 int dirOffset = 0;
197
198 // make trace renumbering map where first solved trace starts
199 // at 0 so we can set up graph.
200 for (i = 0; i < nTraceExp; ++i)
201 {
202 id = trace->GetExp(i)->GetGeom()->GetGlobalID();
203
204 if (dirTrace.count(id) == 0)
205 {
206 // Initial put in element ordering (starting from zero) into
207 // traceElmtGid
208 boost::add_vertex(boostGraphObj);
209 traceElmtGid[i] = cnt++;
210 }
211 else
212 {
213 // Use existing offset for Dirichlet edges
214 traceElmtGid[i] = dirOffset;
215 dirOffset += trace->GetExp(i)->GetNcoeffs();
216 nDir++;
217 }
218 }
219
220 // Set up boost Graph
221 for (i = 0; i < nel; ++i)
222 {
223 exp = expList[i];
224
225 for (j = 0; j < exp->GetNtraces(); ++j)
226 {
227 // Add trace to boost graph for non-Dirichlet Boundary
228 traceGeom = m_elmtToTrace[i][j]->GetGeom();
229 id = traceGeom->GetGlobalID();
230 trace_id = meshTraceId.find(id)->second;
231
232 if (dirTrace.count(id) == 0)
233 {
234 for (k = j + 1; k < exp->GetNtraces(); ++k)
235 {
236 traceGeom = m_elmtToTrace[i][k]->GetGeom();
237 id1 = traceGeom->GetGlobalID();
238 trace_id1 = meshTraceId.find(id1)->second;
239
240 if (dirTrace.count(id1) == 0)
241 {
242 boost::add_edge((size_t)traceElmtGid[trace_id],
243 (size_t)traceElmtGid[trace_id1],
244 boostGraphObj);
245 }
246 }
247 }
248 }
249 }
250
251 int nGraphVerts = nTraceExp - nDir;
252 Array<OneD, int> perm(nGraphVerts);
253 Array<OneD, int> iperm(nGraphVerts);
254 Array<OneD, int> vwgts(nGraphVerts);
256
257 for (i = 0; i < nGraphVerts; ++i)
258 {
259 vwgts[i] = trace->GetExp(i + nDir)->GetNcoeffs();
260 }
261
262 if (nGraphVerts)
263 {
264 switch (m_solnType)
265 {
267 case eIterativeFull:
269 case eXxtFullMatrix:
270 case eXxtStaticCond:
271 case ePETScFullMatrix:
272 case ePETScStaticCond:
273 {
274 NoReordering(boostGraphObj, perm, iperm);
275 break;
276 }
278 {
279 CuthillMckeeReordering(boostGraphObj, perm, iperm);
280 break;
281 }
286 {
287 MultiLevelBisectionReordering(boostGraphObj, perm, iperm,
288 bottomUpGraph);
289 break;
290 }
291 default:
292 {
293 ASSERTL0(false, "Unrecognised solution type");
294 }
295 }
296 }
297
298 // Recast the permutation so that it can be used as a map from old
299 // trace ID to new trace ID
301 for (i = 0; i < nTraceExp - nDir; ++i)
302 {
303 traceElmtGid[perm[i] + nDir] = cnt;
304 cnt += trace->GetExp(perm[i] + nDir)->GetNcoeffs();
305 }
306
307 // Now have trace edges Gid position
308 cnt = 0;
309 for (i = 0; i < nel; ++i)
310 {
311 exp = expList[i];
312
313 for (j = 0; j < exp->GetNtraces(); ++j)
314 {
315 traceGeom = m_elmtToTrace[i][j]->GetGeom();
316 id = traceGeom->GetGlobalID();
317 gid = traceElmtGid[meshTraceId.find(id)->second];
318
319 const int nDim = exp->GetNumBases();
320
321 if (nDim == 1)
322 {
323 order_e = 1;
324 m_localToGlobalBndMap[cnt] = gid;
325 }
326 else if (nDim == 2)
327 {
328 order_e = exp->GetTraceNcoeffs(j);
329
330 if (exp->GetTraceOrient(j) == StdRegions::eForwards)
331 {
332 for (k = 0; k < order_e; ++k)
333 {
334 m_localToGlobalBndMap[k + cnt] = gid + k;
335 }
336 }
337 else
338 {
339 switch (m_elmtToTrace[i][j]->GetBasisType(0))
340 {
342 {
343 // reverse vertex order
344 m_localToGlobalBndMap[cnt] = gid + 1;
345 m_localToGlobalBndMap[cnt + 1] = gid;
346 for (k = 2; k < order_e; ++k)
347 {
348 m_localToGlobalBndMap[k + cnt] = gid + k;
349 }
350
351 // negate odd modes
352 for (k = 3; k < order_e; k += 2)
353 {
354 m_localToGlobalBndSign[cnt + k] = -1.0;
355 }
356 break;
357 }
359 {
360 // reverse order
361 for (k = 0; k < order_e; ++k)
362 {
363 m_localToGlobalBndMap[cnt + order_e - k - 1] =
364 gid + k;
365 }
366 break;
367 }
369 {
370 // reverse order
371 for (k = 0; k < order_e; ++k)
372 {
373 m_localToGlobalBndMap[cnt + order_e - k - 1] =
374 gid + k;
375 }
376 break;
377 }
378 default:
379 {
380 ASSERTL0(false, "Boundary type not permitted");
381 }
382 }
383 }
384 }
385 else if (nDim == 3)
386 {
387 order_e = exp->GetTraceNcoeffs(j);
388
389 std::map<int, int> orientMap;
390
391 Array<OneD, unsigned int> elmMap1(order_e);
392 Array<OneD, int> elmSign1(order_e);
393 Array<OneD, unsigned int> elmMap2(order_e);
394 Array<OneD, int> elmSign2(order_e);
395
396 StdRegions::Orientation fo = exp->GetTraceOrient(j);
397
398 // Construct mapping which will permute global IDs
399 // according to face orientations.
400 exp->GetTraceToElementMap(j, elmMap1, elmSign1, fo);
401 exp->GetTraceToElementMap(j, elmMap2, elmSign2,
403
404 for (k = 0; k < elmMap1.size(); ++k)
405 {
406 // Find the elemental co-efficient in the original
407 // mapping.
408 int idx = -1;
409 for (int l = 0; l < elmMap2.size(); ++l)
410 {
411 if (elmMap1[k] == elmMap2[l])
412 {
413 idx = l;
414 break;
415 }
416 }
417
418 ASSERTL2(idx != -1, "Problem with face to element map!");
419 orientMap[k] = idx;
420 }
421
422 for (k = 0; k < order_e; ++k)
423 {
424 m_localToGlobalBndMap[k + cnt] = gid + orientMap[k];
425 m_localToGlobalBndSign[k + cnt] = elmSign2[orientMap[k]];
426 }
427 }
428
429 cnt += order_e;
430 }
431 }
432
433 // set up identify map for lcoal to lcoal
435
436 // local to bnd map is just a copy
437 for (i = 0; i < m_numLocalBndCoeffs; ++i)
438 {
440 }
441
442 m_numGlobalBndCoeffs = trace->GetNcoeffs();
444
446
447 // set up m_bndCondCoeffsToLocalTraceMap
448 // Number of boundary expansions
449 int nbndexp = 0;
450 int nrotperbndexp = 0;
451 int bndTotal = 0;
452 int bndOffset;
453 int traceOffset;
454
455 cnt = 0;
456 for (i = 0; i < nbnd; ++i)
457 {
458 if (bndCond[i]->GetBoundaryConditionType() == SpatialDomains::ePeriodic)
459 {
460 if (boost::icontains(bndCond[i]->GetUserDefined(), "Rotated"))
461 {
462 nrotperbndexp += bndCondExp[i]->GetExpSize();
463 }
464
465 continue;
466 }
467 cnt += bndCondExp[i]->GetNcoeffs();
468 nbndexp += bndCondExp[i]->GetExpSize();
469 }
470
474
475 cnt = 0;
476 int percnt = 0;
477 for (i = 0; i < bndCondExp.size(); ++i)
478 {
479 if (bndCond[i]->GetBoundaryConditionType() == SpatialDomains::ePeriodic)
480 {
481 if (boost::icontains(bndCond[i]->GetUserDefined(), "Rotated"))
482 {
483
484 for (j = 0; j < bndCondExp[i]->GetExpSize(); ++j)
485 {
486 bndExp = bndCondExp[i]->GetExp(j);
487 id = bndExp->GetGeom()->GetGlobalID();
488
489 int meshId = meshTraceId.find(id)->second;
490 m_perbndCondIDToGlobalTraceID[percnt++] = meshId;
491 }
492 }
493 continue;
494 }
495
496 for (j = 0; j < bndCondExp[i]->GetExpSize(); ++j)
497 {
498 bndExp = bndCondExp[i]->GetExp(j);
499 id = bndExp->GetGeom()->GetGlobalID();
500
501 int meshId = meshTraceId.find(id)->second;
502 m_bndCondIDToGlobalTraceID[cnt++] = meshId;
503
504 // initialy set up map with global bnd location
505 // and then use the localToGlobalBndMap to invert
506 // since this is a one to one mapping on boundaries
507 traceOffset = traceElmtGid[meshId];
508 bndOffset = bndCondExp[i]->GetCoeff_Offset(j) + bndTotal;
509
510 for (k = 0; k < bndExp->GetNcoeffs(); ++k)
511 {
512 m_bndCondCoeffsToLocalTraceMap[bndOffset + k] = traceOffset + k;
513 }
514 }
515 bndTotal += bndCondExp[i]->GetNcoeffs();
516 }
517
518 // generate an inverse local to global bnd map;
519 map<int, int> invLocToGloMap;
520 for (i = 0; i < nbndry; ++i)
521 {
522 invLocToGloMap[m_localToGlobalBndMap[i]] = i;
523 }
524
525 // reset bndCondCoeffToLocalTraceMap to hold local rather
526 // than global reference
527 for (i = 0; i < m_bndCondCoeffsToLocalTraceMap.size(); ++i)
528 {
530 invLocToGloMap[m_bndCondCoeffsToLocalTraceMap[i]];
531 }
532
533 // Now set up mapping from global coefficients to universal.
534 ExpListSharedPtr tr = std::dynamic_pointer_cast<ExpList>(trace);
535 SetUpUniversalDGMap(locExp);
536
539 locExp, tr, m_elmtToTrace, bndCondExp, bndCond, periodicTrace));
540
545 nGraphVerts)
546 {
547 if (m_staticCondLevel < (bottomUpGraph->GetNlevels() - 1))
548 {
549 Array<OneD, int> vwgts_perm(nGraphVerts);
550
551 for (int i = 0; i < nGraphVerts; i++)
552 {
553 vwgts_perm[i] = vwgts[perm[i]];
554 }
555
556 bottomUpGraph->ExpandGraphWithVertexWeights(vwgts_perm);
559 bottomUpGraph);
560 }
561 }
562
563 m_hash =
565}
566
567/**
568 * Constructs a mapping between the process-local global numbering and
569 * a universal numbering of the trace space expansion. The universal
570 * numbering is defined by the mesh edge IDs to enforce consistency
571 * across processes.
572 *
573 * @param locExp List of local elemental expansions.
574 */
576{
578 int cnt = 0;
579 int id = 0;
580 int order_e = 0;
581 int vGlobalId = 0;
582 int maxDof = 0;
583 int dof = 0;
584 int nDim = 0;
585 int i, j, k;
586
587 const LocalRegions::ExpansionVector &locExpVector = *(locExp.GetExp());
588
589 // Initialise the global to universal maps.
594
595 // Loop over all the elements in the domain and compute max
596 // DOF. Reduce across all processes to get universal maximum.
597 for (i = 0; i < locExpVector.size(); ++i)
598 {
599 locExpansion = locExpVector[i];
600 nDim = locExpansion->GetShapeDimension();
601
602 // Loop over all edges of element i
603 if (nDim == 1)
604 {
605 maxDof = (1 > maxDof ? 1 : maxDof);
606 }
607 else
608 {
609 for (j = 0; j < locExpansion->GetNtraces(); ++j)
610 {
611 dof = locExpansion->GetTraceNcoeffs(j);
612 maxDof = (dof > maxDof ? dof : maxDof);
613 }
614 }
615 }
616 m_comm->GetRowComm()->AllReduce(maxDof, LibUtilities::ReduceMax);
617
618 // Now have trace edges Gid position
619 cnt = 0;
620 for (i = 0; i < locExpVector.size(); ++i)
621 {
622 locExpansion = locExpVector[i];
623 nDim = locExpansion->GetShapeDimension();
624
625 // Populate mapping for each edge of the element.
626 if (nDim == 1)
627 {
628 int nverts = locExpansion->GetNverts();
629 for (j = 0; j < nverts; ++j)
630 {
633 id = locPointExp->GetGeom()->GetGlobalID();
634 vGlobalId = m_localToGlobalBndMap[cnt + j];
635 m_globalToUniversalBndMap[vGlobalId] = id * maxDof + j + 1;
636 }
637 cnt += nverts;
638 }
639 else if (nDim == 2)
640 {
641 for (j = 0; j < locExpansion->GetNtraces(); ++j)
642 {
645
646 id = locSegExp->GetGeom()->GetGlobalID();
647 order_e = locExpansion->GetTraceNcoeffs(j);
648
649 map<int, int> orientMap;
650 Array<OneD, unsigned int> map1(order_e), map2(order_e);
651 Array<OneD, int> sign1(order_e), sign2(order_e);
652
653 locExpansion->GetTraceToElementMap(j, map1, sign1,
655 locExpansion->GetTraceToElementMap(
656 j, map2, sign2, locExpansion->GetTraceOrient(j));
657
658 for (k = 0; k < map1.size(); ++k)
659 {
660 // Find the elemental co-efficient in the original
661 // mapping.
662 int idx = -1;
663 for (int l = 0; l < map2.size(); ++l)
664 {
665 if (map1[k] == map2[l])
666 {
667 idx = l;
668 break;
669 }
670 }
671
672 ASSERTL2(idx != -1, "Problem with face to"
673 " element map!");
674 orientMap[k] = idx;
675 }
676
677 for (k = 0; k < order_e; ++k)
678 {
679 vGlobalId = m_localToGlobalBndMap[k + cnt];
680 m_globalToUniversalBndMap[vGlobalId] =
681 id * maxDof + orientMap[k] + 1;
682 }
683 cnt += order_e;
684 }
685 }
686 else if (nDim == 3) // This could likely be combined with nDim == 2
687 {
688 for (j = 0; j < locExpansion->GetNtraces(); ++j)
689 {
692
693 id = locFaceExp->GetGeom()->GetGlobalID();
694 order_e = locExpansion->GetTraceNcoeffs(j);
695
696 map<int, int> orientMap;
697 Array<OneD, unsigned int> map1(order_e), map2(order_e);
698 Array<OneD, int> sign1(order_e), sign2(order_e);
699
700 locExpansion->GetTraceToElementMap(
702 locExpansion->GetTraceToElementMap(
703 j, map2, sign2, locExpansion->GetTraceOrient(j));
704
705 for (k = 0; k < map1.size(); ++k)
706 {
707 // Find the elemental co-efficient in the original
708 // mapping.
709 int idx = -1;
710 for (int l = 0; l < map2.size(); ++l)
711 {
712 if (map1[k] == map2[l])
713 {
714 idx = l;
715 break;
716 }
717 }
718
719 ASSERTL2(idx != -1, "Problem with face to "
720 "element map!");
721 orientMap[k] = idx;
722 }
723
724 for (k = 0; k < order_e; ++k)
725 {
726 vGlobalId = m_localToGlobalBndMap[k + cnt];
727 m_globalToUniversalBndMap[vGlobalId] =
728 id * maxDof + orientMap[k] + 1;
729 }
730 cnt += order_e;
731 }
732 }
733 }
734
735 // Initialise GSlib and populate the unique map.
737 for (i = 0; i < m_globalToUniversalBndMap.size(); ++i)
738 {
739 tmp[i] = m_globalToUniversalBndMap[i];
740 }
741
742 bool verbose = m_comm->IsParallelInTime()
743 ? m_comm->GetTimeComm()->GetRank() == 0
744 : true;
745
746 m_bndGsh = m_gsh = Gs::Init(tmp, m_comm->GetRowComm(), verbose);
747 Gs::Unique(tmp, m_comm->GetRowComm());
748 for (i = 0; i < m_globalToUniversalBndMap.size(); ++i)
749 {
750 m_globalToUniversalBndMapUnique[i] = (tmp[i] >= 0 ? 1 : 0);
751 }
752}
753
756 int nquad1, int nquad2)
757{
758 if (orient == StdRegions::eBackwards)
759 {
760 ASSERTL1(nquad2 == 0, "nquad2 != 0 for reorienation");
761 for (int i = 0; i < nquad1 / 2; ++i)
762 {
763 swap(toAlign[i], toAlign[nquad1 - 1 - i]);
764 }
765 }
766 else if (orient != StdRegions::eForwards)
767 {
768 ASSERTL1(nquad2 != 0, "nquad2 == 0 for reorienation");
769
770 Array<OneD, int> tmp(nquad1 * nquad2);
771
772 // Copy transpose.
777 {
778 for (int i = 0; i < nquad2; ++i)
779 {
780 for (int j = 0; j < nquad1; ++j)
781 {
782 tmp[i * nquad1 + j] = toAlign[j * nquad2 + i];
783 }
784 }
785 }
786 else
787 {
788 for (int i = 0; i < nquad2; ++i)
789 {
790 for (int j = 0; j < nquad1; ++j)
791 {
792 tmp[i * nquad1 + j] = toAlign[i * nquad1 + j];
793 }
794 }
795 }
796
801 {
802 // Reverse x direction
803 for (int i = 0; i < nquad2; ++i)
804 {
805 for (int j = 0; j < nquad1 / 2; ++j)
806 {
807 swap(tmp[i * nquad1 + j], tmp[i * nquad1 + nquad1 - j - 1]);
808 }
809 }
810 }
811
816 {
817 // Reverse y direction
818 for (int j = 0; j < nquad1; ++j)
819 {
820 for (int i = 0; i < nquad2 / 2; ++i)
821 {
822 swap(tmp[i * nquad1 + j],
823 tmp[(nquad2 - i - 1) * nquad1 + j]);
824 }
825 }
826 }
827 Vmath::Vcopy(nquad1 * nquad2, tmp, 1, toAlign, 1);
828 }
829}
830
832{
833 return m_localToGlobalBndMap[i];
834}
835
837{
839}
840
845
850
855
860
865
870
873 bool useComm) const
874{
875 LocalBndToGlobal(loc, global, useComm);
876}
877
879 Array<OneD, NekDouble> &loc) const
880{
881 GlobalToLocalBnd(global, loc);
882}
883
885 NekVector<NekDouble> &loc) const
886{
887 GlobalToLocalBnd(global, loc);
888}
889
891 Array<OneD, NekDouble> &global) const
892{
893 AssembleBnd(loc, global);
894}
895
897 NekVector<NekDouble> &global) const
898{
899 AssembleBnd(loc, global);
900}
901
906
908 int offset) const
909{
910 AssemblyMap::v_UniversalAssemble(pGlobal, offset);
911}
912
917
922
924 const int i)
925{
926 ASSERTL1(i >= 0 && i < m_elmtToTrace.size(), "i is out of range");
927 return m_elmtToTrace[i];
928}
929
935
940
941} // namespace Nektar::MultiRegions
#define ASSERTL0(condition, msg)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed to...
SpatialDomains::Geometry * GetGeom() const
const SpatialDomains::PointGeom * GetGeom() const
Definition PointExp.h:109
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
Array< OneD, Array< OneD, LocalRegions::ExpansionSharedPtr > > m_elmtToTrace
list of edge expansions for a given element
const Array< OneD, const int > & v_GetGlobalToUniversalMap() override
void v_LocalToGlobal(const Array< OneD, const NekDouble > &loc, Array< OneD, NekDouble > &global, bool useComm=false) const override
void v_GlobalToLocal(const Array< OneD, const NekDouble > &global, Array< OneD, NekDouble > &loc) const override
static void RealignTraceElement(Array< OneD, int > &toAlign, StdRegions::Orientation orient, int nquad1, int nquad2=0)
AssemblyCommDGSharedPtr m_assemblyComm
Array< OneD, Array< OneD, LocalRegions::ExpansionSharedPtr > > & GetElmtToTrace()
const Array< OneD, const int > & v_GetLocalToGlobalMap() override
AssemblyCommDGSharedPtr GetAssemblyCommDG()
const Array< OneD, NekDouble > & v_GetLocalToGlobalSign() const override
int GetNumDirichletBndPhys()
Return the number of boundary segments on which Dirichlet boundary conditions are imposed.
void v_Assemble(const Array< OneD, const NekDouble > &loc, Array< OneD, NekDouble > &global) const override
void SetUpUniversalDGMap(const ExpList &locExp)
int m_numDirichletBndPhys
Number of physical dirichlet boundary values in trace.
const Array< OneD, const int > & v_GetGlobalToUniversalMapUnique() override
void v_UniversalAssemble(Array< OneD, NekDouble > &pGlobal) const override
int v_GetFullSystemBandWidth() const override
Base class for constructing local to global mapping of degrees of freedom.
Definition AssemblyMap.h:56
int m_lowestStaticCondLevel
Lowest static condensation level.
GlobalSysSolnType m_solnType
The solution type of the global system.
int m_numLocalCoeffs
Total number of local coefficients.
Array< OneD, int > m_bndCondCoeffsToLocalTraceMap
Integer map of bnd cond coeff to local trace coeff.
Array< OneD, int > m_perbndCondIDToGlobalTraceID
Integer map of rotational periodic bnd cond trace number to global trace number.
bool m_signChange
Flag indicating if modes require sign reversal.
void AssembleBnd(const NekVector< NekDouble > &loc, NekVector< NekDouble > &global, int offset) const
int m_numGlobalCoeffs
Total number of global coefficients.
Array< OneD, int > m_globalToUniversalBndMap
Integer map of process coeffs to universal space.
void CalculateBndSystemBandWidth()
Calculates the bandwidth of the boundary system.
Array< OneD, NekDouble > m_localToGlobalBndSign
Integer sign of local boundary coeffs to global space.
Array< OneD, unsigned int > m_numLocalBndCoeffsPerPatch
The number of bnd dofs per patch.
virtual const Array< OneD, NekDouble > & v_GetLocalToGlobalSign() const
int m_numLocalBndCoeffs
Number of local boundary coefficients.
AssemblyMapSharedPtr m_nextLevelLocalToGlobalMap
Map from the patches of the previous level to the patches of the current level.
int m_staticCondLevel
The level of recursion in the case of multi-level static condensation.
int m_numLocalDirBndCoeffs
Number of Local Dirichlet Boundary Coefficients.
int m_numGlobalDirBndCoeffs
Number of Global Dirichlet Boundary Coefficients.
Array< OneD, unsigned int > m_numLocalIntCoeffsPerPatch
The number of int dofs per patch.
int GetBndSystemBandWidth() const
Returns the bandwidth of the boundary system.
virtual void v_UniversalAssemble(Array< OneD, NekDouble > &pGlobal) const
Array< OneD, int > m_localToGlobalBndMap
Integer map of local coeffs to global Boundary Dofs.
Array< OneD, const NekDouble > GetLocalToGlobalBndSign() const
Retrieve the sign change for all local boundary modes.
Array< OneD, int > m_globalToUniversalBndMapUnique
Integer map of unique process coeffs to universal space (signed)
LibUtilities::CommSharedPtr m_comm
Communicator.
Array< OneD, int > m_localToLocalBndMap
Integer map of local boundary coeffs to local boundary system numbering.
void LocalBndToGlobal(const Array< OneD, const NekDouble > &loc, Array< OneD, NekDouble > &global, int offset, bool UseComm=true) const
int m_numPatches
The number of patches (~elements) in the current level.
void GlobalToLocalBnd(const NekVector< NekDouble > &global, NekVector< NekDouble > &loc, int offset) const
int m_numGlobalBndCoeffs
Total number of global boundary coefficients.
Array< OneD, int > m_bndCondIDToGlobalTraceID
Integer map of bnd cond trace number to global trace number.
Base class for all multi-elemental spectral/hp expansions.
Definition ExpList.h:98
const std::shared_ptr< LocalRegions::ExpansionVector > GetExp() const
This function returns the vector of elements in the expansion.
Definition ExpList.h:2189
Base class for shape geometry information.
Definition Geometry.h:84
int GetGlobalID(void) const
Get the ID of this object.
Definition Geometry.h:314
static gs_data * Init(const Nektar::Array< OneD, long > &pId, const LibUtilities::CommSharedPtr &pComm, bool verbose=true)
Initialise Gather-Scatter map.
Definition GsLib.hpp:190
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.
Definition GsLib.hpp:278
@ gs_add
Definition GsLib.hpp:60
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.
Definition GsLib.hpp:225
static void Finalise(gs_data *pGsh)
Deallocates the GSLib mapping data.
Definition GsLib.hpp:248
std::shared_ptr< SessionReader > SessionReaderSharedPtr
@ eGauss_Lagrange
Lagrange Polynomials using the Gauss points.
Definition BasisType.h:57
@ eGLL_Lagrange
Lagrange for SEM basis .
Definition BasisType.h:56
@ eModified_A
Principle Modified Functions .
Definition BasisType.h:48
std::shared_ptr< SegExp > SegExpSharedPtr
Definition SegExp.h:208
std::shared_ptr< PointExp > PointExpSharedPtr
Definition PointExp.h:130
std::shared_ptr< Expansion > ExpansionSharedPtr
Definition Expansion.h:66
std::shared_ptr< Expansion2D > Expansion2DSharedPtr
Definition Expansion1D.h:46
std::vector< ExpansionSharedPtr > ExpansionVector
Definition Expansion.h:68
void NoReordering(const BoostGraph &graph, Array< OneD, int > &perm, Array< OneD, int > &iperm)
std::shared_ptr< AssemblyCommDG > AssemblyCommDGSharedPtr
void CuthillMckeeReordering(const BoostGraph &graph, Array< OneD, int > &perm, Array< OneD, int > &iperm)
void MultiLevelBisectionReordering(const BoostGraph &graph, Array< OneD, int > &perm, Array< OneD, int > &iperm, BottomUpSubStructuredGraphSharedPtr &substructgraph, std::set< int > partVerts, int mdswitch)
std::shared_ptr< BottomUpSubStructuredGraph > BottomUpSubStructuredGraphSharedPtr
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
std::map< int, std::vector< PeriodicEntity > > PeriodicMap
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition MeshGraph.h:224
std::size_t hash_range(Iter first, Iter last)
Definition HashUtils.hpp:64
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition Vmath.hpp:825
STL namespace.