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  LinearAdvectionDiffusionReaction_Helper
 LinearAdvectionDiffusionReaction help class to calculate the size of the collection that is given as an input and as an output to the LinearAdvectionDiffusionReaction Operator. The size evaluation takes into account that the evaluation of the LinearAdvectionDiffusionReaction operator takes input from the coeff space and gives the output in the coeff space too. More...
 
class  LinearAdvectionDiffusionReaction_IterPerExp
 LinearAdvectionDiffusionReaction operator using LocalRegions implementation. More...
 
class  LinearAdvectionDiffusionReaction_MatrixFree
 
class  LinearAdvectionDiffusionReaction_NoCollection
 LinearAdvectionDiffusionReaction operator using LocalRegions implementation. More...
 
class  MatrixFreeBase
 
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_MatrixFree
 PhysInterp1DScaled operator using matrix free implementation. More...
 
class  PhysInterp1DScaled_NoCollection
 PhysInterp1DScaled operator using LocalRegions implementation. 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 , eLinearAdvectionDiffusionReaction , 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 128 of file Collection.h.

◆ CollectionVectorSharedPtr

Definition at line 129 of file Collection.h.

◆ ExpansionIsNodal

Definition at line 113 of file Operator.h.

◆ OperatorFactory

Operator factory definition.

Definition at line 126 of file Operator.h.

◆ OperatorImpMap

Definition at line 131 of file Operator.h.

◆ OperatorKey

Key for describing an Operator.

Definition at line 120 of file Operator.h.

◆ OperatorSharedPtr

Shared pointer to an Operator object.

Definition at line 235 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 86 of file Operator.h.

◆ OperatorType

Enumerator
eBwdTrans 
eHelmholtz 
eLinearAdvectionDiffusionReaction 
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 171 of file IProduct.cpp.

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

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

347{
349 nmodes0, nmodes1, nmodes2);
350 int totpoints = nquad0 * nquad1 * nquad2;
351 int cnt;
352 int mode, mode1;
353
354 Vmath::Vmul(numElmt * totpoints, jac, 1, input, 1, wsp, 1);
355
357 wsp + numElmt * nquad2 * (max(nquad0 * nquad1, nmodes0 * nmodes1));
358
359 // Perform iproduct with respect to the '0' direction
360 Blas::Dgemm('T', 'N', nquad1 * nquad2 * numElmt, nmodes0, nquad0, 1.0,
361 wsp.data(), nquad0, base0.data(), nquad0, 0.0, wsp1.data(),
362 nquad1 * nquad2 * numElmt);
363
364 // Perform iproduct with respect to the '1' direction
365 Blas::Dgemm('T', 'N', nquad2 * numElmt * nmodes0, nmodes1, nquad1, 1.0,
366 wsp1.data(), nquad1, base1.data(), nquad1, 0.0, wsp.data(),
367 nquad2 * numElmt * nmodes0);
368
369 // Inner product with respect to the '2' direction (not sure if it would
370 // be better to swap loops?)
371 mode = mode1 = cnt = 0;
372 for (int i = 0; i < nmodes0; ++i)
373 {
374 cnt = i * nquad2 * numElmt;
375 for (int j = 0; j < nmodes1; ++j)
376 {
377 Blas::Dgemm('T', 'N', nmodes2 - i, numElmt, nquad2, 1.0,
378 base2.data() + mode * nquad2, nquad2,
379 wsp.data() + j * nquad2 * numElmt * nmodes0 + cnt,
380 nquad2, 0.0, output.data() + mode1, totmodes);
381 mode1 += nmodes2 - i;
382 }
383 mode += nmodes2 - i;
384 }
385
386 // fix for modified basis by splitting top vertex mode
387 if (sortTopVertex)
388 {
389 // top singular vertex
390 // ((1+a)/2 components entry into (1+c)/2)
391 // Could be made into an mxv if we have specialised base1[1]
392 for (int j = 0; j < nmodes1; ++j)
393 {
394 Blas::Dgemv('T', nquad2, numElmt, 1.0,
395 wsp.data() + j * nquad2 * numElmt * nmodes0 +
396 nquad2 * numElmt,
397 nquad2, base2.data() + nquad2, 1, 1.0,
398 &output[j * nmodes2 + 1], totmodes);
399 }
400 }
401}
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 406 of file IProduct.cpp.

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

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

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

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.data(), 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.data() + mode * nquad1, nquad1,
153 wsp1.data() + 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.data() + nquad1 * numElmt,
163 nquad1, base1.data() + nquad1, 1, 1.0, &output[1],
164 totmodes);
165 }
166}

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 97 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 104 of file Operator.h.

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

◆ OperatorTypeMap

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

Definition at line 74 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", "LinearADR", "IPWrtBase",
"IPWrtDBase", "PhysDeriv", "PhysInterp1DScaled"}

Definition at line 82 of file Operator.h.

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