Nektar++
Public Member Functions | Protected Attributes | Private Member Functions | List of all members
Nektar::Collections::BwdTrans_SumFac_Quad Class Referencefinal

Backward transform operator using sum-factorisation (Quad) More...

Inheritance diagram for Nektar::Collections::BwdTrans_SumFac_Quad:
[legend]

Public Member Functions

 ~BwdTrans_SumFac_Quad () final=default
 
void operator() (const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output0, Array< OneD, NekDouble > &output1, Array< OneD, NekDouble > &output2, Array< OneD, NekDouble > &wsp) override
 Perform operation. More...
 
void operator() (int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
 
- Public Member Functions inherited from Nektar::Collections::Operator
 Operator (std::vector< StdRegions::StdExpansionSharedPtr > pCollExp, std::shared_ptr< CoalescedGeomData > GeomData, StdRegions::FactorMap factors)
 Constructor. More...
 
virtual ~Operator ()=default
 
virtual COLLECTIONS_EXPORT void operator() (const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output0, Array< OneD, NekDouble > &output1, Array< OneD, NekDouble > &output2, Array< OneD, NekDouble > &wsp=NullNekDouble1DArray)=0
 Perform operation. More...
 
virtual COLLECTIONS_EXPORT void operator() (int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp=NullNekDouble1DArray)=0
 
virtual COLLECTIONS_EXPORT void UpdateFactors (StdRegions::FactorMap factors)
 Update the supplied factor map. More...
 
virtual COLLECTIONS_EXPORT void UpdateVarcoeffs (StdRegions::VarCoeffMap &varcoeffs)
 Update the supplied variable coefficients. More...
 
unsigned int GetWspSize ()
 Get the size of the required workspace. More...
 
unsigned int GetNumElmt ()
 Get number of elements. More...
 
StdRegions::StdExpansionSharedPtr GetExpSharedPtr ()
 Get expansion pointer. More...
 
unsigned int GetInputSize (bool defaultIn=true)
 
unsigned int GetOutputSize (bool defaultOut=true)
 

Protected Attributes

const int m_nquad0
 
const int m_nquad1
 
const int m_nmodes0
 
const int m_nmodes1
 
const bool m_colldir0
 
const bool m_colldir1
 
Array< OneD, const NekDoublem_base0
 
Array< OneD, const NekDoublem_base1
 
- Protected Attributes inherited from Nektar::Collections::Operator
bool m_isDeformed
 
StdRegions::StdExpansionSharedPtr m_stdExp
 
unsigned int m_numElmt
 number of elements that the operator is applied on More...
 
unsigned int m_nqe
 
unsigned int m_wspSize
 
unsigned int m_inputSize
 number of modes or quadrature points that are passed as input to an operator More...
 
unsigned int m_outputSize
 number of modes or quadrature points that are taken as output from an operator More...
 
unsigned int m_inputSizeOther
 Number of modes or quadrature points, opposite to m_inputSize. More...
 
unsigned int m_outputSizeOther
 Number of modes or quadrature points, opposite to m_outputSize. More...
 

Private Member Functions

 BwdTrans_SumFac_Quad (vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
 

Additional Inherited Members

- Protected Member Functions inherited from Nektar::Collections::BwdTrans_Helper
 BwdTrans_Helper ()
 

Detailed Description

Backward transform operator using sum-factorisation (Quad)

Definition at line 472 of file BwdTrans.cpp.

Constructor & Destructor Documentation

◆ ~BwdTrans_SumFac_Quad()

Nektar::Collections::BwdTrans_SumFac_Quad::~BwdTrans_SumFac_Quad ( )
finaldefault

◆ BwdTrans_SumFac_Quad()

Nektar::Collections::BwdTrans_SumFac_Quad::BwdTrans_SumFac_Quad ( vector< StdRegions::StdExpansionSharedPtr pCollExp,
CoalescedGeomDataSharedPtr  pGeomData,
StdRegions::FactorMap  factors 
)
inlineprivate

Definition at line 547 of file BwdTrans.cpp.

550 : Operator(pCollExp, pGeomData, factors), BwdTrans_Helper(),
551 m_nquad0(m_stdExp->GetNumPoints(0)),
552 m_nquad1(m_stdExp->GetNumPoints(1)),
553 m_nmodes0(m_stdExp->GetBasisNumModes(0)),
554 m_nmodes1(m_stdExp->GetBasisNumModes(1)),
555 m_colldir0(m_stdExp->GetBasis(0)->Collocation()),
556 m_colldir1(m_stdExp->GetBasis(1)->Collocation()),
557 m_base0(m_stdExp->GetBasis(0)->GetBdata()),
558 m_base1(m_stdExp->GetBasis(1)->GetBdata())
559 {
561 }
Array< OneD, const NekDouble > m_base1
Definition: BwdTrans.cpp:544
Array< OneD, const NekDouble > m_base0
Definition: BwdTrans.cpp:543
StdRegions::StdExpansionSharedPtr m_stdExp
Definition: Operator.h:217
unsigned int m_numElmt
number of elements that the operator is applied on
Definition: Operator.h:219
Operator(std::vector< StdRegions::StdExpansionSharedPtr > pCollExp, std::shared_ptr< CoalescedGeomData > GeomData, StdRegions::FactorMap factors)
Constructor.
Definition: Operator.cpp:66
StdRegions::ConstFactorMap factors

References m_nmodes1, m_nquad0, Nektar::Collections::Operator::m_numElmt, and Nektar::Collections::Operator::m_wspSize.

Member Function Documentation

◆ operator()() [1/2]

void Nektar::Collections::BwdTrans_SumFac_Quad::operator() ( const Array< OneD, const NekDouble > &  input,
Array< OneD, NekDouble > &  output0,
Array< OneD, NekDouble > &  output1,
Array< OneD, NekDouble > &  output2,
Array< OneD, NekDouble > &  wsp 
)
inlineoverridevirtual

Perform operation.

Implements Nektar::Collections::Operator.

Definition at line 480 of file BwdTrans.cpp.

485 {
486 int i = 0;
487 if (m_colldir0 && m_colldir1)
488 {
489 Vmath::Vcopy(m_numElmt * m_nmodes0 * m_nmodes1, input.get(), 1,
490 output0.get(), 1);
491 }
492 else if (m_colldir0)
493 {
494 for (i = 0; i < m_numElmt; ++i)
495 {
496 Blas::Dgemm('N', 'T', m_nquad0, m_nquad1, m_nmodes1, 1.0,
497 &input[i * m_nquad0 * m_nmodes1], m_nquad0,
498 m_base1.get(), m_nquad1, 0.0,
499 &output0[i * m_nquad0 * m_nquad1], m_nquad0);
500 }
501 }
502 else if (m_colldir1)
503 {
505 1.0, m_base0.get(), m_nquad0, &input[0], m_nmodes0, 0.0,
506 &output0[0], m_nquad0);
507 }
508 else
509 {
510 ASSERTL1(wsp.size() == m_wspSize, "Incorrect workspace size");
511
512 // Those two calls correpsond to the operation
513 // out = B0*in*Transpose(B1);
515 1.0, m_base0.get(), m_nquad0, &input[0], m_nmodes0, 0.0,
516 &wsp[0], m_nquad0);
517
518 for (i = 0; i < m_numElmt; ++i)
519 {
520 Blas::Dgemm('N', 'T', m_nquad0, m_nquad1, m_nmodes1, 1.0,
521 &wsp[i * m_nquad0 * m_nmodes1], m_nquad0,
522 m_base1.get(), m_nquad1, 0.0,
523 &output0[i * m_nquad0 * m_nquad1], m_nquad0);
524 }
525 }
526 }
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:242
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 Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.hpp:825

References ASSERTL1, Blas::Dgemm(), m_base0, m_base1, m_colldir0, m_colldir1, m_nmodes0, m_nmodes1, m_nquad0, m_nquad1, Nektar::Collections::Operator::m_numElmt, Nektar::Collections::Operator::m_wspSize, and Vmath::Vcopy().

◆ operator()() [2/2]

void Nektar::Collections::BwdTrans_SumFac_Quad::operator() ( int  dir,
const Array< OneD, const NekDouble > &  input,
Array< OneD, NekDouble > &  output,
Array< OneD, NekDouble > &  wsp 
)
inlinefinalvirtual

Implements Nektar::Collections::Operator.

Definition at line 528 of file BwdTrans.cpp.

532 {
533 ASSERTL0(false, "Not valid for this operator.");
534 }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:208

References ASSERTL0.

Member Data Documentation

◆ m_base0

Array<OneD, const NekDouble> Nektar::Collections::BwdTrans_SumFac_Quad::m_base0
protected

Definition at line 543 of file BwdTrans.cpp.

Referenced by operator()().

◆ m_base1

Array<OneD, const NekDouble> Nektar::Collections::BwdTrans_SumFac_Quad::m_base1
protected

Definition at line 544 of file BwdTrans.cpp.

Referenced by operator()().

◆ m_colldir0

const bool Nektar::Collections::BwdTrans_SumFac_Quad::m_colldir0
protected

Definition at line 541 of file BwdTrans.cpp.

Referenced by operator()().

◆ m_colldir1

const bool Nektar::Collections::BwdTrans_SumFac_Quad::m_colldir1
protected

Definition at line 542 of file BwdTrans.cpp.

Referenced by operator()().

◆ m_nmodes0

const int Nektar::Collections::BwdTrans_SumFac_Quad::m_nmodes0
protected

Definition at line 539 of file BwdTrans.cpp.

Referenced by operator()().

◆ m_nmodes1

const int Nektar::Collections::BwdTrans_SumFac_Quad::m_nmodes1
protected

Definition at line 540 of file BwdTrans.cpp.

Referenced by BwdTrans_SumFac_Quad(), and operator()().

◆ m_nquad0

const int Nektar::Collections::BwdTrans_SumFac_Quad::m_nquad0
protected

Definition at line 537 of file BwdTrans.cpp.

Referenced by BwdTrans_SumFac_Quad(), and operator()().

◆ m_nquad1

const int Nektar::Collections::BwdTrans_SumFac_Quad::m_nquad1
protected

Definition at line 538 of file BwdTrans.cpp.

Referenced by operator()().