Nektar++
NodalTriExp.cpp
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: NodalTriExp.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: NodalTriExp routines
32//
33///////////////////////////////////////////////////////////////////////////////
34
37
38using namespace std;
39
41{
43 const LibUtilities::BasisKey &Bb,
44 const LibUtilities::PointsType Ntype,
46 : StdExpansion(LibUtilities::StdTriData::getNumberOfCoefficients(
47 Ba.GetNumModes(), (Bb.GetNumModes())),
48 2, Ba, Bb),
49 StdExpansion2D(LibUtilities::StdTriData::getNumberOfCoefficients(
50 Ba.GetNumModes(), (Bb.GetNumModes())),
51 Ba, Bb),
52 StdNodalTriExp(Ba, Bb, Ntype), Expansion(geom), Expansion2D(geom),
53 m_matrixManager(
54 std::bind(&Expansion2D::CreateMatrix, this, std::placeholders::_1),
55 std::string("NodalTriExpMatrix")),
56 m_staticCondMatrixManager(std::bind(&Expansion::CreateStaticCondMatrix,
57 this, std::placeholders::_1),
58 std::string("NodalTriExpStaticCondMatrix"))
59{
60}
61
63 : StdExpansion(T), StdExpansion2D(T), StdRegions::StdTriExp(T),
64 StdRegions::StdNodalTriExp(T), Expansion(T), Expansion2D(T),
65 m_matrixManager(T.m_matrixManager),
66 m_staticCondMatrixManager(T.m_staticCondMatrixManager)
67{
68}
69
71{
72 int nquad0 = m_base[0]->GetNumPoints();
73 int nquad1 = m_base[1]->GetNumPoints();
75 NekDouble ival;
76 Array<OneD, NekDouble> tmp(nquad0 * nquad1);
77
78 // multiply inarray with Jacobian
79 if (m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
80 {
81 Vmath::Vmul(nquad0 * nquad1, jac, 1, inarray, 1, tmp, 1);
82 }
83 else
84 {
85 Vmath::Smul(nquad0 * nquad1, jac[0], inarray, 1, tmp, 1);
86 }
87
88 // call StdQuadExp version;
89 ival = StdNodalTriExp::v_Integral(tmp);
90 return ival;
91}
92
97{
98 int nquad0 = m_base[0]->GetNumPoints();
99 int nquad1 = m_base[1]->GetNumPoints();
100 int nqtot = nquad0 * nquad1;
102 m_metricinfo->GetDerivFactors(GetPointsKeys());
103
104 Array<OneD, NekDouble> diff0(2 * nqtot);
105 Array<OneD, NekDouble> diff1(diff0 + nqtot);
106
107 StdNodalTriExp::v_PhysDeriv(inarray, diff0, diff1);
108
109 if (m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
110 {
111 if (out_d0.size())
112 {
113 Vmath::Vmul(nqtot, df[0], 1, diff0, 1, out_d0, 1);
114 Vmath::Vvtvp(nqtot, df[1], 1, diff1, 1, out_d0, 1, out_d0, 1);
115 }
116
117 if (out_d1.size())
118 {
119 Vmath::Vmul(nqtot, df[2], 1, diff0, 1, out_d1, 1);
120 Vmath::Vvtvp(nqtot, df[3], 1, diff1, 1, out_d1, 1, out_d1, 1);
121 }
122
123 if (out_d2.size())
124 {
125 Vmath::Vmul(nqtot, df[4], 1, diff0, 1, out_d2, 1);
126 Vmath::Vvtvp(nqtot, df[5], 1, diff1, 1, out_d2, 1, out_d2, 1);
127 }
128 }
129 else // regular geometry
130 {
131 if (out_d0.size())
132 {
133 Vmath::Smul(nqtot, df[0][0], diff0, 1, out_d0, 1);
134 Blas::Daxpy(nqtot, df[1][0], diff1, 1, out_d0, 1);
135 }
136
137 if (out_d1.size())
138 {
139 Vmath::Smul(nqtot, df[2][0], diff0, 1, out_d1, 1);
140 Blas::Daxpy(nqtot, df[3][0], diff1, 1, out_d1, 1);
141 }
142
143 if (out_d2.size())
144 {
145 Vmath::Smul(nqtot, df[4][0], diff0, 1, out_d2, 1);
146 Blas::Daxpy(nqtot, df[5][0], diff1, 1, out_d2, 1);
147 }
148 }
149}
150
151void NodalTriExp::v_PhysDeriv(const int dir,
152 const Array<OneD, const NekDouble> &inarray,
153 Array<OneD, NekDouble> &outarray)
154{
156 switch (dir)
157 {
158 case 0:
159 {
160 PhysDeriv(inarray, outarray, tmp);
161 }
162 break;
163 case 1:
164 {
165 PhysDeriv(inarray, tmp, outarray);
166 }
167 break;
168 default:
169 {
170 ASSERTL1(dir >= 0 && dir < 2, "input dir is out of range");
171 }
172 break;
173 }
174}
175
177 Array<OneD, NekDouble> &outarray)
178{
179 IProductWRTBase(inarray, outarray);
180
181 // get Mass matrix inverse
186 DNekScalMatSharedPtr matsys = m_matrixManager[masskey];
187
188 // copy inarray in case inarray == outarray
189 NekVector<NekDouble> in(m_ncoeffs, outarray, eCopy);
191
192 out = (*matsys) * in;
193}
194
196 Array<OneD, NekDouble> &outarray)
197{
198 v_IProductWRTBase_SumFac(inarray, outarray);
199}
200
202 const int dir, const Array<OneD, const NekDouble> &inarray,
203 Array<OneD, NekDouble> &outarray)
204{
205 v_IProductWRTDerivBase_SumFac(dir, inarray, outarray);
206}
207
209 const Array<OneD, const NekDouble> &inarray,
210 Array<OneD, NekDouble> &outarray, bool multiplybyweights)
211{
212 int nquad0 = m_base[0]->GetNumPoints();
213 int nquad1 = m_base[1]->GetNumPoints();
214 int order1 = m_base[1]->GetNumModes();
215
216 if (multiplybyweights)
217 {
218 Array<OneD, NekDouble> tmp(nquad0 * nquad1 + nquad0 * order1);
219 Array<OneD, NekDouble> wsp(tmp + nquad0 * nquad1);
220
221 MultiplyByQuadratureMetric(inarray, tmp);
222 StdTriExp::IProductWRTBase_SumFacKernel(
223 m_base[0]->GetBdata(), m_base[1]->GetBdata(), tmp, outarray, wsp);
224 NodalToModalTranspose(outarray, outarray);
225 }
226 else
227 {
228 Array<OneD, NekDouble> wsp(nquad0 * order1);
229
230 StdTriExp::IProductWRTBase_SumFacKernel(m_base[0]->GetBdata(),
231 m_base[1]->GetBdata(), inarray,
232 outarray, wsp);
233 NodalToModalTranspose(outarray, outarray);
234 }
235}
236
238 const int dir, const Array<OneD, const NekDouble> &inarray,
239 Array<OneD, NekDouble> &outarray)
240{
241 int nquad0 = m_base[0]->GetNumPoints();
242 int nquad1 = m_base[1]->GetNumPoints();
243 int nqtot = nquad0 * nquad1;
244 int wspsize = max(nqtot, m_ncoeffs);
245
246 Array<OneD, NekDouble> tmp0(4 * wspsize);
247 Array<OneD, NekDouble> tmp1(tmp0 + wspsize);
248 Array<OneD, NekDouble> tmp2(tmp0 + 2 * wspsize);
249 Array<OneD, NekDouble> tmp3(tmp0 + 3 * wspsize);
250
252 tmp2D[0] = tmp1;
253 tmp2D[1] = tmp2;
254
255 AlignVectorToCollapsedDir(dir, inarray, tmp2D);
256
257 MultiplyByQuadratureMetric(tmp1, tmp1);
258 MultiplyByQuadratureMetric(tmp2, tmp2);
259
260 IProductWRTBase_SumFacKernel(m_base[0]->GetDbdata(), m_base[1]->GetBdata(),
261 tmp1, tmp3, tmp0);
262 IProductWRTBase_SumFacKernel(m_base[0]->GetBdata(), m_base[1]->GetDbdata(),
263 tmp2, outarray, tmp0);
264 Vmath::Vadd(m_ncoeffs, tmp3, 1, outarray, 1, outarray, 1);
265
266 NodalToModalTranspose(outarray, outarray);
267}
268
270 const int dir, const Array<OneD, const NekDouble> &inarray,
272{
273 ASSERTL1((dir == 0) || (dir == 1) || (dir == 2), "Invalid direction.");
274 ASSERTL1((dir == 2) ? (m_geom->GetCoordim() == 3) : true,
275 "Invalid direction.");
276
277 int nquad0 = m_base[0]->GetNumPoints();
278 int nquad1 = m_base[1]->GetNumPoints();
279 int nqtot = nquad0 * nquad1;
280 int wspsize = max(nqtot, m_ncoeffs);
281
283 m_metricinfo->GetDerivFactors(GetPointsKeys());
284
285 Array<OneD, NekDouble> tmp0(4 * wspsize);
286 Array<OneD, NekDouble> tmp3(tmp0 + wspsize);
287 Array<OneD, NekDouble> gfac0(tmp0 + 2 * wspsize);
288 Array<OneD, NekDouble> gfac1(tmp0 + 3 * wspsize);
289
290 Array<OneD, NekDouble> tmp1 = outarray[0];
291 Array<OneD, NekDouble> tmp2 = outarray[1];
292
293 const Array<OneD, const NekDouble> &z0 = m_base[0]->GetZ();
294 const Array<OneD, const NekDouble> &z1 = m_base[1]->GetZ();
295
296 // set up geometric factor: 2/(1-z1)
297 for (int i = 0; i < nquad1; ++i)
298 {
299 gfac0[i] = 2.0 / (1 - z1[i]);
300 }
301 for (int i = 0; i < nquad0; ++i)
302 {
303 gfac1[i] = 0.5 * (1 + z0[i]);
304 }
305
306 for (int i = 0; i < nquad1; ++i)
307 {
308 Vmath::Smul(nquad0, gfac0[i], &inarray[0] + i * nquad0, 1,
309 &tmp0[0] + i * nquad0, 1);
310 }
311
312 for (int i = 0; i < nquad1; ++i)
313 {
314 Vmath::Vmul(nquad0, &gfac1[0], 1, &tmp0[0] + i * nquad0, 1,
315 &tmp1[0] + i * nquad0, 1);
316 }
317
318 if (m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
319 {
320 Vmath::Vmul(nqtot, &df[2 * dir][0], 1, &tmp0[0], 1, &tmp0[0], 1);
321 Vmath::Vmul(nqtot, &df[2 * dir + 1][0], 1, &tmp1[0], 1, &tmp1[0], 1);
322 Vmath::Vmul(nqtot, &df[2 * dir + 1][0], 1, &inarray[0], 1, &tmp2[0], 1);
323 }
324 else
325 {
326 Vmath::Smul(nqtot, df[2 * dir][0], tmp0, 1, tmp0, 1);
327 Vmath::Smul(nqtot, df[2 * dir + 1][0], tmp1, 1, tmp1, 1);
328 Vmath::Smul(nqtot, df[2 * dir + 1][0], inarray, 1, tmp2, 1);
329 }
330 Vmath::Vadd(nqtot, tmp0, 1, tmp1, 1, tmp1, 1);
331}
332
334{
335
337 m_base[0]->GetBasisKey(), m_base[1]->GetBasisKey(),
339}
340
342{
344 m_base[0]->GetPointsKey());
346 m_base[1]->GetPointsKey());
347
349 bkey0, bkey1, m_nodalPointsKey.GetPointsType());
350}
351
353 Array<OneD, NekDouble> &coords_1,
354 Array<OneD, NekDouble> &coords_2)
355{
356 Expansion::v_GetCoords(coords_0, coords_1, coords_2);
357}
358
361{
362 int i;
363
364 ASSERTL1(Lcoords[0] >= -1.0 && Lcoords[1] <= 1.0 && Lcoords[1] >= -1.0 &&
365 Lcoords[1] <= 1.0,
366 "Local coordinates are not in region [-1,1]");
367
368 m_geom->FillGeom();
369
370 for (i = 0; i < m_geom->GetCoordim(); ++i)
371 {
372 coords[i] = m_geom->GetCoord(i, Lcoords);
373 }
374}
375
377 const Array<OneD, const NekDouble> &coord,
378 const Array<OneD, const NekDouble> &physvals)
379
380{
382
383 ASSERTL0(m_geom, "m_geom not defined");
384 m_geom->GetLocCoords(coord, Lcoord);
385
386 return StdExpansion2D::v_PhysEvaluate(Lcoord, physvals);
387}
388
390{
391 int i;
392 const SpatialDomains::GeomFactorsSharedPtr &geomFactors =
393 GetGeom()->GetMetricInfo();
394 const SpatialDomains::GeomType type = geomFactors->GetGtype();
395
398 geomFactors->GetDerivFactors(ptsKeys);
399 const Array<OneD, const NekDouble> &jac = geomFactors->GetJac(ptsKeys);
400 int nqe = m_base[0]->GetNumPoints();
401 int dim = GetCoordim();
402
405 for (i = 0; i < dim; ++i)
406 {
407 normal[i] = Array<OneD, NekDouble>(nqe);
408 }
409
410 size_t nqb = nqe;
411 size_t nbnd = edge;
414
415 // Regular geometry case
416 if ((type == SpatialDomains::eRegular) ||
418 {
419 NekDouble fac;
420 // Set up normals
421 switch (edge)
422 {
423 case 0:
424 for (i = 0; i < GetCoordim(); ++i)
425 {
426 Vmath::Fill(nqe, -df[2 * i + 1][0], normal[i], 1);
427 }
428 break;
429 case 1:
430 for (i = 0; i < GetCoordim(); ++i)
431 {
432 Vmath::Fill(nqe, df[2 * i + 1][0] + df[2 * i][0], normal[i],
433 1);
434 }
435 break;
436 case 2:
437 for (i = 0; i < GetCoordim(); ++i)
438 {
439 Vmath::Fill(nqe, -df[2 * i][0], normal[i], 1);
440 }
441 break;
442 default:
443 ASSERTL0(false, "Edge is out of range (edge < 3)");
444 }
445
446 // normalise
447 fac = 0.0;
448 for (i = 0; i < GetCoordim(); ++i)
449 {
450 fac += normal[i][0] * normal[i][0];
451 }
452 fac = 1.0 / sqrt(fac);
453
454 Vmath::Fill(nqb, fac, length, 1);
455
456 for (i = 0; i < GetCoordim(); ++i)
457 {
458 Vmath::Smul(nqe, fac, normal[i], 1, normal[i], 1);
459 }
460 }
461 else // Set up deformed normals
462 {
463 int j;
464
465 int nquad0 = ptsKeys[0].GetNumPoints();
466 int nquad1 = ptsKeys[1].GetNumPoints();
467
469
470 Array<OneD, NekDouble> normals(GetCoordim() * max(nquad0, nquad1), 0.0);
471 Array<OneD, NekDouble> edgejac(GetCoordim() * max(nquad0, nquad1), 0.0);
472
473 // Extract Jacobian along edges and recover local
474 // derivates (dx/dr) for polynomial interpolation by
475 // multiplying m_gmat by jacobian
476 switch (edge)
477 {
478 case 0:
479 for (j = 0; j < nquad0; ++j)
480 {
481 edgejac[j] = jac[j];
482 for (i = 0; i < GetCoordim(); ++i)
483 {
484 normals[i * nquad0 + j] =
485 -df[2 * i + 1][j] * edgejac[j];
486 }
487 }
488 from_key = ptsKeys[0];
489 break;
490 case 1:
491 for (j = 0; j < nquad1; ++j)
492 {
493 edgejac[j] = jac[nquad0 * j + nquad0 - 1];
494 for (i = 0; i < GetCoordim(); ++i)
495 {
496 normals[i * nquad1 + j] =
497 (df[2 * i][nquad0 * j + nquad0 - 1] +
498 df[2 * i + 1][nquad0 * j + nquad0 - 1]) *
499 edgejac[j];
500 }
501 }
502 from_key = ptsKeys[1];
503 break;
504 case 2:
505 for (j = 0; j < nquad1; ++j)
506 {
507 edgejac[j] = jac[nquad0 * j];
508 for (i = 0; i < GetCoordim(); ++i)
509 {
510 normals[i * nquad1 + j] =
511 -df[2 * i][nquad0 * j] * edgejac[j];
512 }
513 }
514 from_key = ptsKeys[1];
515 break;
516 default:
517 ASSERTL0(false, "edge is out of range (edge < 3)");
518 }
519
520 int nq = from_key.GetNumPoints();
521 Array<OneD, NekDouble> work(nqe, 0.0);
522
523 // interpolate Jacobian and invert
524 LibUtilities::Interp1D(from_key, jac, m_base[0]->GetPointsKey(), work);
525 Vmath::Sdiv(nq, 1.0, &work[0], 1, &work[0], 1);
526
527 // interpolate
528 for (i = 0; i < GetCoordim(); ++i)
529 {
530 LibUtilities::Interp1D(from_key, &normals[i * nq],
531 m_base[0]->GetPointsKey(), &normal[i][0]);
532 Vmath::Vmul(nqe, work, 1, normal[i], 1, normal[i], 1);
533 }
534
535 // normalise normal vectors
536 Vmath::Zero(nqe, work, 1);
537 for (i = 0; i < GetCoordim(); ++i)
538 {
539 Vmath::Vvtvp(nqe, normal[i], 1, normal[i], 1, work, 1, work, 1);
540 }
541
542 Vmath::Vsqrt(nqe, work, 1, work, 1);
543 Vmath::Sdiv(nqe, 1.0, work, 1, work, 1);
544
545 Vmath::Vcopy(nqb, work, 1, length, 1);
546
547 for (i = 0; i < GetCoordim(); ++i)
548 {
549 Vmath::Vmul(nqe, normal[i], 1, work, 1, normal[i], 1);
550 }
551
552 // Reverse direction so that points are in
553 // anticlockwise direction if edge >=2
554 if (edge >= 2)
555 {
556 for (i = 0; i < GetCoordim(); ++i)
557 {
558 Vmath::Reverse(nqe, normal[i], 1, normal[i], 1);
559 }
560 }
561 }
562}
563
565 const NekDouble *data, const std::vector<unsigned int> &nummodes,
566 const int mode_offset, NekDouble *coeffs,
567 [[maybe_unused]] std::vector<LibUtilities::BasisType> &fromType)
568{
570 Expansion::ExtractDataToCoeffs(data, nummodes, mode_offset, &modes[0],
571 fromType);
572
574 ModalToNodal(modes, nodes);
575}
576
578 const int edge, const StdRegions::StdExpansionSharedPtr &EdgeExp,
579 const Array<OneD, const NekDouble> &inarray,
581{
582 int nquad0 = m_base[0]->GetNumPoints();
583 int nquad1 = m_base[1]->GetNumPoints();
584 int nt = 0;
585 // Extract in Cartesian direction because we have to deal with
586 // e.g. Gauss-Radau points.
587 switch (edge)
588 {
589 case 0:
590 Vmath::Vcopy(nquad0, &(inarray[0]), 1, &(outarray[0]), 1);
591 nt = nquad0;
592 break;
593 case 1:
594 Vmath::Vcopy(nquad1, &(inarray[0]) + (nquad0 - 1), nquad0,
595 &(outarray[0]), 1);
596 nt = nquad1;
597 break;
598 case 2:
599 Vmath::Vcopy(nquad1, &(inarray[0]), nquad0, &(outarray[0]), 1);
600 nt = nquad1;
601 break;
602 default:
603 ASSERTL0(false, "edge value (< 3) is out of range");
604 break;
605 }
606
607 ASSERTL1(EdgeExp->GetBasis(0)->GetPointsType() ==
609 "Edge expansion should be GLL");
610
611 // Interpolate if required
612 if (m_base[edge ? 1 : 0]->GetPointsKey() !=
613 EdgeExp->GetBasis(0)->GetPointsKey())
614 {
615 Array<OneD, NekDouble> outtmp(max(nquad0, nquad1));
616
617 Vmath::Vcopy(nt, outarray, 1, outtmp, 1);
618
619 LibUtilities::Interp1D(m_base[edge ? 1 : 0]->GetPointsKey(), outtmp,
620 EdgeExp->GetBasis(0)->GetPointsKey(), outarray);
621 }
622
623 if (orient == StdRegions::eNoOrientation)
624 {
625 orient = GetTraceOrient(edge);
626 }
627
628 // Reverse data if necessary
629 if (orient == StdRegions::eBackwards)
630 {
631 Vmath::Reverse(EdgeExp->GetNumPoints(0), &outarray[0], 1, &outarray[0],
632 1);
633 }
634}
635
637{
638 DNekMatSharedPtr returnval;
639
640 switch (mkey.GetMatrixType())
641 {
648 returnval = Expansion2D::v_GenMatrix(mkey);
649 break;
650 default:
651 returnval = StdNodalTriExp::v_GenMatrix(mkey);
652 break;
653 }
654 return returnval;
655}
656
658 const StdRegions::StdMatrixKey &mkey)
659{
660 LibUtilities::BasisKey bkey0 = m_base[0]->GetBasisKey();
661 LibUtilities::BasisKey bkey1 = m_base[1]->GetBasisKey();
665
666 return tmp->GetStdMatrix(mkey);
667}
668
670{
671 return m_matrixManager[mkey];
672}
674 const MatrixKey &mkey)
675{
676 return m_staticCondMatrixManager[mkey];
677}
679{
680 m_matrixManager.DeleteObject(mkey);
681}
682
684 Array<OneD, NekDouble> &outarray,
685 const StdRegions::StdMatrixKey &mkey)
686{
687 StdExpansion::MassMatrixOp_MatFree(inarray, outarray, mkey);
688}
689
691 const Array<OneD, const NekDouble> &inarray,
693{
694 StdExpansion::LaplacianMatrixOp_MatFree_GenericImpl(inarray, outarray,
695 mkey);
696}
697
699 const int k1, const int k2, const Array<OneD, const NekDouble> &inarray,
701{
702 StdExpansion::LaplacianMatrixOp_MatFree(k1, k2, inarray, outarray, mkey);
703}
704
706 const int i, const Array<OneD, const NekDouble> &inarray,
708{
709 StdExpansion::WeakDerivMatrixOp_MatFree(i, inarray, outarray, mkey);
710}
711
713 const Array<OneD, const NekDouble> &inarray,
715{
716 StdExpansion::HelmholtzMatrixOp_MatFree_GenericImpl(inarray, outarray,
717 mkey);
718}
719
720} // namespace Nektar::LocalRegions
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:208
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:242
Describes the specification for a Basis.
Definition: Basis.h:45
Defines a specification for a set of points.
Definition: Points.h:50
PointsType GetPointsType() const
Definition: Points.h:90
size_t GetNumPoints() const
Definition: Points.h:85
DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey) override
std::map< int, NormalVector > m_traceNormals
Definition: Expansion.h:276
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:286
SpatialDomains::GeometrySharedPtr GetGeom() const
Definition: Expansion.cpp:167
SpatialDomains::GeometrySharedPtr m_geom
Definition: Expansion.h:273
void AlignVectorToCollapsedDir(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
Definition: Expansion.h:151
void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3) override
Definition: Expansion.cpp:534
SpatialDomains::GeomFactorsSharedPtr m_metricinfo
Definition: Expansion.h:274
void ExtractDataToCoeffs(const NekDouble *data, const std::vector< unsigned int > &nummodes, const int nmodes_offset, NekDouble *coeffs, std::vector< LibUtilities::BasisType > &fromType)
Definition: Expansion.cpp:106
StdRegions::Orientation GetTraceOrient(int trace)
Definition: Expansion.h:168
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition: NodalTriExp.h:177
void v_IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
void v_PhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray) override
Calculate the derivative of the physical points.
Definition: NodalTriExp.cpp:93
NekDouble v_PhysEvaluate(const Array< OneD, const NekDouble > &coord, const Array< OneD, const NekDouble > &physvals) override
This function evaluates the expansion at a single (arbitrary) point of the domain.
void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Calculates the inner product of a given function f with the different modes of the expansion.
DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey) override
void v_AlignVectorToCollapsedDir(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray) override
NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray) override
Integrates the specified function over the domain.
Definition: NodalTriExp.cpp:70
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
Definition: NodalTriExp.h:179
void v_MassMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
void v_GetTracePhysVals(const int edge, const StdRegions::StdExpansionSharedPtr &EdgeExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, StdRegions::Orientation orient) override
void v_HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
void v_ExtractDataToCoeffs(const NekDouble *data, const std::vector< unsigned int > &nummodes, const int mode_offset, NekDouble *coeffs, std::vector< LibUtilities::BasisType > &fromType) override
void v_FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Transform a given function from physical quadrature space to coefficient space.
StdRegions::StdExpansionSharedPtr v_GetStdExp(void) const override
void v_GetCoords(Array< OneD, NekDouble > &coords_0, Array< OneD, NekDouble > &coords_1=NullNekDouble1DArray, Array< OneD, NekDouble > &coords_2=NullNekDouble1DArray) override
void v_DropLocMatrix(const MatrixKey &mkey) override
void v_LaplacianMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
void v_WeakDerivMatrixOp(const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
DNekScalMatSharedPtr v_GetLocMatrix(const MatrixKey &mkey) override
StdRegions::StdExpansionSharedPtr v_GetLinStdExp(void) const override
NodalTriExp(const LibUtilities::BasisKey &Ba, const LibUtilities::BasisKey &Bb, const LibUtilities::PointsType Ntype, const SpatialDomains::TriGeomSharedPtr &geom)
Constructor using BasisKey class for quadrature points and order definition.
Definition: NodalTriExp.cpp:42
DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix(const MatrixKey &mkey) override
void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true) override
DNekMatSharedPtr v_CreateStdMatrix(const StdRegions::StdMatrixKey &mkey) override
void v_ComputeTraceNormal(const int edge) override
void v_GetCoord(const Array< OneD, const NekDouble > &lcoord, Array< OneD, NekDouble > &coord) override
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
void IProductWRTBase_SumFacKernel(const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0=true, bool doCheckCollDir1=true)
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
Definition: StdExpansion.h:156
const LibUtilities::PointsKeyVector GetPointsKeys() const
void IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
this function calculates the inner product of a given function f with the different modes of the expa...
Definition: StdExpansion.h:537
LibUtilities::ShapeType DetShapeType() const
This function returns the shape of the expansion domain.
Definition: StdExpansion.h:370
void MultiplyByQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: StdExpansion.h:732
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)
Definition: StdExpansion.h:858
Array< OneD, LibUtilities::BasisSharedPtr > m_base
MatrixType GetMatrixType() const
Definition: StdMatrixKey.h:83
void NodalToModalTranspose(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void ModalToNodal(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
LibUtilities::PointsKey m_nodalPointsKey
static void Daxpy(const int &n, const double &alpha, const double *x, const int &incx, const double *y, const int &incy)
BLAS level 1: y = alpha x plus y.
Definition: Blas.hpp:135
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
std::vector< PointsKey > PointsKeyVector
Definition: Points.h:231
@ eGaussLobattoLegendre
1D Gauss-Lobatto-Legendre quadrature points
Definition: PointsType.h:51
std::shared_ptr< GeomFactors > GeomFactorsSharedPtr
Pointer to a GeomFactors object.
Definition: GeomFactors.h:60
GeomType
Indicates the type of element geometry.
@ eRegular
Geometry is straight-sided with constant geometric factors.
@ eMovingRegular
Currently unused.
@ eDeformed
Geometry is curved or has non-constant factors.
std::shared_ptr< TriGeom > TriGeomSharedPtr
Definition: TriGeom.h:56
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
std::shared_ptr< StdNodalTriExp > StdNodalTriExpSharedPtr
static ConstFactorMap NullConstFactorMap
Definition: StdRegions.hpp:431
static VarCoeffMap NullVarCoeffMap
Definition: StdRegions.hpp:376
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
std::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
Definition: NekTypeDefs.hpp:79
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:75
double NekDouble
void Vsqrt(int n, const T *x, const int incx, T *y, const int incy)
sqrt y = sqrt(x)
Definition: Vmath.hpp:340
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 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 Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
Definition: Vmath.hpp:180
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
Definition: Vmath.hpp:100
void Sdiv(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha/x.
Definition: Vmath.hpp:154
void Zero(int n, T *x, const int incx)
Zero vector.
Definition: Vmath.hpp:273
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
Definition: Vmath.hpp:54
void Reverse(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.hpp:844
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.hpp:825
STL namespace.
scalarT< T > sqrt(scalarT< T > in)
Definition: scalar.hpp:285