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_metricinfo(m_geom->GetGeomFactors()),
48 m_elementTraceLeft(-1), m_elementTraceRight(-1)
49{
50 if (!m_metricinfo)
51 {
52 return;
53 }
54
55 if (!m_metricinfo->IsValid())
56 {
57 int nDim = m_base.size();
58 string type = "regular";
59 if (m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
60 {
61 type = "deformed";
62 }
63
64 stringstream err;
65 err << nDim << "D " << type << " Jacobian not positive "
66 << "(element ID = " << m_geom->GetGlobalID() << ") "
67 << "(first vertex ID = " << m_geom->GetVid(0) << ")";
68 NEKERROR(ErrorUtil::ewarning, err.str());
69 }
70
71 m_traceExp.clear();
72}
73
75 : StdExpansion(pSrc), m_indexMapManager(pSrc.m_indexMapManager),
76 m_geom(pSrc.m_geom), m_metricinfo(pSrc.m_metricinfo)
77{
78}
79
83
89
91{
92 return v_DropLocMatrix(mkey);
93}
94
100
105
107 const NekDouble *data, const std::vector<unsigned int> &nummodes,
108 const int nmodes_offset, NekDouble *coeffs,
109 std::vector<LibUtilities::BasisType> &fromType)
110{
111 v_ExtractDataToCoeffs(data, nummodes, nmodes_offset, coeffs, fromType);
112}
113
115 const int edge, const std::shared_ptr<Expansion> &EdgeExp,
118{
119 v_AddEdgeNormBoundaryInt(edge, EdgeExp, Fx, Fy, outarray);
120}
121
123 const int edge, const std::shared_ptr<Expansion> &EdgeExp,
125{
126 v_AddEdgeNormBoundaryInt(edge, EdgeExp, Fn, outarray);
127}
128
130 const int face, const std::shared_ptr<Expansion> &FaceExp,
132{
133 v_AddFaceNormBoundaryInt(face, FaceExp, Fn, outarray);
134}
135
136void Expansion::DGDeriv(const int dir,
137 const Array<OneD, const NekDouble> &inarray,
140 Array<OneD, NekDouble> &outarray)
141{
142 v_DGDeriv(dir, inarray, EdgeExp, coeffs, outarray);
143}
144
149
152 Array<OneD, Array<OneD, NekDouble>> &d0factors,
153 Array<OneD, Array<OneD, NekDouble>> &d1factors)
154{
155 return v_NormalTraceDerivFactors(factors, d0factors, d1factors);
156}
157
159 const StdRegions::MatrixType mtype,
160 const StdRegions::ConstFactorMap &factors,
161 const StdRegions::VarCoeffMap &varcoeffs)
162{
163 MatrixKey mkey(mtype, DetShapeType(), *this, factors, varcoeffs);
164 return GetLocMatrix(mkey);
165}
166
171
173{
174 // Clear metrics
175 m_metrics.clear();
176
177 // Regenerate geometry factors
179}
180
182{
183 IndexMapValuesSharedPtr returnval;
184
185 IndexMapType itype = ikey.GetIndexMapType();
186
187 int entity = ikey.GetIndexEntity();
188
190
193
194 switch (itype)
195 {
196 case eEdgeToElement:
197 {
198 GetTraceToElementMap(entity, map, sign, orient);
199 }
200 break;
201 case eFaceToElement:
202 {
203 GetTraceToElementMap(entity, map, sign, orient);
204 }
205 break;
206 case eEdgeInterior:
207 {
208 ASSERTL0(false, "Boundary Index Map not implemented yet.");
209 // v_GetEdgeInteriorMap(entity,orient,map,sign);
210 }
211 break;
212 case eFaceInterior:
213 {
214 ASSERTL0(false, "Boundary Index Map not implemented yet.");
215 // v_GetFaceInteriorMap(entity,orient,map,sign);
216 }
217 break;
218 case eBoundary:
219 {
220 ASSERTL0(false, "Boundary Index Map not implemented yet.");
221 }
222 break;
223 case eVertex:
224 {
225 ASSERTL0(false, "Vertex Index Map not implemented yet.");
226 }
227 break;
228 default:
229 {
230 ASSERTL0(false, "The Index Map you are requiring "
231 "is not between the possible options.");
232 }
233 }
234
236
237 for (int i = 0; i < map.size(); i++)
238 {
239 (*returnval)[i].index = map[i];
240 (*returnval)[i].sign = sign[i];
241 }
242
243 return returnval;
244}
245
250
252{
253 std::map<int, NormalVector>::const_iterator x;
254 x = m_traceNormals.find(id);
255
256 // if edge normal not defined compute it
257 if (x == m_traceNormals.end())
258 {
260 x = m_traceNormals.find(id);
261 }
262 return x->second;
263}
264
266 [[maybe_unused]] const LocalRegions::MatrixKey &mkey)
267{
268 NEKERROR(ErrorUtil::efatal, "This function is only valid for LocalRegions");
270}
271
273{
274 DNekScalBlkMatSharedPtr returnval;
275
277 "Geometric information is not set up");
278
279 // set up block matrix system
280 unsigned int nbdry = NumBndryCoeffs();
281 unsigned int nint = (unsigned int)(m_ncoeffs - nbdry);
282 unsigned int exp_size[] = {nbdry, nint};
283 unsigned int nblks = 2;
285 nblks, nblks, exp_size, exp_size);
286 // Really need a constructor which takes Arrays
287 NekDouble factor = 1.0;
288
289 switch (mkey.GetMatrixType())
290 {
291 // this can only use stdregions statically condensed system
292 // for mass matrix
294 if ((m_metricinfo->GetGtype() == SpatialDomains::eDeformed) ||
295 (mkey.GetNVarCoeff()))
296 {
297 factor = 1.0;
298 goto UseLocRegionsMatrix;
299 }
300 else
301 {
302 factor = (m_metricinfo->GetJac(GetPointsKeys()))[0];
303 goto UseStdRegionsMatrix;
304 }
305 break;
306 default: // use Deformed case for both
307 // regular and deformed geometries
308 factor = 1.0;
309 goto UseLocRegionsMatrix;
310 break;
311 UseStdRegionsMatrix:
312 {
313 NekDouble invfactor = 1.0 / factor;
314 NekDouble one = 1.0;
317 DNekMatSharedPtr Asubmat;
318
319 returnval->SetBlock(
320 0, 0,
322 factor, Asubmat = mat->GetBlock(0, 0)));
323 returnval->SetBlock(
324 0, 1,
326 one, Asubmat = mat->GetBlock(0, 1)));
327 returnval->SetBlock(
328 1, 0,
330 factor, Asubmat = mat->GetBlock(1, 0)));
331 returnval->SetBlock(
332 1, 1,
334 invfactor, Asubmat = mat->GetBlock(1, 1)));
335 }
336 break;
337 UseLocRegionsMatrix:
338 {
339 int i, j;
340 NekDouble invfactor = 1.0 / factor;
341 NekDouble one = 1.0;
342 DNekScalMat &mat = *GetLocMatrix(mkey);
351
352 Array<OneD, unsigned int> bmap(nbdry);
353 Array<OneD, unsigned int> imap(nint);
354 GetBoundaryMap(bmap);
355 GetInteriorMap(imap);
356
357 for (i = 0; i < nbdry; ++i)
358 {
359 for (j = 0; j < nbdry; ++j)
360 {
361 (*A)(i, j) = mat(bmap[i], bmap[j]);
362 }
363
364 for (j = 0; j < nint; ++j)
365 {
366 (*B)(i, j) = mat(bmap[i], imap[j]);
367 }
368 }
369
370 for (i = 0; i < nint; ++i)
371 {
372 for (j = 0; j < nbdry; ++j)
373 {
374 (*C)(i, j) = mat(imap[i], bmap[j]);
375 }
376
377 for (j = 0; j < nint; ++j)
378 {
379 (*D)(i, j) = mat(imap[i], imap[j]);
380 }
381 }
382
383 // Calculate static condensed system
384 if (nint)
385 {
386 D->Invert();
387 (*B) = (*B) * (*D);
388 (*A) = (*A) - (*B) * (*C);
389 }
390
392
393 returnval->SetBlock(
394 0, 0,
395 Atmp =
397 returnval->SetBlock(
398 0, 1,
400 returnval->SetBlock(
401 1, 0,
402 Atmp =
404 returnval->SetBlock(
405 1, 1,
407 D));
408
409 // Remove the local matrix from manager if using this option since
410 // we assume it is only created to generate static condensed system
411 v_DropLocMatrix(mkey);
412 }
413 }
414 return returnval;
415}
416
418 [[maybe_unused]] const LocalRegions::MatrixKey &mkey)
419{
420 NEKERROR(ErrorUtil::efatal, "This function is only valid for LocalRegions");
421}
422
424 const Array<OneD, const NekDouble> &inarray,
425 Array<OneD, NekDouble> &outarray)
426{
427 const int nqtot = GetTotPoints();
428
429 if (m_metrics.count(eMetricQuadrature) == 0)
430 {
432 }
433
434 Vmath::Vmul(nqtot, m_metrics[eMetricQuadrature], 1, inarray, 1, outarray,
435 1);
436}
437
439 const Array<OneD, const NekDouble> &inarray,
440 Array<OneD, NekDouble> &outarray)
441{
442 const int nqtot = GetTotPoints();
443
444 if (m_metrics.count(eMetricQuadrature) == 0)
445 {
447 }
448
449 Vmath::Vdiv(nqtot, inarray, 1, m_metrics[eMetricQuadrature], 1, outarray,
450 1);
451 // remove NaN or Inf values and set to zero
452 for (int i = 0; i < nqtot; ++i)
453 {
454 if (std::isnan(outarray[i]) || std::isinf(outarray[i]))
455 {
456 outarray[i] = 0.0;
457 }
458 }
459}
460
465
485
487{
488 int nquad = GetTotPoints();
489 int ntraces = GetNtraces();
490 int ndir = m_base.size();
491
493 Array<OneD, NekDouble> phys(nquad);
494
495 Array<OneD, Array<OneD, int>> traceids(ntraces);
496
497 int tottracepts = 0;
498 for (int i = 0; i < ntraces; ++i)
499 {
500 GetTracePhysMap(i, traceids[i]);
501 tottracepts += GetTraceNumPoints(i);
502 }
503
504 // initialise array to null so can call for
505 // differnt dimensions
507
508 DerivMat = Array<OneD, DNekMatSharedPtr>(ndir);
509
510 for (int i = 0; i < ndir; ++i)
511 {
512 Deriv[i] = Array<OneD, NekDouble>(nquad);
513 DerivMat[i] =
515 }
516
517 for (int i = 0; i < m_ncoeffs; ++i)
518 {
519 Vmath::Zero(m_ncoeffs, coeffs, 1);
520 coeffs[i] = 1.0;
521 BwdTrans(coeffs, phys);
522
523 // dphi_i/d\xi_1, dphi_i/d\xi_2 dphi_i/d\xi_3
524 StdPhysDeriv(phys, Deriv[0], Deriv[1], Deriv[2]);
525
526 int cnt = 0;
527 for (int j = 0; j < ntraces; ++j)
528 {
529 int nTracePts = GetTraceNumPoints(j);
530 for (int k = 0; k < nTracePts; ++k)
531 {
532 for (int d = 0; d < ndir; ++d)
533 {
534 (*DerivMat[d])(i, cnt + k) = Deriv[d][traceids[j][k]];
535 }
536 }
537 cnt += nTracePts;
538 }
539 }
540}
541
544{
545 int nquad = GetTotPoints();
546 int ndir = m_base.size();
547
549 Array<OneD, NekDouble> phys(nquad);
550
551 Array<OneD, int> tracePhysIds;
552 GetTracePhysMap(traceid, tracePhysIds);
553
554 int nTracePts = GetTraceNumPoints(traceid);
555
556 // initialise array to null so can call for
557 // differnt dimensions
559 DerivMat = Array<OneD, DNekMatSharedPtr>(ndir);
560 for (int d = 0; d < ndir; ++d)
561 {
562 Deriv[d] = Array<OneD, NekDouble>(nquad);
564 nTracePts, 0.0);
565 }
566
567 for (int i = 0; i < m_ncoeffs; ++i)
568 {
569 Vmath::Zero(m_ncoeffs, coeffs, 1);
570 coeffs[i] = 1.0;
571 BwdTrans(coeffs, phys);
572
573 // dphi_i/d\xi_1, dphi_i/d\xi_2 dphi_i/d\xi_3
574 PhysDeriv(phys, Deriv[0], Deriv[1], Deriv[2]);
575
576 for (int k = 0; k < nTracePts; ++k)
577 {
578 for (int d = 0; d < ndir; ++d)
579 {
580 (*DerivMat[d])(i, k) = Deriv[d][tracePhysIds[k]];
581 }
582 }
583 }
584}
585
586void Expansion::PhysBaseOnTraceMat(const int traceid,
587 DNekMatSharedPtr &BdataMat)
588{
589 int nquad = GetTotPoints();
590
592 Array<OneD, NekDouble> phys(nquad);
593
594 Array<OneD, int> tracePhysIds;
595 GetTracePhysMap(traceid, tracePhysIds);
596
597 int nTracePts = GetTraceNumPoints(traceid);
598
599 BdataMat =
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 for (int k = 0; k < nTracePts; ++k)
609 {
610 (*BdataMat)(i, k) = phys[tracePhysIds[k]];
611 }
612 }
613}
614
616 Array<OneD, NekDouble> &coords_1,
617 Array<OneD, NekDouble> &coords_2)
618{
619 ASSERTL1(m_geom, "m_geom not defined");
620
621 // get physical points defined in Geom
622 m_geom->FillGeom();
623
624 const int expDim = m_base.size();
625 int nqGeom = 1;
626 bool doCopy = true;
627
630
631 for (int i = 0; i < expDim; ++i)
632 {
633 CBasis[i] = m_geom->GetXmap()->GetBasis(i);
634 nqGeom *= CBasis[i]->GetNumPoints();
635 doCopy = doCopy &&
636 m_base[i]->GetBasisKey().SamePoints(CBasis[i]->GetBasisKey());
637 }
638
639 tmp[0] = coords_0;
640 tmp[1] = coords_1;
641 tmp[2] = coords_2;
642
643 if (doCopy)
644 {
645 for (int i = 0; i < m_geom->GetCoordim(); ++i)
646 {
647 m_geom->GetXmap()->BwdTrans(m_geom->GetCoeffs(i), tmp[i]);
648 }
649 }
650 else
651 {
652 for (int i = 0; i < m_geom->GetCoordim(); ++i)
653 {
654 Array<OneD, NekDouble> tmpGeom(nqGeom);
655 m_geom->GetXmap()->BwdTrans(m_geom->GetCoeffs(i), tmpGeom);
656
657 switch (expDim)
658 {
659 case 1:
660 {
662 CBasis[0]->GetPointsKey(), &tmpGeom[0],
663 m_base[0]->GetPointsKey(), &tmp[i][0]);
664 break;
665 }
666 case 2:
667 {
669 CBasis[0]->GetPointsKey(), CBasis[1]->GetPointsKey(),
670 &tmpGeom[0], m_base[0]->GetPointsKey(),
671 m_base[1]->GetPointsKey(), &tmp[i][0]);
672 break;
673 }
674 case 3:
675 {
677 CBasis[0]->GetPointsKey(), CBasis[1]->GetPointsKey(),
678 CBasis[2]->GetPointsKey(), &tmpGeom[0],
679 m_base[0]->GetPointsKey(), m_base[1]->GetPointsKey(),
680 m_base[2]->GetPointsKey(), &tmp[i][0]);
681 break;
682 }
683 }
684 }
685 }
686}
687
689 const Array<OneD, const NekDouble> &direction,
691{
692 int shapedim = dfdir.size();
693 int coordim = GetCoordim();
694 int nqtot = direction.size() / coordim;
695
696 for (int j = 0; j < shapedim; j++)
697 {
698 dfdir[j] = Array<OneD, NekDouble>(nqtot, 0.0);
699 for (int k = 0; k < coordim; k++)
700 {
701 if (m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
702 {
703 Vmath::Vvtvp(nqtot, &df[shapedim * k + j][0], 1,
704 &direction[k * nqtot], 1, &dfdir[j][0], 1,
705 &dfdir[j][0], 1);
706 }
707 else
708 {
709 Vmath::Svtvp(nqtot, df[shapedim * k + j][0],
710 &direction[k * nqtot], 1, &dfdir[j][0], 1,
711 &dfdir[j][0], 1);
712 }
713 }
714 }
715}
716
717// Get Moving frames
719 const int dir, const int shapedim, const StdRegions::VarCoeffMap &varcoeffs)
720{
721 int coordim = GetCoordim();
722
723 int nquad0, nquad1, nquad2;
724 int nqtot = 1;
725 switch (shapedim)
726 {
727 case 2:
728 {
729 nquad0 = m_base[0]->GetNumPoints();
730 nquad1 = m_base[1]->GetNumPoints();
731 nqtot = nquad0 * nquad1;
732 break;
733 }
734 case 3:
735 {
736 nquad0 = m_base[0]->GetNumPoints();
737 nquad1 = m_base[1]->GetNumPoints();
738 nquad2 = m_base[2]->GetNumPoints();
739 nqtot = nquad0 * nquad1 * nquad2;
740 break;
741 }
742 default:
743 break;
744 }
745
746 StdRegions::VarCoeffType MMFCoeffs[15] = {
755
756 Array<OneD, NekDouble> MF(coordim * nqtot);
757 Array<OneD, NekDouble> tmp(nqtot);
758 for (int k = 0; k < coordim; k++)
759 {
760 StdRegions::VarCoeffMap::const_iterator MFdir =
761 varcoeffs.find(MMFCoeffs[5 * dir + k]);
762 tmp = MFdir->second.GetValue();
763
764 Vmath::Vcopy(nqtot, &tmp[0], 1, &MF[k * nqtot], 1);
765 }
766
767 return MF;
768}
769
770// Get magnitude of MF
792
793// Get magnitude of MF
815
817 [[maybe_unused]] const DNekScalMatSharedPtr &r_bnd,
818 [[maybe_unused]] const StdRegions::MatrixType matrixType)
819{
820 NEKERROR(ErrorUtil::efatal, "This function is only valid for LocalRegions");
822}
823
825 [[maybe_unused]] const DNekScalMatSharedPtr &r_bnd)
826{
827 NEKERROR(ErrorUtil::efatal, "This function is only valid for LocalRegions");
829}
830
832 [[maybe_unused]] const NekDouble *data,
833 [[maybe_unused]] const std::vector<unsigned int> &nummodes,
834 [[maybe_unused]] const int nmodes_offset,
835 [[maybe_unused]] NekDouble *coeffs,
836 [[maybe_unused]] std::vector<LibUtilities::BasisType> &fromType)
837{
838 NEKERROR(ErrorUtil::efatal, "This function is only valid for LocalRegions");
839}
840
842 [[maybe_unused]] const int edge,
843 [[maybe_unused]] const std::shared_ptr<Expansion> &EdgeExp,
844 [[maybe_unused]] const Array<OneD, const NekDouble> &Fx,
845 [[maybe_unused]] const Array<OneD, const NekDouble> &Fy,
846 [[maybe_unused]] Array<OneD, NekDouble> &outarray)
847{
848 NEKERROR(ErrorUtil::efatal, "This function is only valid for LocalRegions");
849}
850
852 [[maybe_unused]] const int edge,
853 [[maybe_unused]] const std::shared_ptr<Expansion> &EdgeExp,
854 [[maybe_unused]] const Array<OneD, const NekDouble> &Fn,
855 [[maybe_unused]] Array<OneD, NekDouble> &outarray)
856{
857 NEKERROR(ErrorUtil::efatal, "This function is only valid for LocalRegions");
858}
859
861 [[maybe_unused]] const int face,
862 [[maybe_unused]] const std::shared_ptr<Expansion> &FaceExp,
863 [[maybe_unused]] const Array<OneD, const NekDouble> &Fn,
864 [[maybe_unused]] Array<OneD, NekDouble> &outarray)
865{
866 NEKERROR(ErrorUtil::efatal, "This function is only valid for LocalRegions");
867}
868
870 [[maybe_unused]] const int dir,
871 [[maybe_unused]] const Array<OneD, const NekDouble> &inarray,
872 [[maybe_unused]] Array<OneD, ExpansionSharedPtr> &EdgeExp,
873 [[maybe_unused]] Array<OneD, Array<OneD, NekDouble>> &coeffs,
874 [[maybe_unused]] Array<OneD, NekDouble> &outarray)
875{
876 NEKERROR(ErrorUtil::efatal, "This function is only valid for LocalRegions");
877}
878
880 [[maybe_unused]] const Array<OneD, Array<OneD, NekDouble>> &vec)
881{
883 "This function is only valid for "
884 "shape expansion in LocalRegions, not parant class");
885 return 0.0;
886}
887
889 [[maybe_unused]] Array<OneD, Array<OneD, NekDouble>> &factors,
890 [[maybe_unused]] Array<OneD, Array<OneD, NekDouble>> &d0factors,
891 [[maybe_unused]] Array<OneD, Array<OneD, NekDouble>> &d1factors)
892{
894 "This function is only valid for "
895 "shape expansion in LocalRegions, not parant class");
896}
897
899{
901}
902
904 [[maybe_unused]] StdRegions::Orientation dir,
905 [[maybe_unused]] Array<OneD, const NekDouble> &inarray,
906 [[maybe_unused]] Array<OneD, NekDouble> &outarray)
907{
908 NEKERROR(ErrorUtil::efatal, "This function is not defined for this shape");
909}
910
912 [[maybe_unused]] const int trace,
913 [[maybe_unused]] Array<OneD, NekDouble> &outarray)
914{
916 "Method does not exist for this shape or library");
917}
918
920 [[maybe_unused]] const int trace,
921 [[maybe_unused]] const StdRegions::StdExpansionSharedPtr &TraceExp,
922 [[maybe_unused]] const Array<OneD, const NekDouble> &inarray,
923 [[maybe_unused]] Array<OneD, NekDouble> &outarray,
924 [[maybe_unused]] StdRegions::Orientation orient)
925{
927 "Method does not exist for this shape or library");
928}
929
930void Expansion::v_GetTracePhysMap([[maybe_unused]] const int edge,
931 [[maybe_unused]] Array<OneD, int> &outarray)
932{
934 "Method does not exist for this shape or library");
935}
936
938 [[maybe_unused]] const StdRegions::Orientation orient,
939 [[maybe_unused]] Array<OneD, int> &idmap, [[maybe_unused]] const int nq0,
940 [[maybe_unused]] const int nq1)
941{
943 "Method does not exist for this shape or library");
944}
945
946void Expansion::v_GenTraceExp([[maybe_unused]] const int traceid,
947 [[maybe_unused]] ExpansionSharedPtr &exp)
948{
950 "Method does not exist for this shape or library");
951}
952
953void Expansion::v_ComputeTraceNormal([[maybe_unused]] const int id)
954{
955 ASSERTL0(false, "Cannot compute trace normal for this expansion.");
956}
957
959{
960 NEKERROR(ErrorUtil::efatal, "This function is not valid for this class");
962}
963
965 [[maybe_unused]] Array<OneD, const NekDouble> &normal)
966{
967 NEKERROR(ErrorUtil::efatal, "This function is not valid for this class");
968}
969
970void Expansion::v_SetUpPhysNormals([[maybe_unused]] const int edge)
971{
972 NEKERROR(ErrorUtil::efatal, "This function is not valid for this class");
973}
974
976 [[maybe_unused]] const int trace,
977 [[maybe_unused]] const Array<OneD, const NekDouble> &primCoeffs,
978 [[maybe_unused]] DNekMatSharedPtr &inoutmat)
979{
980 NEKERROR(ErrorUtil::efatal, "This function is not valid for this class");
981}
982
984 [[maybe_unused]] const int traceid,
985 [[maybe_unused]] const Array<OneD, const NekDouble> &primCoeffs,
986 [[maybe_unused]] const Array<OneD, NekDouble> &incoeffs,
987 [[maybe_unused]] Array<OneD, NekDouble> &coeffs)
988{
989 NEKERROR(ErrorUtil::efatal, "This function is not valid for this class");
990}
991
992void Expansion::v_TraceNormLen([[maybe_unused]] const int traceid,
993 [[maybe_unused]] NekDouble &h,
994 [[maybe_unused]] NekDouble &p)
995{
996 NEKERROR(ErrorUtil::efatal, "This method has not been defined");
997}
998
1000 const int nbnd) const
1001{
1002 auto x = m_elmtBndNormDirElmtLen.find(nbnd);
1004 "m_elmtBndNormDirElmtLen normal not computed.");
1005 return x->second;
1006}
1007
1009 [[maybe_unused]] const int dir,
1010 [[maybe_unused]] const Array<OneD, const NekDouble> &inarray,
1011 [[maybe_unused]] Array<OneD, Array<OneD, NekDouble>> &outarray)
1012{
1013 NEKERROR(ErrorUtil::efatal, "v_AlignVectorToCollapsedDir is not defined");
1014}
1015
1017 const LibUtilities::BasisKeyVector &bkeys, int traceid,
1018 std::vector<int> &q_begin, std::vector<int> &q_end)
1019{
1020 auto DIM = LibUtilities::ShapeTypeDimMap[shapeType];
1021
1022 if (DIM == 1)
1023 {
1024 q_begin.resize(1);
1025 q_end.resize(1);
1026 LibUtilities::GetEffectiveQuadRange(bkeys[0].GetPointsKey(), q_begin[0],
1027 q_end[0]);
1028 return;
1029 }
1030 else if (DIM == 2)
1031 {
1032 q_begin.resize(2);
1033 q_end.resize(2);
1034 LibUtilities::GetEffectiveQuadRange(bkeys[0].GetPointsKey(), q_begin[0],
1035 q_end[0]);
1036 LibUtilities::GetEffectiveQuadRange(bkeys[1].GetPointsKey(), q_begin[1],
1037 q_end[1]);
1038 }
1039 else if (DIM == 3)
1040 {
1041 q_begin.resize(3);
1042 q_end.resize(3);
1043 LibUtilities::GetEffectiveQuadRange(bkeys[0].GetPointsKey(), q_begin[0],
1044 q_end[0]);
1045 LibUtilities::GetEffectiveQuadRange(bkeys[1].GetPointsKey(), q_begin[1],
1046 q_end[1]);
1047 LibUtilities::GetEffectiveQuadRange(bkeys[2].GetPointsKey(), q_begin[2],
1048 q_end[2]);
1049 }
1050
1051 switch (shapeType)
1052 {
1054 {
1055 switch (traceid)
1056 {
1057 case 0:
1058 {
1059 // assume it always includes the end points
1060 q_begin[1] = 0;
1061 q_end[1] = 1;
1062 return;
1063 }
1064 case 1:
1065 {
1066 // assume it always includes the end points
1067 q_begin[0] = bkeys[0].GetNumPoints() - 1;
1068 q_end[0] = bkeys[0].GetNumPoints();
1069 return;
1070 }
1071 case 2:
1072 {
1073 q_begin[0] = 0;
1074 q_end[0] = 1;
1075 return;
1076 }
1077 default:
1078 {
1079 NEKERROR(ErrorUtil::efatal, "Invalid trace id");
1080 break;
1081 }
1082 }
1083 }
1084 break;
1086 {
1087 switch (traceid)
1088 {
1089 case 0:
1090 {
1091 q_begin[1] = 0;
1092 q_end[1] = 1;
1093 return;
1094 }
1095 case 1:
1096 {
1097 q_begin[0] = bkeys[0].GetNumPoints() - 1;
1098 q_end[0] = bkeys[0].GetNumPoints();
1099 return;
1100 }
1101 case 2:
1102 {
1103 q_begin[1] = bkeys[1].GetNumPoints() - 1;
1104 q_end[1] = bkeys[1].GetNumPoints();
1105 return;
1106 }
1107 case 3:
1108 {
1109 q_begin[0] = 0;
1110 q_end[0] = 1;
1111 return;
1112 }
1113 default:
1114 {
1115 NEKERROR(ErrorUtil::efatal, "Invalid trace id");
1116 break;
1117 }
1118 }
1119 }
1120 break;
1122 {
1123 switch (traceid)
1124 {
1125 case 0:
1126 {
1127 q_begin[2] = 0;
1128 q_end[2] = 1;
1129 return;
1130 }
1131 case 1:
1132 {
1133 q_begin[1] = 0;
1134 q_end[1] = 1;
1135 return;
1136 }
1137 case 2:
1138 {
1139 q_begin[0] = bkeys[0].GetNumPoints() - 1;
1140 q_end[0] = bkeys[0].GetNumPoints();
1141 return;
1142 }
1143 case 3:
1144 {
1145 q_begin[1] = bkeys[1].GetNumPoints() - 1;
1146 q_end[1] = bkeys[1].GetNumPoints();
1147 return;
1148 }
1149 case 4:
1150 {
1151 q_begin[0] = 0;
1152 q_end[0] = 1;
1153 return;
1154 }
1155 case 5:
1156 {
1157 q_begin[2] = bkeys[2].GetNumPoints() - 1;
1158 q_end[2] = bkeys[2].GetNumPoints();
1159 return;
1160 }
1161 default:
1162 {
1163 NEKERROR(ErrorUtil::efatal, "Invalid trace id");
1164 break;
1165 }
1166 }
1167 }
1168 break;
1170 {
1171 switch (traceid)
1172 {
1173 case 0:
1174 {
1175 q_begin[2] = 0;
1176 q_end[2] = 1;
1177 return;
1178 }
1179 case 1:
1180 {
1181 q_begin[1] = 0;
1182 q_end[1] = 1;
1183 return;
1184 }
1185 case 2:
1186 {
1187 q_begin[0] = bkeys[0].GetNumPoints() - 1;
1188 q_end[0] = bkeys[0].GetNumPoints();
1189 return;
1190 }
1191 case 3:
1192 {
1193 q_begin[0] = 0;
1194 q_end[0] = 1;
1195 return;
1196 }
1197 default:
1198 {
1199 NEKERROR(ErrorUtil::efatal, "Invalid trace id");
1200 break;
1201 }
1202 }
1203 }
1204 break;
1206 {
1207 switch (traceid)
1208 {
1209 case 0:
1210 {
1211 q_begin[2] = 0;
1212 q_end[2] = 1;
1213 return;
1214 }
1215 case 1:
1216 {
1217 q_begin[1] = 0;
1218 q_end[1] = 1;
1219 return;
1220 }
1221 case 2:
1222 {
1223 q_begin[0] = bkeys[0].GetNumPoints() - 1;
1224 q_end[0] = bkeys[0].GetNumPoints();
1225 return;
1226 }
1227 case 3:
1228 {
1229 q_begin[1] = bkeys[1].GetNumPoints() - 1;
1230 q_end[1] = bkeys[1].GetNumPoints();
1231 return;
1232 }
1233 case 4:
1234 {
1235 q_begin[0] = 0;
1236 q_end[0] = 1;
1237 return;
1238 }
1239 default:
1240 {
1241 NEKERROR(ErrorUtil::efatal, "Invalid trace id");
1242 break;
1243 }
1244 }
1245 }
1246 break;
1248 {
1249 switch (traceid)
1250 {
1251 case 0:
1252 {
1253 q_begin[2] = 0;
1254 q_end[2] = 1;
1255 return;
1256 }
1257 case 1:
1258 {
1259 q_begin[1] = 0;
1260 q_end[1] = 1;
1261 return;
1262 }
1263 case 2:
1264 {
1265 q_begin[0] = bkeys[0].GetNumPoints() - 1;
1266 q_end[0] = bkeys[0].GetNumPoints();
1267 return;
1268 }
1269 case 3:
1270 {
1271 q_begin[0] = bkeys[1].GetNumPoints() - 1;
1272 q_end[0] = bkeys[1].GetNumPoints();
1273 return;
1274 }
1275 case 4:
1276 {
1277 q_begin[1] = 0;
1278 q_end[1] = 1;
1279 return;
1280 }
1281 default:
1282 {
1283 NEKERROR(ErrorUtil::efatal, "Invalid trace id");
1284 break;
1285 }
1286 }
1287 }
1288 break;
1289 default:
1290 return;
1291 }
1292}
1293
1294} // 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
std::map< int, NormalVector > m_traceNormals
Definition Expansion.h:282
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:292
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:209
void DropLocMatrix(const LocalRegions::MatrixKey &mkey)
Definition Expansion.cpp:90
const SpatialDomains::GeomFactorsSharedPtr & GetMetricInfo() const
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:279
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)
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 DNekMatSharedPtr v_BuildVertexMatrix(const DNekScalMatSharedPtr &r_bnd)
virtual DNekScalMatSharedPtr v_GetLocMatrix(const LocalRegions::MatrixKey &mkey)
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:278
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)
SpatialDomains::GeomFactorsSharedPtr m_metricinfo
Definition Expansion.h:280
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
virtual void v_ReOrientTracePhysMap(const StdRegions::Orientation orient, Array< OneD, int > &idmap, const int nq0, const int nq1=-1)
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:317
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)
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:84
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)
virtual void v_GetTracePhysVals(const int trace, const StdRegions::StdExpansionSharedPtr &TraceExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, StdRegions::Orientation orient)
DNekMatSharedPtr BuildTransformationMatrix(const DNekScalMatSharedPtr &r_bnd, const StdRegions::MatrixType matrixType)
Definition Expansion.cpp:95
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.
Base class for shape geometry information.
Definition Geometry.h:74
int GetVid(int i) const
Returns global id of vertex i of this object.
Definition Geometry.h:353
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:448
int GetGlobalID(void) const
Get the ID of this object.
Definition Geometry.h:322
int GetCoordim() const
Return the coordinate dimension of this object (i.e. the dimension of the space in which this object ...
Definition Geometry.h:279
void FillGeom()
Populate the coordinate mapping Geometry::m_coeffs information from any children geometry elements.
Definition Geometry.h:460
StdRegions::StdExpansionSharedPtr GetXmap() const
Return the mapping object Geometry::m_xmap that represents the coordinate transformation from standar...
Definition Geometry.h:439
GeomFactorsSharedPtr GetGeomFactors()
Get the geometric factors for this object, generating them if required.
Definition Geometry.h:297
void GetBoundaryMap(Array< OneD, unsigned int > &outarray)
int GetTotPoints() const
This function returns the total number of quadrature points used in the element.
int GetTraceNumPoints(const int i) const
This function returns the number of quadrature points belonging to the i-th trace.
const LibUtilities::PointsKeyVector GetPointsKeys() const
DNekBlkMatSharedPtr GetStdStaticCondMatrix(const StdMatrixKey &mkey)
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.
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)
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 GetEffectiveQuadRange(const LibUtilities::PointsKey &pkey, int &q_begin, int &q_end)
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
std::vector< PointsKey > PointsKeyVector
Definition Points.h:231
constexpr unsigned int ShapeTypeDimMap[SIZE_ShapeType]
Definition ShapeType.hpp:81
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)
std::shared_ptr< GeomFactors > GeomFactorsSharedPtr
Pointer to a GeomFactors object.
Definition GeomFactors.h:58
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
std::map< ConstFactorType, NekDouble > ConstFactorMap
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.