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

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

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

Public Member Functions

 ~BwdTrans_SumFac_Prism () 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) final
 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_nquad2
 
const int m_nmodes0
 
const int m_nmodes1
 
const int m_nmodes2
 
Array< OneD, const NekDoublem_base0
 
Array< OneD, const NekDoublem_base1
 
Array< OneD, const NekDoublem_base2
 
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_Prism (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 (Prism)

Definition at line 939 of file BwdTrans.cpp.

Constructor & Destructor Documentation

◆ ~BwdTrans_SumFac_Prism()

Nektar::Collections::BwdTrans_SumFac_Prism::~BwdTrans_SumFac_Prism ( )
finaldefault

◆ BwdTrans_SumFac_Prism()

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

Definition at line 1038 of file BwdTrans.cpp.

1041 : Operator(pCollExp, pGeomData, factors), BwdTrans_Helper(),
1042 m_nquad0(m_stdExp->GetNumPoints(0)),
1043 m_nquad1(m_stdExp->GetNumPoints(1)),
1044 m_nquad2(m_stdExp->GetNumPoints(2)),
1045 m_nmodes0(m_stdExp->GetBasisNumModes(0)),
1046 m_nmodes1(m_stdExp->GetBasisNumModes(1)),
1047 m_nmodes2(m_stdExp->GetBasisNumModes(2)),
1048 m_base0(m_stdExp->GetBasis(0)->GetBdata()),
1049 m_base1(m_stdExp->GetBasis(1)->GetBdata()),
1050 m_base2(m_stdExp->GetBasis(2)->GetBdata())
1051 {
1054
1055 if (m_stdExp->GetBasis(0)->GetBasisType() == LibUtilities::eModified_A)
1056 {
1057 m_sortTopVertex = true;
1058 }
1059 else
1060 {
1061 m_sortTopVertex = false;
1062 }
1063 }
Array< OneD, const NekDouble > m_base0
Definition: BwdTrans.cpp:1032
Array< OneD, const NekDouble > m_base1
Definition: BwdTrans.cpp:1033
Array< OneD, const NekDouble > m_base2
Definition: BwdTrans.cpp:1034
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_nmodes1, m_nquad1, m_nquad2, 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_Prism::operator() ( const Array< OneD, const NekDouble > &  input,
Array< OneD, NekDouble > &  output0,
Array< OneD, NekDouble > &  output1,
Array< OneD, NekDouble > &  output2,
Array< OneD, NekDouble > &  wsp 
)
inlinefinalvirtual

Perform operation.

Implements Nektar::Collections::Operator.

Definition at line 947 of file BwdTrans.cpp.

952 {
953 ASSERTL1(wsp.size() == m_wspSize, "Incorrect workspace size");
954
955 // Assign second half of workspace for 2nd DGEMM operation.
956 int totmodes = m_stdExp->GetNcoeffs();
957
958 Array<OneD, NekDouble> wsp2 =
960
962 int i = 0;
963 int j = 0;
964 int mode = 0;
965 int mode1 = 0;
966 int cnt = 0;
967 for (i = mode = mode1 = 0; i < m_nmodes0; ++i)
968 {
969 cnt = i * m_nquad2 * m_numElmt;
970 for (j = 0; j < m_nmodes1; ++j)
971 {
972 Blas::Dgemm('N', 'N', m_nquad2, m_numElmt, m_nmodes2 - i, 1.0,
973 m_base2.get() + mode * m_nquad2, m_nquad2,
974 input.get() + mode1, totmodes, 0.0,
975 &wsp[j * m_nquad2 * m_numElmt * m_nmodes0 + cnt],
976 m_nquad2);
977 mode1 += m_nmodes2 - i;
978 }
979 mode += m_nmodes2 - i;
980 }
981
982 // fix for modified basis by splitting top vertex mode
983 if (m_sortTopVertex)
984 {
985 for (j = 0; j < m_nmodes1; ++j)
986 {
987 for (i = 0; i < m_numElmt; ++i)
988 {
990 input[1 + i * totmodes + j * m_nmodes2],
991 m_base2.get() + m_nquad2, 1,
992 &wsp[j * m_nquad2 * m_numElmt * m_nmodes0 +
994 i * m_nquad2,
995 1);
996 }
997 }
998 // Believe this could be made into a m_nmodes1
999 // dgemv if we made an array of m_numElmt copies
1000 // of m_base2[m_quad2] (which are of size
1001 // m_nquad2.
1002 }
1003
1004 // Perform summation over '1' direction
1006 m_nmodes1, 1.0, m_base1.get(), m_nquad1, wsp.get(),
1007 m_nquad2 * m_numElmt * m_nmodes0, 0.0, wsp2.get(),
1008 m_nquad1);
1009
1010 // Perform summation over '0' direction
1012 m_nmodes0, 1.0, m_base0.get(), m_nquad0, wsp2.get(),
1013 m_nquad1 * m_nquad2 * m_numElmt, 0.0, output0.get(),
1014 m_nquad0);
1015 }
#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
void Zero(int n, T *x, const int incx)
Zero vector.
Definition: Vmath.hpp:273

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

◆ operator()() [2/2]

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

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

References ASSERTL0.

Member Data Documentation

◆ m_base0

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

Definition at line 1032 of file BwdTrans.cpp.

Referenced by operator()().

◆ m_base1

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

Definition at line 1033 of file BwdTrans.cpp.

Referenced by operator()().

◆ m_base2

Array<OneD, const NekDouble> Nektar::Collections::BwdTrans_SumFac_Prism::m_base2
protected

Definition at line 1034 of file BwdTrans.cpp.

Referenced by operator()().

◆ m_nmodes0

const int Nektar::Collections::BwdTrans_SumFac_Prism::m_nmodes0
protected

Definition at line 1029 of file BwdTrans.cpp.

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

◆ m_nmodes1

const int Nektar::Collections::BwdTrans_SumFac_Prism::m_nmodes1
protected

Definition at line 1030 of file BwdTrans.cpp.

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

◆ m_nmodes2

const int Nektar::Collections::BwdTrans_SumFac_Prism::m_nmodes2
protected

Definition at line 1031 of file BwdTrans.cpp.

Referenced by operator()().

◆ m_nquad0

const int Nektar::Collections::BwdTrans_SumFac_Prism::m_nquad0
protected

Definition at line 1026 of file BwdTrans.cpp.

Referenced by operator()().

◆ m_nquad1

const int Nektar::Collections::BwdTrans_SumFac_Prism::m_nquad1
protected

Definition at line 1027 of file BwdTrans.cpp.

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

◆ m_nquad2

const int Nektar::Collections::BwdTrans_SumFac_Prism::m_nquad2
protected

Definition at line 1028 of file BwdTrans.cpp.

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

◆ m_sortTopVertex

bool Nektar::Collections::BwdTrans_SumFac_Prism::m_sortTopVertex
protected

Definition at line 1035 of file BwdTrans.cpp.

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