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
59
62 [[maybe_unused]] const SpatialDomains::MeshGraphSharedPtr &graph,
63 const ExpListSharedPtr &trace, const ExpList &locExp,
66 const PeriodicMap &periodicTrace, const std::string variable)
67 : AssemblyMap(pSession, locExp.GetComm(), variable)
68{
69 int i, j, k, cnt, id, id1, gid;
70 int order_e = 0;
71 int nTraceExp = trace->GetExpSize();
72 int nbnd = bndCondExp.size();
73
76 SpatialDomains::Geometry *traceGeom;
77
78 const LocalRegions::ExpansionVector expList = *(locExp.GetExp());
79 int nel = expList.size();
80
81 map<int, int> meshTraceId;
82
83 m_signChange = true;
84
85 // determine mapping from geometry edges to trace
86 for (i = 0; i < nTraceExp; ++i)
87 {
88 meshTraceId[trace->GetExp(i)->GetGeom()->GetGlobalID()] = i;
89 }
90
91 // Count total number of trace elements
92 cnt = 0;
93 for (i = 0; i < nel; ++i)
94 {
95 cnt += expList[i]->GetNtraces();
96 }
97
101
102 // set up trace expansions links;
103 for (cnt = i = 0; i < nel; ++i)
104 {
105 m_elmtToTrace[i] = tracemap + cnt;
106 exp = expList[i];
107
108 for (j = 0; j < exp->GetNtraces(); ++j)
109 {
110 id = exp->GetGeom()->GetTid(j);
111
112 if (meshTraceId.count(id) > 0)
113 {
114 m_elmtToTrace[i][j] =
115 trace->GetExp(meshTraceId.find(id)->second);
116 }
117 else
118 {
119 ASSERTL0(false, "Failed to find trace map");
120 }
121 }
122
123 cnt += exp->GetNtraces();
124 }
125
126 // Set up boundary mapping
127 cnt = 0;
128 for (i = 0; i < nbnd; ++i)
129 {
130 if (bndCond[i]->GetBoundaryConditionType() == SpatialDomains::ePeriodic)
131 {
132 continue;
133 }
134 cnt += bndCondExp[i]->GetExpSize();
135 }
136
137 set<int> dirTrace;
138
141
142 for (i = 0; i < bndCondExp.size(); ++i)
143 {
144 for (j = 0; j < bndCondExp[i]->GetExpSize(); ++j)
145 {
146 bndExp = bndCondExp[i]->GetExp(j);
147 traceGeom = bndExp->GetGeom();
148 id = traceGeom->GetGlobalID();
149
150 if (bndCond[i]->GetBoundaryConditionType() ==
152 {
153 m_numLocalDirBndCoeffs += bndExp->GetNcoeffs();
154 m_numDirichletBndPhys += bndExp->GetTotPoints();
155 dirTrace.insert(id);
156 }
157 }
158 }
159
160 // Set up integer mapping array and sign change for each degree of
161 // freedom + initialise some more data members.
164 m_numPatches = nel;
167
168 int nbndry = 0;
169 for (i = 0; i < nel; ++i) // count number of elements in array
170 {
171 int BndCoeffs = expList[i]->NumDGBndryCoeffs();
172 nbndry += BndCoeffs;
174 m_numLocalBndCoeffsPerPatch[i] = (unsigned int)BndCoeffs;
175 }
176
178 m_numLocalBndCoeffs = nbndry;
179 m_numLocalCoeffs = nbndry;
182
183 // Set up array for potential mesh optimsation
184 Array<OneD, int> traceElmtGid(nTraceExp, -1);
185 int nDir = 0;
186 cnt = 0;
187
188 // We are now going to construct a graph of the mesh which can be
189 // reordered depending on the type of solver we would like to use.
190 typedef boost::adjacency_list<boost::setS, boost::vecS, boost::undirectedS>
191 BoostGraph;
192
193 BoostGraph boostGraphObj;
194 int trace_id, trace_id1;
195 int dirOffset = 0;
196
197 // make trace renumbering map where first solved trace starts
198 // at 0 so we can set up graph.
199 for (i = 0; i < nTraceExp; ++i)
200 {
201 id = trace->GetExp(i)->GetGeom()->GetGlobalID();
202
203 if (dirTrace.count(id) == 0)
204 {
205 // Initial put in element ordering (starting from zero) into
206 // traceElmtGid
207 boost::add_vertex(boostGraphObj);
208 traceElmtGid[i] = cnt++;
209 }
210 else
211 {
212 // Use existing offset for Dirichlet edges
213 traceElmtGid[i] = dirOffset;
214 dirOffset += trace->GetExp(i)->GetNcoeffs();
215 nDir++;
216 }
217 }
218
219 // Set up boost Graph
220 for (i = 0; i < nel; ++i)
221 {
222 exp = expList[i];
223
224 for (j = 0; j < exp->GetNtraces(); ++j)
225 {
226 // Add trace to boost graph for non-Dirichlet Boundary
227 traceGeom = m_elmtToTrace[i][j]->GetGeom();
228 id = traceGeom->GetGlobalID();
229 trace_id = meshTraceId.find(id)->second;
230
231 if (dirTrace.count(id) == 0)
232 {
233 for (k = j + 1; k < exp->GetNtraces(); ++k)
234 {
235 traceGeom = m_elmtToTrace[i][k]->GetGeom();
236 id1 = traceGeom->GetGlobalID();
237 trace_id1 = meshTraceId.find(id1)->second;
238
239 if (dirTrace.count(id1) == 0)
240 {
241 boost::add_edge((size_t)traceElmtGid[trace_id],
242 (size_t)traceElmtGid[trace_id1],
243 boostGraphObj);
244 }
245 }
246 }
247 }
248 }
249
250 int nGraphVerts = nTraceExp - nDir;
251 Array<OneD, int> perm(nGraphVerts);
252 Array<OneD, int> iperm(nGraphVerts);
253 Array<OneD, int> vwgts(nGraphVerts);
255
256 for (i = 0; i < nGraphVerts; ++i)
257 {
258 vwgts[i] = trace->GetExp(i + nDir)->GetNcoeffs();
259 }
260
261 if (nGraphVerts)
262 {
263 switch (m_solnType)
264 {
266 case eIterativeFull:
268 case eXxtFullMatrix:
269 case eXxtStaticCond:
270 case ePETScFullMatrix:
271 case ePETScStaticCond:
272 {
273 NoReordering(boostGraphObj, perm, iperm);
274 break;
275 }
277 {
278 CuthillMckeeReordering(boostGraphObj, perm, iperm);
279 break;
280 }
285 {
286 MultiLevelBisectionReordering(boostGraphObj, perm, iperm,
287 bottomUpGraph);
288 break;
289 }
290 default:
291 {
292 ASSERTL0(false, "Unrecognised solution type");
293 }
294 }
295 }
296
297 // Recast the permutation so that it can be used as a map from old
298 // trace ID to new trace ID
300 for (i = 0; i < nTraceExp - nDir; ++i)
301 {
302 traceElmtGid[perm[i] + nDir] = cnt;
303 cnt += trace->GetExp(perm[i] + nDir)->GetNcoeffs();
304 }
305
306 // Now have trace edges Gid position
307 cnt = 0;
308 for (i = 0; i < nel; ++i)
309 {
310 exp = expList[i];
311
312 for (j = 0; j < exp->GetNtraces(); ++j)
313 {
314 traceGeom = m_elmtToTrace[i][j]->GetGeom();
315 id = traceGeom->GetGlobalID();
316 gid = traceElmtGid[meshTraceId.find(id)->second];
317
318 const int nDim = exp->GetNumBases();
319
320 if (nDim == 1)
321 {
322 order_e = 1;
323 m_localToGlobalBndMap[cnt] = gid;
324 }
325 else if (nDim == 2)
326 {
327 order_e = exp->GetTraceNcoeffs(j);
328
329 if (exp->GetTraceOrient(j) == StdRegions::eForwards)
330 {
331 for (k = 0; k < order_e; ++k)
332 {
333 m_localToGlobalBndMap[k + cnt] = gid + k;
334 }
335 }
336 else
337 {
338 switch (m_elmtToTrace[i][j]->GetBasisType(0))
339 {
341 {
342 // reverse vertex order
343 m_localToGlobalBndMap[cnt] = gid + 1;
344 m_localToGlobalBndMap[cnt + 1] = gid;
345 for (k = 2; k < order_e; ++k)
346 {
347 m_localToGlobalBndMap[k + cnt] = gid + k;
348 }
349
350 // negate odd modes
351 for (k = 3; k < order_e; k += 2)
352 {
353 m_localToGlobalBndSign[cnt + k] = -1.0;
354 }
355 break;
356 }
358 {
359 // reverse order
360 for (k = 0; k < order_e; ++k)
361 {
362 m_localToGlobalBndMap[cnt + order_e - k - 1] =
363 gid + k;
364 }
365 break;
366 }
368 {
369 // reverse order
370 for (k = 0; k < order_e; ++k)
371 {
372 m_localToGlobalBndMap[cnt + order_e - k - 1] =
373 gid + k;
374 }
375 break;
376 }
377 default:
378 {
379 ASSERTL0(false, "Boundary type not permitted");
380 }
381 }
382 }
383 }
384 else if (nDim == 3)
385 {
386 order_e = exp->GetTraceNcoeffs(j);
387
388 std::map<int, int> orientMap;
389
390 Array<OneD, unsigned int> elmMap1(order_e);
391 Array<OneD, int> elmSign1(order_e);
392 Array<OneD, unsigned int> elmMap2(order_e);
393 Array<OneD, int> elmSign2(order_e);
394
395 StdRegions::Orientation fo = exp->GetTraceOrient(j);
396
397 // Construct mapping which will permute global IDs
398 // according to face orientations.
399 exp->GetTraceToElementMap(j, elmMap1, elmSign1, fo);
400 exp->GetTraceToElementMap(j, elmMap2, elmSign2,
402
403 for (k = 0; k < elmMap1.size(); ++k)
404 {
405 // Find the elemental co-efficient in the original
406 // mapping.
407 int idx = -1;
408 for (int l = 0; l < elmMap2.size(); ++l)
409 {
410 if (elmMap1[k] == elmMap2[l])
411 {
412 idx = l;
413 break;
414 }
415 }
416
417 ASSERTL2(idx != -1, "Problem with face to element map!");
418 orientMap[k] = idx;
419 }
420
421 for (k = 0; k < order_e; ++k)
422 {
423 m_localToGlobalBndMap[k + cnt] = gid + orientMap[k];
424 m_localToGlobalBndSign[k + cnt] = elmSign2[orientMap[k]];
425 }
426 }
427
428 cnt += order_e;
429 }
430 }
431
432 // set up identify map for lcoal to lcoal
434
435 // local to bnd map is just a copy
436 for (i = 0; i < m_numLocalBndCoeffs; ++i)
437 {
439 }
440
441 m_numGlobalBndCoeffs = trace->GetNcoeffs();
443
445
446 // set up m_bndCondCoeffsToLocalTraceMap
447 // Number of boundary expansions
448 int nbndexp = 0;
449 int nrotperbndexp = 0;
450 int bndTotal = 0;
451 int bndOffset;
452 int traceOffset;
453
454 cnt = 0;
455 for (i = 0; i < nbnd; ++i)
456 {
457 if (bndCond[i]->GetBoundaryConditionType() == SpatialDomains::ePeriodic)
458 {
459 if (boost::icontains(bndCond[i]->GetUserDefined(), "Rotated"))
460 {
461 nrotperbndexp += bndCondExp[i]->GetExpSize();
462 }
463
464 continue;
465 }
466 cnt += bndCondExp[i]->GetNcoeffs();
467 nbndexp += bndCondExp[i]->GetExpSize();
468 }
469
473
474 cnt = 0;
475 int percnt = 0;
476 for (i = 0; i < bndCondExp.size(); ++i)
477 {
478 if (bndCond[i]->GetBoundaryConditionType() == SpatialDomains::ePeriodic)
479 {
480 if (boost::icontains(bndCond[i]->GetUserDefined(), "Rotated"))
481 {
482
483 for (j = 0; j < bndCondExp[i]->GetExpSize(); ++j)
484 {
485 bndExp = bndCondExp[i]->GetExp(j);
486 id = bndExp->GetGeom()->GetGlobalID();
487
488 int meshId = meshTraceId.find(id)->second;
489 m_perbndCondIDToGlobalTraceID[percnt++] = meshId;
490 }
491 }
492 continue;
493 }
494
495 for (j = 0; j < bndCondExp[i]->GetExpSize(); ++j)
496 {
497 bndExp = bndCondExp[i]->GetExp(j);
498 id = bndExp->GetGeom()->GetGlobalID();
499
500 int meshId = meshTraceId.find(id)->second;
501 m_bndCondIDToGlobalTraceID[cnt++] = meshId;
502
503 // initialy set up map with global bnd location
504 // and then use the localToGlobalBndMap to invert
505 // since this is a one to one mapping on boundaries
506 traceOffset = traceElmtGid[meshId];
507 bndOffset = bndCondExp[i]->GetCoeff_Offset(j) + bndTotal;
508
509 for (k = 0; k < bndExp->GetNcoeffs(); ++k)
510 {
511 m_bndCondCoeffsToLocalTraceMap[bndOffset + k] = traceOffset + k;
512 }
513 }
514 bndTotal += bndCondExp[i]->GetNcoeffs();
515 }
516
517 // generate an inverse local to global bnd map;
518 map<int, int> invLocToGloMap;
519 for (i = 0; i < nbndry; ++i)
520 {
521 invLocToGloMap[m_localToGlobalBndMap[i]] = i;
522 }
523
524 // reset bndCondCoeffToLocalTraceMap to hold local rather
525 // than global reference
526 for (i = 0; i < m_bndCondCoeffsToLocalTraceMap.size(); ++i)
527 {
529 invLocToGloMap[m_bndCondCoeffsToLocalTraceMap[i]];
530 }
531
532 // Now set up mapping from global coefficients to universal.
533 ExpListSharedPtr tr = std::dynamic_pointer_cast<ExpList>(trace);
534 SetUpUniversalDGMap(locExp);
535
538 locExp, tr, m_elmtToTrace, bndCondExp, bndCond, periodicTrace));
539
544 nGraphVerts)
545 {
546 if (m_staticCondLevel < (bottomUpGraph->GetNlevels() - 1))
547 {
548 Array<OneD, int> vwgts_perm(nGraphVerts);
549
550 for (int i = 0; i < nGraphVerts; i++)
551 {
552 vwgts_perm[i] = vwgts[perm[i]];
553 }
554
555 bottomUpGraph->ExpandGraphWithVertexWeights(vwgts_perm);
558 bottomUpGraph);
559 }
560 }
561
562 m_hash =
564}
565
566/**
567 * Constructs a mapping between the process-local global numbering and
568 * a universal numbering of the trace space expansion. The universal
569 * numbering is defined by the mesh edge IDs to enforce consistency
570 * across processes.
571 *
572 * @param locExp List of local elemental expansions.
573 */
575{
577 int cnt = 0;
578 int id = 0;
579 int order_e = 0;
580 int vGlobalId = 0;
581 int maxDof = 0;
582 int dof = 0;
583 int nDim = 0;
584 int i, j, k;
585
586 const LocalRegions::ExpansionVector &locExpVector = *(locExp.GetExp());
587
588 // Initialise the global to universal maps.
593
594 // Loop over all the elements in the domain and compute max
595 // DOF. Reduce across all processes to get universal maximum.
596 for (i = 0; i < locExpVector.size(); ++i)
597 {
598 locExpansion = locExpVector[i];
599 nDim = locExpansion->GetShapeDimension();
600
601 // Loop over all edges of element i
602 if (nDim == 1)
603 {
604 maxDof = (1 > maxDof ? 1 : maxDof);
605 }
606 else
607 {
608 for (j = 0; j < locExpansion->GetNtraces(); ++j)
609 {
610 dof = locExpansion->GetTraceNcoeffs(j);
611 maxDof = (dof > maxDof ? dof : maxDof);
612 }
613 }
614 }
615 m_comm->GetRowComm()->AllReduce(maxDof, LibUtilities::ReduceMax);
616
617 // Now have trace edges Gid position
618 cnt = 0;
619 for (i = 0; i < locExpVector.size(); ++i)
620 {
621 locExpansion = locExpVector[i];
622 nDim = locExpansion->GetShapeDimension();
623
624 // Populate mapping for each edge of the element.
625 if (nDim == 1)
626 {
627 int nverts = locExpansion->GetNverts();
628 for (j = 0; j < nverts; ++j)
629 {
632 id = locPointExp->GetGeom()->GetGlobalID();
633 vGlobalId = m_localToGlobalBndMap[cnt + j];
634 m_globalToUniversalBndMap[vGlobalId] = id * maxDof + j + 1;
635 }
636 cnt += nverts;
637 }
638 else if (nDim == 2)
639 {
640 for (j = 0; j < locExpansion->GetNtraces(); ++j)
641 {
644
645 id = locSegExp->GetGeom()->GetGlobalID();
646 order_e = locExpansion->GetTraceNcoeffs(j);
647
648 map<int, int> orientMap;
649 Array<OneD, unsigned int> map1(order_e), map2(order_e);
650 Array<OneD, int> sign1(order_e), sign2(order_e);
651
652 locExpansion->GetTraceToElementMap(j, map1, sign1,
654 locExpansion->GetTraceToElementMap(
655 j, map2, sign2, locExpansion->GetTraceOrient(j));
656
657 for (k = 0; k < map1.size(); ++k)
658 {
659 // Find the elemental co-efficient in the original
660 // mapping.
661 int idx = -1;
662 for (int l = 0; l < map2.size(); ++l)
663 {
664 if (map1[k] == map2[l])
665 {
666 idx = l;
667 break;
668 }
669 }
670
671 ASSERTL2(idx != -1, "Problem with face to"
672 " element map!");
673 orientMap[k] = idx;
674 }
675
676 for (k = 0; k < order_e; ++k)
677 {
678 vGlobalId = m_localToGlobalBndMap[k + cnt];
679 m_globalToUniversalBndMap[vGlobalId] =
680 id * maxDof + orientMap[k] + 1;
681 }
682 cnt += order_e;
683 }
684 }
685 else if (nDim == 3) // This could likely be combined with nDim == 2
686 {
687 for (j = 0; j < locExpansion->GetNtraces(); ++j)
688 {
691
692 id = locFaceExp->GetGeom()->GetGlobalID();
693 order_e = locExpansion->GetTraceNcoeffs(j);
694
695 map<int, int> orientMap;
696 Array<OneD, unsigned int> map1(order_e), map2(order_e);
697 Array<OneD, int> sign1(order_e), sign2(order_e);
698
699 locExpansion->GetTraceToElementMap(
701 locExpansion->GetTraceToElementMap(
702 j, map2, sign2, locExpansion->GetTraceOrient(j));
703
704 for (k = 0; k < map1.size(); ++k)
705 {
706 // Find the elemental co-efficient in the original
707 // mapping.
708 int idx = -1;
709 for (int l = 0; l < map2.size(); ++l)
710 {
711 if (map1[k] == map2[l])
712 {
713 idx = l;
714 break;
715 }
716 }
717
718 ASSERTL2(idx != -1, "Problem with face to "
719 "element map!");
720 orientMap[k] = idx;
721 }
722
723 for (k = 0; k < order_e; ++k)
724 {
725 vGlobalId = m_localToGlobalBndMap[k + cnt];
726 m_globalToUniversalBndMap[vGlobalId] =
727 id * maxDof + orientMap[k] + 1;
728 }
729 cnt += order_e;
730 }
731 }
732 }
733
734 // Initialise GSlib and populate the unique map.
736 for (i = 0; i < m_globalToUniversalBndMap.size(); ++i)
737 {
738 tmp[i] = m_globalToUniversalBndMap[i];
739 }
740
741 bool verbose = m_comm->IsParallelInTime()
742 ? m_comm->GetTimeComm()->GetRank() == 0
743 : true;
744
745 m_bndGsh = m_gsh = Gs::Init(tmp, m_comm->GetRowComm(), verbose);
746 Gs::Unique(tmp, m_comm->GetRowComm());
747 for (i = 0; i < m_globalToUniversalBndMap.size(); ++i)
748 {
749 m_globalToUniversalBndMapUnique[i] = (tmp[i] >= 0 ? 1 : 0);
750 }
751}
752
755 int nquad1, int nquad2)
756{
757 if (orient == StdRegions::eBackwards)
758 {
759 ASSERTL1(nquad2 == 0, "nquad2 != 0 for reorienation");
760 for (int i = 0; i < nquad1 / 2; ++i)
761 {
762 swap(toAlign[i], toAlign[nquad1 - 1 - i]);
763 }
764 }
765 else if (orient != StdRegions::eForwards)
766 {
767 ASSERTL1(nquad2 != 0, "nquad2 == 0 for reorienation");
768
769 Array<OneD, int> tmp(nquad1 * nquad2);
770
771 // Copy transpose.
776 {
777 for (int i = 0; i < nquad2; ++i)
778 {
779 for (int j = 0; j < nquad1; ++j)
780 {
781 tmp[i * nquad1 + j] = toAlign[j * nquad2 + i];
782 }
783 }
784 }
785 else
786 {
787 for (int i = 0; i < nquad2; ++i)
788 {
789 for (int j = 0; j < nquad1; ++j)
790 {
791 tmp[i * nquad1 + j] = toAlign[i * nquad1 + j];
792 }
793 }
794 }
795
800 {
801 // Reverse x direction
802 for (int i = 0; i < nquad2; ++i)
803 {
804 for (int j = 0; j < nquad1 / 2; ++j)
805 {
806 swap(tmp[i * nquad1 + j], tmp[i * nquad1 + nquad1 - j - 1]);
807 }
808 }
809 }
810
815 {
816 // Reverse y direction
817 for (int j = 0; j < nquad1; ++j)
818 {
819 for (int i = 0; i < nquad2 / 2; ++i)
820 {
821 swap(tmp[i * nquad1 + j],
822 tmp[(nquad2 - i - 1) * nquad1 + j]);
823 }
824 }
825 }
826 Vmath::Vcopy(nquad1 * nquad2, tmp, 1, toAlign, 1);
827 }
828}
829
831{
832 return m_localToGlobalBndMap[i];
833}
834
836{
838}
839
844
849
854
859
864
869
872 bool useComm) const
873{
874 LocalBndToGlobal(loc, global, useComm);
875}
876
878 Array<OneD, NekDouble> &loc) const
879{
880 GlobalToLocalBnd(global, loc);
881}
882
884 NekVector<NekDouble> &loc) const
885{
886 GlobalToLocalBnd(global, loc);
887}
888
890 Array<OneD, NekDouble> &global) const
891{
892 AssembleBnd(loc, global);
893}
894
896 NekVector<NekDouble> &global) const
897{
898 AssembleBnd(loc, global);
899}
900
905
907 int offset) const
908{
909 AssemblyMap::v_UniversalAssemble(pGlobal, offset);
910}
911
916
921
923 const int i)
924{
925 ASSERTL1(i >= 0 && i < m_elmtToTrace.size(), "i is out of range");
926 return m_elmtToTrace[i];
927}
928
934
939
940} // 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:99
const std::shared_ptr< LocalRegions::ExpansionVector > GetExp() const
This function returns the vector of elements in the expansion.
Definition ExpList.h:2151
Base class for shape geometry information.
Definition Geometry.h:74
int GetGlobalID(void) const
Get the ID of this object.
Definition Geometry.h:322
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
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:252
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:217
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.