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 
36 #include <Collections/Operator.h>
38 #include <MatrixFreeOps/Operator.hpp>
39 #include <boost/core/ignore_unused.hpp>
40 
41 using namespace std;
42 
43 namespace Nektar
44 {
45 namespace Collections
46 {
47 
55 
56 /**
57  * @brief Backward transform operator using standard matrix approach.
58  */
59 class BwdTrans_StdMat : public Operator
60 {
61 public:
64  {
65  }
66 
68  Array<OneD, NekDouble> &output,
69  Array<OneD, NekDouble> &output1,
70  Array<OneD, NekDouble> &output2,
72  {
73  boost::ignore_unused(output1, output2, wsp);
74  Blas::Dgemm('N', 'N', m_mat->GetRows(), m_numElmt,
75  m_mat->GetColumns(), 1.0, m_mat->GetRawPtr(),
76  m_mat->GetRows(), input.get(), m_stdExp->GetNcoeffs(),
77  0.0, output.get(), m_stdExp->GetTotPoints());
78  }
79 
80  void operator()(int dir,
81  const Array<OneD, const NekDouble> &input,
82  Array<OneD, NekDouble> &output,
83  Array<OneD, NekDouble> &wsp) final
84  {
85  boost::ignore_unused(dir, input, output, wsp);
86  ASSERTL0(false, "Not valid for this operator.");
87  }
88 
89  virtual void CheckFactors(StdRegions::FactorMap factors,
90  int coll_phys_offset)
91  {
92  boost::ignore_unused(factors, coll_phys_offset);
93  ASSERTL0(false, "Not valid for this operator.");
94  }
95 
96 protected:
98 
99 private:
100  BwdTrans_StdMat(vector<StdRegions::StdExpansionSharedPtr> pCollExp,
101  CoalescedGeomDataSharedPtr pGeomData,
102  StdRegions::FactorMap factors)
103  : Operator(pCollExp, pGeomData, factors)
104  {
106  m_stdExp->DetShapeType(), *m_stdExp);
107  m_mat = m_stdExp->GetStdMatrix(key);
108  }
109 };
110 
111 /// Factory initialisation for the BwdTrans_StdMat operators
112 OperatorKey BwdTrans_StdMat::m_typeArr[] = {
115  BwdTrans_StdMat::create, "BwdTrans_StdMat_Seg"),
118  BwdTrans_StdMat::create, "BwdTrans_StdMat_Tri"),
121  BwdTrans_StdMat::create, "BwdTrans_StdMat_NodalTri"),
124  BwdTrans_StdMat::create, "BwdTrans_StdMat_Quad"),
127  BwdTrans_StdMat::create, "BwdTrans_StdMat_Tet"),
130  BwdTrans_StdMat::create, "BwdTrans_StdMat_NodalTet"),
133  BwdTrans_StdMat::create, "BwdTrans_StdMat_Pyr"),
135  OperatorKey(ePrism, eBwdTrans, eStdMat, false), BwdTrans_StdMat::create,
136  "BwdTrans_StdMat_Prism"),
138  OperatorKey(ePrism, eBwdTrans, eStdMat, true), BwdTrans_StdMat::create,
139  "BwdTrans_StdMat_NodalPrism"),
142  BwdTrans_StdMat::create, "BwdTrans_StdMat_Hex"),
145  BwdTrans_StdMat::create, "BwdTrans_SumFac_Pyr")};
146 
147 /**
148  * @brief Backward transform operator using matrix free operators.
149  */
151 {
152 public:
154 
156  {
157  }
158 
160  Array<OneD, NekDouble> &output0,
161  Array<OneD, NekDouble> &output1,
162  Array<OneD, NekDouble> &output2,
163  Array<OneD, NekDouble> &wsp) final
164  {
165  boost::ignore_unused(output1, output2, wsp);
166 
167  if (m_isPadded)
168  {
169  // copy into padded vector
170  Vmath::Vcopy(m_nIn, input, 1, m_input, 1);
171  // call op
172  (*m_oper)(m_input, m_output);
173  // copy out of padded vector
174  Vmath::Vcopy(m_nOut, m_output, 1, output0, 1);
175  }
176  else
177  {
178  (*m_oper)(input, output0);
179  }
180  }
181 
182  void operator()(int dir, const Array<OneD, const NekDouble> &input,
183  Array<OneD, NekDouble> &output,
184  Array<OneD, NekDouble> &wsp) final
185  {
186  boost::ignore_unused(dir, input, output, wsp);
187  NEKERROR(ErrorUtil::efatal,
188  "BwdTrans_MatrixFree: Not valid for this operator.");
189  }
190 
191  virtual void CheckFactors(StdRegions::FactorMap factors,
192  int coll_phys_offset)
193  {
194  boost::ignore_unused(factors, coll_phys_offset);
195  ASSERTL0(false, "Not valid for this operator.");
196  }
197 
198 
199 private:
200  std::shared_ptr<MatrixFree::BwdTrans> m_oper;
201 
202  BwdTrans_MatrixFree(vector<StdRegions::StdExpansionSharedPtr> pCollExp,
203  CoalescedGeomDataSharedPtr pGeomData,
204  StdRegions::FactorMap factors)
205  : Operator(pCollExp, pGeomData, factors),
206  MatrixFreeOneInOneOut(pCollExp[0]->GetStdExp()->GetNcoeffs(),
207  pCollExp[0]->GetStdExp()->GetTotPoints(),
208  pCollExp.size())
209  {
210  // Basis vector.
211  const auto dim = pCollExp[0]->GetStdExp()->GetShapeDimension();
212  std::vector<LibUtilities::BasisSharedPtr> basis(dim);
213  for (auto i = 0; i < dim; ++i)
214  {
215  basis[i] = pCollExp[0]->GetBasis(i);
216  }
217 
218  // Get shape type
219  auto shapeType = pCollExp[0]->GetStdExp()->DetShapeType();
220 
221  // Generate operator string and create operator.
222  std::string op_string = "BwdTrans";
223  op_string += MatrixFree::GetOpstring(shapeType, false);
225  op_string, basis, m_nElmtPad);
226 
227  m_oper = std::dynamic_pointer_cast<MatrixFree::BwdTrans>(oper);
228  ASSERTL0(m_oper, "Failed to cast pointer.");
229  }
230 };
231 
232 /// Factory initialisation for the BwdTrans_MatrixFree operators
233 OperatorKey BwdTrans_MatrixFree::m_typeArr[] = {
236  BwdTrans_MatrixFree::create, "BwdTrans_MatrixFree_Seg"),
239  BwdTrans_MatrixFree::create, "BwdTrans_MatrixFree_Quad"),
242  BwdTrans_MatrixFree::create, "BwdTrans_MatrixFree_Tri"),
245  BwdTrans_MatrixFree::create, "BwdTrans_MatrixFree_Hex"),
248  BwdTrans_MatrixFree::create, "BwdTrans_MatrixFree_Prism"),
251  BwdTrans_MatrixFree::create, "BwdTrans_MatrixFree_Tet"),
254  BwdTrans_MatrixFree::create, "BwdTrans_MatrixFree_Pyr")
255 };
256 
257 /**
258  * @brief Backward transform operator using default StdRegions operator
259  */
261 {
262 public:
264 
266  {
267  }
268 
270  Array<OneD, NekDouble> &output,
271  Array<OneD, NekDouble> &output1,
272  Array<OneD, NekDouble> &output2,
274  {
275  boost::ignore_unused(output1, output2, wsp);
276 
277  const int nCoeffs = m_stdExp->GetNcoeffs();
278  const int nPhys = m_stdExp->GetTotPoints();
280 
281  for (int i = 0; i < m_numElmt; ++i)
282  {
283  m_stdExp->BwdTrans(input + i*nCoeffs, tmp = output + i*nPhys);
284  }
285  }
286 
287  void operator()(int dir,
288  const Array<OneD, const NekDouble> &input,
289  Array<OneD, NekDouble> &output,
290  Array<OneD, NekDouble> &wsp) final
291  {
292  boost::ignore_unused(dir, input, output, wsp);
293  ASSERTL0(false, "Not valid for this operator.");
294  }
295 
296  virtual void CheckFactors(StdRegions::FactorMap factors,
297  int coll_phys_offset)
298  {
299  boost::ignore_unused(factors, coll_phys_offset);
300  ASSERTL0(false, "Not valid for this operator.");
301  }
302 
303 
304 private:
305  BwdTrans_IterPerExp(vector<StdRegions::StdExpansionSharedPtr> pCollExp,
306  CoalescedGeomDataSharedPtr pGeomData,
307  StdRegions::FactorMap factors)
308  : Operator(pCollExp, pGeomData, factors)
309  {
310  }
311 };
312 
313 /// Factory initialisation for the BwdTrans_IterPerExp operators
314 OperatorKey BwdTrans_IterPerExp::m_typeArr[] = {
317  BwdTrans_IterPerExp::create, "BwdTrans_IterPerExp_Seg"),
320  BwdTrans_IterPerExp::create, "BwdTrans_IterPerExp_Tri"),
323  BwdTrans_IterPerExp::create, "BwdTrans_IterPerExp_NodalTri"),
326  BwdTrans_IterPerExp::create, "BwdTrans_IterPerExp_Quad"),
329  BwdTrans_IterPerExp::create, "BwdTrans_IterPerExp_Tet"),
332  BwdTrans_IterPerExp::create, "BwdTrans_IterPerExp_NodalTet"),
335  BwdTrans_IterPerExp::create, "BwdTrans_IterPerExp_Pyr"),
338  BwdTrans_IterPerExp::create, "BwdTrans_IterPerExp_Prism"),
341  BwdTrans_IterPerExp::create, "BwdTrans_IterPerExp_NodalPrism"),
344  BwdTrans_IterPerExp::create, "BwdTrans_IterPerExp_Hex"),
345 };
346 
347 /**
348  * @brief Backward transform operator using LocalRegions implementation.
349  */
351 {
352 public:
354 
356  {
357  }
358 
360  Array<OneD, NekDouble> &output,
361  Array<OneD, NekDouble> &output1,
362  Array<OneD, NekDouble> &output2,
364  {
365  boost::ignore_unused(output1, output2, wsp);
366 
367  const int nCoeffs = m_expList[0]->GetNcoeffs();
368  const int nPhys = m_expList[0]->GetTotPoints();
370 
371  for (int i = 0; i < m_numElmt; ++i)
372  {
373  m_expList[i]->BwdTrans(input + i*nCoeffs,
374  tmp = output + i*nPhys);
375  }
376  }
377 
378  void operator()(int dir,
379  const Array<OneD, const NekDouble> &input,
380  Array<OneD, NekDouble> &output,
381  Array<OneD, NekDouble> &wsp) final
382  {
383  boost::ignore_unused(dir, input, output, wsp);
384  ASSERTL0(false, "Not valid for this operator.");
385  }
386 
387  virtual void CheckFactors(StdRegions::FactorMap factors,
388  int coll_phys_offset)
389  {
390  boost::ignore_unused(factors, coll_phys_offset);
391  ASSERTL0(false, "Not valid for this operator.");
392  }
393 
394 protected:
395  vector<StdRegions::StdExpansionSharedPtr> m_expList;
396 
397 private:
398  BwdTrans_NoCollection(vector<StdRegions::StdExpansionSharedPtr> pCollExp,
399  CoalescedGeomDataSharedPtr pGeomData,
400  StdRegions::FactorMap factors)
401  : Operator(pCollExp, pGeomData, factors)
402  {
403  m_expList = pCollExp;
404  }
405 };
406 
407 /// Factory initialisation for the BwdTrans_NoCollection operators
408 OperatorKey BwdTrans_NoCollection::m_typeArr[] = {
411  BwdTrans_NoCollection::create, "BwdTrans_NoCollection_Seg"),
414  BwdTrans_NoCollection::create, "BwdTrans_NoCollection_Tri"),
417  BwdTrans_NoCollection::create, "BwdTrans_NoCollection_NodalTri"),
420  BwdTrans_NoCollection::create, "BwdTrans_NoCollection_Quad"),
423  BwdTrans_NoCollection::create, "BwdTrans_NoCollection_Tet"),
426  BwdTrans_NoCollection::create, "BwdTrans_NoCollection_NodalTet"),
429  BwdTrans_NoCollection::create, "BwdTrans_NoCollection_Pyr"),
432  BwdTrans_NoCollection::create, "BwdTrans_NoCollection_Prism"),
435  BwdTrans_NoCollection::create, "BwdTrans_NoCollection_NodalPrism"),
438  BwdTrans_NoCollection::create, "BwdTrans_NoCollection_Hex"),
439 };
440 
441 /**
442  * @brief Backward transform operator using sum-factorisation (Segment)
443  */
445 {
446 public:
448 
450  {
451  }
452 
454  Array<OneD, NekDouble> &output,
455  Array<OneD, NekDouble> &output1,
456  Array<OneD, NekDouble> &output2,
458  {
459  boost::ignore_unused(output1, output2, wsp);
460  if(m_colldir0)
461  {
462  Vmath::Vcopy(m_numElmt*m_nmodes0,input.get(),1,output.get(),1);
463  }
464  else
465  {
466  // out = B0*in;
467  Blas::Dgemm('N','N', m_nquad0, m_numElmt, m_nmodes0,
468  1.0, m_base0.get(), m_nquad0,
469  &input[0], m_nmodes0, 0.0,
470  &output[0], m_nquad0);
471  }
472  }
473 
474  void operator()(int dir,
475  const Array<OneD, const NekDouble> &input,
476  Array<OneD, NekDouble> &output,
477  Array<OneD, NekDouble> &wsp) final
478  {
479  boost::ignore_unused(dir, input, output, wsp);
480  ASSERTL0(false, "Not valid for this operator.");
481  }
482 
483  virtual void CheckFactors(StdRegions::FactorMap factors,
484  int coll_phys_offset)
485  {
486  boost::ignore_unused(factors, coll_phys_offset);
487  ASSERTL0(false, "Not valid for this operator.");
488  }
489 
490 
491 protected:
492  const int m_nquad0;
493  const int m_nmodes0;
494  const bool m_colldir0;
496 
497 private:
498  BwdTrans_SumFac_Seg(vector<StdRegions::StdExpansionSharedPtr> pCollExp,
499  CoalescedGeomDataSharedPtr pGeomData,
500  StdRegions::FactorMap factors)
501  : Operator(pCollExp, pGeomData, factors), m_nquad0(m_stdExp->GetNumPoints(0)),
502  m_nmodes0(m_stdExp->GetBasisNumModes(0)),
503  m_colldir0(m_stdExp->GetBasis(0)->Collocation()),
504  m_base0(m_stdExp->GetBasis(0)->GetBdata())
505  {
506  m_wspSize = 0;
507  }
508 };
509 
510 /// Factory initialisation for the BwdTrans_SumFac_Seg operator
511 OperatorKey BwdTrans_SumFac_Seg::m_type =
514  BwdTrans_SumFac_Seg::create, "BwdTrans_SumFac_Seg");
515 
516 /**
517  * @brief Backward transform operator using sum-factorisation (Quad)
518  */
520 {
521 public:
523 
525  {
526  }
527 
529  Array<OneD, NekDouble> &output,
530  Array<OneD, NekDouble> &output1,
531  Array<OneD, NekDouble> &output2,
533  {
534  boost::ignore_unused(output1, output2);
535 
536  int i = 0;
537  if (m_colldir0 && m_colldir1)
538  {
539  Vmath::Vcopy(m_numElmt * m_nmodes0 * m_nmodes1, input.get(), 1,
540  output.get(), 1);
541  }
542  else if (m_colldir0)
543  {
545  m_stdExp->GetBasis(1)->GetBdata();
546 
547  for (i = 0; i < m_numElmt; ++i)
548  {
549  Blas::Dgemm('N', 'T', m_nquad0, m_nquad1, m_nmodes1, 1.0,
550  &input[i * m_nquad0 * m_nmodes1], m_nquad0,
551  base1.get(), m_nquad1, 0.0,
552  &output[i * m_nquad0 * m_nquad1], m_nquad0);
553  }
554  }
555  else if (m_colldir1)
556  {
557  Blas::Dgemm('N', 'N', m_nquad0, m_nmodes1 * m_numElmt, m_nmodes0,
558  1.0, m_base0.get(), m_nquad0, &input[0], m_nmodes0, 0.0,
559  &output[0], m_nquad0);
560  }
561  else
562  {
563  ASSERTL1(wsp.size() == m_wspSize, "Incorrect workspace size");
564 
565  // Those two calls correpsond to the operation
566  // out = B0*in*Transpose(B1);
567  Blas::Dgemm('N', 'N', m_nquad0, m_nmodes1 * m_numElmt, m_nmodes0,
568  1.0, m_base0.get(), m_nquad0, &input[0], m_nmodes0, 0.0,
569  &wsp[0], m_nquad0);
570 
571  for (i = 0; i < m_numElmt; ++i)
572  {
573  Blas::Dgemm('N', 'T', m_nquad0, m_nquad1, m_nmodes1, 1.0,
574  &wsp[i * m_nquad0 * m_nmodes1], m_nquad0,
575  m_base1.get(), m_nquad1, 0.0,
576  &output[i * m_nquad0 * m_nquad1], m_nquad0);
577  }
578  }
579  }
580 
581  void operator()(int dir, const Array<OneD, const NekDouble> &input,
582  Array<OneD, NekDouble> &output,
583  Array<OneD, NekDouble> &wsp) final
584  {
585  boost::ignore_unused(dir, input, output, wsp);
586  ASSERTL0(false, "Not valid for this operator.");
587  }
588 
589  virtual void CheckFactors(StdRegions::FactorMap factors,
590  int coll_phys_offset)
591  {
592  boost::ignore_unused(factors, coll_phys_offset);
593  ASSERTL0(false, "Not valid for this operator.");
594  }
595 
596 
597 protected:
598  const int m_nquad0;
599  const int m_nquad1;
600  const int m_nmodes0;
601  const int m_nmodes1;
602  const bool m_colldir0;
603  const bool m_colldir1;
606 
607 private:
608  BwdTrans_SumFac_Quad(vector<StdRegions::StdExpansionSharedPtr> pCollExp,
609  CoalescedGeomDataSharedPtr pGeomData,
610  StdRegions::FactorMap factors)
611  : Operator(pCollExp, pGeomData, factors), m_nquad0(m_stdExp->GetNumPoints(0)),
612  m_nquad1(m_stdExp->GetNumPoints(1)),
613  m_nmodes0(m_stdExp->GetBasisNumModes(0)),
614  m_nmodes1(m_stdExp->GetBasisNumModes(1)),
615  m_colldir0(m_stdExp->GetBasis(0)->Collocation()),
616  m_colldir1(m_stdExp->GetBasis(1)->Collocation()),
617  m_base0(m_stdExp->GetBasis(0)->GetBdata()),
618  m_base1(m_stdExp->GetBasis(1)->GetBdata())
619  {
620  m_wspSize = m_nquad0 * m_nmodes1 * m_numElmt;
621  }
622 };
623 
624 /// Factory initialisation for the BwdTrans_SumFac_Quad operator
625 OperatorKey BwdTrans_SumFac_Quad::m_type =
628  BwdTrans_SumFac_Quad::create, "BwdTrans_SumFac_Quad");
629 
630 /**
631  * @brief Backward transform operator using sum-factorisation (Tri)
632  */
634 {
635 public:
637 
639  {
640  }
641 
643  Array<OneD, NekDouble> &output,
644  Array<OneD, NekDouble> &output1,
645  Array<OneD, NekDouble> &output2,
647  {
648  boost::ignore_unused(output1, output2);
649 
650  ASSERTL1(wsp.size() == m_wspSize, "Incorrect workspace size");
651 
652  int ncoeffs = m_stdExp->GetNcoeffs();
653  int i = 0;
654  int mode = 0;
655 
656  for (i = mode = 0; i < m_nmodes0; ++i)
657  {
658  Blas::Dgemm('N', 'N', m_nquad1, m_numElmt, m_nmodes1 - i, 1.0,
659  m_base1.get() + mode * m_nquad1, m_nquad1,
660  &input[0] + mode, ncoeffs, 0.0,
661  &wsp[i * m_nquad1 * m_numElmt], m_nquad1);
662  mode += m_nmodes1 - i;
663  }
664 
665  // fix for modified basis by splitting top vertex mode
666  if (m_sortTopVertex)
667  {
668  for (i = 0; i < m_numElmt; ++i)
669  {
670  Blas::Daxpy(m_nquad1, input[1 + i * ncoeffs],
671  m_base1.get() + m_nquad1, 1,
672  &wsp[m_nquad1 * m_numElmt] + i * m_nquad1, 1);
673  }
674  }
675 
676  Blas::Dgemm('N', 'T', m_nquad0, m_nquad1 * m_numElmt, m_nmodes0, 1.0,
677  m_base0.get(), m_nquad0, &wsp[0], m_nquad1 * m_numElmt, 0.0,
678  &output[0], m_nquad0);
679  }
680 
681  void operator()(int dir, const Array<OneD, const NekDouble> &input,
682  Array<OneD, NekDouble> &output,
683  Array<OneD, NekDouble> &wsp) final
684  {
685  boost::ignore_unused(dir, input, output, wsp);
686  ASSERTL0(false, "Not valid for this operator.");
687  }
688 
689  virtual void CheckFactors(StdRegions::FactorMap factors,
690  int coll_phys_offset)
691  {
692  boost::ignore_unused(factors, coll_phys_offset);
693  ASSERTL0(false, "Not valid for this operator.");
694  }
695 
696 
697 protected:
698  const int m_nquad0;
699  const int m_nquad1;
700  const int m_nmodes0;
701  const int m_nmodes1;
705 
706 private:
707  BwdTrans_SumFac_Tri(vector<StdRegions::StdExpansionSharedPtr> pCollExp,
708  CoalescedGeomDataSharedPtr pGeomData,
709  StdRegions::FactorMap factors)
710  : Operator(pCollExp, pGeomData, factors), m_nquad0(m_stdExp->GetNumPoints(0)),
711  m_nquad1(m_stdExp->GetNumPoints(1)),
712  m_nmodes0(m_stdExp->GetBasisNumModes(0)),
713  m_nmodes1(m_stdExp->GetBasisNumModes(1)),
714  m_base0(m_stdExp->GetBasis(0)->GetBdata()),
715  m_base1(m_stdExp->GetBasis(1)->GetBdata())
716  {
717  m_wspSize = m_nquad0 * m_nmodes1 * m_numElmt;
718  if (m_stdExp->GetBasis(0)->GetBasisType() == LibUtilities::eModified_A)
719  {
720  m_sortTopVertex = true;
721  }
722  else
723  {
724  m_sortTopVertex = false;
725  }
726  }
727 };
728 
729 /// Factory initialisation for the BwdTrans_SumFac_Tri operator
730 OperatorKey BwdTrans_SumFac_Tri::m_type =
733  BwdTrans_SumFac_Tri::create, "BwdTrans_SumFac_Tri");
734 
735 /// Backward transform operator using sum-factorisation (Hex)
737 {
738 public:
740 
742  {
743  }
744 
746  Array<OneD, NekDouble> &output,
747  Array<OneD, NekDouble> &output1,
748  Array<OneD, NekDouble> &output2,
750  {
751  boost::ignore_unused(output1, output2);
752 
753  if (m_colldir0 && m_colldir1 && m_colldir2)
754  {
755  Vmath::Vcopy(m_numElmt * m_nmodes0 * m_nmodes1 * m_nmodes2,
756  input.get(), 1,
757  output.get(), 1);
758  }
759  else
760  {
761  ASSERTL1(wsp.size() == m_wspSize, "Incorrect workspace size");
762 
763  // Assign second half of workspace for 2nd DGEMM operation.
764  int totmodes = m_nmodes0 * m_nmodes1 * m_nmodes2;
765 
767  wsp + m_nmodes0 * m_nmodes1 * m_nquad2 * m_numElmt;
768 
769  // loop over elements and do bwd trans wrt c
770  for (int n = 0; n < m_numElmt; ++n)
771  {
772  Blas::Dgemm('N', 'T', m_nquad2, m_nmodes0 * m_nmodes1,
773  m_nmodes2, 1.0, m_base2.get(), m_nquad2,
774  &input[n * totmodes], m_nmodes0 * m_nmodes1, 0.0,
775  &wsp[n * m_nquad2], m_nquad2 * m_numElmt);
776  }
777 
778  // trans wrt b
779  Blas::Dgemm('N', 'T', m_nquad1, m_nquad2 * m_numElmt * m_nmodes0,
780  m_nmodes1, 1.0, m_base1.get(), m_nquad1, wsp.get(),
781  m_nquad2 * m_numElmt * m_nmodes0, 0.0, wsp2.get(),
782  m_nquad1);
783 
784  // trans wrt a
785  Blas::Dgemm('N', 'T', m_nquad0, m_nquad1 * m_nquad2 * m_numElmt,
786  m_nmodes0, 1.0, m_base0.get(), m_nquad0, wsp2.get(),
787  m_nquad1 * m_nquad2 * m_numElmt, 0.0, output.get(),
788  m_nquad0);
789  }
790  }
791 
792  void operator()(int dir, const Array<OneD, const NekDouble> &input,
793  Array<OneD, NekDouble> &output,
794  Array<OneD, NekDouble> &wsp) final
795  {
796  boost::ignore_unused(dir, input, output, wsp);
797  ASSERTL0(false, "Not valid for this operator.");
798  }
799 
800  virtual void CheckFactors(StdRegions::FactorMap factors,
801  int coll_phys_offset)
802  {
803  boost::ignore_unused(factors, coll_phys_offset);
804  ASSERTL0(false, "Not valid for this operator.");
805  }
806 
807 protected:
808  const int m_nquad0;
809  const int m_nquad1;
810  const int m_nquad2;
811  const int m_nmodes0;
812  const int m_nmodes1;
813  const int m_nmodes2;
817  const bool m_colldir0;
818  const bool m_colldir1;
819  const bool m_colldir2;
820 
821 private:
822  BwdTrans_SumFac_Hex(vector<StdRegions::StdExpansionSharedPtr> pCollExp,
823  CoalescedGeomDataSharedPtr pGeomData,
824  StdRegions::FactorMap factors)
825  : Operator(pCollExp, pGeomData, factors), m_nquad0(pCollExp[0]->GetNumPoints(0)),
826  m_nquad1(pCollExp[0]->GetNumPoints(1)),
827  m_nquad2(pCollExp[0]->GetNumPoints(2)),
828  m_nmodes0(pCollExp[0]->GetBasisNumModes(0)),
829  m_nmodes1(pCollExp[0]->GetBasisNumModes(1)),
830  m_nmodes2(pCollExp[0]->GetBasisNumModes(2)),
831  m_base0(pCollExp[0]->GetBasis(0)->GetBdata()),
832  m_base1(pCollExp[0]->GetBasis(1)->GetBdata()),
833  m_base2(pCollExp[0]->GetBasis(2)->GetBdata()),
834  m_colldir0(pCollExp[0]->GetBasis(0)->Collocation()),
835  m_colldir1(pCollExp[0]->GetBasis(1)->Collocation()),
836  m_colldir2(pCollExp[0]->GetBasis(2)->Collocation())
837  {
838  m_wspSize = m_numElmt * m_nmodes0 *
839  (m_nmodes1 * m_nquad2 + m_nquad1 * m_nquad2);
840  }
841 };
842 
843 /// Factory initialisation for the BwdTrans_SumFac_Hex operator
844 OperatorKey BwdTrans_SumFac_Hex::m_type =
847  BwdTrans_SumFac_Hex::create, "BwdTrans_SumFac_Hex");
848 
849 /**
850  * @brief Backward transform operator using sum-factorisation (Tet)
851  */
853 {
854 public:
856 
858  {
859  }
860 
862  Array<OneD, NekDouble> &output,
863  Array<OneD, NekDouble> &output1,
864  Array<OneD, NekDouble> &output2,
865  Array<OneD, NekDouble> &wsp) final
866  {
867  boost::ignore_unused(output1, output2);
868 
869  ASSERTL1(wsp.size() == m_wspSize, "Incorrect workspace size");
870 
871  Array<OneD, NekDouble> tmp = wsp;
873  tmp + m_numElmt * m_nquad2 * m_nmodes0 *
874  (2 * m_nmodes1 - m_nmodes0 + 1) / 2;
875 
876  int mode = 0;
877  int mode1 = 0;
878  int cnt = 0;
879  int ncoeffs = m_stdExp->GetNcoeffs();
880 
881  // Perform summation over '2' direction
882  for (int i = 0; i < m_nmodes0; ++i)
883  {
884  for (int j = 0; j < m_nmodes1 - i; ++j, ++cnt)
885  {
886  Blas::Dgemm('N', 'N', m_nquad2, m_numElmt, m_nmodes2 - i - j,
887  1.0, m_base2.get() + mode * m_nquad2, m_nquad2,
888  input.get() + mode1, ncoeffs, 0.0,
889  tmp.get() + cnt * m_nquad2 * m_numElmt, m_nquad2);
890  mode += m_nmodes2 - i - j;
891  mode1 += m_nmodes2 - i - j;
892  }
893 
894  // increment mode in case m_nmodes1!=m_nmodes2
895  mode += (m_nmodes2 - m_nmodes1) * (m_nmodes2 - m_nmodes1 + 1) / 2;
896  }
897 
898  // vertex mode - currently (1+c)/2 x (1-b)/2 x (1-a)/2
899  // component is evaluated
900  if (m_sortTopEdge)
901  {
902  for (int i = 0; i < m_numElmt; ++i)
903  {
904  // top singular vertex
905  // (1+c)/2 x (1+b)/2 x (1-a)/2 component
906  Blas::Daxpy(m_nquad2, input[1 + i * ncoeffs],
907  m_base2.get() + m_nquad2, 1,
908  &tmp[m_nquad2 * m_numElmt] + i * m_nquad2, 1);
909 
910  // top singular vertex
911  // (1+c)/2 x (1-b)/2 x (1+a)/2 component
912  Blas::Daxpy(
913  m_nquad2, input[1 + i * ncoeffs], m_base2.get() + m_nquad2,
914  1, &tmp[m_nmodes1 * m_nquad2 * m_numElmt] + i * m_nquad2,
915  1);
916  }
917  }
918 
919  // Perform summation over '1' direction
920  mode = 0;
921  for (int i = 0; i < m_nmodes0; ++i)
922  {
923  Blas::Dgemm('N', 'T', m_nquad1, m_nquad2 * m_numElmt, m_nmodes1 - i,
924  1.0, m_base1.get() + mode * m_nquad1, m_nquad1,
925  tmp.get() + mode * m_nquad2 * m_numElmt,
926  m_nquad2 * m_numElmt, 0.0,
927  tmp1.get() + i * m_nquad1 * m_nquad2 * m_numElmt,
928  m_nquad1);
929  mode += m_nmodes1 - i;
930  }
931 
932  // fix for modified basis by adding additional split of
933  // top and base singular vertex modes as well as singular
934  // edge
935  if (m_sortTopEdge)
936  {
937  // this could probably be a dgemv or higher if we
938  // made a specialised m_base1[m_nuqad1] array
939  // containing multiply copies
940  for (int i = 0; i < m_numElmt; ++i)
941  {
942  // sort out singular vertices and singular
943  // edge components with (1+b)/2 (1+a)/2 form
944  for (int j = 0; j < m_nquad2; ++j)
945  {
946  Blas::Daxpy(m_nquad1,
947  tmp[m_nquad2 * m_numElmt + i * m_nquad2 + j],
948  m_base1.get() + m_nquad1, 1,
949  &tmp1[m_nquad1 * m_nquad2 * m_numElmt] +
950  i * m_nquad1 * m_nquad2 + j * m_nquad1,
951  1);
952  }
953  }
954  }
955 
956  // Perform summation over '0' direction
957  Blas::Dgemm('N', 'T', m_nquad0, m_nquad1 * m_nquad2 * m_numElmt,
958  m_nmodes0, 1.0, m_base0.get(), m_nquad0, tmp1.get(),
959  m_nquad1 * m_nquad2 * m_numElmt, 0.0, output.get(),
960  m_nquad0);
961  }
962 
963  void operator()(int dir, const Array<OneD, const NekDouble> &input,
964  Array<OneD, NekDouble> &output,
965  Array<OneD, NekDouble> &wsp) final
966  {
967  boost::ignore_unused(dir, input, output, wsp);
968  ASSERTL0(false, "Not valid for this operator.");
969  }
970 
971  virtual void CheckFactors(StdRegions::FactorMap factors,
972  int coll_phys_offset)
973  {
974  boost::ignore_unused(factors, coll_phys_offset);
975  ASSERTL0(false, "Not valid for this operator.");
976  }
977 
978 
979 protected:
980  const int m_nquad0;
981  const int m_nquad1;
982  const int m_nquad2;
983  const int m_nmodes0;
984  const int m_nmodes1;
985  const int m_nmodes2;
990 
991 private:
992  BwdTrans_SumFac_Tet(vector<StdRegions::StdExpansionSharedPtr> pCollExp,
993  CoalescedGeomDataSharedPtr pGeomData,
994  StdRegions::FactorMap factors)
995  : Operator(pCollExp, pGeomData, factors), m_nquad0(m_stdExp->GetNumPoints(0)),
996  m_nquad1(m_stdExp->GetNumPoints(1)),
997  m_nquad2(m_stdExp->GetNumPoints(2)),
998  m_nmodes0(m_stdExp->GetBasisNumModes(0)),
999  m_nmodes1(m_stdExp->GetBasisNumModes(1)),
1000  m_nmodes2(m_stdExp->GetBasisNumModes(2)),
1001  m_base0(m_stdExp->GetBasis(0)->GetBdata()),
1002  m_base1(m_stdExp->GetBasis(1)->GetBdata()),
1003  m_base2(m_stdExp->GetBasis(2)->GetBdata())
1004  {
1005  m_wspSize = m_numElmt * (m_nquad2 * m_nmodes0 *
1006  (2 * m_nmodes1 - m_nmodes0 + 1) / 2 +
1007  m_nquad2 * m_nquad1 * m_nmodes0);
1008 
1009  if (m_stdExp->GetBasis(0)->GetBasisType() == LibUtilities::eModified_A)
1010  {
1011  m_sortTopEdge = true;
1012  }
1013  else
1014  {
1015  m_sortTopEdge = false;
1016  }
1017  }
1018 };
1019 
1020 /// Factory initialisation for the BwdTrans_SumFac_Tet operator
1021 OperatorKey BwdTrans_SumFac_Tet::m_type =
1024  BwdTrans_SumFac_Tet::create, "BwdTrans_SumFac_Tet");
1025 
1026 /**
1027  * @brief Backward transform operator using sum-factorisation (Prism)
1028  */
1030 {
1031 public:
1033 
1035  {
1036  }
1037 
1039  Array<OneD, NekDouble> &output,
1040  Array<OneD, NekDouble> &output1,
1041  Array<OneD, NekDouble> &output2,
1042  Array<OneD, NekDouble> &wsp) final
1043  {
1044  boost::ignore_unused(output1, output2);
1045 
1046  ASSERTL1(wsp.size() == m_wspSize, "Incorrect workspace size");
1047 
1048  // Assign second half of workspace for 2nd DGEMM operation.
1049  int totmodes = m_stdExp->GetNcoeffs();
1050 
1051  Array<OneD, NekDouble> wsp2 =
1052  wsp + m_nmodes0 * m_nmodes1 * m_nquad2 * m_numElmt;
1053 
1054  Vmath::Zero(m_nmodes0 * m_nmodes1 * m_nquad2 * m_numElmt, wsp, 1);
1055  int i = 0;
1056  int j = 0;
1057  int mode = 0;
1058  int mode1 = 0;
1059  int cnt = 0;
1060  for (i = mode = mode1 = 0; i < m_nmodes0; ++i)
1061  {
1062  cnt = i * m_nquad2 * m_numElmt;
1063  for (j = 0; j < m_nmodes1; ++j)
1064  {
1065  Blas::Dgemm('N', 'N', m_nquad2, m_numElmt, m_nmodes2 - i, 1.0,
1066  m_base2.get() + mode * m_nquad2, m_nquad2,
1067  input.get() + mode1, totmodes, 0.0,
1068  &wsp[j * m_nquad2 * m_numElmt * m_nmodes0 + cnt],
1069  m_nquad2);
1070  mode1 += m_nmodes2 - i;
1071  }
1072  mode += m_nmodes2 - i;
1073  }
1074 
1075  // fix for modified basis by splitting top vertex mode
1076  if (m_sortTopVertex)
1077  {
1078  for (j = 0; j < m_nmodes1; ++j)
1079  {
1080  for (i = 0; i < m_numElmt; ++i)
1081  {
1082  Blas::Daxpy(m_nquad2,
1083  input[1 + i * totmodes + j * m_nmodes2],
1084  m_base2.get() + m_nquad2, 1,
1085  &wsp[j * m_nquad2 * m_numElmt * m_nmodes0 +
1086  m_nquad2 * m_numElmt] +
1087  i * m_nquad2,
1088  1);
1089  }
1090  }
1091  // Believe this could be made into a m_nmodes1
1092  // dgemv if we made an array of m_numElmt copies
1093  // of m_base2[m_quad2] (which are of size
1094  // m_nquad2.
1095  }
1096 
1097  // Perform summation over '1' direction
1098  Blas::Dgemm('N', 'T', m_nquad1, m_nquad2 * m_numElmt * m_nmodes0,
1099  m_nmodes1, 1.0, m_base1.get(), m_nquad1, wsp.get(),
1100  m_nquad2 * m_numElmt * m_nmodes0, 0.0, wsp2.get(),
1101  m_nquad1);
1102 
1103  // Perform summation over '0' direction
1104  Blas::Dgemm('N', 'T', m_nquad0, m_nquad1 * m_nquad2 * m_numElmt,
1105  m_nmodes0, 1.0, m_base0.get(), m_nquad0, wsp2.get(),
1106  m_nquad1 * m_nquad2 * m_numElmt, 0.0, output.get(),
1107  m_nquad0);
1108  }
1109 
1110  void operator()(int dir, const Array<OneD, const NekDouble> &input,
1111  Array<OneD, NekDouble> &output,
1112  Array<OneD, NekDouble> &wsp) final
1113  {
1114  boost::ignore_unused(dir, input, output, wsp);
1115  ASSERTL0(false, "Not valid for this operator.");
1116  }
1117 
1118  virtual void CheckFactors(StdRegions::FactorMap factors,
1119  int coll_phys_offset)
1120  {
1121  boost::ignore_unused(factors, coll_phys_offset);
1122  ASSERTL0(false, "Not valid for this operator.");
1123  }
1124 
1125 
1126 protected:
1127  const int m_nquad0;
1128  const int m_nquad1;
1129  const int m_nquad2;
1130  const int m_nmodes0;
1131  const int m_nmodes1;
1132  const int m_nmodes2;
1137 
1138 private:
1139  BwdTrans_SumFac_Prism(vector<StdRegions::StdExpansionSharedPtr> pCollExp,
1140  CoalescedGeomDataSharedPtr pGeomData,
1141  StdRegions::FactorMap factors)
1142  : Operator(pCollExp, pGeomData, factors), m_nquad0(m_stdExp->GetNumPoints(0)),
1143  m_nquad1(m_stdExp->GetNumPoints(1)),
1144  m_nquad2(m_stdExp->GetNumPoints(2)),
1145  m_nmodes0(m_stdExp->GetBasisNumModes(0)),
1146  m_nmodes1(m_stdExp->GetBasisNumModes(1)),
1147  m_nmodes2(m_stdExp->GetBasisNumModes(2)),
1148  m_base0(m_stdExp->GetBasis(0)->GetBdata()),
1149  m_base1(m_stdExp->GetBasis(1)->GetBdata()),
1150  m_base2(m_stdExp->GetBasis(2)->GetBdata())
1151  {
1152  m_wspSize = m_numElmt * m_nmodes0 *
1153  (m_nmodes1 * m_nquad2 + m_nquad1 * m_nquad2);
1154 
1155  if (m_stdExp->GetBasis(0)->GetBasisType() == LibUtilities::eModified_A)
1156  {
1157  m_sortTopVertex = true;
1158  }
1159  else
1160  {
1161  m_sortTopVertex = false;
1162  }
1163  }
1164 };
1165 
1166 /// Factory initialisation for the BwdTrans_SumFac_Prism operator
1167 OperatorKey BwdTrans_SumFac_Prism::m_type =
1169  OperatorKey(ePrism, eBwdTrans, eSumFac, false),
1170  BwdTrans_SumFac_Prism::create, "BwdTrans_SumFac_Prism");
1171 
1172 /**
1173  * @brief Backward transform operator using sum-factorisation (Pyr)
1174  */
1176 {
1177 public:
1179 
1181  {
1182  }
1183 
1185  Array<OneD, NekDouble> &output,
1186  Array<OneD, NekDouble> &output1,
1187  Array<OneD, NekDouble> &output2,
1188  Array<OneD, NekDouble> &wsp) final
1189  {
1190  boost::ignore_unused(output1, output2);
1191 
1192  ASSERTL1(wsp.size() == m_wspSize, "Incorrect workspace size");
1193 
1194  // Assign second half of workspace for 2nd DGEMM operation.
1195  int totmodes = m_stdExp->GetNcoeffs();
1196 
1197  Array<OneD, NekDouble> wsp2 =
1198  wsp + m_nmodes0 * m_nmodes1 * m_nquad2 * m_numElmt;
1199 
1200  Vmath::Zero(m_nmodes0 * m_nmodes1 * m_nquad2 * m_numElmt, wsp, 1);
1201  int i = 0;
1202  int j = 0;
1203  int mode = 0;
1204  int mode1 = 0;
1205  int cnt = 0;
1206  for (i = 0; i < m_nmodes0; ++i)
1207  {
1208  for (j = 0; j < m_nmodes1; ++j, ++cnt)
1209  {
1210  int ijmax = max(i, j);
1211  Blas::Dgemm('N', 'N', m_nquad2, m_numElmt, m_nmodes2 - ijmax,
1212  1.0, m_base2.get() + mode * m_nquad2, m_nquad2,
1213  input.get() + mode1, totmodes, 0.0,
1214  wsp.get() + cnt * m_nquad2 * m_numElmt, m_nquad2);
1215  mode += m_nmodes2 - ijmax;
1216  mode1 += m_nmodes2 - ijmax;
1217  }
1218 
1219  // increment mode in case order1!=order2
1220  for (j = m_nmodes1; j < m_nmodes2 - i; ++j)
1221  {
1222  int ijmax = max(i, j);
1223  mode += m_nmodes2 - ijmax;
1224  }
1225  }
1226 
1227  // vertex mode - currently (1+c)/2 x (1-b)/2 x (1-a)/2
1228  // component is evaluated
1229  if (m_sortTopVertex)
1230  {
1231  for (i = 0; i < m_numElmt; ++i)
1232  {
1233  // top singular vertex
1234  // (1+c)/2 x (1+b)/2 x (1-a)/2 component
1235  Blas::Daxpy(m_nquad2, input[1 + i * totmodes],
1236  m_base2.get() + m_nquad2, 1,
1237  &wsp[m_nquad2 * m_numElmt] + i * m_nquad2, 1);
1238 
1239  // top singular vertex
1240  // (1+c)/2 x (1-b)/2 x (1+a)/2 component
1241  Blas::Daxpy(
1242  m_nquad2, input[1 + i * totmodes], m_base2.get() + m_nquad2,
1243  1, &wsp[m_nmodes1 * m_nquad2 * m_numElmt] + i * m_nquad2,
1244  1);
1245 
1246  // top singular vertex
1247  // (1+c)/2 x (1+b)/2 x (1+a)/2 component
1248  Blas::Daxpy(m_nquad2, input[1 + i * totmodes],
1249  m_base2.get() + m_nquad2, 1,
1250  &wsp[(m_nmodes1 + 1) * m_nquad2 * m_numElmt] +
1251  i * m_nquad2,
1252  1);
1253  }
1254  }
1255 
1256  // Perform summation over '1' direction
1257  mode = 0;
1258  for (i = 0; i < m_nmodes0; ++i)
1259  {
1260  Blas::Dgemm('N', 'T', m_nquad1, m_nquad2 * m_numElmt, m_nmodes1,
1261  1.0, m_base1.get(), m_nquad1,
1262  wsp.get() + mode * m_nquad2 * m_numElmt,
1263  m_nquad2 * m_numElmt, 0.0,
1264  wsp2.get() + i * m_nquad1 * m_nquad2 * m_numElmt,
1265  m_nquad1);
1266  mode += m_nmodes1;
1267  }
1268 
1269  // Perform summation over '0' direction
1270  Blas::Dgemm('N', 'T', m_nquad0, m_nquad1 * m_nquad2 * m_numElmt,
1271  m_nmodes0, 1.0, m_base0.get(), m_nquad0, wsp2.get(),
1272  m_nquad1 * m_nquad2 * m_numElmt, 0.0, output.get(),
1273  m_nquad0);
1274  }
1275 
1276  void operator()(int dir, const Array<OneD, const NekDouble> &input,
1277  Array<OneD, NekDouble> &output,
1278  Array<OneD, NekDouble> &wsp) final
1279  {
1280  boost::ignore_unused(dir, input, output, wsp);
1281  ASSERTL0(false, "Not valid for this operator.");
1282  }
1283 
1284  virtual void CheckFactors(StdRegions::FactorMap factors,
1285  int coll_phys_offset)
1286  {
1287  boost::ignore_unused(factors, coll_phys_offset);
1288  ASSERTL0(false, "Not valid for this operator.");
1289  }
1290 
1291 
1292 protected:
1293  const int m_nquad0;
1294  const int m_nquad1;
1295  const int m_nquad2;
1296  const int m_nmodes0;
1297  const int m_nmodes1;
1298  const int m_nmodes2;
1303 
1304 private:
1305  BwdTrans_SumFac_Pyr(vector<StdRegions::StdExpansionSharedPtr> pCollExp,
1306  CoalescedGeomDataSharedPtr pGeomData,
1307  StdRegions::FactorMap factors)
1308  : Operator(pCollExp, pGeomData, factors), m_nquad0(m_stdExp->GetNumPoints(0)),
1309  m_nquad1(m_stdExp->GetNumPoints(1)),
1310  m_nquad2(m_stdExp->GetNumPoints(2)),
1311  m_nmodes0(m_stdExp->GetBasisNumModes(0)),
1312  m_nmodes1(m_stdExp->GetBasisNumModes(1)),
1313  m_nmodes2(m_stdExp->GetBasisNumModes(2)),
1314  m_base0(m_stdExp->GetBasis(0)->GetBdata()),
1315  m_base1(m_stdExp->GetBasis(1)->GetBdata()),
1316  m_base2(m_stdExp->GetBasis(2)->GetBdata())
1317  {
1318  m_wspSize = m_numElmt * m_nmodes0 * m_nquad2 * (m_nmodes1 + m_nquad1);
1319 
1320  if (m_stdExp->GetBasis(0)->GetBasisType() == LibUtilities::eModified_A)
1321  {
1322  m_sortTopVertex = true;
1323  }
1324  else
1325  {
1326  m_sortTopVertex = false;
1327  }
1328  }
1329 };
1330 
1331 /// Factory initialisation for the BwdTrans_SumFac_Pyr operator
1332 OperatorKey BwdTrans_SumFac_Pyr::m_type =
1335  BwdTrans_SumFac_Pyr::create, "BwdTrans_SumFac_Pyr");
1336 
1337 } // namespace Collections
1338 
1339 } // namespace Nektar
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
Definition: ErrorUtil.hpp:209
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:250
#define OPERATOR_CREATE(cname)
Definition: Operator.h:45
Backward transform operator using default StdRegions operator.
Definition: BwdTrans.cpp:261
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
Definition: BwdTrans.cpp:287
BwdTrans_IterPerExp(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
Definition: BwdTrans.cpp:305
void operator()(const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &output1, Array< OneD, NekDouble > &output2, Array< OneD, NekDouble > &wsp)
Perform operation.
Definition: BwdTrans.cpp:269
virtual void CheckFactors(StdRegions::FactorMap factors, int coll_phys_offset)
Check the validity of the supplied factor map.
Definition: BwdTrans.cpp:296
Backward transform operator using matrix free operators.
Definition: BwdTrans.cpp:151
std::shared_ptr< MatrixFree::BwdTrans > m_oper
Definition: BwdTrans.cpp:200
virtual void CheckFactors(StdRegions::FactorMap factors, int coll_phys_offset)
Check the validity of the supplied factor map.
Definition: BwdTrans.cpp:191
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
Definition: BwdTrans.cpp:182
void operator()(const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output0, Array< OneD, NekDouble > &output1, Array< OneD, NekDouble > &output2, Array< OneD, NekDouble > &wsp) final
Perform operation.
Definition: BwdTrans.cpp:159
BwdTrans_MatrixFree(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
Definition: BwdTrans.cpp:202
Backward transform operator using LocalRegions implementation.
Definition: BwdTrans.cpp:351
BwdTrans_NoCollection(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
Definition: BwdTrans.cpp:398
virtual void CheckFactors(StdRegions::FactorMap factors, int coll_phys_offset)
Check the validity of the supplied factor map.
Definition: BwdTrans.cpp:387
vector< StdRegions::StdExpansionSharedPtr > m_expList
Definition: BwdTrans.cpp:395
void operator()(const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &output1, Array< OneD, NekDouble > &output2, Array< OneD, NekDouble > &wsp)
Perform operation.
Definition: BwdTrans.cpp:359
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
Definition: BwdTrans.cpp:378
Backward transform operator using standard matrix approach.
Definition: BwdTrans.cpp:60
virtual void CheckFactors(StdRegions::FactorMap factors, int coll_phys_offset)
Check the validity of the supplied factor map.
Definition: BwdTrans.cpp:89
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
Definition: BwdTrans.cpp:80
BwdTrans_StdMat(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
Definition: BwdTrans.cpp:100
void operator()(const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &output1, Array< OneD, NekDouble > &output2, Array< OneD, NekDouble > &wsp)
Perform operation.
Definition: BwdTrans.cpp:67
Backward transform operator using sum-factorisation (Hex)
Definition: BwdTrans.cpp:737
Array< OneD, const NekDouble > m_base1
Definition: BwdTrans.cpp:815
Array< OneD, const NekDouble > m_base2
Definition: BwdTrans.cpp:816
void operator()(const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &output1, Array< OneD, NekDouble > &output2, Array< OneD, NekDouble > &wsp)
Perform operation.
Definition: BwdTrans.cpp:745
virtual void CheckFactors(StdRegions::FactorMap factors, int coll_phys_offset)
Check the validity of the supplied factor map.
Definition: BwdTrans.cpp:800
Array< OneD, const NekDouble > m_base0
Definition: BwdTrans.cpp:814
BwdTrans_SumFac_Hex(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
Definition: BwdTrans.cpp:822
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
Definition: BwdTrans.cpp:792
Backward transform operator using sum-factorisation (Prism)
Definition: BwdTrans.cpp:1030
virtual void CheckFactors(StdRegions::FactorMap factors, int coll_phys_offset)
Check the validity of the supplied factor map.
Definition: BwdTrans.cpp:1118
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
Definition: BwdTrans.cpp:1110
BwdTrans_SumFac_Prism(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
Definition: BwdTrans.cpp:1139
Array< OneD, const NekDouble > m_base0
Definition: BwdTrans.cpp:1133
Array< OneD, const NekDouble > m_base1
Definition: BwdTrans.cpp:1134
void operator()(const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &output1, Array< OneD, NekDouble > &output2, Array< OneD, NekDouble > &wsp) final
Perform operation.
Definition: BwdTrans.cpp:1038
Array< OneD, const NekDouble > m_base2
Definition: BwdTrans.cpp:1135
Backward transform operator using sum-factorisation (Pyr)
Definition: BwdTrans.cpp:1176
Array< OneD, const NekDouble > m_base2
Definition: BwdTrans.cpp:1301
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
Definition: BwdTrans.cpp:1276
BwdTrans_SumFac_Pyr(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
Definition: BwdTrans.cpp:1305
virtual void CheckFactors(StdRegions::FactorMap factors, int coll_phys_offset)
Check the validity of the supplied factor map.
Definition: BwdTrans.cpp:1284
Array< OneD, const NekDouble > m_base1
Definition: BwdTrans.cpp:1300
Array< OneD, const NekDouble > m_base0
Definition: BwdTrans.cpp:1299
void operator()(const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &output1, Array< OneD, NekDouble > &output2, Array< OneD, NekDouble > &wsp) final
Perform operation.
Definition: BwdTrans.cpp:1184
Backward transform operator using sum-factorisation (Quad)
Definition: BwdTrans.cpp:520
Array< OneD, const NekDouble > m_base1
Definition: BwdTrans.cpp:605
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
Definition: BwdTrans.cpp:581
virtual void CheckFactors(StdRegions::FactorMap factors, int coll_phys_offset)
Check the validity of the supplied factor map.
Definition: BwdTrans.cpp:589
Array< OneD, const NekDouble > m_base0
Definition: BwdTrans.cpp:604
BwdTrans_SumFac_Quad(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
Definition: BwdTrans.cpp:608
void operator()(const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &output1, Array< OneD, NekDouble > &output2, Array< OneD, NekDouble > &wsp)
Perform operation.
Definition: BwdTrans.cpp:528
Backward transform operator using sum-factorisation (Segment)
Definition: BwdTrans.cpp:445
void operator()(const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &output1, Array< OneD, NekDouble > &output2, Array< OneD, NekDouble > &wsp)
Perform operation.
Definition: BwdTrans.cpp:453
BwdTrans_SumFac_Seg(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
Definition: BwdTrans.cpp:498
Array< OneD, const NekDouble > m_base0
Definition: BwdTrans.cpp:495
virtual void CheckFactors(StdRegions::FactorMap factors, int coll_phys_offset)
Check the validity of the supplied factor map.
Definition: BwdTrans.cpp:483
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
Definition: BwdTrans.cpp:474
Backward transform operator using sum-factorisation (Tet)
Definition: BwdTrans.cpp:853
BwdTrans_SumFac_Tet(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
Definition: BwdTrans.cpp:992
Array< OneD, const NekDouble > m_base1
Definition: BwdTrans.cpp:987
Array< OneD, const NekDouble > m_base0
Definition: BwdTrans.cpp:986
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
Definition: BwdTrans.cpp:963
virtual void CheckFactors(StdRegions::FactorMap factors, int coll_phys_offset)
Check the validity of the supplied factor map.
Definition: BwdTrans.cpp:971
void operator()(const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &output1, Array< OneD, NekDouble > &output2, Array< OneD, NekDouble > &wsp) final
Perform operation.
Definition: BwdTrans.cpp:861
Array< OneD, const NekDouble > m_base2
Definition: BwdTrans.cpp:988
Backward transform operator using sum-factorisation (Tri)
Definition: BwdTrans.cpp:634
void operator()(const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &output1, Array< OneD, NekDouble > &output2, Array< OneD, NekDouble > &wsp)
Perform operation.
Definition: BwdTrans.cpp:642
virtual void CheckFactors(StdRegions::FactorMap factors, int coll_phys_offset)
Check the validity of the supplied factor map.
Definition: BwdTrans.cpp:689
BwdTrans_SumFac_Tri(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
Definition: BwdTrans.cpp:707
Array< OneD, const NekDouble > m_base0
Definition: BwdTrans.cpp:702
Array< OneD, const NekDouble > m_base1
Definition: BwdTrans.cpp:703
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
Definition: BwdTrans.cpp:681
Base class for operators on a collection of elements.
Definition: Operator.h:115
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
Definition: NekFactory.hpp:200
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
Definition: NekFactory.hpp:145
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:394
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:167
std::tuple< LibUtilities::ShapeType, OperatorType, ImplementationType, ExpansionIsNodal > OperatorKey
Key for describing an Operator.
Definition: Operator.h:181
std::shared_ptr< CoalescedGeomData > CoalescedGeomDataSharedPtr
OperatorFactory & GetOperatorFactory()
Returns the singleton Operator factory object.
Definition: Operator.cpp:121
@ eModified_A
Principle Modified Functions .
Definition: BasisType.h:48
ConstFactorMap FactorMap
Definition: StdRegions.hpp:318
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:1
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:69
void Zero(int n, T *x, const int incx)
Zero vector.
Definition: Vmath.cpp:436
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1199