Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
IProductWRTBase.cpp
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File: IProductWRTBase.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 // License for the specific language governing rights and limitations under
14 // Permission is hereby granted, free of charge, to any person obtaining a
15 // copy of this software and associated documentation files (the "Software"),
16 // to deal in the Software without restriction, including without limitation
17 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
18 // and/or sell copies of the Software, and to permit persons to whom the
19 // Software is furnished to do so, subject to the following conditions:
20 //
21 // The above copyright notice and this permission notice shall be included
22 // in all copies or substantial portions of the Software.
23 //
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
30 // DEALINGS IN THE SOFTWARE.
31 //
32 // Description: IProductWRTBase operator implementations
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #include <loki/Singleton.h>
37 #include <Collections/Operator.h>
38 #include <Collections/Collection.h>
39 #include <Collections/IProduct.h>
40 
41 using namespace std;
42 
43 namespace Nektar {
44 namespace Collections {
45 
53 
54 /**
55  * @brief Inner product operator using standard matrix approach
56  */
58 {
59  public:
61 
63  {
64  }
65 
66  virtual void operator()(
67  const Array<OneD, const NekDouble> &input,
68  Array<OneD, NekDouble> &output,
69  Array<OneD, NekDouble> &output1,
70  Array<OneD, NekDouble> &output2,
72  {
73  ASSERTL1(wsp.num_elements() == m_wspSize,
74  "Incorrect workspace size");
75 
76  Vmath::Vmul(m_jac.num_elements(),m_jac,1,input,1,wsp,1);
77 
78  Blas::Dgemm('N', 'N', m_mat->GetRows(), m_numElmt,
79  m_mat->GetColumns(), 1.0, m_mat->GetRawPtr(),
80  m_mat->GetRows(), wsp.get(), m_stdExp->GetTotPoints(),
81  0.0, output.get(), m_stdExp->GetNcoeffs());
82  }
83 
84  virtual void operator()(
85  int dir,
86  const Array<OneD, const NekDouble> &input,
87  Array<OneD, NekDouble> &output,
89  {
90  ASSERTL0(false, "Not valid for this operator.");
91  }
92 
93  protected:
96 
97  private:
99  vector<StdRegions::StdExpansionSharedPtr> pCollExp,
100  CoalescedGeomDataSharedPtr pGeomData)
101  : Operator(pCollExp, pGeomData)
102  {
103  m_jac = pGeomData->GetJac(pCollExp);
105  m_stdExp->DetShapeType(), *m_stdExp);
106  m_mat = m_stdExp->GetStdMatrix(key);
107  m_wspSize = m_stdExp->GetTotPoints()*m_numElmt;
108  }
109 };
110 
111 /// Factory initialisation for the IProductWRTBase_StdMat operators
112 OperatorKey IProductWRTBase_StdMat::m_typeArr[] = {
115  IProductWRTBase_StdMat::create, "IProductWRTBase_StdMat_Seg"),
118  IProductWRTBase_StdMat::create, "IProductWRTBase_StdMat_Tri"),
121  IProductWRTBase_StdMat::create, "IProductWRTBase_StdMat_NodalTri"),
124  IProductWRTBase_StdMat::create, "IProductWRTBase_StdMat_Quad"),
127  IProductWRTBase_StdMat::create, "IProductWRTBase_StdMat_Tet"),
130  IProductWRTBase_StdMat::create, "IProductWRTBase_StdMat_NodalTet"),
133  IProductWRTBase_StdMat::create, "IProductWRTBase_StdMat_Pyr"),
136  IProductWRTBase_StdMat::create, "IProductWRTBase_StdMat_Prism"),
139  IProductWRTBase_StdMat::create, "IProductWRTBase_StdMat_NodalPrism"),
142  IProductWRTBase_StdMat::create, "IProductWRTBase_StdMat_Hex"),
143 };
144 
145 
146 /**
147  * @brief Inner product operator using element-wise operation
148  */
150 {
151  public:
153 
155  {
156  }
157 
158  virtual void operator()(
159  const Array<OneD, const NekDouble> &input,
160  Array<OneD, NekDouble> &output,
161  Array<OneD, NekDouble> &output1,
162  Array<OneD, NekDouble> &output2,
164  {
165  ASSERTL1(wsp.num_elements() == m_wspSize,
166  "Incorrect workspace size");
167 
168  const int nCoeffs = m_stdExp->GetNcoeffs();
169  const int nPhys = m_stdExp->GetTotPoints();
171 
172  Vmath::Vmul(m_jac.num_elements(),m_jac,1,input,1,wsp,1);
173 
174  for (int i = 0; i < m_numElmt; ++i)
175  {
176  m_stdExp->IProductWRTBase_SumFac(wsp + i*nPhys,
177  tmp = output + i*nCoeffs,
178  false);
179  }
180  }
181 
182  virtual void operator()(
183  int dir,
184  const Array<OneD, const NekDouble> &input,
185  Array<OneD, NekDouble> &output,
187  {
188  ASSERTL0(false, "Not valid for this operator.");
189  }
190 
191  protected:
193 
194  private:
196  vector<StdRegions::StdExpansionSharedPtr> pCollExp,
197  CoalescedGeomDataSharedPtr pGeomData)
198  : Operator(pCollExp, pGeomData)
199  {
200  int nqtot = 1;
201  LibUtilities::PointsKeyVector PtsKey = m_stdExp->GetPointsKeys();
202  for(int i = 0; i < PtsKey.size(); ++i)
203  {
204  nqtot *= PtsKey[i].GetNumPoints();
205  }
206 
207  m_jac = pGeomData->GetJacWithStdWeights(pCollExp);
208 
209  m_wspSize = nqtot*m_numElmt;
210  }
211 
212 };
213 
214 /// Factory initialisation for the IProductWRTBase_IterPerExp operators
215 OperatorKey IProductWRTBase_IterPerExp::m_typeArr[] = {
218  IProductWRTBase_IterPerExp::create,
219  "IProductWRTBase_IterPerExp_Seg"),
222  IProductWRTBase_IterPerExp::create,
223  "IProductWRTBase_IterPerExp_Tri"),
226  IProductWRTBase_IterPerExp::create,
227  "IProductWRTBase_IterPerExp_NodalTri"),
230  IProductWRTBase_IterPerExp::create,
231  "IProductWRTBase_IterPerExp_Quad"),
234  IProductWRTBase_IterPerExp::create,
235  "IProductWRTBase_IterPerExp_Tet"),
238  IProductWRTBase_IterPerExp::create,
239  "IProductWRTBase_IterPerExp_NodalTet"),
242  IProductWRTBase_IterPerExp::create,
243  "IProductWRTBase_IterPerExp_Pyr"),
246  IProductWRTBase_IterPerExp::create,
247  "IProductWRTBase_IterPerExp_Prism"),
250  IProductWRTBase_IterPerExp::create,
251  "IProductWRTBase_IterPerExp_NodalPrism"),
254  IProductWRTBase_IterPerExp::create,
255  "IProductWRTBase_IterPerExp_Hex"),
256 };
257 
258 
259 /**
260  * @brief Inner product operator using original MultiRegions implementation.
261  */
263 {
264  public:
266 
268  {
269  }
270 
271  virtual void operator()(
272  const Array<OneD, const NekDouble> &input,
273  Array<OneD, NekDouble> &output,
274  Array<OneD, NekDouble> &output1,
275  Array<OneD, NekDouble> &output2,
277  {
278 
279  const int nCoeffs = m_expList[0]->GetNcoeffs();
280  const int nPhys = m_expList[0]->GetTotPoints();
282 
283  for (int i = 0; i < m_numElmt; ++i)
284  {
285  m_expList[i]->IProductWRTBase(input + i*nPhys,
286  tmp = output + i*nCoeffs);
287  }
288 
289  }
290 
291  virtual void operator()(
292  int dir,
293  const Array<OneD, const NekDouble> &input,
294  Array<OneD, NekDouble> &output,
296  {
297  ASSERTL0(false, "Not valid for this operator.");
298  }
299 
300  protected:
301  vector<StdRegions::StdExpansionSharedPtr> m_expList;
302 
303  private:
305  vector<StdRegions::StdExpansionSharedPtr> pCollExp,
306  CoalescedGeomDataSharedPtr pGeomData)
307  : Operator(pCollExp, pGeomData)
308  {
309  m_expList = pCollExp;
310  }
311 };
312 
313 /// Factory initialisation for the IProductWRTBase_NoCollection operators
314 OperatorKey IProductWRTBase_NoCollection::m_typeArr[] = {
317  IProductWRTBase_NoCollection::create,
318  "IProductWRTBase_NoCollection_Seg"),
321  IProductWRTBase_NoCollection::create,
322  "IProductWRTBase_NoCollection_Tri"),
325  IProductWRTBase_NoCollection::create,
326  "IProductWRTBase_NoCollection_NodalTri"),
329  IProductWRTBase_NoCollection::create,
330  "IProductWRTBase_NoCollection_Quad"),
333  IProductWRTBase_NoCollection::create,
334  "IProductWRTBase_NoCollection_Tet"),
337  IProductWRTBase_NoCollection::create,
338  "IProductWRTBase_NoCollection_NodalTet"),
341  IProductWRTBase_NoCollection::create,
342  "IProductWRTBase_NoCollection_Pyr"),
345  IProductWRTBase_NoCollection::create,
346  "IProductWRTBase_NoCollection_Prism"),
349  IProductWRTBase_NoCollection::create,
350  "IProductWRTBase_NoCollection_NodalPrism"),
353  IProductWRTBase_NoCollection::create,
354  "IProductWRTBase_NoCollection_Hex"),
355 };
356 
357 
358 /**
359  * @brief Inner product operator using sum-factorisation (Segment)
360  */
362 {
363  public:
365 
367  {
368  }
369 
370  virtual void operator()(
371  const Array<OneD, const NekDouble> &input,
372  Array<OneD, NekDouble> &output,
373  Array<OneD, NekDouble> &output1,
374  Array<OneD, NekDouble> &output2,
376  {
377 
378  if(m_colldir0)
379  {
380  Vmath::Vmul(m_numElmt*m_nquad0,m_jac,1,input,1,output,1);
381  }
382  else
383  {
384  Vmath::Vmul(m_numElmt*m_nquad0,m_jac,1,input,1,wsp,1);
385 
386  // out = B0*in;
387  Blas::Dgemm('T','N', m_nmodes0, m_numElmt, m_nquad0,
388  1.0, m_base0.get(), m_nquad0,
389  &wsp[0], m_nquad0, 0.0,
390  &output[0], m_nmodes0);
391  }
392  }
393 
394  virtual void operator()(
395  int dir,
396  const Array<OneD, const NekDouble> &input,
397  Array<OneD, NekDouble> &output,
399  {
400  ASSERTL0(false, "Not valid for this operator.");
401  }
402 
403  protected:
404  const int m_nquad0;
405  const int m_nmodes0;
406  const bool m_colldir0;
409 
410  private:
412  vector<StdRegions::StdExpansionSharedPtr> pCollExp,
413  CoalescedGeomDataSharedPtr pGeomData)
414  : Operator (pCollExp, pGeomData),
415  m_nquad0 (m_stdExp->GetNumPoints(0)),
416  m_nmodes0 (m_stdExp->GetBasisNumModes(0)),
417  m_colldir0(m_stdExp->GetBasis(0)->Collocation()),
418  m_base0 (m_stdExp->GetBasis(0)->GetBdata())
419  {
420  m_wspSize = m_numElmt*m_nquad0;
421  m_jac = pGeomData->GetJacWithStdWeights(pCollExp);
422  }
423 };
424 
425 /// Factory initialisation for the IProductWRTBase_SumFac_Seg operator
426 OperatorKey IProductWRTBase_SumFac_Seg::m_type = GetOperatorFactory().
427  RegisterCreatorFunction(
429  IProductWRTBase_SumFac_Seg::create, "IProductWRTBase_SumFac_Seg");
430 
431 
432 
433 /**
434  * @brief Inner product operator using sum-factorisation (Quad)
435  */
437 {
438  public:
440 
442  {
443  }
444 
445  virtual void operator()(const Array<OneD, const NekDouble> &input,
446  Array<OneD, NekDouble> &output,
447  Array<OneD, NekDouble> &output1,
448  Array<OneD, NekDouble> &output2,
450  {
451  ASSERTL1(wsp.num_elements() == m_wspSize,
452  "Incorrect workspace size");
453 
454  QuadIProduct(m_colldir0,m_colldir1,m_numElmt,
455  m_nquad0, m_nquad1,
456  m_nmodes0, m_nmodes1,
457  m_base0, m_base1,
458  m_jac, input, output, wsp);
459  }
460 
461  virtual void operator()(
462  int dir,
463  const Array<OneD, const NekDouble> &input,
464  Array<OneD, NekDouble> &output,
466  {
467  ASSERTL0(false, "Not valid for this operator.");
468  }
469 
470  protected:
471  const int m_nquad0;
472  const int m_nquad1;
473  const int m_nmodes0;
474  const int m_nmodes1;
475  const bool m_colldir0;
476  const bool m_colldir1;
480 
481  private:
483  vector<StdRegions::StdExpansionSharedPtr> pCollExp,
484  CoalescedGeomDataSharedPtr pGeomData)
485  : Operator (pCollExp, pGeomData),
486  m_nquad0 (m_stdExp->GetNumPoints(0)),
487  m_nquad1 (m_stdExp->GetNumPoints(1)),
488  m_nmodes0 (m_stdExp->GetBasisNumModes(0)),
489  m_nmodes1 (m_stdExp->GetBasisNumModes(1)),
490  m_colldir0(m_stdExp->GetBasis(0)->Collocation()),
491  m_colldir1(m_stdExp->GetBasis(1)->Collocation()),
492  m_base0 (m_stdExp->GetBasis(0)->GetBdata()),
493  m_base1 (m_stdExp->GetBasis(1)->GetBdata())
494  {
495  m_jac = pGeomData->GetJacWithStdWeights(pCollExp);
496  m_wspSize = 2 * m_numElmt
497  * (max(m_nquad0*m_nquad1,m_nmodes0*m_nmodes1));
498  }
499 };
500 
501 /// Factory initialisation for the IProductWRTBase_SumFac_Quad operator
502 OperatorKey IProductWRTBase_SumFac_Quad::m_type = GetOperatorFactory().
503  RegisterCreatorFunction(
505  IProductWRTBase_SumFac_Quad::create, "IProductWRTBase_SumFac_Quad");
506 
507 
508 /**
509  * @brief Inner product operator using sum-factorisation (Tri)
510  */
512 {
513  public:
515 
517  {
518  }
519 
520  virtual void operator()(
521  const Array<OneD, const NekDouble> &input,
522  Array<OneD, NekDouble> &output,
523  Array<OneD, NekDouble> &output1,
524  Array<OneD, NekDouble> &output2,
526  {
527  ASSERTL1(wsp.num_elements() == m_wspSize,
528  "Incorrect workspace size");
529 
530  TriIProduct(m_sortTopVertex, m_numElmt, m_nquad0, m_nquad1,
531  m_nmodes0, m_nmodes1,m_base0,m_base1,m_jac, input,
532  output,wsp);
533  }
534 
535  virtual void operator()(
536  int dir,
537  const Array<OneD, const NekDouble> &input,
538  Array<OneD, NekDouble> &output,
540  {
541  ASSERTL0(false, "Not valid for this operator.");
542  }
543 
544  protected:
545  const int m_nquad0;
546  const int m_nquad1;
547  const int m_nmodes0;
548  const int m_nmodes1;
553 
554  private:
556  vector<StdRegions::StdExpansionSharedPtr> pCollExp,
557  CoalescedGeomDataSharedPtr pGeomData)
558  : Operator (pCollExp, pGeomData),
559  m_nquad0 (m_stdExp->GetNumPoints(0)),
560  m_nquad1 (m_stdExp->GetNumPoints(1)),
561  m_nmodes0 (m_stdExp->GetBasisNumModes(0)),
562  m_nmodes1 (m_stdExp->GetBasisNumModes(1)),
563  m_base0 (m_stdExp->GetBasis(0)->GetBdata()),
564  m_base1 (m_stdExp->GetBasis(1)->GetBdata())
565  {
566  m_jac = pGeomData->GetJacWithStdWeights(pCollExp);
567  m_wspSize = 2 * m_numElmt
568  * (max(m_nquad0*m_nquad1,m_nmodes0*m_nmodes1));
569  if(m_stdExp->GetBasis(0)->GetBasisType()
571  {
572  m_sortTopVertex = true;
573  }
574  else
575  {
576  m_sortTopVertex = false;
577  }
578  }
579 };
580 
581 /// Factory initialisation for the IProductWRTBase_SumFac_Tri operator
582 OperatorKey IProductWRTBase_SumFac_Tri::m_type = GetOperatorFactory().
583  RegisterCreatorFunction(
585  IProductWRTBase_SumFac_Tri::create, "IProductWRTBase_SumFac_Tri");
586 
587 
588 /**
589  * @brief Backward transform operator using sum-factorisation (Hex)
590  */
592 {
593  public:
595 
597  {
598  }
599 
600  virtual void operator()(
601  const Array<OneD, const NekDouble> &input,
602  Array<OneD, NekDouble> &output,
603  Array<OneD, NekDouble> &output1,
604  Array<OneD, NekDouble> &output2,
606  {
607 
608  ASSERTL1(wsp.num_elements() == m_wspSize,
609  "Incorrect workspace size");
610 
611  HexIProduct(m_colldir0,m_colldir1,m_colldir2, m_numElmt,
612  m_nquad0, m_nquad1, m_nquad2,
613  m_nmodes0, m_nmodes1, m_nmodes2,
614  m_base0, m_base1, m_base2,
615  m_jac,input,output,wsp);
616  }
617 
618  virtual void operator()(
619  int dir,
620  const Array<OneD, const NekDouble> &input,
621  Array<OneD, NekDouble> &output,
623  {
624  ASSERTL0(false, "Not valid for this operator.");
625  }
626 
627  protected:
628  const int m_nquad0;
629  const int m_nquad1;
630  const int m_nquad2;
631  const int m_nmodes0;
632  const int m_nmodes1;
633  const int m_nmodes2;
634  const bool m_colldir0;
635  const bool m_colldir1;
636  const bool m_colldir2;
641 
642  private:
644  vector<StdRegions::StdExpansionSharedPtr> pCollExp,
645  CoalescedGeomDataSharedPtr pGeomData)
646  : Operator (pCollExp, pGeomData),
647  m_nquad0 (m_stdExp->GetNumPoints(0)),
648  m_nquad1 (m_stdExp->GetNumPoints(1)),
649  m_nquad2 (m_stdExp->GetNumPoints(2)),
650  m_nmodes0 (m_stdExp->GetBasisNumModes(0)),
651  m_nmodes1 (m_stdExp->GetBasisNumModes(1)),
652  m_nmodes2 (m_stdExp->GetBasisNumModes(2)),
653  m_colldir0(m_stdExp->GetBasis(0)->Collocation()),
654  m_colldir1(m_stdExp->GetBasis(1)->Collocation()),
655  m_colldir2(m_stdExp->GetBasis(2)->Collocation()),
656  m_base0 (m_stdExp->GetBasis(0)->GetBdata()),
657  m_base1 (m_stdExp->GetBasis(1)->GetBdata()),
658  m_base2 (m_stdExp->GetBasis(2)->GetBdata())
659 
660  {
661  m_jac = pGeomData->GetJacWithStdWeights(pCollExp);
662  m_wspSize = 3 * m_numElmt * (max(m_nquad0*m_nquad1*m_nquad2,
663  m_nmodes0*m_nmodes1*m_nmodes2));
664  }
665 };
666 
667 /// Factory initialisation for the IProductWRTBase_SumFac_Hex operator
668 OperatorKey IProductWRTBase_SumFac_Hex::m_type = GetOperatorFactory().
669  RegisterCreatorFunction(
671  IProductWRTBase_SumFac_Hex::create, "IProductWRTBase_SumFac_Hex");
672 
673 
674 
675 /**
676  * @brief Inner product operator using sum-factorisation (Tet)
677  */
679 {
680  public:
682 
684  {
685  }
686 
687  virtual void operator()(
688  const Array<OneD, const NekDouble> &input,
689  Array<OneD, NekDouble> &output,
690  Array<OneD, NekDouble> &output1,
691  Array<OneD, NekDouble> &output2,
693  {
694  ASSERTL1(wsp.num_elements() == m_wspSize,
695  "Incorrect workspace size");
696 
697  TetIProduct(m_sortTopEdge, m_numElmt,
698  m_nquad0, m_nquad1, m_nquad2,
699  m_nmodes0, m_nmodes1, m_nmodes2,
700  m_base0, m_base1, m_base2,
701  m_jac,input,output,wsp);
702 
703  }
704 
705  virtual void operator()(
706  int dir,
707  const Array<OneD, const NekDouble> &input,
708  Array<OneD, NekDouble> &output,
710  {
711  ASSERTL0(false, "Not valid for this operator.");
712  }
713 
714  protected:
715  const int m_nquad0;
716  const int m_nquad1;
717  const int m_nquad2;
718  const int m_nmodes0;
719  const int m_nmodes1;
720  const int m_nmodes2;
726 
727  private:
729  vector<StdRegions::StdExpansionSharedPtr> pCollExp,
730  CoalescedGeomDataSharedPtr pGeomData)
731  : Operator (pCollExp, pGeomData),
732  m_nquad0 (m_stdExp->GetNumPoints(0)),
733  m_nquad1 (m_stdExp->GetNumPoints(1)),
734  m_nquad2 (m_stdExp->GetNumPoints(2)),
735  m_nmodes0 (m_stdExp->GetBasisNumModes(0)),
736  m_nmodes1 (m_stdExp->GetBasisNumModes(1)),
737  m_nmodes2 (m_stdExp->GetBasisNumModes(2)),
738  m_base0 (m_stdExp->GetBasis(0)->GetBdata()),
739  m_base1 (m_stdExp->GetBasis(1)->GetBdata()),
740  m_base2 (m_stdExp->GetBasis(2)->GetBdata())
741  {
742  m_jac = pGeomData->GetJacWithStdWeights(pCollExp);
743  m_wspSize = m_numElmt*(max(m_nquad0*m_nquad1*m_nquad2,
744  m_nquad2*m_nmodes0*(2*m_nmodes1-m_nmodes0+1)/2)+
745  m_nquad2*m_nquad1*m_nmodes0);
746 
747  if(m_stdExp->GetBasis(0)->GetBasisType()
749  {
750  m_sortTopEdge = true;
751  }
752  else
753  {
754  m_sortTopEdge = false;
755  }
756  }
757 };
758 
759 /// Factory initialisation for the IProductWRTBase_SumFac_Tet operator
760 OperatorKey IProductWRTBase_SumFac_Tet::m_type = GetOperatorFactory().
761  RegisterCreatorFunction(
763  IProductWRTBase_SumFac_Tet::create, "IProductWRTBase_SumFac_Tet");
764 
765 
766 
767 /**
768  * @brief Backward transform operator using sum-factorisation (Prism)
769  */
771 {
772  public:
774 
776  {
777  }
778 
779  virtual void operator()(
780  const Array<OneD, const NekDouble> &input,
781  Array<OneD, NekDouble> &output,
782  Array<OneD, NekDouble> &output1,
783  Array<OneD, NekDouble> &output2,
785  {
786 
787  ASSERTL1(wsp.num_elements() == m_wspSize,
788  "Incorrect workspace size");
789 
790  PrismIProduct(m_sortTopVertex, m_numElmt,
791  m_nquad0, m_nquad1, m_nquad2,
792  m_nmodes0, m_nmodes1, m_nmodes2,
793  m_base0, m_base1, m_base2,
794  m_jac,input,output,wsp);
795  }
796 
797  virtual void operator()(
798  int dir,
799  const Array<OneD, const NekDouble> &input,
800  Array<OneD, NekDouble> &output,
802  {
803  ASSERTL0(false, "Not valid for this operator.");
804  }
805 
806  protected:
807  const int m_nquad0;
808  const int m_nquad1;
809  const int m_nquad2;
810  const int m_nmodes0;
811  const int m_nmodes1;
812  const int m_nmodes2;
818 
819  private:
821  vector<StdRegions::StdExpansionSharedPtr> pCollExp,
822  CoalescedGeomDataSharedPtr pGeomData)
823  : Operator (pCollExp, pGeomData),
824  m_nquad0 (m_stdExp->GetNumPoints(0)),
825  m_nquad1 (m_stdExp->GetNumPoints(1)),
826  m_nquad2 (m_stdExp->GetNumPoints(2)),
827  m_nmodes0 (m_stdExp->GetBasisNumModes(0)),
828  m_nmodes1 (m_stdExp->GetBasisNumModes(1)),
829  m_nmodes2 (m_stdExp->GetBasisNumModes(2)),
830  m_base0 (m_stdExp->GetBasis(0)->GetBdata()),
831  m_base1 (m_stdExp->GetBasis(1)->GetBdata()),
832  m_base2 (m_stdExp->GetBasis(2)->GetBdata())
833 
834  {
835  m_jac = pGeomData->GetJacWithStdWeights(pCollExp);
836 
837  m_wspSize = m_numElmt * m_nquad2
838  *(max(m_nquad0*m_nquad1,m_nmodes0*m_nmodes1))
839  + m_nquad1*m_nquad2*m_numElmt*m_nmodes0;
840 
841  if(m_stdExp->GetBasis(0)->GetBasisType()
843  {
844  m_sortTopVertex = true;
845  }
846  else
847  {
848  m_sortTopVertex = false;
849  }
850  }
851 };
852 
853 /// Factory initialisation for the IProductWRTBase_SumFac_Prism operator
854 OperatorKey IProductWRTBase_SumFac_Prism::m_type = GetOperatorFactory().
855  RegisterCreatorFunction(
857  IProductWRTBase_SumFac_Prism::create, "IProductWRTBase_SumFac_Prism");
858 
859 }
860 }
virtual void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp)
virtual void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp)
virtual void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp)
virtual void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp)
IProductWRTBase_StdMat(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData)
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:198
void HexIProduct(bool colldir0, bool colldir1, bool colldir2, int numElmt, int nquad0, int nquad1, int nquad2, int nmodes0, int nmodes1, int nmodes2, const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &jac, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp)
Definition: IProduct.cpp:179
Backward transform operator using sum-factorisation (Prism)
std::vector< PointsKey > PointsKeyVector
Definition: Points.h:242
virtual 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.
Inner product operator using sum-factorisation (Tet)
boost::tuple< LibUtilities::ShapeType, OperatorType, ImplementationType, ExpansionIsNodal > OperatorKey
Key for describing an Operator.
Definition: Operator.h:159
virtual 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.
Principle Modified Functions .
Definition: BasisType.h:49
STL namespace.
Inner product operator using sum-factorisation (Quad)
void QuadIProduct(bool colldir0, bool colldir1, int numElmt, int nquad0, int nquad1, int nmodes0, int nmodes1, const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &jac, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp)
Definition: IProduct.cpp:49
vector< StdRegions::StdExpansionSharedPtr > m_expList
virtual 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.
Base class for operators on a collection of elements.
Definition: Operator.h:108
boost::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:70
virtual 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.
Array< OneD, const NekDouble > m_jac
void TetIProduct(bool sortTopEdge, int numElmt, int nquad0, int nquad1, int nquad2, int nmodes0, int nmodes1, int nmodes2, const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &jac, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp)
Definition: IProduct.cpp:428
IProductWRTBase_SumFac_Tri(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData)
IProductWRTBase_NoCollection(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData)
Inner product operator using element-wise operation.
void TriIProduct(bool sortTopVertex, int numElmt, int nquad0, int nquad1, int nmodes0, int nmodes1, const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &jac, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp)
Definition: IProduct.cpp:135
Inner product operator using sum-factorisation (Tri)
Inner product operator using standard matrix approach.
virtual void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp)
virtual void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp)
IProductWRTBase_IterPerExp(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData)
virtual void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp)
OperatorFactory & GetOperatorFactory()
Returns the singleton Operator factory object.
Definition: Operator.cpp:110
virtual 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.
virtual 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.
IProductWRTBase_SumFac_Hex(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData)
Inner product operator using sum-factorisation (Segment)
virtual 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.
virtual void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp)
IProductWRTBase_SumFac_Prism(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData)
void PrismIProduct(bool sortTopVertex, int numElmt, int nquad0, int nquad1, int nquad2, int nmodes0, int nmodes1, int nmodes2, const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &jac, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp)
Definition: IProduct.cpp:356
virtual 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.
#define OPERATOR_CREATE(cname)
Definition: Operator.h:44
virtual void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp)
boost::shared_ptr< CoalescedGeomData > CoalescedGeomDataSharedPtr
virtual 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.
Backward transform operator using sum-factorisation (Hex)
IProductWRTBase_SumFac_Quad(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData)
IProductWRTBase_SumFac_Seg(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:228
Inner product operator using original MultiRegions implementation.
IProductWRTBase_SumFac_Tet(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData)
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.cpp:183
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.
Definition: NekFactory.hpp:215