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

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

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

Public Member Functions

 ~BwdTrans_SumFac_Tri () 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
 
Array< OneD, const NekDoublem_base0
 
Array< OneD, const NekDoublem_base1
 
bool m_sortTopVertex
 
- 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_Tri (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 (Tri)

Definition at line 573 of file BwdTrans.cpp.

Constructor & Destructor Documentation

◆ ~BwdTrans_SumFac_Tri()

Nektar::Collections::BwdTrans_SumFac_Tri::~BwdTrans_SumFac_Tri ( )
finaldefault

◆ BwdTrans_SumFac_Tri()

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

Definition at line 636 of file BwdTrans.cpp.

639 : Operator(pCollExp, pGeomData, factors),
640 m_nquad0(m_stdExp->GetNumPoints(0)),
641 m_nquad1(m_stdExp->GetNumPoints(1)),
642 m_nmodes0(m_stdExp->GetBasisNumModes(0)),
643 m_nmodes1(m_stdExp->GetBasisNumModes(1)),
644 m_base0(m_stdExp->GetBasis(0)->GetBdata()),
645 m_base1(m_stdExp->GetBasis(1)->GetBdata())
646 {
648 if (m_stdExp->GetBasis(0)->GetBasisType() == LibUtilities::eModified_A)
649 {
650 m_sortTopVertex = true;
651 }
652 else
653 {
654 m_sortTopVertex = false;
655 }
656 }
Array< OneD, const NekDouble > m_base0
Definition: BwdTrans.cpp:631
Array< OneD, const NekDouble > m_base1
Definition: BwdTrans.cpp:632
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
@ eModified_A
Principle Modified Functions .
Definition: BasisType.h:48
StdRegions::ConstFactorMap factors

References Nektar::LibUtilities::eModified_A, m_nmodes0, m_nquad1, Nektar::Collections::Operator::m_numElmt, m_sortTopVertex, Nektar::Collections::Operator::m_stdExp, and Nektar::Collections::Operator::m_wspSize.

Member Function Documentation

◆ operator()() [1/2]

void Nektar::Collections::BwdTrans_SumFac_Tri::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 581 of file BwdTrans.cpp.

586 {
587 ASSERTL1(wsp.size() == m_wspSize, "Incorrect workspace size");
588
589 int ncoeffs = m_stdExp->GetNcoeffs();
590 int i = 0;
591 int mode = 0;
592
593 for (i = mode = 0; i < m_nmodes0; ++i)
594 {
595 Blas::Dgemm('N', 'N', m_nquad1, m_numElmt, m_nmodes1 - i, 1.0,
596 m_base1.get() + mode * m_nquad1, m_nquad1,
597 &input[0] + mode, ncoeffs, 0.0,
598 &wsp[i * m_nquad1 * m_numElmt], m_nquad1);
599 mode += m_nmodes1 - i;
600 }
601
602 // fix for modified basis by splitting top vertex mode
603 if (m_sortTopVertex)
604 {
605 for (i = 0; i < m_numElmt; ++i)
606 {
607 Blas::Daxpy(m_nquad1, input[1 + i * ncoeffs],
608 m_base1.get() + m_nquad1, 1,
609 &wsp[m_nquad1 * m_numElmt] + i * m_nquad1, 1);
610 }
611 }
612
614 m_base0.get(), m_nquad0, &wsp[0], m_nquad1 * m_numElmt, 0.0,
615 &output0[0], m_nquad0);
616 }
#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
static void Daxpy(const int &n, const double &alpha, const double *x, const int &incx, const double *y, const int &incy)
BLAS level 1: y = alpha x plus y.
Definition: Blas.hpp:135

References ASSERTL1, Blas::Daxpy(), Blas::Dgemm(), m_base0, m_base1, m_nmodes0, m_nmodes1, m_nquad0, m_nquad1, Nektar::Collections::Operator::m_numElmt, m_sortTopVertex, Nektar::Collections::Operator::m_stdExp, and Nektar::Collections::Operator::m_wspSize.

◆ operator()() [2/2]

void Nektar::Collections::BwdTrans_SumFac_Tri::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 618 of file BwdTrans.cpp.

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

References ASSERTL0.

Member Data Documentation

◆ m_base0

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

Definition at line 631 of file BwdTrans.cpp.

Referenced by operator()().

◆ m_base1

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

Definition at line 632 of file BwdTrans.cpp.

Referenced by operator()().

◆ m_nmodes0

const int Nektar::Collections::BwdTrans_SumFac_Tri::m_nmodes0
protected

Definition at line 629 of file BwdTrans.cpp.

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

◆ m_nmodes1

const int Nektar::Collections::BwdTrans_SumFac_Tri::m_nmodes1
protected

Definition at line 630 of file BwdTrans.cpp.

Referenced by operator()().

◆ m_nquad0

const int Nektar::Collections::BwdTrans_SumFac_Tri::m_nquad0
protected

Definition at line 627 of file BwdTrans.cpp.

Referenced by operator()().

◆ m_nquad1

const int Nektar::Collections::BwdTrans_SumFac_Tri::m_nquad1
protected

Definition at line 628 of file BwdTrans.cpp.

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

◆ m_sortTopVertex

bool Nektar::Collections::BwdTrans_SumFac_Tri::m_sortTopVertex
protected

Definition at line 633 of file BwdTrans.cpp.

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