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

Classes

class  BwdTrans_Helper
 Backward transform help class to calculate the size of the collection that is given as an input and as an output to the BwdTrans Operator. The size evaluation takes into account the conversion from the coefficient space to the physical space. More...
 
class  BwdTrans_IterPerExp
 Backward transform operator using default StdRegions operator. More...
 
class  BwdTrans_MatrixFree
 Backward transform operator using matrix free operators. More...
 
class  BwdTrans_NoCollection
 Backward transform operator using LocalRegions implementation. More...
 
class  BwdTrans_StdMat
 Backward transform operator using standard matrix approach. More...
 
class  BwdTrans_SumFac_Hex
 Backward transform operator using sum-factorisation (Hex) 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  BwdTrans_SumFac_Quad
 Backward transform operator using sum-factorisation (Quad) More...
 
class  BwdTrans_SumFac_Seg
 Backward transform operator using sum-factorisation (Segment) More...
 
class  BwdTrans_SumFac_Tet
 Backward transform operator using sum-factorisation (Tet) More...
 
class  BwdTrans_SumFac_Tri
 Backward transform operator using sum-factorisation (Tri) More...
 
class  CoalescedGeomData
 
class  Collection
 Collection. More...
 
class  CollectionOptimisation
 
class  Helmholtz_Helper
 Helmholtz help class to calculate the size of the collection that is given as an input and as an output to the Helmholtz Operator. The size evaluation takes into account that the evaluation of the Helmholtz operator takes input from the coeff space and gives the output in the coeff space too. More...
 
class  Helmholtz_IterPerExp
 Helmholtz operator using LocalRegions implementation. More...
 
class  Helmholtz_MatrixFree
 Helmholtz operator using matrix free operators. More...
 
class  Helmholtz_NoCollection
 Helmholtz operator using LocalRegions implementation. More...
 
class  IProductWRTBase_Helper
 Inner product help class to calculate the size of the collection that is given as an input and as an output to the IProductWRTBase Operator. The size evaluation takes into account the conversion from the physical space to the coefficient space. More...
 
class  IProductWRTBase_IterPerExp
 Inner product operator using element-wise operation. More...
 
class  IProductWRTBase_MatrixFree
 Inner product operator using operator using matrix free operators. More...
 
class  IProductWRTBase_NoCollection
 Inner product operator using original MultiRegions implementation. More...
 
class  IProductWRTBase_StdMat
 Inner product operator using standard matrix approach. More...
 
class  IProductWRTBase_SumFac_Hex
 Inner Product operator using sum-factorisation (Hex) 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  IProductWRTBase_SumFac_Quad
 Inner product operator using sum-factorisation (Quad) More...
 
class  IProductWRTBase_SumFac_Seg
 Inner product operator using sum-factorisation (Segment) More...
 
class  IProductWRTBase_SumFac_Tet
 Inner product operator using sum-factorisation (Tet) More...
 
class  IProductWRTBase_SumFac_Tri
 Inner product operator using sum-factorisation (Tri) More...
 
class  IProductWRTDerivBase_Helper
 Inner product deriv base help class to calculate the size of the collection that is given as an input and as an output to the IProductWRTDerivBase Operator. The size evaluation takes into account the conversion from the physical space to the coefficient space. More...
 
class  IProductWRTDerivBase_IterPerExp
 Inner product WRT deriv base operator using element-wise operation. More...
 
class  IProductWRTDerivBase_MatrixFree
 Inner product operator using operator using matrix free operators. More...
 
class  IProductWRTDerivBase_NoCollection
 Inner product WRT deriv base operator using LocalRegions implementation. More...
 
class  IProductWRTDerivBase_StdMat
 Inner product WRT deriv base operator using standard matrix approach. More...
 
class  IProductWRTDerivBase_SumFac_Hex
 Inner product WRT deriv base operator using sum-factorisation (Hex) 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  IProductWRTDerivBase_SumFac_Quad
 Inner product WRT deriv base operator using sum-factorisation (Quad) More...
 
class  IProductWRTDerivBase_SumFac_Seg
 Inner product WRT deriv base operator using sum-factorisation (Segment) More...
 
class  IProductWRTDerivBase_SumFac_Tet
 Inner product WRT deriv base operator using sum-factorisation (Tet) More...
 
class  IProductWRTDerivBase_SumFac_Tri
 Inner product WRT deriv base operator using sum-factorisation (Tri) More...
 
class  MatrixFreeBase
 
class  MatrixFreeMultiInOneOut
 
class  MatrixFreeOneInMultiOut
 
class  MatrixFreeOneInOneOut
 
class  Operator
 Base class for operators on a collection of elements. More...
 
class  OpImpTimingKey
 
class  PhysDeriv_Helper
 Physical Derivative help class to calculate the size of the collection that is given as an input and as an output to the PhysDeriv Operator. The Operator evaluation is happenning in the physical space and the output is expected to be part of the physical space too. More...
 
class  PhysDeriv_IterPerExp
 Phys deriv operator using element-wise operation. More...
 
class  PhysDeriv_MatrixFree
 Phys deriv operator using matrix free operators. More...
 
class  PhysDeriv_NoCollection
 Phys deriv operator using original LocalRegions implementation. More...
 
class  PhysDeriv_StdMat
 Phys deriv operator using standard matrix approach. More...
 
class  PhysDeriv_SumFac_Hex
 Phys deriv operator using sum-factorisation (Hex) 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...
 
class  PhysDeriv_SumFac_Quad
 Phys deriv operator using sum-factorisation (Quad) More...
 
class  PhysDeriv_SumFac_Seg
 Phys deriv operator using sum-factorisation (Segment) More...
 
class  PhysDeriv_SumFac_Tet
 Phys deriv operator using sum-factorisation (Tet) More...
 
class  PhysDeriv_SumFac_Tri
 Phys deriv operator using sum-factorisation (Tri) More...
 
class  PhysInterp1DScaled_Helper
 PhysInterp1DScaled help class to calculate the size of the collection that is given as an input and as an output to the PhysInterp1DScaled Operator. The size evaluation takes into account that both the input and the output array belong to the physical space and that the output array can have either a larger, or a smaller size than the input array. More...
 
class  PhysInterp1DScaled_IterPerExp
 PhysInterp1DScaled operator using default StdRegions operator. More...
 
class  PhysInterp1DScaled_MatrixFree
 PhysInterp1DScaled operator using matrix free operators. More...
 
class  PhysInterp1DScaled_NoCollection
 PhysInterp1DScaled operator using LocalRegions implementation. More...
 
class  PhysInterp1DScaled_StdMat
 PhysInterp1DScaled operator using standard matrix approach. Currently, it is an identical copy of the BwdTrans operator. More...
 

Typedefs

using vec_t = simd< NekDouble >
 
typedef std::vector< vec_t, tinysimd::allocator< vec_t > > VecVec_t
 
typedef std::shared_ptr< CoalescedGeomDataCoalescedGeomDataSharedPtr
 
typedef std::vector< CollectionCollectionVector
 
typedef std::shared_ptr< CollectionVectorCollectionVectorSharedPtr
 
typedef bool ExpansionIsNodal
 
typedef std::tuple< LibUtilities::ShapeType, OperatorType, ImplementationType, ExpansionIsNodalOperatorKey
 Key for describing an Operator. More...
 
typedef Nektar::LibUtilities::NekFactory< OperatorKey, Operator, std::vector< StdRegions::StdExpansionSharedPtr >, CoalescedGeomDataSharedPtr, StdRegions::FactorMapOperatorFactory
 Operator factory definition. More...
 
typedef std::map< OperatorType, ImplementationTypeOperatorImpMap
 
typedef std::shared_ptr< OperatorOperatorSharedPtr
 Shared pointer to an Operator object. More...
 

Enumerations

enum  GeomData { eJac , eJacWithStdWeights , eDerivFactors }
 
enum  OperatorType {
  eBwdTrans , eHelmholtz , eIProductWRTBase , eIProductWRTDerivBase ,
  ePhysDeriv , ePhysInterp1DScaled , SIZE_OperatorType
}
 
enum  ImplementationType {
  eNoImpType , eNoCollection , eIterPerExp , eStdMat ,
  eSumFac , eMatrixFree , 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 sortTopVert, 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 sortTopVert, 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)
 
OperatorFactoryGetOperatorFactory ()
 Returns the singleton Operator factory object. More...
 
OperatorImpMap SetFixedImpType (ImplementationType defaultType)
 simple Operator Implementation Map generator More...
 
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...
 

Variables

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

Typedef Documentation

◆ CoalescedGeomDataSharedPtr

Definition at line 88 of file CoalescedGeomData.h.

◆ CollectionVector

Definition at line 118 of file Collection.h.

◆ CollectionVectorSharedPtr

Definition at line 119 of file Collection.h.

◆ ExpansionIsNodal

Definition at line 108 of file Operator.h.

◆ OperatorFactory

Operator factory definition.

Definition at line 121 of file Operator.h.

◆ OperatorImpMap

Definition at line 126 of file Operator.h.

◆ OperatorKey

Key for describing an Operator.

Definition at line 115 of file Operator.h.

◆ OperatorSharedPtr

Shared pointer to an Operator object.

Definition at line 227 of file Operator.h.

◆ vec_t

Definition at line 47 of file CoalescedGeomData.h.

◆ VecVec_t

Definition at line 48 of file CoalescedGeomData.h.

Enumeration Type Documentation

◆ GeomData

Enumerator
eJac 
eJacWithStdWeights 
eDerivFactors 

Definition at line 50 of file CoalescedGeomData.h.

◆ ImplementationType

Enumerator
eNoImpType 
eNoCollection 
eIterPerExp 
eStdMat 
eSumFac 
eMatrixFree 
SIZE_ImplementationType 

Definition at line 81 of file Operator.h.

◆ OperatorType

Enumerator
eBwdTrans 
eHelmholtz 
eIProductWRTBase 
eIProductWRTDerivBase 
ePhysDeriv 
ePhysInterp1DScaled 
SIZE_OperatorType 

Definition at line 62 of file Operator.h.

Function Documentation

◆ GetOperatorFactory()

OperatorFactory & Nektar::Collections::GetOperatorFactory ( )

◆ 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 170 of file IProduct.cpp.

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

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 78 of file Operator.cpp.

79{
80 if (std::get<0>(p1) < std::get<0>(p2))
81 {
82 return true;
83 }
84 if (std::get<0>(p1) > std::get<0>(p2))
85 {
86 return false;
87 }
88 if (std::get<1>(p1) < std::get<1>(p2))
89 {
90 return true;
91 }
92 if (std::get<1>(p1) > std::get<1>(p2))
93 {
94 return false;
95 }
96 if (std::get<2>(p1) < std::get<2>(p2))
97 {
98 return true;
99 }
100 if (std::get<2>(p1) > std::get<2>(p2))
101 {
102 return false;
103 }
104
105 if (std::get<3>(p1) < std::get<3>(p2))
106 {
107 return true;
108 }
109 if (std::get<3>(p1) > std::get<3>(p2))
110 {
111 return false;
112 }
113
114 return false;
115}

◆ operator<<()

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

Stream output operator for OperatorKey objects.

Definition at line 120 of file Operator.cpp.

121{
122 os << LibUtilities::ShapeTypeMap[std::get<0>(p)] << ", "
123 << OperatorTypeMap[std::get<1>(p)] << ", "
124 << ImplementationTypeMap[std::get<2>(p)] << ", "
125 << (std::get<3>(p) ? "Nodal" : "Modal");
126 return os;
127}
const char *const ImplementationTypeMap[]
Definition: Operator.h:92
const char *const OperatorTypeMap[]
Definition: Operator.h:73

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

◆ PrismIProduct()

void Nektar::Collections::PrismIProduct ( bool  sortTopVert,
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 338 of file IProduct.cpp.

346{
348 nmodes0, nmodes1, nmodes2);
349 int totpoints = nquad0 * nquad1 * nquad2;
350 int cnt;
351 int mode, mode1;
352
353 Vmath::Vmul(numElmt * totpoints, jac, 1, input, 1, wsp, 1);
354
356 wsp + numElmt * nquad2 * (max(nquad0 * nquad1, nmodes0 * nmodes1));
357
358 // Perform iproduct with respect to the '0' direction
359 Blas::Dgemm('T', 'N', nquad1 * nquad2 * numElmt, nmodes0, nquad0, 1.0,
360 wsp.get(), nquad0, base0.get(), nquad0, 0.0, wsp1.get(),
361 nquad1 * nquad2 * numElmt);
362
363 // Perform iproduct with respect to the '1' direction
364 Blas::Dgemm('T', 'N', nquad2 * numElmt * nmodes0, nmodes1, nquad1, 1.0,
365 wsp1.get(), nquad1, base1.get(), nquad1, 0.0, wsp.get(),
366 nquad2 * numElmt * nmodes0);
367
368 // Inner product with respect to the '2' direction (not sure if it would
369 // be better to swap loops?)
370 mode = mode1 = cnt = 0;
371 for (int i = 0; i < nmodes0; ++i)
372 {
373 cnt = i * nquad2 * numElmt;
374 for (int j = 0; j < nmodes1; ++j)
375 {
376 Blas::Dgemm('T', 'N', nmodes2 - i, numElmt, nquad2, 1.0,
377 base2.get() + mode * nquad2, nquad2,
378 wsp.get() + j * nquad2 * numElmt * nmodes0 + cnt,
379 nquad2, 0.0, output.get() + mode1, totmodes);
380 mode1 += nmodes2 - i;
381 }
382 mode += nmodes2 - i;
383 }
384
385 // fix for modified basis by splitting top vertex mode
386 if (sortTopVertex)
387 {
388 // top singular vertex
389 // ((1+a)/2 components entry into (1+c)/2)
390 // Could be made into an mxv if we have specialised base1[1]
391 for (int j = 0; j < nmodes1; ++j)
392 {
393 Blas::Dgemv('T', nquad2, numElmt, 1.0,
394 wsp.get() + j * nquad2 * numElmt * nmodes0 +
395 nquad2 * numElmt,
396 nquad2, base2.get() + nquad2, 1, 1.0,
397 &output[j * nmodes2 + 1], totmodes);
398 }
399 }
400}
static void Dgemv(const char &trans, const int &m, const int &n, const double &alpha, const double *a, const int &lda, const double *x, const int &incx, const double &beta, double *y, const int &incy)
BLAS level 2: Matrix vector multiply y = alpha A x plus beta y where A[m x n].
Definition: Blas.hpp:211

References Blas::Dgemm(), Blas::Dgemv(), Nektar::LibUtilities::StdPrismData::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  sortTopVert,
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 405 of file IProduct.cpp.

413{
415 nmodes0, nmodes1, nmodes2);
416 int totpoints = nquad0 * nquad1 * nquad2;
417 int cnt;
418 int mode, mode1;
419
420 ASSERTL1(wsp.size() >=
421 numElmt * (nquad1 * nquad2 * nmodes0 +
422 nquad2 * max(nquad0 * nquad1, nmodes0 * nmodes1)),
423 "Insufficient workspace size");
424
425 Vmath::Vmul(numElmt * totpoints, jac, 1, input, 1, wsp, 1);
426
428 wsp + numElmt * nquad2 * (max(nquad0 * nquad1, nmodes0 * nmodes1));
429
430 // Perform iproduct with respect to the '0' direction
431 Blas::Dgemm('T', 'N', nquad1 * nquad2 * numElmt, nmodes0, nquad0, 1.0,
432 wsp.get(), nquad0, base0.get(), nquad0, 0.0, wsp1.get(),
433 nquad1 * nquad2 * numElmt);
434
435 // Inner product with respect to the '1' direction
436 mode = 0;
437 for (int i = 0; i < nmodes0; ++i)
438 {
439 Blas::Dgemm('T', 'N', nquad2 * numElmt, nmodes1, nquad1, 1.0,
440 wsp1.get() + i * nquad1 * nquad2 * numElmt, nquad1,
441 base1.get(), nquad1, 0.0,
442 wsp.get() + mode * nquad2 * numElmt, nquad2 * numElmt);
443 mode += nmodes1;
444 }
445
446 // Inner product with respect to the '2' direction
447 mode = mode1 = cnt = 0;
448 for (int i = 0; i < nmodes0; ++i)
449 {
450 for (int j = 0; j < nmodes1; ++j, ++cnt)
451 {
452 int ijmax = max(i, j);
453 Blas::Dgemm('T', 'N', nmodes2 - ijmax, numElmt, nquad2, 1.0,
454 base2.get() + mode * nquad2, nquad2,
455 wsp.get() + cnt * nquad2 * numElmt, nquad2, 0.0,
456 output.get() + mode1, totmodes);
457 mode += nmodes2 - ijmax;
458 mode1 += nmodes2 - ijmax;
459 }
460
461 // increment mode in case order1!=order2
462 for (int j = nmodes1; j < nmodes2; ++j)
463 {
464 int ijmax = max(i, j);
465 mode += nmodes2 - ijmax;
466 }
467 }
468
469 // fix for modified basis for top singular vertex component
470 // Already have evaluated (1+c)/2 (1-b)/2 (1-a)/2
471 if (sortTopVertex)
472 {
473 for (int n = 0; n < numElmt; ++n)
474 {
475 // add in (1+c)/2 (1+b)/2 component
476 output[1 + n * totmodes] +=
477 Blas::Ddot(nquad2, base2.get() + nquad2, 1,
478 &wsp[nquad2 * numElmt + n * nquad2], 1);
479
480 // add in (1+c)/2 (1-b)/2 (1+a)/2 component
481 output[1 + n * totmodes] +=
482 Blas::Ddot(nquad2, base2.get() + nquad2, 1,
483 &wsp[nquad2 * nmodes1 * numElmt + n * nquad2], 1);
484
485 // add in (1+c)/2 (1+b)/2 (1+a)/2 component
486 output[1 + n * totmodes] += Blas::Ddot(
487 nquad2, base2.get() + nquad2, 1,
488 &wsp[nquad2 * (nmodes1 + 1) * numElmt + n * nquad2], 1);
489 }
490 }
491}
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:242
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:163

References ASSERTL1, Blas::Ddot(), Blas::Dgemm(), Nektar::LibUtilities::StdPyrData::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 46 of file IProduct.cpp.

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

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 51 of file Operator.cpp.

52{
53 OperatorImpMap opMap;
54
55 for (int i = 0; i < SIZE_OperatorType; ++i)
56 {
57 opMap[(OperatorType)i] = defaultType;
58 }
59
60 return opMap;
61}
std::map< OperatorType, ImplementationType > OperatorImpMap
Definition: Operator.h:126

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 496 of file IProduct.cpp.

504{
506 nmodes0, nmodes1, nmodes2);
507 int totpoints = nquad0 * nquad1 * nquad2;
508 int cnt;
509 int mode, mode1;
510
511 Vmath::Vmul(numElmt * totpoints, jac, 1, input, 1, wsp, 1);
512
514 wsp +
515 nquad2 * numElmt *
516 (max(nquad0 * nquad1, nmodes0 * (2 * nmodes1 - nmodes0 + 1) / 2));
517
518 // Perform iproduct with respect to the '0' direction
519 Blas::Dgemm('T', 'N', nquad1 * nquad2 * numElmt, nmodes0, nquad0, 1.0,
520 wsp.get(), nquad0, base0.get(), nquad0, 0.0, wsp1.get(),
521 nquad1 * nquad2 * numElmt);
522
523 // Inner product with respect to the '1' direction
524 mode = 0;
525 for (int i = 0; i < nmodes0; ++i)
526 {
527 Blas::Dgemm('T', 'N', nquad2 * numElmt, nmodes1 - i, nquad1, 1.0,
528 wsp1.get() + i * nquad1 * nquad2 * numElmt, nquad1,
529 base1.get() + mode * nquad1, nquad1, 0.0,
530 wsp.get() + mode * nquad2 * numElmt, nquad2 * numElmt);
531 mode += nmodes1 - i;
532 }
533
534 // fix for modified basis by splitting top vertex mode
535 if (sortTopEdge)
536 {
537 // base singular vertex and singular edge (1+b)/2
538 // ((1+a)/2 components entry into (1+b)/2)
539 // Could be made into an mxm if we have specialised base1[1]
540 for (int n = 0; n < numElmt; ++n)
541 {
542 Blas::Dgemv('T', nquad1, nquad2, 1.0,
543 wsp1.get() + numElmt * nquad1 * nquad2 +
544 n * nquad1 * nquad2,
545 nquad1, base1.get() + nquad1, 1, 1.0,
546 wsp.get() + nquad2 * numElmt + n * nquad2, 1);
547 }
548 }
549
550 // Inner product with respect to the '2' direction
551 mode = mode1 = cnt = 0;
552 for (int i = 0; i < nmodes0; ++i)
553 {
554 for (int j = 0; j < nmodes1 - i; ++j, ++cnt)
555 {
556 Blas::Dgemm('T', 'N', nmodes2 - i - j, numElmt, nquad2, 1.0,
557 base2.get() + mode * nquad2, nquad2,
558 wsp.get() + cnt * nquad2 * numElmt, nquad2, 0.0,
559 output.get() + mode1, totmodes);
560 mode += nmodes2 - i - j;
561 mode1 += nmodes2 - i - j;
562 }
563
564 // increment mode in case order1!=order2
565 mode += (nmodes2 - nmodes1) * (nmodes2 - nmodes1 + 1) / 2;
566 }
567
568 // fix for modified basis for top singular vertex component
569 // Already have evaluated (1+c)/2 (1-b)/2 (1-a)/2
570 if (sortTopEdge)
571 {
572 for (int n = 0; n < numElmt; ++n)
573 {
574 // add in (1+c)/2 (1+b)/2 component
575 output[1 + n * totmodes] +=
576 Blas::Ddot(nquad2, base2.get() + nquad2, 1,
577 &wsp[nquad2 * numElmt + n * nquad2], 1);
578
579 // add in (1+c)/2 (1-b)/2 (1+a)/2 component
580 output[1 + n * totmodes] +=
581 Blas::Ddot(nquad2, base2.get() + nquad2, 1,
582 &wsp[nquad2 * nmodes1 * numElmt + n * nquad2], 1);
583 }
584 }
585}

References Blas::Ddot(), Blas::Dgemm(), Blas::Dgemv(), Nektar::LibUtilities::StdTetData::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 128 of file IProduct.cpp.

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

References Blas::Dgemm(), Blas::Dgemv(), Nektar::LibUtilities::StdTriData::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 90 of file CoalescedGeomData.h.

◆ ImplementationTypeMap

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

Definition at line 92 of file Operator.h.

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

◆ ImplementationTypeMap1

const char* const Nektar::Collections::ImplementationTypeMap1[]
Initial value:
= {
"NoImplementationType",
"IterLocExp",
"IterStdExp",
"StdMat ",
"SumFac ",
"MatFree "
}

Definition at line 99 of file Operator.h.

Referenced by Nektar::Collections::CollectionOptimisation::SetWithTimings().

◆ OperatorTypeMap

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

Definition at line 73 of file Operator.h.

Referenced by Nektar::Collections::CollectionOptimisation::CollectionOptimisation(), Nektar::Collections::Collection::Initialise(), operator<<(), Nektar::Collections::CollectionOptimisation::ReadCollOps(), and Nektar::Collections::CollectionOptimisation::UpdateOptFile().

◆ OperatorTypeMap1

const char* const Nektar::Collections::OperatorTypeMap1[]
Initial value:
= {"BwdTrans", "Helmholtz",
"IPWrtBase", "IPWrtDBase",
"PhysDeriv", "PhysInterp1DScaled"}

Definition at line 77 of file Operator.h.

Referenced by Nektar::Collections::CollectionOptimisation::SetWithTimings().