Nektar++
Loading...
Searching...
No Matches
Expansion.cpp
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: Expansion.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: File for Expansion routines
32//
33///////////////////////////////////////////////////////////////////////////////
34
38
39using namespace std;
40
42{
44 : m_indexMapManager(
45 std::bind(&Expansion::CreateIndexMap, this, std::placeholders::_1),
46 std::string("ExpansionIndexMap")),
47 m_geom(pGeom), m_elementTraceLeft(-1), m_elementTraceRight(-1)
48{
50
51 if (!m_geomFactors)
52 {
53 return;
54 }
55
56 if (!m_geomFactors->IsValid())
57 {
58 int nDim = m_base.size();
59 string type = "regular";
61 {
62 type = "deformed";
63 }
64
65 stringstream err;
66 err << nDim << "D " << type << " Jacobian not positive "
67 << "(element ID = " << m_geom->GetGlobalID() << ") "
68 << "(first vertex ID = " << m_geom->GetVid(0) << ")";
69 NEKERROR(ErrorUtil::ewarning, err.str());
70 }
71
72 m_traceExp.clear();
73}
74
76 : StdExpansion(pSrc), m_indexMapManager(pSrc.m_indexMapManager),
77 m_geom(pSrc.m_geom)
78{
81 *(pSrc.m_geomFactors));
82}
83
87
93
95{
96 return v_DropLocMatrix(mkey);
97}
98
100 const DNekScalMatSharedPtr &r_bnd, const StdRegions::MatrixType matrixType)
101{
102 return v_BuildTransformationMatrix(r_bnd, matrixType);
103}
104
109
111 const NekDouble *data, const std::vector<unsigned int> &nummodes,
112 const int nmodes_offset, NekDouble *coeffs,
113 std::vector<LibUtilities::BasisType> &fromType)
114{
115 v_ExtractDataToCoeffs(data, nummodes, nmodes_offset, coeffs, fromType);
116}
117
119 const int edge, const std::shared_ptr<Expansion> &EdgeExp,
122{
123 v_AddEdgeNormBoundaryInt(edge, EdgeExp, Fx, Fy, outarray);
124}
125
127 const int edge, const std::shared_ptr<Expansion> &EdgeExp,
129{
130 v_AddEdgeNormBoundaryInt(edge, EdgeExp, Fn, outarray);
131}
132
134 const int face, const std::shared_ptr<Expansion> &FaceExp,
136{
137 v_AddFaceNormBoundaryInt(face, FaceExp, Fn, outarray);
138}
139
140void Expansion::DGDeriv(const int dir,
141 const Array<OneD, const NekDouble> &inarray,
144 Array<OneD, NekDouble> &outarray)
145{
146 v_DGDeriv(dir, inarray, EdgeExp, coeffs, outarray);
147}
148
153
156 Array<OneD, Array<OneD, NekDouble>> &d0factors,
157 Array<OneD, Array<OneD, NekDouble>> &d1factors)
158{
159 return v_NormalTraceDerivFactors(factors, d0factors, d1factors);
160}
161
163 const StdRegions::MatrixType mtype,
164 const StdRegions::ConstFactorMap &factors,
165 const StdRegions::VarCoeffMap &varcoeffs)
166{
167 MatrixKey mkey(mtype, DetShapeType(), *this, factors, varcoeffs);
168 return GetLocMatrix(mkey);
169}
170
175
177{
178 // Clear metrics
179 m_metrics.clear();
180
181 // Regenerate geometry factors
183}
184
186{
187 IndexMapValuesSharedPtr returnval;
188
189 IndexMapType itype = ikey.GetIndexMapType();
190
191 int entity = ikey.GetIndexEntity();
192
194
197
198 switch (itype)
199 {
200 case eEdgeToElement:
201 {
202 GetTraceToElementMap(entity, map, sign, orient);
203 }
204 break;
205 case eFaceToElement:
206 {
207 GetTraceToElementMap(entity, map, sign, orient);
208 }
209 break;
210 case eEdgeInterior:
211 {
212 ASSERTL0(false, "Boundary Index Map not implemented yet.");
213 // v_GetEdgeInteriorMap(entity,orient,map,sign);
214 }
215 break;
216 case eFaceInterior:
217 {
218 ASSERTL0(false, "Boundary Index Map not implemented yet.");
219 // v_GetFaceInteriorMap(entity,orient,map,sign);
220 }
221 break;
222 case eBoundary:
223 {
224 ASSERTL0(false, "Boundary Index Map not implemented yet.");
225 }
226 break;
227 case eVertex:
228 {
229 ASSERTL0(false, "Vertex Index Map not implemented yet.");
230 }
231 break;
232 default:
233 {
234 ASSERTL0(false, "The Index Map you are requiring "
235 "is not between the possible options.");
236 }
237 }
238
240
241 for (int i = 0; i < map.size(); i++)
242 {
243 (*returnval)[i].index = map[i];
244 (*returnval)[i].sign = sign[i];
245 }
246
247 return returnval;
248}
249
251{
252 std::map<int, NormalVector>::const_iterator x;
253 x = m_traceNormals.find(id);
254
255 // if edge normal not defined compute it
256 if (x == m_traceNormals.end())
257 {
259 x = m_traceNormals.find(id);
260 }
261 return x->second;
262}
263
264const std::map<int, NormalVector> &Expansion::GetTraceNormals(void)
265{
266 if (m_traceNormals.size() != GetNtraces())
267 {
268 for (unsigned i = 0; i < GetNtraces(); ++i)
269 {
271 }
272 }
273 return m_traceNormals;
274}
275
277{
278 ASSERTL0(false, "This method is not defined for this expansion");
280 return returnval;
281}
282
284{
285 ASSERTL0(false, "This method is not defined for this expansion");
287 return returnval;
288}
289
291 [[maybe_unused]] const LocalRegions::MatrixKey &mkey)
292{
293 NEKERROR(ErrorUtil::efatal, "This function is only valid for LocalRegions");
295}
296
298{
299 DNekScalBlkMatSharedPtr returnval;
300
302 "Geometric information is not set up");
303
304 // set up block matrix system
305 unsigned int nbdry = NumBndryCoeffs();
306 unsigned int nint = (unsigned int)(m_ncoeffs - nbdry);
307 unsigned int exp_size[] = {nbdry, nint};
308 unsigned int nblks = 2;
310 nblks, nblks, exp_size, exp_size);
311 // Really need a constructor which takes Arrays
312 NekDouble factor = 1.0;
313
314 switch (mkey.GetMatrixType())
315 {
316 // this can only use stdregions statically condensed system
317 // for mass matrix
319 if ((m_geomFactors->GetGtype() == SpatialDomains::eDeformed) ||
320 (mkey.GetNVarCoeff()))
321 {
322 factor = 1.0;
323 goto UseLocRegionsMatrix;
324 }
325 else
326 {
327 factor = (m_geomFactors->GetJac())[0];
328 goto UseStdRegionsMatrix;
329 }
330 break;
331 default: // use Deformed case for both
332 // regular and deformed geometries
333 factor = 1.0;
334 goto UseLocRegionsMatrix;
335 break;
336 UseStdRegionsMatrix:
337 {
338 NekDouble invfactor = 1.0 / factor;
339 NekDouble one = 1.0;
342 DNekMatSharedPtr Asubmat;
343
344 returnval->SetBlock(
345 0, 0,
347 factor, Asubmat = mat->GetBlock(0, 0)));
348 returnval->SetBlock(
349 0, 1,
351 one, Asubmat = mat->GetBlock(0, 1)));
352 returnval->SetBlock(
353 1, 0,
355 factor, Asubmat = mat->GetBlock(1, 0)));
356 returnval->SetBlock(
357 1, 1,
359 invfactor, Asubmat = mat->GetBlock(1, 1)));
360 }
361 break;
362 UseLocRegionsMatrix:
363 {
364 int i, j;
365 NekDouble invfactor = 1.0 / factor;
366 NekDouble one = 1.0;
367 DNekScalMat &mat = *GetLocMatrix(mkey);
376
377 Array<OneD, unsigned int> bmap(nbdry);
378 Array<OneD, unsigned int> imap(nint);
379 GetBoundaryMap(bmap);
380 GetInteriorMap(imap);
381
382 for (i = 0; i < nbdry; ++i)
383 {
384 for (j = 0; j < nbdry; ++j)
385 {
386 (*A)(i, j) = mat(bmap[i], bmap[j]);
387 }
388
389 for (j = 0; j < nint; ++j)
390 {
391 (*B)(i, j) = mat(bmap[i], imap[j]);
392 }
393 }
394
395 for (i = 0; i < nint; ++i)
396 {
397 for (j = 0; j < nbdry; ++j)
398 {
399 (*C)(i, j) = mat(imap[i], bmap[j]);
400 }
401
402 for (j = 0; j < nint; ++j)
403 {
404 (*D)(i, j) = mat(imap[i], imap[j]);
405 }
406 }
407
408 // Calculate static condensed system
409 if (nint)
410 {
411 D->Invert();
412 (*B) = (*B) * (*D);
413 (*A) = (*A) - (*B) * (*C);
414 }
415
417
418 returnval->SetBlock(
419 0, 0,
420 Atmp =
422 returnval->SetBlock(
423 0, 1,
425 returnval->SetBlock(
426 1, 0,
427 Atmp =
429 returnval->SetBlock(
430 1, 1,
432 D));
433
434 // Remove the local matrix from manager if using this option
435 // since we assume it is only created to generate static
436 // condensed system
437 v_DropLocMatrix(mkey);
438 }
439 }
440 return returnval;
441}
442
444 [[maybe_unused]] const LocalRegions::MatrixKey &mkey)
445{
446 NEKERROR(ErrorUtil::efatal, "This function is only valid for LocalRegions");
447}
448
449/**
450 * \brief Forward transform from physical quadrature space stored in
451 * \a inarray and evaluate the expansion coefficients and store in \a
452 * (this)->m_coeffs
453 *
454 * Inputs:\n
455 *
456 * - \a inarray: array of physical quadrature points to be transformed
457 *
458 * Outputs:\n
459 *
460 * - (this)->_coeffs: updated array of expansion coefficients.
461 */
463 Array<OneD, NekDouble> &outarray)
464{
466 {
467 Vmath::Vcopy(GetNcoeffs(), &inarray[0], 1, &outarray[0], 1);
468 }
469 else
470 {
471 v_IProductWRTBase(inarray, outarray);
472
473 // get Mass matrix inverse
474 LibUtilities::PointsType nodalPointsType =
481 StdRegions::NullVarFactorsMap, nodalPointsType);
482 DNekScalMatSharedPtr matsys = v_GetLocMatrix(masskey);
483
484 // copy inarray in case inarray == outarray
485 DNekVec in(m_ncoeffs, outarray);
486 DNekVec out(m_ncoeffs, outarray, eWrapper);
487
488 out = (*matsys) * in;
489 }
490}
491
493 const Array<OneD, const NekDouble> &coord,
494 const Array<OneD, const NekDouble> &physvals)
495{
497
498 ASSERTL0(m_geom, "m_geom not defined");
499 m_geom->GetLocCoords(coord, Lcoord);
500
501 return v_StdPhysEvaluate(Lcoord, physvals);
502}
503
505 const Array<OneD, const NekDouble> &inarray,
506 Array<OneD, NekDouble> &outarray)
507{
508 const int nqtot = GetTotPoints();
509
510 if (m_metrics.count(eMetricQuadrature) == 0)
511 {
513 }
514
515 Vmath::Vmul(nqtot, m_metrics[eMetricQuadrature], 1, inarray, 1, outarray,
516 1);
517}
518
520 const Array<OneD, const NekDouble> &inarray,
521 Array<OneD, NekDouble> &outarray)
522{
523 const int nqtot = GetTotPoints();
524
525 if (m_metrics.count(eMetricQuadrature) == 0)
526 {
528 }
529
530 Vmath::Vdiv(nqtot, inarray, 1, m_metrics[eMetricQuadrature], 1, outarray,
531 1);
532 // remove NaN or Inf values and set to zero
533 for (int i = 0; i < nqtot; ++i)
534 {
535 if (std::isnan(outarray[i]) || std::isinf(outarray[i]))
536 {
537 outarray[i] = 0.0;
538 }
539 }
540}
541
546
548{
549 unsigned int nqtot = GetTotPoints();
550 SpatialDomains::GeomType type = m_geomFactors->GetGtype();
551 if (type == SpatialDomains::eRegular ||
553 {
555 Array<OneD, NekDouble>(nqtot, m_geomFactors->GetJac()[0]);
556 }
557 else
558 {
560 }
561
564}
565
567{
568 int nquad = GetTotPoints();
569 int ntraces = GetNtraces();
570 int ndir = m_base.size();
571
573 Array<OneD, NekDouble> phys(nquad);
574
575 int tottracepts = 0;
576 int maxtracepts = 0;
577 Array<OneD, ExpansionSharedPtr> traceExp(ntraces);
578 for (int i = 0; i < ntraces; ++i)
579 {
580 // Note we are using GenTraceExp to ensure we have local trace
581 // expansion not ont from shared trace which can happe if we use
582 // GetTraceExp since it can be set in DisContField::SetupDG
583 v_GenTraceExp(i, traceExp[i]);
584 int ntpts = traceExp[i]->GetTotPoints();
585 maxtracepts = max(maxtracepts, ntpts);
586 tottracepts += ntpts;
587 }
588
589 // initialise array to null so can call for
590 // differnt dimensions
592 Array<OneD, NekDouble> traceDeriv(maxtracepts);
593
594 DerivMat = Array<OneD, DNekMatSharedPtr>(ndir);
595 for (int i = 0; i < ndir; ++i)
596 {
597 Deriv[i] = Array<OneD, NekDouble>(nquad);
598 DerivMat[i] =
600 }
601
602 for (int i = 0; i < m_ncoeffs; ++i)
603 {
604 Vmath::Zero(m_ncoeffs, coeffs, 1);
605 coeffs[i] = 1.0;
606 BwdTrans(coeffs, phys);
607
608 // dphi_i/d\xi_1, dphi_i/d\xi_2 dphi_i/d\xi_3
609 StdPhysDeriv(phys, Deriv[0], Deriv[1], Deriv[2]);
610
611 int cnt = 0;
612 for (int j = 0; j < ntraces; ++j)
613 {
616
617 int nTracePts = traceExp[j]->GetTotPoints();
618
619 for (int d = 0; d < ndir; ++d)
620 {
621 // specifying eForwards since Std Operation always Fwd
622 GetTracePhysVals(j, traceExp[j], Deriv[d], traceDeriv,
624
625 // fill matrix
626 for (int k = 0; k < nTracePts; ++k)
627 {
628 (*DerivMat[d])(i, cnt + k) = traceDeriv[k];
629 }
630 }
631
632 cnt += nTracePts;
633 }
634 }
635}
636
639{
640 int nquad = GetTotPoints();
641 int ndir = m_base.size();
642
644 Array<OneD, NekDouble> phys(nquad);
645
646 Array<OneD, int> tracePhysIds;
647 GetTracePhysMap(traceid, tracePhysIds);
648
649 int nTracePts = GetTraceNumPoints(traceid);
650
651 // initialise array to null so can call for
652 // differnt dimensions
654 DerivMat = Array<OneD, DNekMatSharedPtr>(ndir);
655 for (int d = 0; d < ndir; ++d)
656 {
657 Deriv[d] = Array<OneD, NekDouble>(nquad);
659 nTracePts, 0.0);
660 }
661
662 for (int i = 0; i < m_ncoeffs; ++i)
663 {
664 Vmath::Zero(m_ncoeffs, coeffs, 1);
665 coeffs[i] = 1.0;
666 BwdTrans(coeffs, phys);
667
668 // dphi_i/d\xi_1, dphi_i/d\xi_2 dphi_i/d\xi_3
669 PhysDeriv(phys, Deriv[0], Deriv[1], Deriv[2]);
670
671 for (int k = 0; k < nTracePts; ++k)
672 {
673 for (int d = 0; d < ndir; ++d)
674 {
675 (*DerivMat[d])(i, k) = Deriv[d][tracePhysIds[k]];
676 }
677 }
678 }
679}
680
681void Expansion::PhysBaseOnTraceMat(const int traceid,
682 DNekMatSharedPtr &BdataMat)
683{
684 int nquad = GetTotPoints();
685
687 Array<OneD, NekDouble> phys(nquad);
688
689 Array<OneD, int> tracePhysIds;
690 GetTracePhysMap(traceid, tracePhysIds);
691
692 int nTracePts = GetTraceNumPoints(traceid);
693
694 BdataMat =
696
697 for (int i = 0; i < m_ncoeffs; ++i)
698 {
699 Vmath::Zero(m_ncoeffs, coeffs, 1);
700 coeffs[i] = 1.0;
701 BwdTrans(coeffs, phys);
702
703 for (int k = 0; k < nTracePts; ++k)
704 {
705 (*BdataMat)(i, k) = phys[tracePhysIds[k]];
706 }
707 }
708}
709
711 Array<OneD, NekDouble> &coords_1,
712 Array<OneD, NekDouble> &coords_2)
713{
714 ASSERTL1(m_geom, "m_geom not defined");
715
716 // get physical points defined in Geom
717 m_geom->FillGeom();
718
719 const int expDim = m_base.size();
720 int nqGeom = 1;
721 bool doCopy = true;
722
725
726 for (int i = 0; i < expDim; ++i)
727 {
728 CBasis[i] = m_geom->GetXmap()->GetBasis(i);
729 nqGeom *= CBasis[i]->GetNumPoints();
730 doCopy = doCopy &&
731 m_base[i]->GetBasisKey().SamePoints(CBasis[i]->GetBasisKey());
732 }
733
734 tmp[0] = coords_0;
735 tmp[1] = coords_1;
736 tmp[2] = coords_2;
737
738 if (doCopy)
739 {
740 for (int i = 0; i < m_geom->GetCoordim(); ++i)
741 {
742 m_geom->GetXmap()->BwdTrans(m_geom->GetCoeffs(i), tmp[i]);
743 }
744 }
745 else
746 {
747 for (int i = 0; i < m_geom->GetCoordim(); ++i)
748 {
749 Array<OneD, NekDouble> tmpGeom(nqGeom);
750 m_geom->GetXmap()->BwdTrans(m_geom->GetCoeffs(i), tmpGeom);
751
752 switch (expDim)
753 {
754 case 1:
755 {
757 CBasis[0]->GetPointsKey(), &tmpGeom[0],
758 m_base[0]->GetPointsKey(), &tmp[i][0]);
759 break;
760 }
761 case 2:
762 {
764 CBasis[0]->GetPointsKey(), CBasis[1]->GetPointsKey(),
765 &tmpGeom[0], m_base[0]->GetPointsKey(),
766 m_base[1]->GetPointsKey(), &tmp[i][0]);
767 break;
768 }
769 case 3:
770 {
772 CBasis[0]->GetPointsKey(), CBasis[1]->GetPointsKey(),
773 CBasis[2]->GetPointsKey(), &tmpGeom[0],
774 m_base[0]->GetPointsKey(), m_base[1]->GetPointsKey(),
775 m_base[2]->GetPointsKey(), &tmp[i][0]);
776 break;
777 }
778 }
779 }
780 }
781}
782
784 const Array<OneD, const NekDouble> &direction,
786{
787 int shapedim = dfdir.size();
788 int coordim = GetCoordim();
789 int nqtot = direction.size() / coordim;
790
791 for (int j = 0; j < shapedim; j++)
792 {
793 dfdir[j] = Array<OneD, NekDouble>(nqtot, 0.0);
794 for (int k = 0; k < coordim; k++)
795 {
796 if (m_geomFactors->GetGtype() == SpatialDomains::eDeformed)
797 {
798 Vmath::Vvtvp(nqtot, &df[shapedim * k + j][0], 1,
799 &direction[k * nqtot], 1, &dfdir[j][0], 1,
800 &dfdir[j][0], 1);
801 }
802 else
803 {
804 Vmath::Svtvp(nqtot, df[shapedim * k + j][0],
805 &direction[k * nqtot], 1, &dfdir[j][0], 1,
806 &dfdir[j][0], 1);
807 }
808 }
809 }
810}
811
812// Get Moving frames
814 const int dir, const int shapedim, const StdRegions::VarCoeffMap &varcoeffs)
815{
816 int coordim = GetCoordim();
817
818 int nquad0, nquad1, nquad2;
819 int nqtot = 1;
820 switch (shapedim)
821 {
822 case 2:
823 {
824 nquad0 = m_base[0]->GetNumPoints();
825 nquad1 = m_base[1]->GetNumPoints();
826 nqtot = nquad0 * nquad1;
827 break;
828 }
829 case 3:
830 {
831 nquad0 = m_base[0]->GetNumPoints();
832 nquad1 = m_base[1]->GetNumPoints();
833 nquad2 = m_base[2]->GetNumPoints();
834 nqtot = nquad0 * nquad1 * nquad2;
835 break;
836 }
837 default:
838 break;
839 }
840
841 StdRegions::VarCoeffType MMFCoeffs[15] = {
850
851 Array<OneD, NekDouble> MF(coordim * nqtot);
852 Array<OneD, NekDouble> tmp(nqtot);
853 for (int k = 0; k < coordim; k++)
854 {
855 StdRegions::VarCoeffMap::const_iterator MFdir =
856 varcoeffs.find(MMFCoeffs[5 * dir + k]);
857 tmp = MFdir->second.GetValue();
858
859 Vmath::Vcopy(nqtot, &tmp[0], 1, &MF[k * nqtot], 1);
860 }
861
862 return MF;
863}
864
865// Get magnitude of MF
887
888// Get magnitude of MF
910
912 [[maybe_unused]] const DNekScalMatSharedPtr &r_bnd,
913 [[maybe_unused]] const StdRegions::MatrixType matrixType)
914{
915 NEKERROR(ErrorUtil::efatal, "This function is only valid for LocalRegions");
917}
918
920 [[maybe_unused]] const DNekScalMatSharedPtr &r_bnd)
921{
922 NEKERROR(ErrorUtil::efatal, "This function is only valid for LocalRegions");
924}
925
927 [[maybe_unused]] const NekDouble *data,
928 [[maybe_unused]] const std::vector<unsigned int> &nummodes,
929 [[maybe_unused]] const int nmodes_offset,
930 [[maybe_unused]] NekDouble *coeffs,
931 [[maybe_unused]] std::vector<LibUtilities::BasisType> &fromType)
932{
933 NEKERROR(ErrorUtil::efatal, "This function is only valid for LocalRegions");
934}
935
937 [[maybe_unused]] const int edge,
938 [[maybe_unused]] const std::shared_ptr<Expansion> &EdgeExp,
939 [[maybe_unused]] const Array<OneD, const NekDouble> &Fx,
940 [[maybe_unused]] const Array<OneD, const NekDouble> &Fy,
941 [[maybe_unused]] Array<OneD, NekDouble> &outarray)
942{
943 NEKERROR(ErrorUtil::efatal, "This function is only valid for LocalRegions");
944}
945
947 [[maybe_unused]] const int edge,
948 [[maybe_unused]] const std::shared_ptr<Expansion> &EdgeExp,
949 [[maybe_unused]] const Array<OneD, const NekDouble> &Fn,
950 [[maybe_unused]] Array<OneD, NekDouble> &outarray)
951{
952 NEKERROR(ErrorUtil::efatal, "This function is only valid for LocalRegions");
953}
954
956 [[maybe_unused]] const int face,
957 [[maybe_unused]] const std::shared_ptr<Expansion> &FaceExp,
958 [[maybe_unused]] const Array<OneD, const NekDouble> &Fn,
959 [[maybe_unused]] Array<OneD, NekDouble> &outarray)
960{
961 NEKERROR(ErrorUtil::efatal, "This function is only valid for LocalRegions");
962}
963
965 [[maybe_unused]] const int dir,
966 [[maybe_unused]] const Array<OneD, const NekDouble> &inarray,
967 [[maybe_unused]] Array<OneD, ExpansionSharedPtr> &EdgeExp,
968 [[maybe_unused]] Array<OneD, Array<OneD, NekDouble>> &coeffs,
969 [[maybe_unused]] Array<OneD, NekDouble> &outarray)
970{
971 NEKERROR(ErrorUtil::efatal, "This function is only valid for LocalRegions");
972}
973
975 [[maybe_unused]] const Array<OneD, Array<OneD, NekDouble>> &vec)
976{
978 "This function is only valid for "
979 "shape expansion in LocalRegions, not parant class");
980 return 0.0;
981}
982
984 [[maybe_unused]] Array<OneD, Array<OneD, NekDouble>> &factors,
985 [[maybe_unused]] Array<OneD, Array<OneD, NekDouble>> &d0factors,
986 [[maybe_unused]] Array<OneD, Array<OneD, NekDouble>> &d1factors)
987{
989 "This function is only valid for "
990 "shape expansion in LocalRegions, not parant class");
991}
992
994{
996}
997
999 [[maybe_unused]] StdRegions::Orientation dir,
1000 [[maybe_unused]] Array<OneD, const NekDouble> &inarray,
1001 [[maybe_unused]] Array<OneD, NekDouble> &outarray)
1002{
1003 NEKERROR(ErrorUtil::efatal, "This function is not defined for this shape");
1004}
1005
1007 [[maybe_unused]] const int trace,
1008 [[maybe_unused]] Array<OneD, NekDouble> &outarray)
1009{
1011 "Method does not exist for this shape or library");
1012}
1013
1015 [[maybe_unused]] const int trace,
1016 [[maybe_unused]] const StdRegions::StdExpansionSharedPtr &TraceExp,
1017 [[maybe_unused]] const Array<OneD, const NekDouble> &inarray,
1018 [[maybe_unused]] Array<OneD, NekDouble> &outarray,
1019 [[maybe_unused]] StdRegions::Orientation orient)
1020{
1022 "Method does not exist for this shape or library");
1023}
1024
1026 [[maybe_unused]] const int trace,
1027 [[maybe_unused]] const StdRegions::StdExpansionSharedPtr &TraceExp,
1028 [[maybe_unused]] const NekDouble *inarray,
1029 [[maybe_unused]] Array<OneD, NekDouble> &outarray)
1030
1031{
1033 "Method does not exist for this shape or library");
1034}
1035
1036void Expansion::v_GetTracePhysMap([[maybe_unused]] const int edge,
1037 [[maybe_unused]] Array<OneD, int> &outarray)
1038{
1040 "Method does not exist for this shape or library");
1041}
1042
1044 [[maybe_unused]] const StdRegions::Orientation orient,
1045 [[maybe_unused]] const Array<OneD, const NekDouble> &in,
1046 [[maybe_unused]] Array<OneD, NekDouble> &out,
1047 [[maybe_unused]] const int nq0, [[maybe_unused]] const int nq1,
1048 [[maybe_unused]] bool Forwards)
1049{
1051 "Method does not exist for this shape or library");
1052}
1053
1054void Expansion::v_GenTraceExp([[maybe_unused]] const int traceid,
1055 [[maybe_unused]] ExpansionSharedPtr &exp)
1056{
1058 "Method does not exist for this shape or library");
1059}
1060
1061void Expansion::v_ComputeTraceNormal([[maybe_unused]] const int id)
1062{
1063 ASSERTL0(false, "Cannot compute trace normal for this expansion.");
1064}
1065
1067{
1068 NEKERROR(ErrorUtil::efatal, "This function is not valid for this class");
1069 return NullNekDouble1DArray;
1070}
1071
1073 [[maybe_unused]] Array<OneD, const NekDouble> &normal)
1074{
1075 NEKERROR(ErrorUtil::efatal, "This function is not valid for this class");
1076}
1077
1078void Expansion::v_SetUpPhysNormals([[maybe_unused]] const int edge)
1079{
1080 NEKERROR(ErrorUtil::efatal, "This function is not valid for this class");
1081}
1082
1084 [[maybe_unused]] const int trace,
1085 [[maybe_unused]] const Array<OneD, const NekDouble> &primCoeffs,
1086 [[maybe_unused]] DNekMatSharedPtr &inoutmat)
1087{
1088 NEKERROR(ErrorUtil::efatal, "This function is not valid for this class");
1089}
1090
1092 [[maybe_unused]] const int traceid,
1093 [[maybe_unused]] const Array<OneD, const NekDouble> &primCoeffs,
1094 [[maybe_unused]] const Array<OneD, NekDouble> &incoeffs,
1095 [[maybe_unused]] Array<OneD, NekDouble> &coeffs)
1096{
1097 NEKERROR(ErrorUtil::efatal, "This function is not valid for this class");
1098}
1099
1100void Expansion::v_TraceNormLen([[maybe_unused]] const int traceid,
1101 [[maybe_unused]] NekDouble &h,
1102 [[maybe_unused]] NekDouble &p)
1103{
1104 NEKERROR(ErrorUtil::efatal, "This method has not been defined");
1105}
1106
1108 const int nbnd) const
1109{
1110 auto x = m_elmtBndNormDirElmtLen.find(nbnd);
1112 "m_elmtBndNormDirElmtLen normal not computed.");
1113 return x->second;
1114}
1115
1117 [[maybe_unused]] const int dir,
1118 [[maybe_unused]] const Array<OneD, const NekDouble> &inarray,
1119 [[maybe_unused]] Array<OneD, Array<OneD, NekDouble>> &outarray)
1120{
1121 NEKERROR(ErrorUtil::efatal, "v_AlignVectorToCollapsedDir is not defined");
1122}
1123
1125 const LibUtilities::BasisKeyVector &bkeys, int traceid,
1126 std::vector<int> &q_begin, std::vector<int> &q_end)
1127{
1128 auto DIM = LibUtilities::ShapeTypeDimMap[shapeType];
1129
1130 if (DIM == 1)
1131 {
1132 q_begin.resize(1);
1133 q_end.resize(1);
1134 LibUtilities::PointsKey::GetEffectiveQuadRange(bkeys[0].GetPointsKey(),
1135 q_begin[0], q_end[0]);
1136 return;
1137 }
1138 else if (DIM == 2)
1139 {
1140 q_begin.resize(2);
1141 q_end.resize(2);
1142 LibUtilities::PointsKey::GetEffectiveQuadRange(bkeys[0].GetPointsKey(),
1143 q_begin[0], q_end[0]);
1144 LibUtilities::PointsKey::GetEffectiveQuadRange(bkeys[1].GetPointsKey(),
1145 q_begin[1], q_end[1]);
1146 }
1147 else if (DIM == 3)
1148 {
1149 q_begin.resize(3);
1150 q_end.resize(3);
1151 LibUtilities::PointsKey::GetEffectiveQuadRange(bkeys[0].GetPointsKey(),
1152 q_begin[0], q_end[0]);
1153 LibUtilities::PointsKey::GetEffectiveQuadRange(bkeys[1].GetPointsKey(),
1154 q_begin[1], q_end[1]);
1155 LibUtilities::PointsKey::GetEffectiveQuadRange(bkeys[2].GetPointsKey(),
1156 q_begin[2], q_end[2]);
1157 }
1158
1159 switch (shapeType)
1160 {
1162 {
1163 switch (traceid)
1164 {
1165 case 0:
1166 {
1167 // assume it always includes the end points
1168 q_begin[1] = 0;
1169 q_end[1] = 1;
1170 return;
1171 }
1172 case 1:
1173 {
1174 // assume it always includes the end points
1175 q_begin[0] = bkeys[0].GetNumPoints() - 1;
1176 q_end[0] = bkeys[0].GetNumPoints();
1177 return;
1178 }
1179 case 2:
1180 {
1181 q_begin[0] = 0;
1182 q_end[0] = 1;
1183 return;
1184 }
1185 default:
1186 {
1187 NEKERROR(ErrorUtil::efatal, "Invalid trace id");
1188 break;
1189 }
1190 }
1191 }
1192 break;
1194 {
1195 switch (traceid)
1196 {
1197 case 0:
1198 {
1199 q_begin[1] = 0;
1200 q_end[1] = 1;
1201 return;
1202 }
1203 case 1:
1204 {
1205 q_begin[0] = bkeys[0].GetNumPoints() - 1;
1206 q_end[0] = bkeys[0].GetNumPoints();
1207 return;
1208 }
1209 case 2:
1210 {
1211 q_begin[1] = bkeys[1].GetNumPoints() - 1;
1212 q_end[1] = bkeys[1].GetNumPoints();
1213 return;
1214 }
1215 case 3:
1216 {
1217 q_begin[0] = 0;
1218 q_end[0] = 1;
1219 return;
1220 }
1221 default:
1222 {
1223 NEKERROR(ErrorUtil::efatal, "Invalid trace id");
1224 break;
1225 }
1226 }
1227 }
1228 break;
1230 {
1231 switch (traceid)
1232 {
1233 case 0:
1234 {
1235 q_begin[2] = 0;
1236 q_end[2] = 1;
1237 return;
1238 }
1239 case 1:
1240 {
1241 q_begin[1] = 0;
1242 q_end[1] = 1;
1243 return;
1244 }
1245 case 2:
1246 {
1247 q_begin[0] = bkeys[0].GetNumPoints() - 1;
1248 q_end[0] = bkeys[0].GetNumPoints();
1249 return;
1250 }
1251 case 3:
1252 {
1253 q_begin[1] = bkeys[1].GetNumPoints() - 1;
1254 q_end[1] = bkeys[1].GetNumPoints();
1255 return;
1256 }
1257 case 4:
1258 {
1259 q_begin[0] = 0;
1260 q_end[0] = 1;
1261 return;
1262 }
1263 case 5:
1264 {
1265 q_begin[2] = bkeys[2].GetNumPoints() - 1;
1266 q_end[2] = bkeys[2].GetNumPoints();
1267 return;
1268 }
1269 default:
1270 {
1271 NEKERROR(ErrorUtil::efatal, "Invalid trace id");
1272 break;
1273 }
1274 }
1275 }
1276 break;
1278 {
1279 switch (traceid)
1280 {
1281 case 0:
1282 {
1283 q_begin[2] = 0;
1284 q_end[2] = 1;
1285 return;
1286 }
1287 case 1:
1288 {
1289 q_begin[1] = 0;
1290 q_end[1] = 1;
1291 return;
1292 }
1293 case 2:
1294 {
1295 q_begin[0] = bkeys[0].GetNumPoints() - 1;
1296 q_end[0] = bkeys[0].GetNumPoints();
1297 return;
1298 }
1299 case 3:
1300 {
1301 q_begin[0] = 0;
1302 q_end[0] = 1;
1303 return;
1304 }
1305 default:
1306 {
1307 NEKERROR(ErrorUtil::efatal, "Invalid trace id");
1308 break;
1309 }
1310 }
1311 }
1312 break;
1314 {
1315 switch (traceid)
1316 {
1317 case 0:
1318 {
1319 q_begin[2] = 0;
1320 q_end[2] = 1;
1321 return;
1322 }
1323 case 1:
1324 {
1325 q_begin[1] = 0;
1326 q_end[1] = 1;
1327 return;
1328 }
1329 case 2:
1330 {
1331 q_begin[0] = bkeys[0].GetNumPoints() - 1;
1332 q_end[0] = bkeys[0].GetNumPoints();
1333 return;
1334 }
1335 case 3:
1336 {
1337 q_begin[1] = bkeys[1].GetNumPoints() - 1;
1338 q_end[1] = bkeys[1].GetNumPoints();
1339 return;
1340 }
1341 case 4:
1342 {
1343 q_begin[0] = 0;
1344 q_end[0] = 1;
1345 return;
1346 }
1347 default:
1348 {
1349 NEKERROR(ErrorUtil::efatal, "Invalid trace id");
1350 break;
1351 }
1352 }
1353 }
1354 break;
1356 {
1357 switch (traceid)
1358 {
1359 case 0:
1360 {
1361 q_begin[2] = 0;
1362 q_end[2] = 1;
1363 return;
1364 }
1365 case 1:
1366 {
1367 q_begin[1] = 0;
1368 q_end[1] = 1;
1369 return;
1370 }
1371 case 2:
1372 {
1373 q_begin[0] = bkeys[0].GetNumPoints() - 1;
1374 q_end[0] = bkeys[0].GetNumPoints();
1375 return;
1376 }
1377 case 3:
1378 {
1379 q_begin[0] = bkeys[1].GetNumPoints() - 1;
1380 q_end[0] = bkeys[1].GetNumPoints();
1381 return;
1382 }
1383 case 4:
1384 {
1385 q_begin[1] = 0;
1386 q_end[1] = 1;
1387 return;
1388 }
1389 default:
1390 {
1391 NEKERROR(ErrorUtil::efatal, "Invalid trace id");
1392 break;
1393 }
1394 }
1395 }
1396 break;
1397 default:
1398 return;
1399 }
1400}
1401
1402} // namespace Nektar::LocalRegions
#define ASSERTL0(condition, msg)
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
#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...
#define sign(a, b)
return the sign(b)*a
Definition Polylib.cpp:47
Describes the specification for a Basis.
Definition Basis.h:45
static void GetEffectiveQuadRange(const LibUtilities::PointsKey &pkey, int &q_begin, int &q_end)
offset the m_nq_begin and m_nq_end according to the points type
Definition Points.h:219
PointsType GetPointsType() const
Definition Points.h:90
std::map< int, NormalVector > m_traceNormals
Definition Expansion.h:309
std::map< int, Array< OneD, NekDouble > > m_elmtBndNormDirElmtLen
the element length in each element boundary(Vertex, edge or face) normal direction calculated based o...
Definition Expansion.h:319
virtual void v_SetPhysNormals(Array< OneD, const NekDouble > &normal)
virtual void v_TraceNormLen(const int traceid, NekDouble &h, NekDouble &p)
IndexMapValuesSharedPtr CreateIndexMap(const IndexMapKey &ikey)
Expansion(SpatialDomains::Geometry *pGeom)
Definition Expansion.cpp:43
void GetTracePhysMap(const int edge, Array< OneD, int > &outarray)
Definition Expansion.h:230
void DropLocMatrix(const LocalRegions::MatrixKey &mkey)
Definition Expansion.cpp:94
SpatialDomains::Geometry * GetGeom() const
DNekMatSharedPtr BuildVertexMatrix(const DNekScalMatSharedPtr &r_bnd)
virtual void v_DivideByQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_GenTraceExp(const int traceid, ExpansionSharedPtr &exp)
void v_SetCoeffsToOrientation(StdRegions::Orientation dir, Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
SpatialDomains::Geometry * m_geom
Definition Expansion.h:306
virtual void v_AddRobinTraceContribution(const int traceid, const Array< OneD, const NekDouble > &primCoeffs, const Array< OneD, NekDouble > &incoeffs, Array< OneD, NekDouble > &coeffs)
void PhysDerivBaseOnTraceMat(const int traceid, Array< OneD, DNekMatSharedPtr > &DerivMat)
void ComputeGmatcdotMF(const Array< TwoD, const NekDouble > &df, const Array< OneD, const NekDouble > &direction, Array< OneD, Array< OneD, NekDouble > > &dfdir)
virtual void v_GetTraceQFactors(const int trace, Array< OneD, NekDouble > &outarray)
virtual void v_ComputeTraceNormal(const int id)
virtual StdRegions::StdExpansionSharedPtr v_GetLinStdExp(void) const
DNekScalBlkMatSharedPtr CreateStaticCondMatrix(const MatrixKey &mkey)
void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3) override
Array< OneD, NekDouble > GetMFMag(const int dir, const StdRegions::VarCoeffMap &varcoeffs)
virtual StdRegions::StdExpansionSharedPtr v_GetStdExp() const
virtual DNekMatSharedPtr v_BuildVertexMatrix(const DNekScalMatSharedPtr &r_bnd)
void v_FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Forward transform from physical quadrature space stored in inarray and evaluate the expansion coeffic...
virtual DNekScalMatSharedPtr v_GetLocMatrix(const LocalRegions::MatrixKey &mkey)
virtual void v_GetLocTracePhysVals(const int trace, const StdRegions::StdExpansionSharedPtr &TraceExp, const NekDouble *inarray, Array< OneD, NekDouble > &outarray)
void GetTracePhysVals(const int trace, const StdRegions::StdExpansionSharedPtr &TraceExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, StdRegions::Orientation orient=StdRegions::eNoOrientation)
Definition Expansion.h:213
virtual void v_AddFaceNormBoundaryInt(const int face, const std::shared_ptr< Expansion > &FaceExp, const Array< OneD, const NekDouble > &Fn, Array< OneD, NekDouble > &outarray)
virtual void v_DGDeriv(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, ExpansionSharedPtr > &EdgeExp, Array< OneD, Array< OneD, NekDouble > > &coeffs, Array< OneD, NekDouble > &outarray)
virtual DNekMatSharedPtr v_BuildTransformationMatrix(const DNekScalMatSharedPtr &r_bnd, const StdRegions::MatrixType matrixType)
const Array< OneD, const NekDouble > & GetElmtBndNormDirElmtLen(const int nbnd) const
virtual void v_AddRobinMassMatrix(const int face, const Array< OneD, const NekDouble > &primCoeffs, DNekMatSharedPtr &inoutmat)
std::map< int, ExpansionWeakPtr > m_traceExp
Definition Expansion.h:305
virtual void v_NormalTraceDerivFactors(Array< OneD, Array< OneD, NekDouble > > &factors, Array< OneD, Array< OneD, NekDouble > > &d0factors, Array< OneD, Array< OneD, NekDouble > > &d1factors)
void AddEdgeNormBoundaryInt(const int edge, const std::shared_ptr< Expansion > &EdgeExp, const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
void AddFaceNormBoundaryInt(const int face, const std::shared_ptr< Expansion > &FaceExp, const Array< OneD, const NekDouble > &Fn, Array< OneD, NekDouble > &outarray)
virtual void v_DropLocMatrix(const LocalRegions::MatrixKey &mkey)
void PhysBaseOnTraceMat(const int traceid, DNekMatSharedPtr &BdataMat)
virtual NekDouble v_VectorFlux(const Array< OneD, Array< OneD, NekDouble > > &vec)
virtual StdRegions::Orientation v_GetTraceOrient(int trace)
void DGDeriv(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, ExpansionSharedPtr > &EdgeExp, Array< OneD, Array< OneD, NekDouble > > &coeffs, Array< OneD, NekDouble > &outarray)
void StdDerivBaseOnTraceMat(Array< OneD, DNekMatSharedPtr > &DerivMat)
void ExtractDataToCoeffs(const NekDouble *data, const std::vector< unsigned int > &nummodes, const int nmodes_offset, NekDouble *coeffs, std::vector< LibUtilities::BasisType > &fromType)
void v_MultiplyByQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
NekDouble v_PhysEvaluate(const Array< OneD, const NekDouble > &coord, const Array< OneD, const NekDouble > &physvals) override
virtual void v_ReOrientTracePhysVals(const StdRegions::Orientation orient, const Array< OneD, const NekDouble > &in, Array< OneD, NekDouble > &out, const int nq0, const int nq1, bool Forwards)
void NormalTraceDerivFactors(Array< OneD, Array< OneD, NekDouble > > &factors, Array< OneD, Array< OneD, NekDouble > > &d0factors, Array< OneD, Array< OneD, NekDouble > > &d1factors)
virtual void v_ComputeLaplacianMetric()
Definition Expansion.h:352
virtual const Array< OneD, const NekDouble > & v_GetPhysNormals()
virtual void v_ExtractDataToCoeffs(const NekDouble *data, const std::vector< unsigned int > &nummodes, const int nmodes_offset, NekDouble *coeffs, std::vector< LibUtilities::BasisType > &fromType)
virtual void v_AlignVectorToCollapsedDir(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
const std::map< int, NormalVector > & GetTraceNormals(void)
virtual void v_AddEdgeNormBoundaryInt(const int edge, const std::shared_ptr< Expansion > &EdgeExp, const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
DNekScalMatSharedPtr GetLocMatrix(const LocalRegions::MatrixKey &mkey)
Definition Expansion.cpp:88
virtual void v_SetUpPhysNormals(const int id)
virtual void v_GetTracePhysMap(const int edge, Array< OneD, int > &outarray)
Array< OneD, NekDouble > GetMFDiv(const int dir, const StdRegions::VarCoeffMap &varcoeffs)
const NormalVector & GetTraceNormal(const int id)
Array< OneD, NekDouble > GetMF(const int dir, const int shapedim, const StdRegions::VarCoeffMap &varcoeffs)
SpatialDomains::GeomFactorsUniquePtr m_geomFactors
Definition Expansion.h:307
virtual void v_GetTracePhysVals(const int trace, const StdRegions::StdExpansionSharedPtr &TraceExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, StdRegions::Orientation orient)
void GenGeomFactors()
Handles generation of geometry factors.
Definition Expansion.h:482
DNekMatSharedPtr BuildTransformationMatrix(const DNekScalMatSharedPtr &r_bnd, const StdRegions::MatrixType matrixType)
Definition Expansion.cpp:99
NekDouble VectorFlux(const Array< OneD, Array< OneD, NekDouble > > &vec)
StdRegions::Orientation GetIndexOrientation() const
Definition IndexMapKey.h:94
IndexMapType GetIndexMapType() const
Definition IndexMapKey.h:89
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.
static std::unique_ptr< DataType, UniquePtrDeleter > AllocateUniquePtr(const Args &...args)
Base class for shape geometry information.
Definition Geometry.h:84
NekDouble GetLocCoords(const Array< OneD, const NekDouble > &coords, Array< OneD, NekDouble > &Lcoords)
Determine the local collapsed coordinates that correspond to a given Cartesian coordinate for this ge...
Definition Geometry.h:549
int GetVid(int i) const
Returns global id of vertex i of this object.
Definition Geometry.h:345
const Array< OneD, const NekDouble > & GetCoeffs(const int i) const
Return the coefficients of the transformation Geometry::m_xmap in coordinate direction i.
Definition Geometry.h:449
int GetGlobalID(void) const
Get the ID of this object.
Definition Geometry.h:314
int GetCoordim() const
Return the coordinate dimension of this object (i.e. the dimension of the space in which this object ...
Definition Geometry.h:277
void FillGeom()
Populate the coordinate mapping Geometry::m_coeffs information from any children geometry elements.
Definition Geometry.h:461
StdRegions::StdExpansionSharedPtr GetXmap() const
Return the mapping object Geometry::m_xmap that represents the coordinate transformation from standar...
Definition Geometry.h:440
void GetBoundaryMap(Array< OneD, unsigned int > &outarray)
int GetNcoeffs(void) const
This function returns the total number of coefficients used in the expansion.
int GetTotPoints() const
This function returns the total number of quadrature points used in the element.
virtual NekDouble v_StdPhysEvaluate(const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
int GetTraceNumPoints(const int i) const
This function returns the number of quadrature points belonging to the i-th trace.
DNekBlkMatSharedPtr GetStdStaticCondMatrix(const StdMatrixKey &mkey)
virtual bool v_IsCollocatedBasis() const =0
int GetNtraces() const
Returns the number of trace elements connected to this element.
virtual void v_MultiplyByStdQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void GetTraceToElementMap(const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation traceOrient=eForwards, int P=-1, int Q=-1)
LibUtilities::ShapeType DetShapeType() const
This function returns the shape of the expansion domain.
void GetInteriorMap(Array< OneD, unsigned int > &outarray)
void BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function performs the Backward transformation from coefficient space to physical space.
virtual const LibUtilities::PointsKey v_GetNodalPointsKey() const
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)=0
Calculates the inner product of a given function f with the different modes of the expansion.
void StdPhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1=NullNekDouble1DArray, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray)
const LibUtilities::BasisKey GetTraceBasisKey(const int i, int k=-1, bool UseGLL=false) const
This function returns the basis key belonging to the i-th trace.
void PhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1=NullNekDouble1DArray, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray)
Array< OneD, LibUtilities::BasisSharedPtr > m_base
MatrixType GetMatrixType() const
std::vector< BasisKey > BasisKeyVector
Name for a vector of BasisKeys.
void Interp1D(const BasisKey &fbasis0, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, Array< OneD, NekDouble > &to)
this function interpolates a 1D function evaluated at the quadrature points of the basis fbasis0 to ...
Definition Interp.cpp:47
void Interp3D(const BasisKey &fbasis0, const BasisKey &fbasis1, const BasisKey &fbasis2, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, const BasisKey &tbasis1, const BasisKey &tbasis2, Array< OneD, NekDouble > &to)
this function interpolates a 3D function evaluated at the quadrature points of the 3D basis,...
Definition Interp.cpp:162
void Interp2D(const BasisKey &fbasis0, const BasisKey &fbasis1, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, const BasisKey &tbasis1, Array< OneD, NekDouble > &to)
this function interpolates a 2D function evaluated at the quadrature points of the 2D basis,...
Definition Interp.cpp:101
constexpr unsigned int ShapeTypeDimMap[SIZE_ShapeType]
Definition ShapeType.hpp:87
static const PointsKey NullPointsKey(0, eNoPointsType)
std::shared_ptr< Expansion > ExpansionSharedPtr
Definition Expansion.h:66
std::shared_ptr< IndexMapValues > IndexMapValuesSharedPtr
void GetTraceQuadRange(const LibUtilities::ShapeType shapeType, const LibUtilities::BasisKeyVector &bkeys, int traceid, std::vector< int > &q_begin, std::vector< int > &q_end)
Array< OneD, Array< OneD, NekDouble > > NormalVector
Definition Expansion.h:53
GeomType
Indicates the type of element geometry.
@ eRegular
Geometry is straight-sided with constant geometric factors.
@ eNoGeomType
No type defined.
@ eMovingRegular
Currently unused.
@ eDeformed
Geometry is curved or has non-constant factors.
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
static VarFactorsMap NullVarFactorsMap
std::map< ConstFactorType, NekDouble > ConstFactorMap
static ConstFactorMap NullConstFactorMap
static VarCoeffMap NullVarCoeffMap
std::map< StdRegions::VarCoeffType, VarCoeffEntry > VarCoeffMap
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
std::shared_ptr< DNekBlkMat > DNekBlkMatSharedPtr
std::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
static DNekMatSharedPtr NullDNekMatSharedPtr
static Array< OneD, NekDouble > NullNekDouble1DArray
static DNekScalMatSharedPtr NullDNekScalMatSharedPtr
std::shared_ptr< DNekMat > DNekMatSharedPtr
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
Definition Vmath.hpp:72
void Svtvp(int n, const T alpha, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Svtvp (scalar times vector plus vector): z = alpha*x + y.
Definition Vmath.hpp:396
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
Definition Vmath.hpp:366
void Vdiv(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x/y.
Definition Vmath.hpp:126
void Zero(int n, T *x, const int incx)
Zero vector.
Definition Vmath.hpp:273
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition Vmath.hpp:825
STL namespace.
scalarT< T > max(scalarT< T > lhs, scalarT< T > rhs)
Definition scalar.hpp:305