Nektar++
BwdTrans.cpp
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: BwdTrans.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: BwdTrans operator implementations
32//
33///////////////////////////////////////////////////////////////////////////////
34
38
39#include <MatrixFreeOps/Operator.hpp>
40
41using namespace std;
42
44{
45
53
54/**
55 * @brief Backward transform help class to calculate the size of the collection
56 * that is given as an input and as an output to the BwdTrans Operator. The size
57 * evaluation takes into account the conversion from the coefficient space to
58 * the physical space
59 */
60class BwdTrans_Helper : virtual public Operator
61{
62protected:
64 {
65 // expect input to be number of elements by the number of coefficients
66 m_inputSize = m_numElmt * m_stdExp->GetNcoeffs();
67 // expect input to be number of elements by the number of quad points
68 m_outputSize = m_numElmt * m_stdExp->GetTotPoints();
69 }
70};
71
72/**
73 * @brief Backward transform operator using standard matrix approach.
74 */
75class BwdTrans_StdMat final : virtual public Operator,
76 virtual public BwdTrans_Helper
77{
78public:
80
81 ~BwdTrans_StdMat() final = default;
82
83 void operator()(const Array<OneD, const NekDouble> &input,
84 Array<OneD, NekDouble> &output0,
85 [[maybe_unused]] Array<OneD, NekDouble> &output1,
86 [[maybe_unused]] Array<OneD, NekDouble> &output2,
87 [[maybe_unused]] Array<OneD, NekDouble> &wsp) override
88 {
89 Blas::Dgemm('N', 'N', m_mat->GetRows(), m_numElmt, m_mat->GetColumns(),
90 1.0, m_mat->GetRawPtr(), m_mat->GetRows(), input.get(),
91 m_stdExp->GetNcoeffs(), 0.0, output0.get(),
92 m_stdExp->GetTotPoints());
93 }
94
95 void operator()([[maybe_unused]] int dir,
96 [[maybe_unused]] const Array<OneD, const NekDouble> &input,
97 [[maybe_unused]] Array<OneD, NekDouble> &output,
98 [[maybe_unused]] Array<OneD, NekDouble> &wsp) final
99 {
100 ASSERTL0(false, "Not valid for this operator.");
101 }
102
103protected:
105
106private:
107 BwdTrans_StdMat(vector<StdRegions::StdExpansionSharedPtr> pCollExp,
110 : Operator(pCollExp, pGeomData, factors), BwdTrans_Helper()
111 {
113 m_stdExp->DetShapeType(), *m_stdExp);
114 m_mat = m_stdExp->GetStdMatrix(key);
115 }
116};
117
118/// Factory initialisation for the BwdTrans_StdMat operators
119OperatorKey BwdTrans_StdMat::m_typeArr[] = {
122 BwdTrans_StdMat::create, "BwdTrans_StdMat_Seg"),
125 BwdTrans_StdMat::create, "BwdTrans_StdMat_Tri"),
128 BwdTrans_StdMat::create, "BwdTrans_StdMat_NodalTri"),
131 BwdTrans_StdMat::create, "BwdTrans_StdMat_Quad"),
134 BwdTrans_StdMat::create, "BwdTrans_StdMat_Tet"),
137 BwdTrans_StdMat::create, "BwdTrans_StdMat_NodalTet"),
140 BwdTrans_StdMat::create, "BwdTrans_StdMat_Pyr"),
142 OperatorKey(ePrism, eBwdTrans, eStdMat, false), BwdTrans_StdMat::create,
143 "BwdTrans_StdMat_Prism"),
145 OperatorKey(ePrism, eBwdTrans, eStdMat, true), BwdTrans_StdMat::create,
146 "BwdTrans_StdMat_NodalPrism"),
149 BwdTrans_StdMat::create, "BwdTrans_StdMat_Hex"),
152 BwdTrans_StdMat::create, "BwdTrans_SumFac_Pyr")};
153
154/**
155 * @brief Backward transform operator using matrix free operators.
156 */
157class BwdTrans_MatrixFree final : virtual public Operator,
159 virtual public BwdTrans_Helper
160{
161public:
163
164 ~BwdTrans_MatrixFree() final = default;
165
166 void operator()(const Array<OneD, const NekDouble> &input,
167 Array<OneD, NekDouble> &output0,
168 [[maybe_unused]] Array<OneD, NekDouble> &output1,
169 [[maybe_unused]] Array<OneD, NekDouble> &output2,
170 [[maybe_unused]] Array<OneD, NekDouble> &wsp) final
171 {
172 (*m_oper)(input, output0);
173 }
174
175 void operator()([[maybe_unused]] int dir,
176 [[maybe_unused]] const Array<OneD, const NekDouble> &input,
177 [[maybe_unused]] Array<OneD, NekDouble> &output,
178 [[maybe_unused]] Array<OneD, NekDouble> &wsp) final
179 {
181 "BwdTrans_MatrixFree: Not valid for this operator.");
182 }
183
184private:
185 std::shared_ptr<MatrixFree::BwdTrans> m_oper;
186
187 BwdTrans_MatrixFree(vector<StdRegions::StdExpansionSharedPtr> pCollExp,
190 : Operator(pCollExp, pGeomData, factors), BwdTrans_Helper(),
191 MatrixFreeBase(pCollExp[0]->GetStdExp()->GetNcoeffs(),
192 pCollExp[0]->GetStdExp()->GetTotPoints(),
193 pCollExp.size())
194 {
195 // Basis vector.
196 const auto dim = pCollExp[0]->GetStdExp()->GetShapeDimension();
197 std::vector<LibUtilities::BasisSharedPtr> basis(dim);
198 for (auto i = 0; i < dim; ++i)
199 {
200 basis[i] = pCollExp[0]->GetBasis(i);
201 }
202
203 // Get shape type
204 auto shapeType = pCollExp[0]->GetStdExp()->DetShapeType();
205
206 // Generate operator string and create operator.
207 std::string op_string = "BwdTrans";
208 op_string += MatrixFree::GetOpstring(shapeType, false);
210 op_string, basis, pCollExp.size());
211
212 oper->SetUpBdata(basis);
213
214 m_oper = std::dynamic_pointer_cast<MatrixFree::BwdTrans>(oper);
215 ASSERTL0(m_oper, "Failed to cast pointer.");
216 }
217};
218
219/// Factory initialisation for the BwdTrans_MatrixFree operators
220OperatorKey BwdTrans_MatrixFree::m_typeArr[] = {
223 BwdTrans_MatrixFree::create, "BwdTrans_MatrixFree_Seg"),
226 BwdTrans_MatrixFree::create, "BwdTrans_MatrixFree_Quad"),
229 BwdTrans_MatrixFree::create, "BwdTrans_MatrixFree_Tri"),
232 BwdTrans_MatrixFree::create, "BwdTrans_MatrixFree_Hex"),
235 BwdTrans_MatrixFree::create, "BwdTrans_MatrixFree_Prism"),
238 BwdTrans_MatrixFree::create, "BwdTrans_MatrixFree_Tet"),
241 BwdTrans_MatrixFree::create, "BwdTrans_MatrixFree_Pyr")};
242
243/**
244 * @brief Backward transform operator using default StdRegions operator
245 */
246class BwdTrans_IterPerExp final : virtual public Operator,
247 virtual public BwdTrans_Helper
248{
249public:
251
252 ~BwdTrans_IterPerExp() final = default;
253
254 void operator()(const Array<OneD, const NekDouble> &input,
255 Array<OneD, NekDouble> &output0,
256 [[maybe_unused]] Array<OneD, NekDouble> &output1,
257 [[maybe_unused]] Array<OneD, NekDouble> &output2,
258 [[maybe_unused]] Array<OneD, NekDouble> &wsp) override
259 {
260 const int nCoeffs = m_stdExp->GetNcoeffs();
261 const int nPhys = m_stdExp->GetTotPoints();
263
264 for (int i = 0; i < m_numElmt; ++i)
265 {
266 m_stdExp->BwdTrans(input + i * nCoeffs, tmp = output0 + i * nPhys);
267 }
268 }
269
270 void operator()([[maybe_unused]] int dir,
271 [[maybe_unused]] const Array<OneD, const NekDouble> &input,
272 [[maybe_unused]] Array<OneD, NekDouble> &output,
273 [[maybe_unused]] Array<OneD, NekDouble> &wsp) final
274 {
275 ASSERTL0(false, "Not valid for this operator.");
276 }
277
278private:
279 BwdTrans_IterPerExp(vector<StdRegions::StdExpansionSharedPtr> pCollExp,
282 : Operator(pCollExp, pGeomData, factors), BwdTrans_Helper()
283 {
284 }
285};
286
287/// Factory initialisation for the BwdTrans_IterPerExp operators
288OperatorKey BwdTrans_IterPerExp::m_typeArr[] = {
291 BwdTrans_IterPerExp::create, "BwdTrans_IterPerExp_Seg"),
294 BwdTrans_IterPerExp::create, "BwdTrans_IterPerExp_Tri"),
297 BwdTrans_IterPerExp::create, "BwdTrans_IterPerExp_NodalTri"),
300 BwdTrans_IterPerExp::create, "BwdTrans_IterPerExp_Quad"),
303 BwdTrans_IterPerExp::create, "BwdTrans_IterPerExp_Tet"),
306 BwdTrans_IterPerExp::create, "BwdTrans_IterPerExp_NodalTet"),
309 BwdTrans_IterPerExp::create, "BwdTrans_IterPerExp_Pyr"),
312 BwdTrans_IterPerExp::create, "BwdTrans_IterPerExp_Prism"),
315 BwdTrans_IterPerExp::create, "BwdTrans_IterPerExp_NodalPrism"),
318 BwdTrans_IterPerExp::create, "BwdTrans_IterPerExp_Hex"),
319};
320
321/**
322 * @brief Backward transform operator using LocalRegions implementation.
323 */
324class BwdTrans_NoCollection final : virtual public Operator,
325 virtual public BwdTrans_Helper
326{
327public:
329
330 ~BwdTrans_NoCollection() final = default;
331
332 void operator()(const Array<OneD, const NekDouble> &input,
333 Array<OneD, NekDouble> &output0,
334 [[maybe_unused]] Array<OneD, NekDouble> &output1,
335 [[maybe_unused]] Array<OneD, NekDouble> &output2,
336 [[maybe_unused]] Array<OneD, NekDouble> &wsp) override
337 {
338 const int nCoeffs = m_expList[0]->GetNcoeffs();
339 const int nPhys = m_expList[0]->GetTotPoints();
341
342 for (int i = 0; i < m_numElmt; ++i)
343 {
344 m_expList[i]->BwdTrans(input + i * nCoeffs,
345 tmp = output0 + i * nPhys);
346 }
347 }
348
349 void operator()([[maybe_unused]] int dir,
350 [[maybe_unused]] const Array<OneD, const NekDouble> &input,
351 [[maybe_unused]] Array<OneD, NekDouble> &output,
352 [[maybe_unused]] Array<OneD, NekDouble> &wsp) final
353 {
354 ASSERTL0(false, "Not valid for this operator.");
355 }
356
357protected:
358 vector<StdRegions::StdExpansionSharedPtr> m_expList;
359
360private:
361 BwdTrans_NoCollection(vector<StdRegions::StdExpansionSharedPtr> pCollExp,
364 : Operator(pCollExp, pGeomData, factors), BwdTrans_Helper()
365 {
366 m_expList = pCollExp;
367 }
368};
369
370/// Factory initialisation for the BwdTrans_NoCollection operators
371OperatorKey BwdTrans_NoCollection::m_typeArr[] = {
374 BwdTrans_NoCollection::create, "BwdTrans_NoCollection_Seg"),
377 BwdTrans_NoCollection::create, "BwdTrans_NoCollection_Tri"),
380 BwdTrans_NoCollection::create, "BwdTrans_NoCollection_NodalTri"),
383 BwdTrans_NoCollection::create, "BwdTrans_NoCollection_Quad"),
386 BwdTrans_NoCollection::create, "BwdTrans_NoCollection_Tet"),
389 BwdTrans_NoCollection::create, "BwdTrans_NoCollection_NodalTet"),
392 BwdTrans_NoCollection::create, "BwdTrans_NoCollection_Pyr"),
395 BwdTrans_NoCollection::create, "BwdTrans_NoCollection_Prism"),
398 BwdTrans_NoCollection::create, "BwdTrans_NoCollection_NodalPrism"),
401 BwdTrans_NoCollection::create, "BwdTrans_NoCollection_Hex"),
402};
403
404/**
405 * @brief Backward transform operator using sum-factorisation (Segment)
406 */
407class BwdTrans_SumFac_Seg final : virtual public Operator,
408 virtual public BwdTrans_Helper
409{
410public:
412
413 ~BwdTrans_SumFac_Seg() final = default;
414
415 void operator()(const Array<OneD, const NekDouble> &input,
416 Array<OneD, NekDouble> &output0,
417 [[maybe_unused]] Array<OneD, NekDouble> &output1,
418 [[maybe_unused]] Array<OneD, NekDouble> &output2,
419 [[maybe_unused]] Array<OneD, NekDouble> &wsp) override
420 {
421 if (m_colldir0)
422 {
423 Vmath::Vcopy(m_numElmt * m_nmodes0, input.get(), 1, output0.get(),
424 1);
425 }
426 else
427 {
428 // out = B0*in;
429 Blas::Dgemm('N', 'N', m_nquad0, m_numElmt, m_nmodes0, 1.0,
430 m_base0.get(), m_nquad0, &input[0], m_nmodes0, 0.0,
431 &output0[0], m_nquad0);
432 }
433 }
434
435 void operator()([[maybe_unused]] int dir,
436 [[maybe_unused]] const Array<OneD, const NekDouble> &input,
437 [[maybe_unused]] Array<OneD, NekDouble> &output,
438 [[maybe_unused]] Array<OneD, NekDouble> &wsp) final
439 {
440 ASSERTL0(false, "Not valid for this operator.");
441 }
442
443protected:
444 const int m_nquad0;
445 const int m_nmodes0;
446 const bool m_colldir0;
448
449private:
450 BwdTrans_SumFac_Seg(vector<StdRegions::StdExpansionSharedPtr> pCollExp,
453 : Operator(pCollExp, pGeomData, factors), BwdTrans_Helper(),
454 m_nquad0(m_stdExp->GetNumPoints(0)),
455 m_nmodes0(m_stdExp->GetBasisNumModes(0)),
456 m_colldir0(m_stdExp->GetBasis(0)->Collocation()),
457 m_base0(m_stdExp->GetBasis(0)->GetBdata())
458 {
459 m_wspSize = 0;
460 }
461};
462
463/// Factory initialisation for the BwdTrans_SumFac_Seg operator
464OperatorKey BwdTrans_SumFac_Seg::m_type =
467 BwdTrans_SumFac_Seg::create, "BwdTrans_SumFac_Seg");
468
469/**
470 * @brief Backward transform operator using sum-factorisation (Quad)
471 */
472class BwdTrans_SumFac_Quad final : virtual public Operator,
473 virtual public BwdTrans_Helper
474{
475public:
477
478 ~BwdTrans_SumFac_Quad() final = default;
479
480 void operator()(const Array<OneD, const NekDouble> &input,
481 Array<OneD, NekDouble> &output0,
482 [[maybe_unused]] Array<OneD, NekDouble> &output1,
483 [[maybe_unused]] Array<OneD, NekDouble> &output2,
484 Array<OneD, NekDouble> &wsp) override
485 {
486 int i = 0;
487 if (m_colldir0 && m_colldir1)
488 {
489 Vmath::Vcopy(m_numElmt * m_nmodes0 * m_nmodes1, input.get(), 1,
490 output0.get(), 1);
491 }
492 else if (m_colldir0)
493 {
494 for (i = 0; i < m_numElmt; ++i)
495 {
496 Blas::Dgemm('N', 'T', m_nquad0, m_nquad1, m_nmodes1, 1.0,
497 &input[i * m_nquad0 * m_nmodes1], m_nquad0,
498 m_base1.get(), m_nquad1, 0.0,
499 &output0[i * m_nquad0 * m_nquad1], m_nquad0);
500 }
501 }
502 else if (m_colldir1)
503 {
505 1.0, m_base0.get(), m_nquad0, &input[0], m_nmodes0, 0.0,
506 &output0[0], m_nquad0);
507 }
508 else
509 {
510 ASSERTL1(wsp.size() == m_wspSize, "Incorrect workspace size");
511
512 // Those two calls correpsond to the operation
513 // out = B0*in*Transpose(B1);
515 1.0, m_base0.get(), m_nquad0, &input[0], m_nmodes0, 0.0,
516 &wsp[0], m_nquad0);
517
518 for (i = 0; i < m_numElmt; ++i)
519 {
520 Blas::Dgemm('N', 'T', m_nquad0, m_nquad1, m_nmodes1, 1.0,
521 &wsp[i * m_nquad0 * m_nmodes1], m_nquad0,
522 m_base1.get(), m_nquad1, 0.0,
523 &output0[i * m_nquad0 * m_nquad1], m_nquad0);
524 }
525 }
526 }
527
528 void operator()([[maybe_unused]] int dir,
529 [[maybe_unused]] const Array<OneD, const NekDouble> &input,
530 [[maybe_unused]] Array<OneD, NekDouble> &output,
531 [[maybe_unused]] Array<OneD, NekDouble> &wsp) final
532 {
533 ASSERTL0(false, "Not valid for this operator.");
534 }
535
536protected:
537 const int m_nquad0;
538 const int m_nquad1;
539 const int m_nmodes0;
540 const int m_nmodes1;
541 const bool m_colldir0;
542 const bool m_colldir1;
545
546private:
547 BwdTrans_SumFac_Quad(vector<StdRegions::StdExpansionSharedPtr> pCollExp,
550 : Operator(pCollExp, pGeomData, factors), BwdTrans_Helper(),
551 m_nquad0(m_stdExp->GetNumPoints(0)),
552 m_nquad1(m_stdExp->GetNumPoints(1)),
553 m_nmodes0(m_stdExp->GetBasisNumModes(0)),
554 m_nmodes1(m_stdExp->GetBasisNumModes(1)),
555 m_colldir0(m_stdExp->GetBasis(0)->Collocation()),
556 m_colldir1(m_stdExp->GetBasis(1)->Collocation()),
557 m_base0(m_stdExp->GetBasis(0)->GetBdata()),
558 m_base1(m_stdExp->GetBasis(1)->GetBdata())
559 {
561 }
562};
563
564/// Factory initialisation for the BwdTrans_SumFac_Quad operator
565OperatorKey BwdTrans_SumFac_Quad::m_type =
568 BwdTrans_SumFac_Quad::create, "BwdTrans_SumFac_Quad");
569
570/**
571 * @brief Backward transform operator using sum-factorisation (Tri)
572 */
573class BwdTrans_SumFac_Tri final : virtual public Operator,
574 virtual public BwdTrans_Helper
575{
576public:
578
579 ~BwdTrans_SumFac_Tri() final = default;
580
581 void operator()(const Array<OneD, const NekDouble> &input,
582 Array<OneD, NekDouble> &output0,
583 [[maybe_unused]] Array<OneD, NekDouble> &output1,
584 [[maybe_unused]] Array<OneD, NekDouble> &output2,
585 Array<OneD, NekDouble> &wsp) override
586 {
587 ASSERTL1(wsp.size() == m_wspSize, "Incorrect workspace size");
588
589 int ncoeffs = m_stdExp->GetNcoeffs();
590 int i = 0;
591 int mode = 0;
592
593 for (i = mode = 0; i < m_nmodes0; ++i)
594 {
595 Blas::Dgemm('N', 'N', m_nquad1, m_numElmt, m_nmodes1 - i, 1.0,
596 m_base1.get() + mode * m_nquad1, m_nquad1,
597 &input[0] + mode, ncoeffs, 0.0,
598 &wsp[i * m_nquad1 * m_numElmt], m_nquad1);
599 mode += m_nmodes1 - i;
600 }
601
602 // fix for modified basis by splitting top vertex mode
603 if (m_sortTopVertex)
604 {
605 for (i = 0; i < m_numElmt; ++i)
606 {
607 Blas::Daxpy(m_nquad1, input[1 + i * ncoeffs],
608 m_base1.get() + m_nquad1, 1,
609 &wsp[m_nquad1 * m_numElmt] + i * m_nquad1, 1);
610 }
611 }
612
614 m_base0.get(), m_nquad0, &wsp[0], m_nquad1 * m_numElmt, 0.0,
615 &output0[0], m_nquad0);
616 }
617
618 void operator()([[maybe_unused]] int dir,
619 [[maybe_unused]] const Array<OneD, const NekDouble> &input,
620 [[maybe_unused]] Array<OneD, NekDouble> &output,
621 [[maybe_unused]] Array<OneD, NekDouble> &wsp) final
622 {
623 ASSERTL0(false, "Not valid for this operator.");
624 }
625
626protected:
627 const int m_nquad0;
628 const int m_nquad1;
629 const int m_nmodes0;
630 const int m_nmodes1;
634
635private:
636 BwdTrans_SumFac_Tri(vector<StdRegions::StdExpansionSharedPtr> pCollExp,
639 : Operator(pCollExp, pGeomData, factors),
640 m_nquad0(m_stdExp->GetNumPoints(0)),
641 m_nquad1(m_stdExp->GetNumPoints(1)),
642 m_nmodes0(m_stdExp->GetBasisNumModes(0)),
643 m_nmodes1(m_stdExp->GetBasisNumModes(1)),
644 m_base0(m_stdExp->GetBasis(0)->GetBdata()),
645 m_base1(m_stdExp->GetBasis(1)->GetBdata())
646 {
648 if (m_stdExp->GetBasis(0)->GetBasisType() == LibUtilities::eModified_A)
649 {
650 m_sortTopVertex = true;
651 }
652 else
653 {
654 m_sortTopVertex = false;
655 }
656 }
657};
658
659/// Factory initialisation for the BwdTrans_SumFac_Tri operator
660OperatorKey BwdTrans_SumFac_Tri::m_type =
663 BwdTrans_SumFac_Tri::create, "BwdTrans_SumFac_Tri");
664
665/// Backward transform operator using sum-factorisation (Hex)
666class BwdTrans_SumFac_Hex final : virtual public Operator,
667 virtual public BwdTrans_Helper
668{
669public:
671
672 ~BwdTrans_SumFac_Hex() final = default;
673
674 void operator()(const Array<OneD, const NekDouble> &input,
675 Array<OneD, NekDouble> &output0,
676 [[maybe_unused]] Array<OneD, NekDouble> &output1,
677 [[maybe_unused]] Array<OneD, NekDouble> &output2,
678 Array<OneD, NekDouble> &wsp) override
679 {
681 {
683 input.get(), 1, output0.get(), 1);
684 }
685 else
686 {
687 ASSERTL1(wsp.size() == m_wspSize, "Incorrect workspace size");
688
689 // Assign second half of workspace for 2nd DGEMM operation.
690 int totmodes = m_nmodes0 * m_nmodes1 * m_nmodes2;
691
694
695 // loop over elements and do bwd trans wrt c
696 for (int n = 0; n < m_numElmt; ++n)
697 {
699 m_nmodes2, 1.0, m_base2.get(), m_nquad2,
700 &input[n * totmodes], m_nmodes0 * m_nmodes1, 0.0,
701 &wsp[n * m_nquad2], m_nquad2 * m_numElmt);
702 }
703
704 // trans wrt b
706 m_nmodes1, 1.0, m_base1.get(), m_nquad1, wsp.get(),
707 m_nquad2 * m_numElmt * m_nmodes0, 0.0, wsp2.get(),
708 m_nquad1);
709
710 // trans wrt a
712 m_nmodes0, 1.0, m_base0.get(), m_nquad0, wsp2.get(),
713 m_nquad1 * m_nquad2 * m_numElmt, 0.0, output0.get(),
714 m_nquad0);
715 }
716 }
717
718 void operator()([[maybe_unused]] int dir,
719 [[maybe_unused]] const Array<OneD, const NekDouble> &input,
720 [[maybe_unused]] Array<OneD, NekDouble> &output,
721 [[maybe_unused]] Array<OneD, NekDouble> &wsp) final
722 {
723 ASSERTL0(false, "Not valid for this operator.");
724 }
725
726protected:
727 const int m_nquad0;
728 const int m_nquad1;
729 const int m_nquad2;
730 const int m_nmodes0;
731 const int m_nmodes1;
732 const int m_nmodes2;
736 const bool m_colldir0;
737 const bool m_colldir1;
738 const bool m_colldir2;
739
740private:
741 BwdTrans_SumFac_Hex(vector<StdRegions::StdExpansionSharedPtr> pCollExp,
744 : Operator(pCollExp, pGeomData, factors), BwdTrans_Helper(),
745 m_nquad0(pCollExp[0]->GetNumPoints(0)),
746 m_nquad1(pCollExp[0]->GetNumPoints(1)),
747 m_nquad2(pCollExp[0]->GetNumPoints(2)),
748 m_nmodes0(pCollExp[0]->GetBasisNumModes(0)),
749 m_nmodes1(pCollExp[0]->GetBasisNumModes(1)),
750 m_nmodes2(pCollExp[0]->GetBasisNumModes(2)),
751 m_base0(pCollExp[0]->GetBasis(0)->GetBdata()),
752 m_base1(pCollExp[0]->GetBasis(1)->GetBdata()),
753 m_base2(pCollExp[0]->GetBasis(2)->GetBdata()),
754 m_colldir0(pCollExp[0]->GetBasis(0)->Collocation()),
755 m_colldir1(pCollExp[0]->GetBasis(1)->Collocation()),
756 m_colldir2(pCollExp[0]->GetBasis(2)->Collocation())
757 {
760 }
761};
762
763/// Factory initialisation for the BwdTrans_SumFac_Hex operator
764OperatorKey BwdTrans_SumFac_Hex::m_type =
767 BwdTrans_SumFac_Hex::create, "BwdTrans_SumFac_Hex");
768
769/**
770 * @brief Backward transform operator using sum-factorisation (Tet)
771 */
772class BwdTrans_SumFac_Tet final : virtual public Operator,
773 virtual public BwdTrans_Helper
774{
775public:
777
778 ~BwdTrans_SumFac_Tet() final = default;
779
780 void operator()(const Array<OneD, const NekDouble> &input,
781 Array<OneD, NekDouble> &output0,
782 [[maybe_unused]] Array<OneD, NekDouble> &output1,
783 [[maybe_unused]] Array<OneD, NekDouble> &output2,
784 Array<OneD, NekDouble> &wsp) final
785 {
786 ASSERTL1(wsp.size() == m_wspSize, "Incorrect workspace size");
787
788 Array<OneD, NekDouble> tmp = wsp;
790 tmp + m_numElmt * m_nquad2 * m_nmodes0 *
791 (2 * m_nmodes1 - m_nmodes0 + 1) / 2;
792
793 int mode = 0;
794 int mode1 = 0;
795 int cnt = 0;
796 int ncoeffs = m_stdExp->GetNcoeffs();
797
798 // Perform summation over '2' direction
799 for (int i = 0; i < m_nmodes0; ++i)
800 {
801 for (int j = 0; j < m_nmodes1 - i; ++j, ++cnt)
802 {
803 Blas::Dgemm('N', 'N', m_nquad2, m_numElmt, m_nmodes2 - i - j,
804 1.0, m_base2.get() + mode * m_nquad2, m_nquad2,
805 input.get() + mode1, ncoeffs, 0.0,
806 tmp.get() + cnt * m_nquad2 * m_numElmt, m_nquad2);
807 mode += m_nmodes2 - i - j;
808 mode1 += m_nmodes2 - i - j;
809 }
810
811 // increment mode in case m_nmodes1!=m_nmodes2
812 mode += (m_nmodes2 - m_nmodes1) * (m_nmodes2 - m_nmodes1 + 1) / 2;
813 }
814
815 // vertex mode - currently (1+c)/2 x (1-b)/2 x (1-a)/2
816 // component is evaluated
817 if (m_sortTopEdge)
818 {
819 for (int i = 0; i < m_numElmt; ++i)
820 {
821 // top singular vertex
822 // (1+c)/2 x (1+b)/2 x (1-a)/2 component
823 Blas::Daxpy(m_nquad2, input[1 + i * ncoeffs],
824 m_base2.get() + m_nquad2, 1,
825 &tmp[m_nquad2 * m_numElmt] + i * m_nquad2, 1);
826
827 // top singular vertex
828 // (1+c)/2 x (1-b)/2 x (1+a)/2 component
830 m_nquad2, input[1 + i * ncoeffs], m_base2.get() + m_nquad2,
831 1, &tmp[m_nmodes1 * m_nquad2 * m_numElmt] + i * m_nquad2,
832 1);
833 }
834 }
835
836 // Perform summation over '1' direction
837 mode = 0;
838 for (int i = 0; i < m_nmodes0; ++i)
839 {
841 1.0, m_base1.get() + mode * m_nquad1, m_nquad1,
842 tmp.get() + mode * m_nquad2 * m_numElmt,
843 m_nquad2 * m_numElmt, 0.0,
844 tmp1.get() + i * m_nquad1 * m_nquad2 * m_numElmt,
845 m_nquad1);
846 mode += m_nmodes1 - i;
847 }
848
849 // fix for modified basis by adding additional split of
850 // top and base singular vertex modes as well as singular
851 // edge
852 if (m_sortTopEdge)
853 {
854 // this could probably be a dgemv or higher if we
855 // made a specialised m_base1[m_nuqad1] array
856 // containing multiply copies
857 for (int i = 0; i < m_numElmt; ++i)
858 {
859 // sort out singular vertices and singular
860 // edge components with (1+b)/2 (1+a)/2 form
861 for (int j = 0; j < m_nquad2; ++j)
862 {
864 tmp[m_nquad2 * m_numElmt + i * m_nquad2 + j],
865 m_base1.get() + m_nquad1, 1,
866 &tmp1[m_nquad1 * m_nquad2 * m_numElmt] +
867 i * m_nquad1 * m_nquad2 + j * m_nquad1,
868 1);
869 }
870 }
871 }
872
873 // Perform summation over '0' direction
875 m_nmodes0, 1.0, m_base0.get(), m_nquad0, tmp1.get(),
876 m_nquad1 * m_nquad2 * m_numElmt, 0.0, output0.get(),
877 m_nquad0);
878 }
879
880 void operator()([[maybe_unused]] int dir,
881 [[maybe_unused]] const Array<OneD, const NekDouble> &input,
882 [[maybe_unused]] Array<OneD, NekDouble> &output,
883 [[maybe_unused]] Array<OneD, NekDouble> &wsp) final
884 {
885 ASSERTL0(false, "Not valid for this operator.");
886 }
887
888protected:
889 const int m_nquad0;
890 const int m_nquad1;
891 const int m_nquad2;
892 const int m_nmodes0;
893 const int m_nmodes1;
894 const int m_nmodes2;
899
900private:
901 BwdTrans_SumFac_Tet(vector<StdRegions::StdExpansionSharedPtr> pCollExp,
904 : Operator(pCollExp, pGeomData, factors), BwdTrans_Helper(),
905 m_nquad0(m_stdExp->GetNumPoints(0)),
906 m_nquad1(m_stdExp->GetNumPoints(1)),
907 m_nquad2(m_stdExp->GetNumPoints(2)),
908 m_nmodes0(m_stdExp->GetBasisNumModes(0)),
909 m_nmodes1(m_stdExp->GetBasisNumModes(1)),
910 m_nmodes2(m_stdExp->GetBasisNumModes(2)),
911 m_base0(m_stdExp->GetBasis(0)->GetBdata()),
912 m_base1(m_stdExp->GetBasis(1)->GetBdata()),
913 m_base2(m_stdExp->GetBasis(2)->GetBdata())
914 {
916 (2 * m_nmodes1 - m_nmodes0 + 1) / 2 +
918
919 if (m_stdExp->GetBasis(0)->GetBasisType() == LibUtilities::eModified_A)
920 {
921 m_sortTopEdge = true;
922 }
923 else
924 {
925 m_sortTopEdge = false;
926 }
927 }
928};
929
930/// Factory initialisation for the BwdTrans_SumFac_Tet operator
931OperatorKey BwdTrans_SumFac_Tet::m_type =
934 BwdTrans_SumFac_Tet::create, "BwdTrans_SumFac_Tet");
935
936/**
937 * @brief Backward transform operator using sum-factorisation (Prism)
938 */
939class BwdTrans_SumFac_Prism final : virtual public Operator,
940 virtual public BwdTrans_Helper
941{
942public:
944
945 ~BwdTrans_SumFac_Prism() final = default;
946
947 void operator()(const Array<OneD, const NekDouble> &input,
948 Array<OneD, NekDouble> &output0,
949 [[maybe_unused]] Array<OneD, NekDouble> &output1,
950 [[maybe_unused]] Array<OneD, NekDouble> &output2,
951 Array<OneD, NekDouble> &wsp) final
952 {
953 ASSERTL1(wsp.size() == m_wspSize, "Incorrect workspace size");
954
955 // Assign second half of workspace for 2nd DGEMM operation.
956 int totmodes = m_stdExp->GetNcoeffs();
957
960
962 int i = 0;
963 int j = 0;
964 int mode = 0;
965 int mode1 = 0;
966 int cnt = 0;
967 for (i = mode = mode1 = 0; i < m_nmodes0; ++i)
968 {
969 cnt = i * m_nquad2 * m_numElmt;
970 for (j = 0; j < m_nmodes1; ++j)
971 {
972 Blas::Dgemm('N', 'N', m_nquad2, m_numElmt, m_nmodes2 - i, 1.0,
973 m_base2.get() + mode * m_nquad2, m_nquad2,
974 input.get() + mode1, totmodes, 0.0,
975 &wsp[j * m_nquad2 * m_numElmt * m_nmodes0 + cnt],
976 m_nquad2);
977 mode1 += m_nmodes2 - i;
978 }
979 mode += m_nmodes2 - i;
980 }
981
982 // fix for modified basis by splitting top vertex mode
983 if (m_sortTopVertex)
984 {
985 for (j = 0; j < m_nmodes1; ++j)
986 {
987 for (i = 0; i < m_numElmt; ++i)
988 {
990 input[1 + i * totmodes + j * m_nmodes2],
991 m_base2.get() + m_nquad2, 1,
992 &wsp[j * m_nquad2 * m_numElmt * m_nmodes0 +
994 i * m_nquad2,
995 1);
996 }
997 }
998 // Believe this could be made into a m_nmodes1
999 // dgemv if we made an array of m_numElmt copies
1000 // of m_base2[m_quad2] (which are of size
1001 // m_nquad2.
1002 }
1003
1004 // Perform summation over '1' direction
1006 m_nmodes1, 1.0, m_base1.get(), m_nquad1, wsp.get(),
1007 m_nquad2 * m_numElmt * m_nmodes0, 0.0, wsp2.get(),
1008 m_nquad1);
1009
1010 // Perform summation over '0' direction
1012 m_nmodes0, 1.0, m_base0.get(), m_nquad0, wsp2.get(),
1013 m_nquad1 * m_nquad2 * m_numElmt, 0.0, output0.get(),
1014 m_nquad0);
1015 }
1016
1017 void operator()([[maybe_unused]] int dir,
1018 [[maybe_unused]] const Array<OneD, const NekDouble> &input,
1019 [[maybe_unused]] Array<OneD, NekDouble> &output,
1020 [[maybe_unused]] Array<OneD, NekDouble> &wsp) final
1021 {
1022 ASSERTL0(false, "Not valid for this operator.");
1023 }
1024
1025protected:
1026 const int m_nquad0;
1027 const int m_nquad1;
1028 const int m_nquad2;
1029 const int m_nmodes0;
1030 const int m_nmodes1;
1031 const int m_nmodes2;
1036
1037private:
1038 BwdTrans_SumFac_Prism(vector<StdRegions::StdExpansionSharedPtr> pCollExp,
1041 : Operator(pCollExp, pGeomData, factors), BwdTrans_Helper(),
1042 m_nquad0(m_stdExp->GetNumPoints(0)),
1043 m_nquad1(m_stdExp->GetNumPoints(1)),
1044 m_nquad2(m_stdExp->GetNumPoints(2)),
1045 m_nmodes0(m_stdExp->GetBasisNumModes(0)),
1046 m_nmodes1(m_stdExp->GetBasisNumModes(1)),
1047 m_nmodes2(m_stdExp->GetBasisNumModes(2)),
1048 m_base0(m_stdExp->GetBasis(0)->GetBdata()),
1049 m_base1(m_stdExp->GetBasis(1)->GetBdata()),
1050 m_base2(m_stdExp->GetBasis(2)->GetBdata())
1051 {
1054
1055 if (m_stdExp->GetBasis(0)->GetBasisType() == LibUtilities::eModified_A)
1056 {
1057 m_sortTopVertex = true;
1058 }
1059 else
1060 {
1061 m_sortTopVertex = false;
1062 }
1063 }
1064};
1065
1066/// Factory initialisation for the BwdTrans_SumFac_Prism operator
1067OperatorKey BwdTrans_SumFac_Prism::m_type =
1070 BwdTrans_SumFac_Prism::create, "BwdTrans_SumFac_Prism");
1071
1072/**
1073 * @brief Backward transform operator using sum-factorisation (Pyr)
1074 */
1075class BwdTrans_SumFac_Pyr final : virtual public Operator,
1076 virtual public BwdTrans_Helper
1077{
1078public:
1080
1081 ~BwdTrans_SumFac_Pyr() final = default;
1082
1083 void operator()(const Array<OneD, const NekDouble> &input,
1084 Array<OneD, NekDouble> &output0,
1085 [[maybe_unused]] Array<OneD, NekDouble> &output1,
1086 [[maybe_unused]] Array<OneD, NekDouble> &output2,
1087 Array<OneD, NekDouble> &wsp) final
1088 {
1089 ASSERTL1(wsp.size() == m_wspSize, "Incorrect workspace size");
1090
1091 // Assign second half of workspace for 2nd DGEMM operation.
1092 int totmodes = m_stdExp->GetNcoeffs();
1093
1096
1098 int i = 0;
1099 int j = 0;
1100 int mode = 0;
1101 int mode1 = 0;
1102 int cnt = 0;
1103 for (i = 0; i < m_nmodes0; ++i)
1104 {
1105 for (j = 0; j < m_nmodes1; ++j, ++cnt)
1106 {
1107 int ijmax = max(i, j);
1108 Blas::Dgemm('N', 'N', m_nquad2, m_numElmt, m_nmodes2 - ijmax,
1109 1.0, m_base2.get() + mode * m_nquad2, m_nquad2,
1110 input.get() + mode1, totmodes, 0.0,
1111 wsp.get() + cnt * m_nquad2 * m_numElmt, m_nquad2);
1112 mode += m_nmodes2 - ijmax;
1113 mode1 += m_nmodes2 - ijmax;
1114 }
1115
1116 // increment mode in case order1!=order2
1117 for (j = m_nmodes1; j < m_nmodes2 - i; ++j)
1118 {
1119 int ijmax = max(i, j);
1120 mode += m_nmodes2 - ijmax;
1121 }
1122 }
1123
1124 // vertex mode - currently (1+c)/2 x (1-b)/2 x (1-a)/2
1125 // component is evaluated
1126 if (m_sortTopVertex)
1127 {
1128 for (i = 0; i < m_numElmt; ++i)
1129 {
1130 // top singular vertex
1131 // (1+c)/2 x (1+b)/2 x (1-a)/2 component
1132 Blas::Daxpy(m_nquad2, input[1 + i * totmodes],
1133 m_base2.get() + m_nquad2, 1,
1134 &wsp[m_nquad2 * m_numElmt] + i * m_nquad2, 1);
1135
1136 // top singular vertex
1137 // (1+c)/2 x (1-b)/2 x (1+a)/2 component
1139 m_nquad2, input[1 + i * totmodes], m_base2.get() + m_nquad2,
1140 1, &wsp[m_nmodes1 * m_nquad2 * m_numElmt] + i * m_nquad2,
1141 1);
1142
1143 // top singular vertex
1144 // (1+c)/2 x (1+b)/2 x (1+a)/2 component
1145 Blas::Daxpy(m_nquad2, input[1 + i * totmodes],
1146 m_base2.get() + m_nquad2, 1,
1147 &wsp[(m_nmodes1 + 1) * m_nquad2 * m_numElmt] +
1148 i * m_nquad2,
1149 1);
1150 }
1151 }
1152
1153 // Perform summation over '1' direction
1154 mode = 0;
1155 for (i = 0; i < m_nmodes0; ++i)
1156 {
1158 1.0, m_base1.get(), m_nquad1,
1159 wsp.get() + mode * m_nquad2 * m_numElmt,
1160 m_nquad2 * m_numElmt, 0.0,
1161 wsp2.get() + i * m_nquad1 * m_nquad2 * m_numElmt,
1162 m_nquad1);
1163 mode += m_nmodes1;
1164 }
1165
1166 // Perform summation over '0' direction
1168 m_nmodes0, 1.0, m_base0.get(), m_nquad0, wsp2.get(),
1169 m_nquad1 * m_nquad2 * m_numElmt, 0.0, output0.get(),
1170 m_nquad0);
1171 }
1172
1173 void operator()([[maybe_unused]] int dir,
1174 [[maybe_unused]] const Array<OneD, const NekDouble> &input,
1175 [[maybe_unused]] Array<OneD, NekDouble> &output,
1176 [[maybe_unused]] Array<OneD, NekDouble> &wsp) final
1177 {
1178 ASSERTL0(false, "Not valid for this operator.");
1179 }
1180
1181protected:
1182 const int m_nquad0;
1183 const int m_nquad1;
1184 const int m_nquad2;
1185 const int m_nmodes0;
1186 const int m_nmodes1;
1187 const int m_nmodes2;
1192
1193private:
1194 BwdTrans_SumFac_Pyr(vector<StdRegions::StdExpansionSharedPtr> pCollExp,
1197 : Operator(pCollExp, pGeomData, factors), BwdTrans_Helper(),
1198 m_nquad0(m_stdExp->GetNumPoints(0)),
1199 m_nquad1(m_stdExp->GetNumPoints(1)),
1200 m_nquad2(m_stdExp->GetNumPoints(2)),
1201 m_nmodes0(m_stdExp->GetBasisNumModes(0)),
1202 m_nmodes1(m_stdExp->GetBasisNumModes(1)),
1203 m_nmodes2(m_stdExp->GetBasisNumModes(2)),
1204 m_base0(m_stdExp->GetBasis(0)->GetBdata()),
1205 m_base1(m_stdExp->GetBasis(1)->GetBdata()),
1206 m_base2(m_stdExp->GetBasis(2)->GetBdata())
1207 {
1209
1210 if (m_stdExp->GetBasis(0)->GetBasisType() == LibUtilities::eModified_A)
1211 {
1212 m_sortTopVertex = true;
1213 }
1214 else
1215 {
1216 m_sortTopVertex = false;
1217 }
1218 }
1219};
1220
1221/// Factory initialisation for the BwdTrans_SumFac_Pyr operator
1222OperatorKey BwdTrans_SumFac_Pyr::m_type =
1225 BwdTrans_SumFac_Pyr::create, "BwdTrans_SumFac_Pyr");
1226
1227} // namespace Nektar::Collections
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:208
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
Definition: ErrorUtil.hpp:202
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:242
#define OPERATOR_CREATE(cname)
Definition: Operator.h:43
Backward transform help class to calculate the size of the collection that is given as an input and a...
Definition: BwdTrans.cpp:61
Backward transform operator using default StdRegions operator.
Definition: BwdTrans.cpp:248
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
Definition: BwdTrans.cpp:270
BwdTrans_IterPerExp(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
Definition: BwdTrans.cpp:279
Backward transform operator using matrix free operators.
Definition: BwdTrans.cpp:160
std::shared_ptr< MatrixFree::BwdTrans > m_oper
Definition: BwdTrans.cpp:185
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
Definition: BwdTrans.cpp:175
BwdTrans_MatrixFree(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
Definition: BwdTrans.cpp:187
Backward transform operator using LocalRegions implementation.
Definition: BwdTrans.cpp:326
BwdTrans_NoCollection(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
Definition: BwdTrans.cpp:361
vector< StdRegions::StdExpansionSharedPtr > m_expList
Definition: BwdTrans.cpp:358
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
Definition: BwdTrans.cpp:349
Backward transform operator using standard matrix approach.
Definition: BwdTrans.cpp:77
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
Definition: BwdTrans.cpp:95
BwdTrans_StdMat(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
Definition: BwdTrans.cpp:107
Backward transform operator using sum-factorisation (Hex)
Definition: BwdTrans.cpp:668
Array< OneD, const NekDouble > m_base1
Definition: BwdTrans.cpp:734
Array< OneD, const NekDouble > m_base2
Definition: BwdTrans.cpp:735
Array< OneD, const NekDouble > m_base0
Definition: BwdTrans.cpp:733
BwdTrans_SumFac_Hex(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
Definition: BwdTrans.cpp:741
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
Definition: BwdTrans.cpp:718
Backward transform operator using sum-factorisation (Prism)
Definition: BwdTrans.cpp:941
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
Definition: BwdTrans.cpp:1017
BwdTrans_SumFac_Prism(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
Definition: BwdTrans.cpp:1038
Array< OneD, const NekDouble > m_base0
Definition: BwdTrans.cpp:1032
Array< OneD, const NekDouble > m_base1
Definition: BwdTrans.cpp:1033
Array< OneD, const NekDouble > m_base2
Definition: BwdTrans.cpp:1034
Backward transform operator using sum-factorisation (Pyr)
Definition: BwdTrans.cpp:1077
Array< OneD, const NekDouble > m_base2
Definition: BwdTrans.cpp:1190
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
Definition: BwdTrans.cpp:1173
BwdTrans_SumFac_Pyr(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
Definition: BwdTrans.cpp:1194
Array< OneD, const NekDouble > m_base1
Definition: BwdTrans.cpp:1189
Array< OneD, const NekDouble > m_base0
Definition: BwdTrans.cpp:1188
Backward transform operator using sum-factorisation (Quad)
Definition: BwdTrans.cpp:474
Array< OneD, const NekDouble > m_base1
Definition: BwdTrans.cpp:544
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
Definition: BwdTrans.cpp:528
Array< OneD, const NekDouble > m_base0
Definition: BwdTrans.cpp:543
BwdTrans_SumFac_Quad(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
Definition: BwdTrans.cpp:547
Backward transform operator using sum-factorisation (Segment)
Definition: BwdTrans.cpp:409
BwdTrans_SumFac_Seg(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
Definition: BwdTrans.cpp:450
Array< OneD, const NekDouble > m_base0
Definition: BwdTrans.cpp:447
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
Definition: BwdTrans.cpp:435
Backward transform operator using sum-factorisation (Tet)
Definition: BwdTrans.cpp:774
BwdTrans_SumFac_Tet(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
Definition: BwdTrans.cpp:901
Array< OneD, const NekDouble > m_base1
Definition: BwdTrans.cpp:896
Array< OneD, const NekDouble > m_base0
Definition: BwdTrans.cpp:895
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
Definition: BwdTrans.cpp:880
Array< OneD, const NekDouble > m_base2
Definition: BwdTrans.cpp:897
Backward transform operator using sum-factorisation (Tri)
Definition: BwdTrans.cpp:575
BwdTrans_SumFac_Tri(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
Definition: BwdTrans.cpp:636
Array< OneD, const NekDouble > m_base0
Definition: BwdTrans.cpp:631
Array< OneD, const NekDouble > m_base1
Definition: BwdTrans.cpp:632
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
Definition: BwdTrans.cpp:618
Base class for operators on a collection of elements.
Definition: Operator.h:138
StdRegions::StdExpansionSharedPtr m_stdExp
Definition: Operator.h:217
unsigned int m_numElmt
number of elements that the operator is applied on
Definition: Operator.h:219
unsigned int m_outputSize
number of modes or quadrature points that are taken as output from an operator
Definition: Operator.h:227
unsigned int m_inputSize
number of modes or quadrature points that are passed as input to an operator
Definition: Operator.h:224
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
static void Dgemm(const char &transa, const char &transb, const int &m, const int &n, const int &k, const double &alpha, const double *a, const int &lda, const double *b, const int &ldb, const double &beta, double *c, const int &ldc)
BLAS level 3: Matrix-matrix multiply C = A x B where op(A)[m x k], op(B)[k x n], C[m x n] DGEMM perfo...
Definition: Blas.hpp:383
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
std::tuple< LibUtilities::ShapeType, OperatorType, ImplementationType, ExpansionIsNodal > OperatorKey
Key for describing an Operator.
Definition: Operator.h:120
std::shared_ptr< CoalescedGeomData > CoalescedGeomDataSharedPtr
OperatorFactory & GetOperatorFactory()
Returns the singleton Operator factory object.
Definition: Operator.cpp:44
@ eModified_A
Principle Modified Functions .
Definition: BasisType.h:48
ConstFactorMap FactorMap
Definition: StdRegions.hpp:434
StdRegions::ConstFactorMap factors
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:75
double NekDouble
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.