Nektar++
Classes | Typedefs | Enumerations | Functions | Variables
Nektar::Collections Namespace Reference

Classes

class  BwdTrans_StdMat
 Backward transform operator using standard matrix approach. More...
 
class  BwdTrans_IterPerExp
 Backward transform operator using default StdRegions operator. More...
 
class  BwdTrans_NoCollection
 Backward transform operator using LocalRegions implementation. More...
 
class  BwdTrans_SumFac_Seg
 Backward transform operator using sum-factorisation (Segment) More...
 
class  BwdTrans_SumFac_Quad
 Backward transform operator using sum-factorisation (Quad) More...
 
class  BwdTrans_SumFac_Tri
 Backward transform operator using sum-factorisation (Tri) More...
 
class  BwdTrans_SumFac_Hex
 Backward transform operator using sum-factorisation (Hex) More...
 
class  BwdTrans_SumFac_Tet
 Backward transform operator using sum-factorisation (Tet) More...
 
class  BwdTrans_SumFac_Prism
 Backward transform operator using sum-factorisation (Prism) More...
 
class  BwdTrans_SumFac_Pyr
 Backward transform operator using sum-factorisation (Pyr) More...
 
class  CoalescedGeomData
 
class  Collection
 Collection. More...
 
class  OpImpTimingKey
 
class  CollectionOptimisation
 
class  IProductWRTBase_StdMat
 Inner product operator using standard matrix approach. More...
 
class  IProductWRTBase_IterPerExp
 Inner product operator using element-wise operation. More...
 
class  IProductWRTBase_NoCollection
 Inner product operator using original MultiRegions implementation. More...
 
class  IProductWRTBase_SumFac_Seg
 Inner product operator using sum-factorisation (Segment) More...
 
class  IProductWRTBase_SumFac_Quad
 Inner product operator using sum-factorisation (Quad) More...
 
class  IProductWRTBase_SumFac_Tri
 Inner product operator using sum-factorisation (Tri) More...
 
class  IProductWRTBase_SumFac_Hex
 Inner Product operator using sum-factorisation (Hex) More...
 
class  IProductWRTBase_SumFac_Tet
 Inner product operator using sum-factorisation (Tet) More...
 
class  IProductWRTBase_SumFac_Prism
 Inner Product operator using sum-factorisation (Prism) More...
 
class  IProductWRTBase_SumFac_Pyr
 Inner Product operator using sum-factorisation (Pyr) More...
 
class  IProductWRTDerivBase_StdMat
 Inner product WRT deriv base operator using standard matrix approach. More...
 
class  IProductWRTDerivBase_IterPerExp
 Inner product WRT deriv base operator using element-wise operation. More...
 
class  IProductWRTDerivBase_NoCollection
 Inner product WRT deriv base operator using LocalRegions implementation. More...
 
class  IProductWRTDerivBase_SumFac_Seg
 Inner product WRT deriv base operator using sum-factorisation (Segment) More...
 
class  IProductWRTDerivBase_SumFac_Quad
 Inner product WRT deriv base operator using sum-factorisation (Quad) More...
 
class  IProductWRTDerivBase_SumFac_Tri
 Inner product WRT deriv base operator using sum-factorisation (Tri) More...
 
class  IProductWRTDerivBase_SumFac_Hex
 Inner product WRT deriv base operator using sum-factorisation (Hex) More...
 
class  IProductWRTDerivBase_SumFac_Tet
 Inner product WRT deriv base operator using sum-factorisation (Tet) More...
 
class  IProductWRTDerivBase_SumFac_Prism
 Inner product WRT deriv base operator using sum-factorisation (Prism) More...
 
class  IProductWRTDerivBase_SumFac_Pyr
 Inner product WRT deriv base operator using sum-factorisation (Pyr) More...
 
class  Operator
 Base class for operators on a collection of elements. More...
 
class  PhysDeriv_StdMat
 Phys deriv operator using standard matrix approach. More...
 
class  PhysDeriv_IterPerExp
 Phys deriv operator using element-wise operation. More...
 
class  PhysDeriv_NoCollection
 Phys deriv operator using original LocalRegions implementation. More...
 
class  PhysDeriv_SumFac_Seg
 Phys deriv operator using sum-factorisation (Segment) More...
 
class  PhysDeriv_SumFac_Quad
 Phys deriv operator using sum-factorisation (Quad) More...
 
class  PhysDeriv_SumFac_Tri
 Phys deriv operator using sum-factorisation (Tri) More...
 
class  PhysDeriv_SumFac_Hex
 Phys deriv operator using sum-factorisation (Hex) More...
 
class  PhysDeriv_SumFac_Tet
 Phys deriv operator using sum-factorisation (Tet) More...
 
class  PhysDeriv_SumFac_Prism
 Phys deriv operator using sum-factorisation (Prism) More...
 
class  PhysDeriv_SumFac_Pyr
 Phys deriv operator using sum-factorisation (Pyramid) More...
 

Typedefs

typedef std::shared_ptr< CoalescedGeomData > CoalescedGeomDataSharedPtr
 
typedef std::vector< Collection > CollectionVector
 
typedef std::shared_ptr< CollectionVector > CollectionVectorSharedPtr
 
typedef bool ExpansionIsNodal
 
typedef std::map< OperatorType, ImplementationType > OperatorImpMap
 
typedef std::shared_ptr< Operator > OperatorSharedPtr
 Shared pointer to an Operator object. More...
 
typedef std::tuple< LibUtilities::ShapeType, OperatorType, ImplementationType, ExpansionIsNodal > OperatorKey
 Key for describing an Operator. More...
 
typedef Nektar::LibUtilities::NekFactory< OperatorKey, Operator, std::vector< StdRegions::StdExpansionSharedPtr >, CoalescedGeomDataSharedPtr > OperatorFactory
 Operator factory definition. More...
 

Enumerations

enum  GeomData { eJac , eJacWithStdWeights , eDerivFactors }
 
enum  OperatorType {
  eBwdTrans , eIProductWRTBase , eIProductWRTDerivBase , ePhysDeriv ,
  SIZE_OperatorType
}
 
enum  ImplementationType {
  eNoImpType , eNoCollection , eIterPerExp , eStdMat ,
  eSumFac , SIZE_ImplementationType
}
 

Functions

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)
 
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)
 
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)
 
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)
 
void PyrIProduct (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)
 
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)
 
bool operator< (OperatorKey const &p1, OperatorKey const &p2)
 Less-than comparison operator for OperatorKey objects. More...
 
std::ostream & operator<< (std::ostream &os, OperatorKey const &p)
 Stream output operator for OperatorKey objects. More...
 
OperatorFactory & GetOperatorFactory ()
 Returns the singleton Operator factory object. More...
 
OperatorImpMap SetFixedImpType (ImplementationType defaultType)
 simple Operator Implementation Map generator More...
 

Variables

static CoalescedGeomDataSharedPtr GeomDataNull
 
const char *const OperatorTypeMap []
 
const char *const ImplementationTypeMap []
 

Typedef Documentation

◆ CoalescedGeomDataSharedPtr

Definition at line 74 of file CoalescedGeomData.h.

◆ CollectionVector

Definition at line 95 of file Collection.h.

◆ CollectionVectorSharedPtr

Definition at line 96 of file Collection.h.

◆ ExpansionIsNodal

Definition at line 101 of file Operator.h.

◆ OperatorFactory

Operator factory definition.

Definition at line 174 of file Operator.h.

◆ OperatorImpMap

Definition at line 103 of file Operator.h.

◆ OperatorKey

Key for describing an Operator.

Definition at line 161 of file Operator.h.

◆ OperatorSharedPtr

Shared pointer to an Operator object.

Definition at line 154 of file Operator.h.

Enumeration Type Documentation

◆ GeomData

Enumerator
eJac 
eJacWithStdWeights 
eDerivFactors 

Definition at line 46 of file CoalescedGeomData.h.

◆ ImplementationType

Enumerator
eNoImpType 
eNoCollection 
eIterPerExp 
eStdMat 
eSumFac 
SIZE_ImplementationType 

Definition at line 82 of file Operator.h.

◆ OperatorType

Enumerator
eBwdTrans 
eIProductWRTBase 
eIProductWRTDerivBase 
ePhysDeriv 
SIZE_OperatorType 

Definition at line 65 of file Operator.h.

Function Documentation

◆ GetOperatorFactory()

OperatorFactory & Nektar::Collections::GetOperatorFactory ( )

Returns the singleton Operator factory object.

Definition at line 108 of file Operator.cpp.

109 {
110  static OperatorFactory instance;
111  return instance;
112 }
Nektar::LibUtilities::NekFactory< OperatorKey, Operator, std::vector< StdRegions::StdExpansionSharedPtr >, CoalescedGeomDataSharedPtr > OperatorFactory
Operator factory definition.
Definition: Operator.h:174

Referenced by Nektar::Collections::Collection::Collection(), and Nektar::Collections::CollectionOptimisation::SetWithTimings().

◆ HexIProduct()

void Nektar::Collections::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 at line 178 of file IProduct.cpp.

188 {
189  int totmodes = nmodes0*nmodes1*nmodes2;
190  int totpoints = nquad0 *nquad1 *nquad2;
191 
192 
193  if(colldir0 && colldir1 && colldir2)
194  {
195 
196  Vmath::Vmul(numElmt*totpoints,jac,1,input,1,output,1);
197  }
198  else
199  {
200  Vmath::Vmul(numElmt*totpoints,jac,1,input,1,wsp,1);
201 
202  // Assign second half of workspace for 2nd DGEMM operation.
203  Array<OneD, NekDouble> wsp1 = wsp + totpoints*numElmt;
204 
205  // note sure what criterion we should use to swap around these
206  // strategies
207  if(numElmt < nmodes0 || 1)
208  {
209  Array<OneD, NekDouble> wsp2 = wsp1 + nmodes0*nquad1*nquad2;
210 
211  //loop over elements
212  for(int n = 0; n < numElmt; ++n)
213  {
214  if(colldir0)
215  {
216 
217  for(int i = 0; i < nmodes0; ++i)
218  {
219  Vmath::Vcopy(nquad1*nquad2,&wsp[n*totpoints] + i,nquad0,
220  wsp1.get()+nquad1*nquad2*i,1);
221  }
222  }
223  else
224  {
225  Blas::Dgemm('T', 'N', nquad1*nquad2, nmodes0, nquad0,
226  1.0, &wsp[n*totpoints], nquad0,
227  base0.get(), nquad0,
228  0.0, wsp1.get(), nquad1*nquad2);
229  }
230 
231 
232  if(colldir1)
233  {
234  // reshuffle data for next operation.
235  for(int i = 0; i < nmodes1; ++i)
236  {
237  Vmath::Vcopy(nquad2*nmodes0,wsp1.get()+i,nquad1,
238  wsp2.get()+nquad2*nmodes0*i,1);
239  }
240  }
241  else
242  {
243  Blas::Dgemm('T', 'N', nquad2*nmodes0, nmodes1, nquad1,
244  1.0, wsp1.get(), nquad1,
245  base1.get(), nquad1,
246  0.0, wsp2.get(), nquad2*nmodes0);
247  }
248 
249  if(colldir2)
250  {
251  // reshuffle data for next operation.
252  for(int i = 0; i < nmodes2; ++i)
253  {
254  Vmath::Vcopy(nmodes0*nmodes1,wsp2.get()+i,nquad2,
255  &output[n*totmodes]+nmodes0*nmodes1*i,1);
256  }
257  }
258  else
259  {
260  Blas::Dgemm('T', 'N', nmodes0*nmodes1, nmodes2, nquad2,
261  1.0, wsp2.get(), nquad2,
262  base2.get(), nquad2,
263  0.0, &output[n*totmodes], nmodes0*nmodes1);
264  }
265  }
266  }
267  else
268  {
269  Array<OneD, NekDouble> wsp2 = wsp1 + numElmt*(max(totpoints,
270  totmodes));
271 
272  if(colldir0)
273  {
274  for(int i = 0; i < nquad0; ++i)
275  {
276  Vmath::Vcopy(nquad1*nquad2*numElmt,&wsp[i],nquad0,
277  &wsp1[i*nquad1*nquad2*numElmt],1);
278  }
279  }
280  else
281  {
282  // large degmm but copy at end.
283  Blas::Dgemm('T','N', nquad1*nquad2*numElmt, nmodes0, nquad0,
284  1.0, &wsp[0], nquad0, base0.get(), nquad0,
285  0.0, &wsp1[0], nquad1*nquad2*numElmt);
286  }
287 
288  if(colldir1)
289  {
290  for(int i = 0; i < nquad1; ++i)
291  {
292  Vmath::Vcopy(nquad2*numElmt*nmodes0,&wsp1[i],nquad1,
293  &wsp2[i*nquad2*numElmt*nmodes0],1);
294  }
295  }
296  else
297  {
298  Blas::Dgemm('T','N', nquad2*numElmt*nmodes0, nmodes1, nquad1,
299  1.0, &wsp1[0], nquad1, base1.get(), nquad1,
300  0.0, &wsp2[0], nquad2*numElmt*nmodes0);
301  }
302 
303 
304  if(numElmt > 1)
305  {
306  if(colldir2)
307  {
308  for(int i = 0; i < nquad2; ++i)
309  {
310  Vmath::Vcopy(nmodes0*nmodes1,&wsp2[i],nquad2,
311  &output[i*nmodes0*nmodes1],1);
312  }
313  }
314  else
315  {
316  Blas::Dgemm('T', 'N', numElmt*nmodes0*nmodes1, nmodes2,
317  nquad2, 1.0, &wsp2[0], nquad2,
318  base2.get(), nquad2, 0.0,
319  &wsp1[0], numElmt*nmodes0*nmodes1);
320  }
321 
322  for(int i = 0; i < totmodes; ++i)
323  {
324  Vmath::Vcopy(numElmt, &wsp1[i*numElmt], 1,
325  &output[i], totmodes);
326  }
327 
328  }
329  else
330  {
331  if(colldir2)
332  {
333  for(int i = 0; i < nquad2; ++i)
334  {
335  Vmath::Vcopy(nmodes0*nmodes1,&wsp2[i],nquad2,
336  &output[i*nmodes0*nmodes1],1);
337  }
338  }
339  else
340  {
341  Blas::Dgemm('T','N', numElmt*nmodes0*nmodes1, nmodes2,
342  nquad2, 1.0, &wsp2[0], nquad2,
343  base2.get(), nquad2, 0.0,
344  &output[0], numElmt*nmodes0*nmodes1);
345  }
346  }
347  }
348  }
349 }
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 A[m x n], B[n x k], C[m x k].
Definition: Blas.hpp:213
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:186
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1064

References Blas::Dgemm(), Vmath::Vcopy(), and Vmath::Vmul().

Referenced by Nektar::Collections::IProductWRTDerivBase_SumFac_Hex::operator()(), and Nektar::Collections::IProductWRTBase_SumFac_Hex::operator()().

◆ operator<()

bool Nektar::Collections::operator< ( OperatorKey const &  p1,
OperatorKey const &  p2 
)

Less-than comparison operator for OperatorKey objects.

Definition at line 44 of file Operator.cpp.

45 {
46  if (std::get<0>(p1) < std::get<0>(p2))
47  {
48  return true;
49  }
50  if (std::get<0>(p1) > std::get<0>(p2))
51  {
52  return false;
53  }
54  if (std::get<1>(p1) < std::get<1>(p2))
55  {
56  return true;
57  }
58  if (std::get<1>(p1) > std::get<1>(p2))
59  {
60  return false;
61  }
62  if (std::get<2>(p1) < std::get<2>(p2))
63  {
64  return true;
65  }
66  if (std::get<2>(p1) > std::get<2>(p2))
67  {
68  return false;
69  }
70 
71  if (std::get<3>(p1) < std::get<3>(p2))
72  {
73  return true;
74  }
75  if (std::get<3>(p1) > std::get<3>(p2))
76  {
77  return false;
78  }
79 
80  return false;
81 }

◆ operator<<()

std::ostream & Nektar::Collections::operator<< ( std::ostream &  os,
OperatorKey const &  p 
)

Stream output operator for OperatorKey objects.

Definition at line 87 of file Operator.cpp.

88 {
89  os << LibUtilities::ShapeTypeMap[std::get<0>(p)] << ", "
90  << OperatorTypeMap [std::get<1>(p)] << ", "
91  << ImplementationTypeMap [std::get<2>(p)] << ", "
92  << (std::get<3>(p) ? "Nodal" : "Modal");
93  return os;
94 }
const char *const ImplementationTypeMap[]
Definition: Operator.h:92
const char *const OperatorTypeMap[]
Definition: Operator.h:74

References ImplementationTypeMap, OperatorTypeMap, and CellMLToNektar.cellml_metadata::p.

◆ PrismIProduct()

void Nektar::Collections::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 at line 355 of file IProduct.cpp.

365 {
367  nmodes0,nmodes1,nmodes2);
368  int totpoints = nquad0*nquad1*nquad2;
369  int cnt;
370  int mode, mode1;
371 
372  Vmath::Vmul(numElmt*totpoints,jac,1,input,1,wsp,1);
373 
374  Array<OneD, NekDouble> wsp1 = wsp + numElmt * nquad2
375  * (max(nquad0*nquad1,
376  nmodes0*nmodes1));
377 
378  // Perform iproduct with respect to the '0' direction
379  Blas::Dgemm('T', 'N', nquad1*nquad2*numElmt, nmodes0, nquad0,
380  1.0, wsp.get(), nquad0, base0.get(),
381  nquad0, 0.0, wsp1.get(), nquad1*nquad2*numElmt);
382 
383 
384  // Perform iproduct with respect to the '1' direction
385  Blas::Dgemm('T', 'N', nquad2*numElmt*nmodes0, nmodes1, nquad1,
386  1.0, wsp1.get(), nquad1, base1.get(),
387  nquad1, 0.0, wsp.get(), nquad2*numElmt*nmodes0);
388 
389 
390  // Inner product with respect to the '2' direction (not sure if it would
391  // be better to swap loops?)
392  mode = mode1 = cnt = 0;
393  for(int i = 0; i < nmodes0; ++i)
394  {
395  cnt = i*nquad2*numElmt;
396  for(int j = 0; j < nmodes1; ++j)
397  {
398  Blas::Dgemm('T', 'N', nmodes2-i, numElmt, nquad2,
399  1.0, base2.get()+mode*nquad2, nquad2,
400  wsp.get()+j*nquad2*numElmt*nmodes0 + cnt, nquad2,
401  0.0, output.get()+mode1, totmodes);
402  mode1 += nmodes2-i;
403  }
404  mode += nmodes2-i;
405  }
406 
407  // fix for modified basis by splitting top vertex mode
408  if (sortTopVertex)
409  {
410  // top singular vertex
411  // ((1+a)/2 components entry into (1+c)/2)
412  // Could be made into an mxv if we have specialised base1[1]
413  for(int j =0; j < nmodes1; ++j)
414  {
415  Blas::Dgemv('T', nquad2,numElmt,1.0,
416  wsp.get()+j*nquad2*numElmt*nmodes0+nquad2*numElmt,
417  nquad2, base2.get()+nquad2,1,1.0,
418  &output[j*nmodes2+1], totmodes);
419  }
420  }
421 }
static void Dgemv(const char &trans, const int &m, const int &n, const double &alpha, const double *a, const int &lda, const double *x, const int &incx, const double &beta, double *y, const int &incy)
BLAS level 2: Matrix vector multiply y = A x where A[m x n].
Definition: Blas.hpp:168

References Blas::Dgemm(), Blas::Dgemv(), Nektar::LibUtilities::StdSegData::getNumberOfCoefficients(), and Vmath::Vmul().

Referenced by Nektar::Collections::IProductWRTDerivBase_SumFac_Prism::operator()(), and Nektar::Collections::IProductWRTBase_SumFac_Prism::operator()().

◆ PyrIProduct()

void Nektar::Collections::PyrIProduct ( 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 at line 427 of file IProduct.cpp.

437 {
439  nmodes0,nmodes1,nmodes2);
440  int totpoints = nquad0*nquad1*nquad2;
441  int cnt;
442  int mode, mode1;
443 
444  ASSERTL1(wsp.num_elements() >= numElmt*(nquad1*nquad2*nmodes0 +
445  nquad2*max(nquad0*nquad1,nmodes0*nmodes1)),
446  "Insufficient workspace size");
447 
448  Vmath::Vmul(numElmt*totpoints,jac,1,input,1,wsp,1);
449 
450  Array<OneD, NekDouble> wsp1 = wsp + numElmt * nquad2
451  * (max(nquad0*nquad1,
452  nmodes0*nmodes1));
453 
454  // Perform iproduct with respect to the '0' direction
455  Blas::Dgemm('T', 'N', nquad1*nquad2*numElmt, nmodes0, nquad0,
456  1.0, wsp.get(), nquad0, base0.get(),
457  nquad0, 0.0, wsp1.get(), nquad1*nquad2*numElmt);
458 
459  // Inner product with respect to the '1' direction
460  mode = 0;
461  for(int i=0; i < nmodes0; ++i)
462  {
463  Blas::Dgemm('T', 'N', nquad2*numElmt, nmodes1, nquad1,
464  1.0, wsp1.get()+ i*nquad1*nquad2*numElmt, nquad1,
465  base1.get(), nquad1,
466  0.0, wsp.get() + mode*nquad2*numElmt,nquad2*numElmt);
467  mode += nmodes1;
468  }
469 
470  // Inner product with respect to the '2' direction
471  mode = mode1 = cnt = 0;
472  for(int i = 0; i < nmodes0; ++i)
473  {
474  for(int j = 0; j < nmodes1; ++j, ++cnt)
475  {
476  int ijmax = max(i,j);
477  Blas::Dgemm('T', 'N', nmodes2-ijmax, numElmt, nquad2,
478  1.0, base2.get()+mode*nquad2, nquad2,
479  wsp.get()+cnt*nquad2*numElmt, nquad2,
480  0.0, output.get()+mode1, totmodes);
481  mode += nmodes2-ijmax;
482  mode1 += nmodes2-ijmax;
483  }
484 
485  //increment mode in case order1!=order2
486  for(int j = nmodes1; j < nmodes2; ++j)
487  {
488  int ijmax = max(i,j);
489  mode += nmodes2-ijmax;
490  }
491  }
492 
493  // fix for modified basis for top singular vertex component
494  // Already have evaluated (1+c)/2 (1-b)/2 (1-a)/2
495  if(sortTopVertex)
496  {
497  for(int n = 0; n < numElmt; ++n)
498  {
499  // add in (1+c)/2 (1+b)/2 component
500  output[1+n*totmodes] += Blas::Ddot(nquad2,
501  base2.get()+nquad2,1,
502  &wsp[nquad2*numElmt + n*nquad2],1);
503 
504  // add in (1+c)/2 (1-b)/2 (1+a)/2 component
505  output[1+n*totmodes] += Blas::Ddot(nquad2,
506  base2.get()+nquad2,1,
507  &wsp[nquad2*nmodes1*numElmt+n*nquad2],1);
508 
509  // add in (1+c)/2 (1+b)/2 (1+a)/2 component
510  output[1+n*totmodes] += Blas::Ddot(nquad2,
511  base2.get()+nquad2,1,
512  &wsp[nquad2*(nmodes1+1)*numElmt+n*nquad2],1);
513  }
514  }
515 }
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:250
static double Ddot(const int &n, const double *x, const int &incx, const double *y, const int &incy)
BLAS level 1: output = .
Definition: Blas.hpp:140

References ASSERTL1, Blas::Ddot(), Blas::Dgemm(), Nektar::LibUtilities::StdSegData::getNumberOfCoefficients(), and Vmath::Vmul().

Referenced by Nektar::Collections::IProductWRTDerivBase_SumFac_Pyr::operator()(), and Nektar::Collections::IProductWRTBase_SumFac_Pyr::operator()().

◆ QuadIProduct()

void Nektar::Collections::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 at line 48 of file IProduct.cpp.

57 {
58  int totpoints = nquad0*nquad1;
59  int totmodes = nmodes0*nmodes1;
60 
61  Vmath::Vmul(numElmt*totpoints,jac,1,input,1,wsp,1);
62 
63  if(colldir0 && colldir1)
64  {
65  Vmath::Vcopy(numElmt*totmodes,wsp.get(),1,output.get(),1);
66  }
67  else
68  {
69  Array<OneD, NekDouble> wsp1 = wsp + max(totpoints,totmodes)*numElmt;
70  if(colldir0)
71  {
72  for(int i = 0; i < nquad0; ++i)
73  {
74  Vmath::Vcopy(nquad1*numElmt,&wsp[i],nquad0,
75  &wsp1[i*nquad1*numElmt],1);
76  }
77  }
78  else
79  {
80  Blas::Dgemm('T','N', nquad1*numElmt,nmodes0,nquad0,1.0,
81  &wsp[0],nquad0, base0.get(), nquad0,
82  0.0,&wsp1[0], nquad1*numElmt);
83  }
84 
85 
86  if(numElmt > 1)
87  {
88 
89  if(colldir1)
90  {
91  for(int i = 0; i < nquad1; ++i)
92  {
93  Vmath::Vcopy(numElmt*nmodes0,&wsp1[i],nquad1,
94  &wsp[i*numElmt*nmodes0],1);
95  }
96  }
97  else
98  {
99 
100  Blas::Dgemm('T','N', numElmt*nmodes0, nmodes1, nquad1,
101  1.0, &wsp1[0], nquad1, base1.get(), nquad1,
102  0.0, &wsp[0], numElmt*nmodes0);
103  }
104 
105  for(int i = 0; i < totmodes; ++i)
106  {
107  Vmath::Vcopy(numElmt,&wsp[i*numElmt],1,&output[i],totmodes);
108  }
109  }
110  else
111  {
112  if(colldir1)
113  {
114  for(int i = 0; i < nquad1; ++i)
115  {
116  Vmath::Vcopy(numElmt*nmodes0,&wsp1[i],nquad1,
117  &output[i*numElmt*nmodes0],1);
118  }
119  }
120  else
121  {
122  Blas::Dgemm('T','N', nmodes0, nmodes1, nquad1,
123  1.0, &wsp1[0], nquad1, base1.get(), nquad1,
124  0.0, &output[0], nmodes0);
125  }
126  }
127  }
128 }

References Blas::Dgemm(), Vmath::Vcopy(), and Vmath::Vmul().

Referenced by Nektar::Collections::IProductWRTDerivBase_SumFac_Quad::operator()(), and Nektar::Collections::IProductWRTBase_SumFac_Quad::operator()().

◆ SetFixedImpType()

OperatorImpMap Nektar::Collections::SetFixedImpType ( ImplementationType  defaultType)

simple Operator Implementation Map generator

Definition at line 117 of file Operator.cpp.

118 {
119  OperatorImpMap opMap;
120 
121  for(int i = 0; i < SIZE_OperatorType; ++i)
122  {
123  opMap[(OperatorType)i] = defaultType;
124  }
125 
126  return opMap;
127 }
std::map< OperatorType, ImplementationType > OperatorImpMap
Definition: Operator.h:103

References SIZE_OperatorType.

◆ TetIProduct()

void Nektar::Collections::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 at line 522 of file IProduct.cpp.

532 {
534  nmodes0,nmodes1,nmodes2);
535  int totpoints = nquad0*nquad1*nquad2;
536  int cnt;
537  int mode, mode1;
538 
539  Vmath::Vmul(numElmt*totpoints,jac,1,input,1,wsp,1);
540 
541  Array<OneD, NekDouble> wsp1 = wsp +
542  nquad2*numElmt*(max(nquad0*nquad1,nmodes0*(2*nmodes1-nmodes0+1)/2));
543 
544 
545  // Perform iproduct with respect to the '0' direction
546  Blas::Dgemm('T', 'N', nquad1*nquad2*numElmt, nmodes0, nquad0,
547  1.0, wsp.get(), nquad0, base0.get(),
548  nquad0, 0.0, wsp1.get(), nquad1*nquad2*numElmt);
549 
550  // Inner product with respect to the '1' direction
551  mode = 0;
552  for(int i=0; i < nmodes0; ++i)
553  {
554  Blas::Dgemm('T', 'N', nquad2*numElmt, nmodes1-i, nquad1,
555  1.0, wsp1.get()+ i*nquad1*nquad2*numElmt, nquad1,
556  base1.get() + mode*nquad1, nquad1,
557  0.0, wsp.get() + mode*nquad2*numElmt,nquad2*numElmt);
558  mode += nmodes1-i;
559  }
560 
561 
562  // fix for modified basis by splitting top vertex mode
563  if (sortTopEdge)
564  {
565  // base singular vertex and singular edge (1+b)/2
566  // ((1+a)/2 components entry into (1+b)/2)
567  // Could be made into an mxm if we have specialised base1[1]
568  for(int n = 0; n < numElmt; ++n)
569  {
570  Blas::Dgemv('T', nquad1, nquad2,
571  1.0, wsp1.get()+numElmt*nquad1*nquad2 +
572  n*nquad1*nquad2, nquad1,
573  base1.get()+nquad1, 1, 1.0,
574  wsp.get()+nquad2*numElmt + n*nquad2, 1);
575  }
576  }
577 
578  // Inner product with respect to the '2' direction
579  mode = mode1 = cnt = 0;
580  for(int i = 0; i < nmodes0; ++i)
581  {
582  for(int j = 0; j < nmodes1-i; ++j, ++cnt)
583  {
584  Blas::Dgemm('T', 'N', nmodes2-i-j, numElmt, nquad2,
585  1.0, base2.get()+mode*nquad2, nquad2,
586  wsp.get()+cnt*nquad2*numElmt, nquad2,
587  0.0, output.get()+mode1, totmodes);
588  mode += nmodes2-i-j;
589  mode1 += nmodes2-i-j;
590  }
591 
592  //increment mode in case order1!=order2
593  mode += (nmodes2-nmodes1)*(nmodes2-nmodes1+1)/2;
594  }
595 
596  // fix for modified basis for top singular vertex component
597  // Already have evaluated (1+c)/2 (1-b)/2 (1-a)/2
598  if(sortTopEdge)
599  {
600  for(int n = 0; n < numElmt; ++n)
601  {
602  // add in (1+c)/2 (1+b)/2 component
603  output[1+n*totmodes] += Blas::Ddot(nquad2,
604  base2.get()+nquad2,1,
605  &wsp[nquad2*numElmt + n*nquad2],1);
606 
607  // add in (1+c)/2 (1-b)/2 (1+a)/2 component
608  output[1+n*totmodes] += Blas::Ddot(nquad2,
609  base2.get()+nquad2,1,
610  &wsp[nquad2*nmodes1*numElmt+n*nquad2],1);
611  }
612  }
613 
614 }

References Blas::Ddot(), Blas::Dgemm(), Blas::Dgemv(), Nektar::LibUtilities::StdSegData::getNumberOfCoefficients(), and Vmath::Vmul().

Referenced by Nektar::Collections::IProductWRTDerivBase_SumFac_Tet::operator()(), and Nektar::Collections::IProductWRTBase_SumFac_Tet::operator()().

◆ TriIProduct()

void Nektar::Collections::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 at line 134 of file IProduct.cpp.

142 {
144  nmodes0, nmodes1);
145  int totpoints = nquad0*nquad1;
146 
147  Vmath::Vmul(numElmt*totpoints,jac,1,input,1,wsp,1);
148 
149  Array<OneD, NekDouble> wsp1 = wsp + max(totpoints,totmodes)*numElmt;
150 
151  Blas::Dgemm('T','N', nquad1*numElmt,nmodes0,nquad0,1.0,&wsp[0],nquad0,
152  base0.get(), nquad0, 0.0, &wsp1[0], nquad1*numElmt);
153 
154  int i, mode;
155  // Inner product with respect to 'b' direction
156  for (mode=i=0; i < nmodes0; ++i)
157  {
158  Blas::Dgemm('T', 'N', nmodes1-i, numElmt, nquad1,
159  1.0, base1.get()+mode*nquad1, nquad1,
160  wsp1.get() + i*nquad1*numElmt, nquad1, 0.0,
161  &output[mode], totmodes);
162 
163  mode += nmodes1 - i;
164  }
165 
166  // fix for modified basis by splitting top vertex mode
167  if (sortTopVertex)
168  {
169  Blas::Dgemv('T', nquad1,numElmt,1.0,wsp1.get()+nquad1*numElmt,nquad1,
170  base1.get()+nquad1,1,1.0, &output[1],totmodes);
171  }
172 }

References Blas::Dgemm(), Blas::Dgemv(), Nektar::LibUtilities::StdSegData::getNumberOfCoefficients(), and Vmath::Vmul().

Referenced by Nektar::Collections::IProductWRTDerivBase_SumFac_Tri::operator()(), and Nektar::Collections::IProductWRTBase_SumFac_Tri::operator()().

Variable Documentation

◆ GeomDataNull

CoalescedGeomDataSharedPtr Nektar::Collections::GeomDataNull
static

Definition at line 76 of file CoalescedGeomData.h.

◆ ImplementationTypeMap

const char* const Nektar::Collections::ImplementationTypeMap[]
Initial value:
=
{
"NoImplementationType",
"NoCollection",
"IterPerExp",
"StdMat",
"SumFac"
}

Definition at line 92 of file Operator.h.

Referenced by Nektar::Collections::CollectionOptimisation::CollectionOptimisation(), operator<<(), and Nektar::Collections::CollectionOptimisation::SetWithTimings().

◆ OperatorTypeMap

const char* const Nektar::Collections::OperatorTypeMap[]
Initial value:
=
{
"BwdTrans",
"IProductWRTBase",
"IProductWRTDerivBase",
"PhysDeriv"
}

Definition at line 74 of file Operator.h.

Referenced by Nektar::Collections::CollectionOptimisation::CollectionOptimisation(), operator<<(), and Nektar::Collections::CollectionOptimisation::SetWithTimings().