Nektar++
Loading...
Searching...
No Matches
TetExp.cpp
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: TetExp.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:
32//
33///////////////////////////////////////////////////////////////////////////////
34
37#include <LocalRegions/TetExp.h>
39
40using namespace std;
41
43{
44/**
45 * @class TetExp
46 * Defines a Tetrahedral local expansion.
47 */
48
49/**
50 * \brief Constructor using BasisKey class for quadrature points and
51 * order definition
52 *
53 * @param Ba Basis key for first coordinate.
54 * @param Bb Basis key for second coordinate.
55 * @param Bc Basis key for third coordinate.
56 */
58 const LibUtilities::BasisKey &Bb,
59 const LibUtilities::BasisKey &Bc,
61 : StdExpansion(LibUtilities::StdTetData::getNumberOfCoefficients(
62 Ba.GetNumModes(), Bb.GetNumModes(), Bc.GetNumModes()),
63 3, Ba, Bb, Bc),
64 StdExpansion3D(LibUtilities::StdTetData::getNumberOfCoefficients(
65 Ba.GetNumModes(), Bb.GetNumModes(), Bc.GetNumModes()),
66 Ba, Bb, Bc),
67 StdTetExp(Ba, Bb, Bc), Expansion(geom), Expansion3D(geom),
68 m_matrixManager(
69 std::bind(&Expansion3D::CreateMatrix, this, std::placeholders::_1)),
70 m_staticCondMatrixManager(std::bind(&Expansion::CreateStaticCondMatrix,
71 this, std::placeholders::_1))
72{
73}
74
75/**
76 * \brief Copy Constructor
77 */
79 : StdRegions::StdExpansion(T), StdRegions::StdExpansion3D(T),
80 StdRegions::StdTetExp(T), Expansion(T), Expansion3D(T),
81 m_matrixManager(T.m_matrixManager),
82 m_staticCondMatrixManager(T.m_staticCondMatrixManager)
83{
84}
85
86//-----------------------------
87// Inner product functions
88//-----------------------------
89/**
90 * @brief Calculates the inner product \f$ I_{pqr} = (u,
91 * \partial_{x_i} \phi_{pqr}) \f$.
92 *
93 * The derivative of the basis functions is performed using the chain
94 * rule in order to incorporate the geometric factors. Assuming that
95 * the basis functions are a tensor product
96 * \f$\phi_{pqr}(\eta_1,\eta_2,\eta_3) =
97 * \phi_1(\eta_1)\phi_2(\eta_2)\phi_3(\eta_3)\f$, this yields the
98 * result
99 *
100 * \f[
101 * I_{pqr} = \sum_{j=1}^3 \left(u, \frac{\partial u}{\partial \eta_j}
102 * \frac{\partial \eta_j}{\partial x_i}\right)
103 * \f]
104 *
105 * In the prismatic element, we must also incorporate a second set of
106 * geometric factors which incorporate the collapsed co-ordinate
107 * system, so that
108 *
109 * \f[ \frac{\partial\eta_j}{\partial x_i} = \sum_{k=1}^3
110 * \frac{\partial\eta_j}{\partial\xi_k}\frac{\partial\xi_k}{\partial
111 * x_i} \f]
112 *
113 * These derivatives can be found on p152 of Sherwin & Karniadakis.
114 *
115 * @param dir Direction in which to take the derivative.
116 * @param inarray The function \f$ u \f$.
117 * @param outarray Value of the inner product.
118 */
120 const Array<OneD, const NekDouble> &inarray,
121 Array<OneD, NekDouble> &outarray)
122{
123 const int nquad0 = m_base[0]->GetNumPoints();
124 const int nquad1 = m_base[1]->GetNumPoints();
125 const int nquad2 = m_base[2]->GetNumPoints();
126 const int nqtot = nquad0 * nquad1 * nquad2;
127
128 Array<OneD, NekDouble> tmp2(nqtot);
129 Array<OneD, NekDouble> tmp3(nqtot);
130 Array<OneD, NekDouble> tmp4(nqtot);
132
134 tmp2D[0] = tmp2;
135 tmp2D[1] = tmp3;
136 tmp2D[2] = tmp4;
137
138 const Array<OneD, const NekDouble> &jac = m_geomFactors->GetJac();
139 bool Deformed = (m_geomFactors->GetGtype() == SpatialDomains::eDeformed);
140
141 v_AlignVectorToCollapsedDir(dir, inarray, tmp2D);
142
143 v_IProductWRTBaseKernel(m_base[0]->GetDbdata(), m_base[1]->GetBdata(),
144 m_base[2]->GetBdata(), tmp2, outarray, jac,
145 Deformed);
146
147 v_IProductWRTBaseKernel(m_base[0]->GetBdata(), m_base[1]->GetDbdata(),
148 m_base[2]->GetBdata(), tmp3, tmp6, jac, Deformed);
149 Vmath::Vadd(m_ncoeffs, tmp6, 1, outarray, 1, outarray, 1);
150
151 v_IProductWRTBaseKernel(m_base[0]->GetBdata(), m_base[1]->GetBdata(),
152 m_base[2]->GetDbdata(), tmp4, tmp6, jac, Deformed);
153 Vmath::Vadd(m_ncoeffs, tmp6, 1, outarray, 1, outarray, 1);
154}
155
157 const int dir, const Array<OneD, const NekDouble> &inarray,
159{
160 int i, j;
161
162 const int nquad0 = m_base[0]->GetNumPoints();
163 const int nquad1 = m_base[1]->GetNumPoints();
164 const int nquad2 = m_base[2]->GetNumPoints();
165 const int nqtot = nquad0 * nquad1 * nquad2;
166
167 const Array<OneD, const NekDouble> &z0 = m_base[0]->GetZ();
168 const Array<OneD, const NekDouble> &z1 = m_base[1]->GetZ();
169 const Array<OneD, const NekDouble> &z2 = m_base[2]->GetZ();
170
171 Array<OneD, NekDouble> tmp2(nqtot);
172 Array<OneD, NekDouble> tmp3(nqtot);
173
174 const Array<TwoD, const NekDouble> &df = m_geomFactors->GetDerivFactors();
175
176 if (m_geomFactors->GetGtype() == SpatialDomains::eDeformed)
177 {
178 Vmath::Vmul(nqtot, &df[3 * dir][0], 1, inarray.data(), 1, tmp2.data(),
179 1);
180 Vmath::Vmul(nqtot, &df[3 * dir + 1][0], 1, inarray.data(), 1,
181 tmp3.data(), 1);
182 Vmath::Vmul(nqtot, &df[3 * dir + 2][0], 1, inarray.data(), 1,
183 outarray[2].data(), 1);
184 }
185 else
186 {
187 Vmath::Smul(nqtot, df[3 * dir][0], inarray.data(), 1, tmp2.data(), 1);
188 Vmath::Smul(nqtot, df[3 * dir + 1][0], inarray.data(), 1, tmp3.data(),
189 1);
190 Vmath::Smul(nqtot, df[3 * dir + 2][0], inarray.data(), 1,
191 outarray[2].data(), 1);
192 }
193
194 NekDouble g0, g1, g1a, g2, g3;
195 int k, cnt;
196
197 for (cnt = 0, k = 0; k < nquad2; ++k)
198 {
199 g2 = 2.0 / (1.0 - z2[k]);
200 for (j = 0; j < nquad1; ++j)
201 {
202 g1 = g2 / (1.0 - z1[j]);
203 g0 = 2.0 * g1;
204 g3 = (1.0 + z1[j]) * g2 * 0.5;
205
206 for (i = 0; i < nquad0; ++i, ++cnt)
207 {
208 g1a = g1 * (1 + z0[i]);
209
210 outarray[0][cnt] =
211 g0 * tmp2[cnt] + g1a * (tmp3[cnt] + outarray[2][cnt]);
212
213 outarray[1][cnt] = g2 * tmp3[cnt] + g3 * outarray[2][cnt];
214 }
215 }
216 }
217}
218
219//-----------------------------
220// Evaluation functions
221//-----------------------------
223 const Array<OneD, NekDouble> &coord,
224 const Array<OneD, const NekDouble> &inarray,
225 std::array<NekDouble, 3> &firstOrderDerivs)
226{
227 Array<OneD, NekDouble> Lcoord(3);
228 ASSERTL0(m_geom, "m_geom not defined");
229 m_geom->GetLocCoords(coord, Lcoord);
230 return StdTetExp::v_PhysEvalFirstDeriv(Lcoord, inarray, firstOrderDerivs);
231}
232
233/**
234 * \brief Get the coordinates "coords" at the local coordinates "Lcoords"
235 */
238{
239 int i;
240
241 ASSERTL1(Lcoords[0] <= -1.0 && Lcoords[0] >= 1.0 && Lcoords[1] <= -1.0 &&
242 Lcoords[1] >= 1.0 && Lcoords[2] <= -1.0 && Lcoords[2] >= 1.0,
243 "Local coordinates are not in region [-1,1]");
244
245 // m_geom->FillGeom(); // TODO: implement FillGeom()
246
247 for (i = 0; i < m_geom->GetCoordim(); ++i)
248 {
249 coords[i] = m_geom->GetCoord(i, Lcoords);
250 }
251}
252
254 Array<OneD, NekDouble> &coords_1,
255 Array<OneD, NekDouble> &coords_2)
256{
257 Expansion::v_GetCoords(coords_0, coords_1, coords_2);
258}
259
260//-----------------------------
261// Helper functions
262//-----------------------------
263
265{
267 m_base[0]->GetBasisKey(), m_base[1]->GetBasisKey(),
268 m_base[2]->GetBasisKey());
269}
270
272{
274 m_base[0]->GetPointsKey());
276 m_base[1]->GetPointsKey());
278 m_base[2]->GetPointsKey());
279
281 bkey2);
282}
283
285 const NekDouble *data, const std::vector<unsigned int> &nummodes,
286 const int mode_offset, NekDouble *coeffs,
287 [[maybe_unused]] std::vector<LibUtilities::BasisType> &fromType)
288{
289 int data_order0 = nummodes[mode_offset];
290 int fillorder0 = min(m_base[0]->GetNumModes(), data_order0);
291 int data_order1 = nummodes[mode_offset + 1];
292 int order1 = m_base[1]->GetNumModes();
293 int fillorder1 = min(order1, data_order1);
294 int data_order2 = nummodes[mode_offset + 2];
295 int order2 = m_base[2]->GetNumModes();
296 int fillorder2 = min(order2, data_order2);
297
298 switch (m_base[0]->GetBasisType())
299 {
301 {
302 int i, j;
303 int cnt = 0;
304 int cnt1 = 0;
305
307 "Extraction routine not set up for this basis");
309 "Extraction routine not set up for this basis");
310
311 Vmath::Zero(m_ncoeffs, coeffs, 1);
312 for (j = 0; j < fillorder0; ++j)
313 {
314 for (i = 0; i < fillorder1 - j; ++i)
315 {
316 Vmath::Vcopy(fillorder2 - j - i, &data[cnt], 1,
317 &coeffs[cnt1], 1);
318 cnt += data_order2 - j - i;
319 cnt1 += order2 - j - i;
320 }
321
322 // count out data for j iteration
323 for (i = fillorder1 - j; i < data_order1 - j; ++i)
324 {
325 cnt += data_order2 - j - i;
326 }
327
328 for (i = fillorder1 - j; i < order1 - j; ++i)
329 {
330 cnt1 += order2 - j - i;
331 }
332 }
333 }
334 break;
335 default:
336 ASSERTL0(false, "basis is either not set up or not "
337 "hierarchicial");
338 }
339}
340
341/**
342 * \brief Returns the physical values at the quadrature points of a face
343 */
344void TetExp::v_GetTracePhysMap(const int face, Array<OneD, int> &outarray)
345{
346 int nquad0 = m_base[0]->GetNumPoints();
347 int nquad1 = m_base[1]->GetNumPoints();
348 int nquad2 = m_base[2]->GetNumPoints();
349
350 int nq0 = 0;
351 int nq1 = 0;
352
353 // get forward aligned faces.
354 switch (face)
355 {
356 case 0:
357 {
358 nq0 = nquad0;
359 nq1 = nquad1;
360 if (outarray.size() != nq0 * nq1)
361 {
362 outarray = Array<OneD, int>(nq0 * nq1);
363 }
364
365 for (int i = 0; i < nquad0 * nquad1; ++i)
366 {
367 outarray[i] = i;
368 }
369
370 break;
371 }
372 case 1:
373 {
374 nq0 = nquad0;
375 nq1 = nquad2;
376 if (outarray.size() != nq0 * nq1)
377 {
378 outarray = Array<OneD, int>(nq0 * nq1);
379 }
380
381 // Direction A and B positive
382 for (int k = 0; k < nquad2; k++)
383 {
384 for (int i = 0; i < nquad0; ++i)
385 {
386 outarray[k * nquad0 + i] = (nquad0 * nquad1 * k) + i;
387 }
388 }
389 break;
390 }
391 case 2:
392 {
393 nq0 = nquad1;
394 nq1 = nquad2;
395 if (outarray.size() != nq0 * nq1)
396 {
397 outarray = Array<OneD, int>(nq0 * nq1);
398 }
399
400 // Directions A and B positive
401 for (int j = 0; j < nquad1 * nquad2; ++j)
402 {
403 outarray[j] = nquad0 - 1 + j * nquad0;
404 }
405 break;
406 }
407 case 3:
408 {
409 nq0 = nquad1;
410 nq1 = nquad2;
411 if (outarray.size() != nq0 * nq1)
412 {
413 outarray = Array<OneD, int>(nq0 * nq1);
414 }
415
416 // Directions A and B positive
417 for (int j = 0; j < nquad1 * nquad2; ++j)
418 {
419 outarray[j] = j * nquad0;
420 }
421 }
422 break;
423 default:
424 ASSERTL0(false, "face value (> 3) is out of range");
425 break;
426 }
427}
428
429/**
430 * \brief Compute the normal of a triangular face
431 */
433{
434 int i;
436 for (int i = 0; i < ptsKeys.size(); ++i)
437 {
438 // Need at least 2 points for computing normals
439 if (ptsKeys[i].GetNumPoints() == 1)
440 {
441 LibUtilities::PointsKey pKey(2, ptsKeys[i].GetPointsType());
442 ptsKeys[i] = pKey;
443 }
444 }
445
446 SpatialDomains::GeomType type = m_geomFactors->GetGtype();
448 m_geomFactors->ComputeDerivFactors(ptsKeys);
450 m_geomFactors->ComputeJac(ptsKeys);
451
452 LibUtilities::BasisKey tobasis0 = GetTraceBasisKey(face, 0);
453 LibUtilities::BasisKey tobasis1 = GetTraceBasisKey(face, 1);
454
455 // number of face quadrature points
456 int nq_face = tobasis0.GetNumPoints() * tobasis1.GetNumPoints();
457
458 int vCoordDim = GetCoordim();
459
462 for (i = 0; i < vCoordDim; ++i)
463 {
464 normal[i] = Array<OneD, NekDouble>(nq_face);
465 }
466
467 size_t nqb = nq_face;
468 size_t nbnd = face;
471
472 // Regular geometry case
473 if (type == SpatialDomains::eRegular ||
475 {
476 NekDouble fac;
477
478 // Set up normals
479 switch (face)
480 {
481 case 0:
482 {
483 for (i = 0; i < vCoordDim; ++i)
484 {
485 normal[i][0] = -df[3 * i + 2][0];
486 }
487
488 break;
489 }
490 case 1:
491 {
492 for (i = 0; i < vCoordDim; ++i)
493 {
494 normal[i][0] = -df[3 * i + 1][0];
495 }
496
497 break;
498 }
499 case 2:
500 {
501 for (i = 0; i < vCoordDim; ++i)
502 {
503 normal[i][0] =
504 df[3 * i][0] + df[3 * i + 1][0] + df[3 * i + 2][0];
505 }
506
507 break;
508 }
509 case 3:
510 {
511 for (i = 0; i < vCoordDim; ++i)
512 {
513 normal[i][0] = -df[3 * i][0];
514 }
515 break;
516 }
517 default:
518 ASSERTL0(false, "face is out of range (edge < 3)");
519 }
520
521 // normalise
522 fac = 0.0;
523 for (i = 0; i < vCoordDim; ++i)
524 {
525 fac += normal[i][0] * normal[i][0];
526 }
527 fac = 1.0 / sqrt(fac);
528 Vmath::Fill(nqb, fac, length, 1);
529
530 for (i = 0; i < vCoordDim; ++i)
531 {
532 Vmath::Fill(nq_face, fac * normal[i][0], normal[i], 1);
533 }
534 }
535 else
536 {
537 // Set up deformed normals
538 int j, k;
539
540 int nq0 = ptsKeys[0].GetNumPoints();
541 int nq1 = ptsKeys[1].GetNumPoints();
542 int nq2 = ptsKeys[2].GetNumPoints();
543 int nqtot;
544 int nq01 = nq0 * nq1;
545
546 // number of elemental quad points
547 if (face == 0)
548 {
549 nqtot = nq01;
550 }
551 else if (face == 1)
552 {
553 nqtot = nq0 * nq2;
554 }
555 else
556 {
557 nqtot = nq1 * nq2;
558 }
559
562
563 Array<OneD, NekDouble> faceJac(nqtot);
564 Array<OneD, NekDouble> normals(vCoordDim * nqtot, 0.0);
565
566 // Extract Jacobian along face and recover local derivates
567 // (dx/dr) for polynomial interpolation by multiplying m_gmat by
568 // jacobian
569 switch (face)
570 {
571 case 0:
572 {
573 for (j = 0; j < nq01; ++j)
574 {
575 normals[j] = -df[2][j] * jac[j];
576 normals[nqtot + j] = -df[5][j] * jac[j];
577 normals[2 * nqtot + j] = -df[8][j] * jac[j];
578 faceJac[j] = jac[j];
579 }
580
581 points0 = ptsKeys[0];
582 points1 = ptsKeys[1];
583 break;
584 }
585
586 case 1:
587 {
588 for (j = 0; j < nq0; ++j)
589 {
590 for (k = 0; k < nq2; ++k)
591 {
592 int tmp = j + nq01 * k;
593 normals[j + k * nq0] = -df[1][tmp] * jac[tmp];
594 normals[nqtot + j + k * nq0] = -df[4][tmp] * jac[tmp];
595 normals[2 * nqtot + j + k * nq0] =
596 -df[7][tmp] * jac[tmp];
597 faceJac[j + k * nq0] = jac[tmp];
598 }
599 }
600
601 points0 = ptsKeys[0];
602 points1 = ptsKeys[2];
603 break;
604 }
605
606 case 2:
607 {
608 for (j = 0; j < nq1; ++j)
609 {
610 for (k = 0; k < nq2; ++k)
611 {
612 int tmp = nq0 - 1 + nq0 * j + nq01 * k;
613 normals[j + k * nq1] =
614 (df[0][tmp] + df[1][tmp] + df[2][tmp]) * jac[tmp];
615 normals[nqtot + j + k * nq1] =
616 (df[3][tmp] + df[4][tmp] + df[5][tmp]) * jac[tmp];
617 normals[2 * nqtot + j + k * nq1] =
618 (df[6][tmp] + df[7][tmp] + df[8][tmp]) * jac[tmp];
619 faceJac[j + k * nq1] = jac[tmp];
620 }
621 }
622
623 points0 = ptsKeys[1];
624 points1 = ptsKeys[2];
625 break;
626 }
627
628 case 3:
629 {
630 for (j = 0; j < nq1; ++j)
631 {
632 for (k = 0; k < nq2; ++k)
633 {
634 int tmp = j * nq0 + nq01 * k;
635 normals[j + k * nq1] = -df[0][tmp] * jac[tmp];
636 normals[nqtot + j + k * nq1] = -df[3][tmp] * jac[tmp];
637 normals[2 * nqtot + j + k * nq1] =
638 -df[6][tmp] * jac[tmp];
639 faceJac[j + k * nq1] = jac[tmp];
640 }
641 }
642
643 points0 = ptsKeys[1];
644 points1 = ptsKeys[2];
645 break;
646 }
647
648 default:
649 ASSERTL0(false, "face is out of range (face < 3)");
650 }
651
652 Array<OneD, NekDouble> work(nq_face, 0.0);
653 // Interpolate Jacobian and invert
654 LibUtilities::Interp2D(points0, points1, faceJac,
655 tobasis0.GetPointsKey(), tobasis1.GetPointsKey(),
656 work);
657 Vmath::Sdiv(nq_face, 1.0, &work[0], 1, &work[0], 1);
658
659 // Interpolate normal and multiply by inverse Jacobian.
660 for (i = 0; i < vCoordDim; ++i)
661 {
662 LibUtilities::Interp2D(points0, points1, &normals[i * nqtot],
663 tobasis0.GetPointsKey(),
664 tobasis1.GetPointsKey(), &normal[i][0]);
665 Vmath::Vmul(nq_face, work, 1, normal[i], 1, normal[i], 1);
666 }
667
668 // Normalise to obtain unit normals.
669 Vmath::Zero(nq_face, work, 1);
670 for (i = 0; i < GetCoordim(); ++i)
671 {
672 Vmath::Vvtvp(nq_face, normal[i], 1, normal[i], 1, work, 1, work, 1);
673 }
674
675 Vmath::Vsqrt(nq_face, work, 1, work, 1);
676 Vmath::Sdiv(nq_face, 1.0, work, 1, work, 1);
677
678 Vmath::Vcopy(nqb, work, 1, length, 1);
679
680 for (i = 0; i < GetCoordim(); ++i)
681 {
682 Vmath::Vmul(nq_face, normal[i], 1, work, 1, normal[i], 1);
683 }
684 }
685}
686
687//-----------------------------
688// Operator creation functions
689//-----------------------------
691 Array<OneD, NekDouble> &outarray,
692 const StdRegions::StdMatrixKey &mkey)
693{
694 TetExp::v_LaplacianMatrixOp_MatFree(inarray, outarray, mkey);
695}
696
697void TetExp::v_LaplacianMatrixOp(const int k1, const int k2,
698 const Array<OneD, const NekDouble> &inarray,
699 Array<OneD, NekDouble> &outarray,
700 const StdRegions::StdMatrixKey &mkey)
701{
702 StdExpansion::LaplacianMatrixOp_MatFree(k1, k2, inarray, outarray, mkey);
703}
704
706 const StdRegions::StdMatrixKey &mkey)
707{
708 int nq = GetTotPoints();
709
710 // Calculate sqrt of the Jacobian
712 Array<OneD, NekDouble> sqrt_jac(nq);
713 if (m_geomFactors->GetGtype() == SpatialDomains::eDeformed)
714 {
715 Vmath::Vsqrt(nq, jac, 1, sqrt_jac, 1);
716 }
717 else
718 {
719 Vmath::Fill(nq, sqrt(jac[0]), sqrt_jac, 1);
720 }
721
722 // Multiply array by sqrt(Jac)
723 Vmath::Vmul(nq, sqrt_jac, 1, array, 1, array, 1);
724
725 // Apply std region filter
726 StdTetExp::v_SVVLaplacianFilter(array, mkey);
727
728 // Divide by sqrt(Jac)
729 Vmath::Vdiv(nq, array, 1, sqrt_jac, 1, array, 1);
730}
731
732//-----------------------------
733// Matrix creation functions
734//-----------------------------
736{
737 DNekMatSharedPtr returnval;
738
739 switch (mkey.GetMatrixType())
740 {
748 returnval = Expansion3D::v_GenMatrix(mkey);
749 break;
750 default:
751 returnval = StdTetExp::v_GenMatrix(mkey);
752 }
753
754 return returnval;
755}
756
758{
759 LibUtilities::BasisKey bkey0 = m_base[0]->GetBasisKey();
760 LibUtilities::BasisKey bkey1 = m_base[1]->GetBasisKey();
761 LibUtilities::BasisKey bkey2 = m_base[2]->GetBasisKey();
764
765 return tmp->GetStdMatrix(mkey);
766}
767
772
774{
775 m_matrixManager.DeleteObject(mkey);
776}
777
782
784{
785 m_staticCondMatrixManager.DeleteObject(mkey);
786}
787
789 Array<OneD, NekDouble> &outarray,
790 const StdRegions::StdMatrixKey &mkey)
791{
793
794 if (inarray.data() == outarray.data())
795 {
797 Vmath::Vcopy(m_ncoeffs, inarray.data(), 1, tmp.data(), 1);
798
799 Blas::Dgemv('N', m_ncoeffs, m_ncoeffs, mat->Scale(),
800 (mat->GetOwnedMatrix())->GetPtr().data(), m_ncoeffs,
801 tmp.data(), 1, 0.0, outarray.data(), 1);
802 }
803 else
804 {
805 Blas::Dgemv('N', m_ncoeffs, m_ncoeffs, mat->Scale(),
806 (mat->GetOwnedMatrix())->GetPtr().data(), m_ncoeffs,
807 inarray.data(), 1, 0.0, outarray.data(), 1);
808 }
809}
810
812 const Array<OneD, const NekDouble> &inarray,
814{
815 // This implementation is only valid when there are no
816 // coefficients associated to the Laplacian operator
817 if (m_metrics.count(eMetricLaplacian00) == 0)
818 {
820 }
821
822 int nquad0 = m_base[0]->GetNumPoints();
823 int nquad1 = m_base[1]->GetNumPoints();
824 int nquad2 = m_base[2]->GetNumPoints();
825 int nqtot = nquad0 * nquad1 * nquad2;
826
827 ASSERTL1(wsp.size() >= 6 * nqtot, "Insufficient workspace size.");
828 ASSERTL1(m_ncoeffs <= nqtot, "Workspace not set up for ncoeffs > nqtot");
829
830 const Array<OneD, const NekDouble> &base0 = m_base[0]->GetBdata();
831 const Array<OneD, const NekDouble> &base1 = m_base[1]->GetBdata();
832 const Array<OneD, const NekDouble> &base2 = m_base[2]->GetBdata();
833 const Array<OneD, const NekDouble> &dbase0 = m_base[0]->GetDbdata();
834 const Array<OneD, const NekDouble> &dbase1 = m_base[1]->GetDbdata();
835 const Array<OneD, const NekDouble> &dbase2 = m_base[2]->GetDbdata();
836 const Array<OneD, const NekDouble> &metric00 =
837 m_metrics[eMetricLaplacian00];
838 const Array<OneD, const NekDouble> &metric01 =
839 m_metrics[eMetricLaplacian01];
840 const Array<OneD, const NekDouble> &metric02 =
841 m_metrics[eMetricLaplacian02];
842 const Array<OneD, const NekDouble> &metric11 =
843 m_metrics[eMetricLaplacian11];
844 const Array<OneD, const NekDouble> &metric12 =
845 m_metrics[eMetricLaplacian12];
846 const Array<OneD, const NekDouble> &metric22 =
847 m_metrics[eMetricLaplacian22];
848
849 // Allocate temporary storage
850 Array<OneD, NekDouble> wsp0(2 * nqtot, wsp);
851 Array<OneD, NekDouble> wsp1(nqtot, wsp + 1 * nqtot);
852 Array<OneD, NekDouble> wsp2(nqtot, wsp + 2 * nqtot);
853 Array<OneD, NekDouble> wsp3(nqtot, wsp + 3 * nqtot);
854 Array<OneD, NekDouble> wsp4(nqtot, wsp + 4 * nqtot);
855 Array<OneD, NekDouble> wsp5(nqtot, wsp + 5 * nqtot);
856
857 // LAPLACIAN MATRIX OPERATION
858 // wsp1 = du_dxi1 = D_xi1 * inarray = D_xi1 * u
859 // wsp2 = du_dxi2 = D_xi2 * inarray = D_xi2 * u
860 // wsp2 = du_dxi3 = D_xi3 * inarray = D_xi3 * u
861 PhysTensorDeriv(inarray, wsp0, wsp1, wsp2);
862
863 // wsp0 = k = g0 * wsp1 + g1 * wsp2 = g0 * du_dxi1 + g1 * du_dxi2
864 // wsp2 = l = g1 * wsp1 + g2 * wsp2 = g0 * du_dxi1 + g1 * du_dxi2
865 // where g0, g1 and g2 are the metric terms set up in the GeomFactors class
866 // especially for this purpose
867 Vmath::Vvtvvtp(nqtot, &metric00[0], 1, &wsp0[0], 1, &metric01[0], 1,
868 &wsp1[0], 1, &wsp3[0], 1);
869 Vmath::Vvtvp(nqtot, &metric02[0], 1, &wsp2[0], 1, &wsp3[0], 1, &wsp3[0], 1);
870 Vmath::Vvtvvtp(nqtot, &metric01[0], 1, &wsp0[0], 1, &metric11[0], 1,
871 &wsp1[0], 1, &wsp4[0], 1);
872 Vmath::Vvtvp(nqtot, &metric12[0], 1, &wsp2[0], 1, &wsp4[0], 1, &wsp4[0], 1);
873 Vmath::Vvtvvtp(nqtot, &metric02[0], 1, &wsp0[0], 1, &metric12[0], 1,
874 &wsp1[0], 1, &wsp5[0], 1);
875 Vmath::Vvtvp(nqtot, &metric22[0], 1, &wsp2[0], 1, &wsp5[0], 1, &wsp5[0], 1);
876
877 // outarray = m = (D_xi1 * B)^T * k
878 // wsp1 = n = (D_xi2 * B)^T * l
879 const Array<OneD, const NekDouble> &jac = m_geomFactors->GetJac();
880 bool Deformed = (m_geomFactors->GetGtype() == SpatialDomains::eDeformed);
881
882 v_IProductWRTBaseKernel(dbase0, base1, base2, wsp3, outarray, jac,
883 Deformed);
884 v_IProductWRTBaseKernel(base0, dbase1, base2, wsp4, wsp2, jac, Deformed);
885 Vmath::Vadd(m_ncoeffs, wsp2.data(), 1, outarray.data(), 1, outarray.data(),
886 1);
887 v_IProductWRTBaseKernel(base0, base1, dbase2, wsp5, wsp2, jac, Deformed);
888 Vmath::Vadd(m_ncoeffs, wsp2.data(), 1, outarray.data(), 1, outarray.data(),
889 1);
890}
891
892void TetExp::v_ComputeLaplacianMetric()
893{
894 int i, j;
895 const unsigned int nqtot = GetTotPoints();
896 const unsigned int dim = 3;
897 const MetricType m[3][3] = {
898 {eMetricLaplacian00, eMetricLaplacian01, eMetricLaplacian02},
899 {eMetricLaplacian01, eMetricLaplacian11, eMetricLaplacian12},
900 {eMetricLaplacian02, eMetricLaplacian12, eMetricLaplacian22}};
901
902 for (unsigned int i = 0; i < dim; ++i)
903 {
904 for (unsigned int j = i; j < dim; ++j)
905 {
906 m_metrics[m[i][j]] = Array<OneD, NekDouble>(nqtot);
907 }
908 }
909
910 // Define shorthand synonyms for m_metrics storage
911 Array<OneD, NekDouble> g0(m_metrics[m[0][0]]);
912 Array<OneD, NekDouble> g1(m_metrics[m[1][1]]);
913 Array<OneD, NekDouble> g2(m_metrics[m[2][2]]);
914 Array<OneD, NekDouble> g3(m_metrics[m[0][1]]);
915 Array<OneD, NekDouble> g4(m_metrics[m[0][2]]);
916 Array<OneD, NekDouble> g5(m_metrics[m[1][2]]);
917
918 // Allocate temporary storage
919 Array<OneD, NekDouble> alloc(7 * nqtot, 0.0);
920 Array<OneD, NekDouble> h0(alloc); // h0
921 Array<OneD, NekDouble> h1(alloc + 1 * nqtot); // h1
922 Array<OneD, NekDouble> h2(alloc + 2 * nqtot); // h2
923 Array<OneD, NekDouble> h3(alloc + 3 * nqtot); // h3
924 Array<OneD, NekDouble> wsp4(alloc + 4 * nqtot); // wsp4
925 Array<OneD, NekDouble> wsp5(alloc + 5 * nqtot); // wsp5
926 Array<OneD, NekDouble> wsp6(alloc + 6 * nqtot); // wsp6
927 // Reuse some of the storage as workspace
928 Array<OneD, NekDouble> wsp7(alloc); // wsp7
929 Array<OneD, NekDouble> wsp8(alloc + 1 * nqtot); // wsp8
930 Array<OneD, NekDouble> wsp9(alloc + 2 * nqtot); // wsp9
931
932 const Array<TwoD, const NekDouble> &df = m_geomFactors->GetDerivFactors();
933 const Array<OneD, const NekDouble> &z0 = m_base[0]->GetZ();
934 const Array<OneD, const NekDouble> &z1 = m_base[1]->GetZ();
935 const Array<OneD, const NekDouble> &z2 = m_base[2]->GetZ();
936 const unsigned int nquad0 = m_base[0]->GetNumPoints();
937 const unsigned int nquad1 = m_base[1]->GetNumPoints();
938 const unsigned int nquad2 = m_base[2]->GetNumPoints();
939
940 for (j = 0; j < nquad2; ++j)
941 {
942 for (i = 0; i < nquad1; ++i)
943 {
944 Vmath::Fill(nquad0, 4.0 / (1.0 - z1[i]) / (1.0 - z2[j]),
945 &h0[0] + i * nquad0 + j * nquad0 * nquad1, 1);
946 Vmath::Fill(nquad0, 2.0 / (1.0 - z1[i]) / (1.0 - z2[j]),
947 &h1[0] + i * nquad0 + j * nquad0 * nquad1, 1);
948 Vmath::Fill(nquad0, 2.0 / (1.0 - z2[j]),
949 &h2[0] + i * nquad0 + j * nquad0 * nquad1, 1);
950 Vmath::Fill(nquad0, (1.0 + z1[i]) / (1.0 - z2[j]),
951 &h3[0] + i * nquad0 + j * nquad0 * nquad1, 1);
952 }
953 }
954 for (i = 0; i < nquad0; i++)
955 {
956 Blas::Dscal(nquad1 * nquad2, 1 + z0[i], &h1[0] + i, nquad0);
957 }
958
959 // Step 3. Construct combined metric terms for physical space to
960 // collapsed coordinate system.
961 // Order of construction optimised to minimise temporary storage
962 if (m_geomFactors->GetGtype() == SpatialDomains::eDeformed)
963 {
964 // wsp4
965 Vmath::Vadd(nqtot, &df[1][0], 1, &df[2][0], 1, &wsp4[0], 1);
966 Vmath::Vvtvvtp(nqtot, &df[0][0], 1, &h0[0], 1, &wsp4[0], 1, &h1[0], 1,
967 &wsp4[0], 1);
968 // wsp5
969 Vmath::Vadd(nqtot, &df[4][0], 1, &df[5][0], 1, &wsp5[0], 1);
970 Vmath::Vvtvvtp(nqtot, &df[3][0], 1, &h0[0], 1, &wsp5[0], 1, &h1[0], 1,
971 &wsp5[0], 1);
972 // wsp6
973 Vmath::Vadd(nqtot, &df[7][0], 1, &df[8][0], 1, &wsp6[0], 1);
974 Vmath::Vvtvvtp(nqtot, &df[6][0], 1, &h0[0], 1, &wsp6[0], 1, &h1[0], 1,
975 &wsp6[0], 1);
976
977 // g0
978 Vmath::Vvtvvtp(nqtot, &wsp4[0], 1, &wsp4[0], 1, &wsp5[0], 1, &wsp5[0],
979 1, &g0[0], 1);
980 Vmath::Vvtvp(nqtot, &wsp6[0], 1, &wsp6[0], 1, &g0[0], 1, &g0[0], 1);
981
982 // g4
983 Vmath::Vvtvvtp(nqtot, &df[2][0], 1, &wsp4[0], 1, &df[5][0], 1, &wsp5[0],
984 1, &g4[0], 1);
985 Vmath::Vvtvp(nqtot, &df[8][0], 1, &wsp6[0], 1, &g4[0], 1, &g4[0], 1);
986
987 // overwrite h0, h1, h2
988 // wsp7 (h2f1 + h3f2)
989 Vmath::Vvtvvtp(nqtot, &df[1][0], 1, &h2[0], 1, &df[2][0], 1, &h3[0], 1,
990 &wsp7[0], 1);
991 // wsp8 (h2f4 + h3f5)
992 Vmath::Vvtvvtp(nqtot, &df[4][0], 1, &h2[0], 1, &df[5][0], 1, &h3[0], 1,
993 &wsp8[0], 1);
994 // wsp9 (h2f7 + h3f8)
995 Vmath::Vvtvvtp(nqtot, &df[7][0], 1, &h2[0], 1, &df[8][0], 1, &h3[0], 1,
996 &wsp9[0], 1);
997
998 // g3
999 Vmath::Vvtvvtp(nqtot, &wsp4[0], 1, &wsp7[0], 1, &wsp5[0], 1, &wsp8[0],
1000 1, &g3[0], 1);
1001 Vmath::Vvtvp(nqtot, &wsp6[0], 1, &wsp9[0], 1, &g3[0], 1, &g3[0], 1);
1002
1003 // overwrite wsp4, wsp5, wsp6
1004 // g1
1005 Vmath::Vvtvvtp(nqtot, &wsp7[0], 1, &wsp7[0], 1, &wsp8[0], 1, &wsp8[0],
1006 1, &g1[0], 1);
1007 Vmath::Vvtvp(nqtot, &wsp9[0], 1, &wsp9[0], 1, &g1[0], 1, &g1[0], 1);
1008
1009 // g5
1010 Vmath::Vvtvvtp(nqtot, &df[2][0], 1, &wsp7[0], 1, &df[5][0], 1, &wsp8[0],
1011 1, &g5[0], 1);
1012 Vmath::Vvtvp(nqtot, &df[8][0], 1, &wsp9[0], 1, &g5[0], 1, &g5[0], 1);
1013
1014 // g2
1015 Vmath::Vvtvvtp(nqtot, &df[2][0], 1, &df[2][0], 1, &df[5][0], 1,
1016 &df[5][0], 1, &g2[0], 1);
1017 Vmath::Vvtvp(nqtot, &df[8][0], 1, &df[8][0], 1, &g2[0], 1, &g2[0], 1);
1018 }
1019 else
1020 {
1021 // wsp4
1022 Vmath::Svtsvtp(nqtot, df[0][0], &h0[0], 1, df[1][0] + df[2][0], &h1[0],
1023 1, &wsp4[0], 1);
1024 // wsp5
1025 Vmath::Svtsvtp(nqtot, df[3][0], &h0[0], 1, df[4][0] + df[5][0], &h1[0],
1026 1, &wsp5[0], 1);
1027 // wsp6
1028 Vmath::Svtsvtp(nqtot, df[6][0], &h0[0], 1, df[7][0] + df[8][0], &h1[0],
1029 1, &wsp6[0], 1);
1030
1031 // g0
1032 Vmath::Vvtvvtp(nqtot, &wsp4[0], 1, &wsp4[0], 1, &wsp5[0], 1, &wsp5[0],
1033 1, &g0[0], 1);
1034 Vmath::Vvtvp(nqtot, &wsp6[0], 1, &wsp6[0], 1, &g0[0], 1, &g0[0], 1);
1035
1036 // g4
1037 Vmath::Svtsvtp(nqtot, df[2][0], &wsp4[0], 1, df[5][0], &wsp5[0], 1,
1038 &g4[0], 1);
1039 Vmath::Svtvp(nqtot, df[8][0], &wsp6[0], 1, &g4[0], 1, &g4[0], 1);
1040
1041 // overwrite h0, h1, h2
1042 // wsp7 (h2f1 + h3f2)
1043 Vmath::Svtsvtp(nqtot, df[1][0], &h2[0], 1, df[2][0], &h3[0], 1,
1044 &wsp7[0], 1);
1045 // wsp8 (h2f4 + h3f5)
1046 Vmath::Svtsvtp(nqtot, df[4][0], &h2[0], 1, df[5][0], &h3[0], 1,
1047 &wsp8[0], 1);
1048 // wsp9 (h2f7 + h3f8)
1049 Vmath::Svtsvtp(nqtot, df[7][0], &h2[0], 1, df[8][0], &h3[0], 1,
1050 &wsp9[0], 1);
1051
1052 // g3
1053 Vmath::Vvtvvtp(nqtot, &wsp4[0], 1, &wsp7[0], 1, &wsp5[0], 1, &wsp8[0],
1054 1, &g3[0], 1);
1055 Vmath::Vvtvp(nqtot, &wsp6[0], 1, &wsp9[0], 1, &g3[0], 1, &g3[0], 1);
1056
1057 // overwrite wsp4, wsp5, wsp6
1058 // g1
1059 Vmath::Vvtvvtp(nqtot, &wsp7[0], 1, &wsp7[0], 1, &wsp8[0], 1, &wsp8[0],
1060 1, &g1[0], 1);
1061 Vmath::Vvtvp(nqtot, &wsp9[0], 1, &wsp9[0], 1, &g1[0], 1, &g1[0], 1);
1062
1063 // g5
1064 Vmath::Svtsvtp(nqtot, df[2][0], &wsp7[0], 1, df[5][0], &wsp8[0], 1,
1065 &g5[0], 1);
1066 Vmath::Svtvp(nqtot, df[8][0], &wsp9[0], 1, &g5[0], 1, &g5[0], 1);
1067
1068 // g2
1069 Vmath::Fill(nqtot,
1070 df[2][0] * df[2][0] + df[5][0] * df[5][0] +
1071 df[8][0] * df[8][0],
1072 &g2[0], 1);
1073 }
1074}
1075} // namespace Nektar::LocalRegions
#define ASSERTL0(condition, msg)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Describes the specification for a Basis.
Definition Basis.h:45
int GetNumPoints() const
Return points order at which basis is defined.
Definition Basis.h:120
PointsKey GetPointsKey() const
Return distribution of points.
Definition Basis.h:137
Defines a specification for a set of points.
Definition Points.h:50
DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey) override
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
SpatialDomains::Geometry * m_geom
Definition Expansion.h:306
void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3) override
DNekScalMatSharedPtr GetLocMatrix(const LocalRegions::MatrixKey &mkey)
Definition Expansion.cpp:88
SpatialDomains::GeomFactorsUniquePtr m_geomFactors
Definition Expansion.h:307
void v_ComputeTraceNormal(const int face) override
Compute the normal of a triangular face.
Definition TetExp.cpp:432
DNekScalMatSharedPtr v_GetLocMatrix(const MatrixKey &mkey) override
Definition TetExp.cpp:768
void v_DropLocMatrix(const MatrixKey &mkey) override
Definition TetExp.cpp:773
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
Definition TetExp.h:155
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition TetExp.h:153
DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey) override
Definition TetExp.cpp:735
void v_LaplacianMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
Definition TetExp.cpp:690
NekDouble v_PhysEvalFirstDeriv(const Array< OneD, NekDouble > &coord, const Array< OneD, const NekDouble > &inarray, std::array< NekDouble, 3 > &firstOrderDerivs) override
Definition TetExp.cpp:222
DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix(const MatrixKey &mkey) override
Definition TetExp.cpp:778
void v_GetCoord(const Array< OneD, const NekDouble > &Lcoords, Array< OneD, NekDouble > &coords) override
Get the coordinates "coords" at the local coordinates "Lcoords".
Definition TetExp.cpp:236
TetExp(const LibUtilities::BasisKey &Ba, const LibUtilities::BasisKey &Bb, const LibUtilities::BasisKey &Bc, SpatialDomains::Geometry3D *geom)
Constructor using BasisKey class for quadrature points and order definition.
Definition TetExp.cpp:57
StdRegions::StdExpansionSharedPtr v_GetStdExp(void) const override
Definition TetExp.cpp:264
DNekMatSharedPtr v_CreateStdMatrix(const StdRegions::StdMatrixKey &mkey) override
Definition TetExp.cpp:757
void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Calculates the inner product .
Definition TetExp.cpp:119
StdRegions::StdExpansionSharedPtr v_GetLinStdExp(void) const override
Definition TetExp.cpp:271
void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3) override
Definition TetExp.cpp:253
void GeneralMatrixOp_MatOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition TetExp.cpp:788
void v_DropLocStaticCondMatrix(const MatrixKey &mkey) override
Definition TetExp.cpp:783
void v_SVVLaplacianFilter(Array< OneD, NekDouble > &array, const StdRegions::StdMatrixKey &mkey) override
Definition TetExp.cpp:705
void v_AlignVectorToCollapsedDir(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray) override
Definition TetExp.cpp:156
void v_GetTracePhysMap(const int face, Array< OneD, int > &outarray) override
Returns the physical values at the quadrature points of a face.
Definition TetExp.cpp:344
void v_LaplacianMatrixOp_MatFree_Kernel(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp) override
Definition TetExp.cpp:811
void v_ExtractDataToCoeffs(const NekDouble *data, const std::vector< unsigned int > &nummodes, const int mode_offset, NekDouble *coeffs, std::vector< LibUtilities::BasisType > &fromType) override
Definition TetExp.cpp:284
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
3D geometry information
Definition Geometry3D.h:50
NekDouble GetCoord(const int i, const Array< OneD, const NekDouble > &Lcoord)
Given local collapsed coordinate Lcoord, return the value of physical coordinate in direction i.
Definition Geometry.h:559
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 GetCoordim() const
Return the coordinate dimension of this object (i.e. the dimension of the space in which this object ...
Definition Geometry.h:277
virtual void v_LaplacianMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
int GetTotPoints() const
This function returns the total number of quadrature points used in the element.
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
const LibUtilities::PointsKeyVector GetPointsKeys() const
LibUtilities::PointsType GetPointsType(const int dir) const
This function returns the type of quadrature points used in the dir direction.
int GetNumPoints(const int dir) const
This function returns the number of quadrature points in the dir direction.
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.
Array< OneD, LibUtilities::BasisSharedPtr > m_base
MatrixType GetMatrixType() const
void v_IProductWRTBaseKernel(const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const Array< OneD, NekDouble > &jac, const bool Deformed, bool CollDir0=false, bool CollDir1=false, bool CollDir2=false) override
Inner product of inarray over region with respect to the expansion basis (this)->m_base[0] and return...
static void Dgemv(const char &trans, const int &m, const int &n, const double &alpha, const double *a, const int &lda, const double *x, const int &incx, const double &beta, double *y, const int &incy)
BLAS level 2: Matrix vector multiply y = alpha A x plus beta y where A[m x n].
Definition Blas.hpp:152
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:313
@ eModified_B
Principle Modified Functions .
Definition BasisType.h:49
@ eModified_C
Principle Modified Functions .
Definition BasisType.h:50
@ eModified_A
Principle Modified Functions .
Definition BasisType.h:48
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< StdTetExp > StdTetExpSharedPtr
Definition StdTetExp.h:187
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
std::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
std::shared_ptr< DNekMat > DNekMatSharedPtr
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 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 Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
Definition Vmath.hpp:54
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition Vmath.hpp:825
STL namespace.
scalarT< T > min(scalarT< T > lhs, scalarT< T > rhs)
Definition scalar.hpp:300
scalarT< T > sqrt(scalarT< T > in)
Definition scalar.hpp:290