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

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

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

Public Member Functions

 ~BwdTrans_SumFac_Pyr () 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_Pyr (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 (Pyr)

Definition at line 1075 of file BwdTrans.cpp.

Constructor & Destructor Documentation

◆ ~BwdTrans_SumFac_Pyr()

Nektar::Collections::BwdTrans_SumFac_Pyr::~BwdTrans_SumFac_Pyr ( )
finaldefault

◆ BwdTrans_SumFac_Pyr()

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

Definition at line 1194 of file BwdTrans.cpp.

1197 : Operator(pCollExp, pGeomData, factors), BwdTrans_Helper(),
1198 m_nquad0(m_stdExp->GetNumPoints(0)),
1199 m_nquad1(m_stdExp->GetNumPoints(1)),
1200 m_nquad2(m_stdExp->GetNumPoints(2)),
1201 m_nmodes0(m_stdExp->GetBasisNumModes(0)),
1202 m_nmodes1(m_stdExp->GetBasisNumModes(1)),
1203 m_nmodes2(m_stdExp->GetBasisNumModes(2)),
1204 m_base0(m_stdExp->GetBasis(0)->GetBdata()),
1205 m_base1(m_stdExp->GetBasis(1)->GetBdata()),
1206 m_base2(m_stdExp->GetBasis(2)->GetBdata())
1207 {
1209
1210 if (m_stdExp->GetBasis(0)->GetBasisType() == LibUtilities::eModified_A)
1211 {
1212 m_sortTopVertex = true;
1213 }
1214 else
1215 {
1216 m_sortTopVertex = false;
1217 }
1218 }
Array< OneD, const NekDouble > m_base2
Definition: BwdTrans.cpp:1190
Array< OneD, const NekDouble > m_base1
Definition: BwdTrans.cpp:1189
Array< OneD, const NekDouble > m_base0
Definition: BwdTrans.cpp:1188
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_Pyr::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 1083 of file BwdTrans.cpp.

1088 {
1089 ASSERTL1(wsp.size() == m_wspSize, "Incorrect workspace size");
1090
1091 // Assign second half of workspace for 2nd DGEMM operation.
1092 int totmodes = m_stdExp->GetNcoeffs();
1093
1094 Array<OneD, NekDouble> wsp2 =
1096
1098 int i = 0;
1099 int j = 0;
1100 int mode = 0;
1101 int mode1 = 0;
1102 int cnt = 0;
1103 for (i = 0; i < m_nmodes0; ++i)
1104 {
1105 for (j = 0; j < m_nmodes1; ++j, ++cnt)
1106 {
1107 int ijmax = max(i, j);
1108 Blas::Dgemm('N', 'N', m_nquad2, m_numElmt, m_nmodes2 - ijmax,
1109 1.0, m_base2.get() + mode * m_nquad2, m_nquad2,
1110 input.get() + mode1, totmodes, 0.0,
1111 wsp.get() + cnt * m_nquad2 * m_numElmt, m_nquad2);
1112 mode += m_nmodes2 - ijmax;
1113 mode1 += m_nmodes2 - ijmax;
1114 }
1115
1116 // increment mode in case order1!=order2
1117 for (j = m_nmodes1; j < m_nmodes2 - i; ++j)
1118 {
1119 int ijmax = max(i, j);
1120 mode += m_nmodes2 - ijmax;
1121 }
1122 }
1123
1124 // vertex mode - currently (1+c)/2 x (1-b)/2 x (1-a)/2
1125 // component is evaluated
1126 if (m_sortTopVertex)
1127 {
1128 for (i = 0; i < m_numElmt; ++i)
1129 {
1130 // top singular vertex
1131 // (1+c)/2 x (1+b)/2 x (1-a)/2 component
1132 Blas::Daxpy(m_nquad2, input[1 + i * totmodes],
1133 m_base2.get() + m_nquad2, 1,
1134 &wsp[m_nquad2 * m_numElmt] + i * m_nquad2, 1);
1135
1136 // top singular vertex
1137 // (1+c)/2 x (1-b)/2 x (1+a)/2 component
1139 m_nquad2, input[1 + i * totmodes], m_base2.get() + m_nquad2,
1140 1, &wsp[m_nmodes1 * m_nquad2 * m_numElmt] + i * m_nquad2,
1141 1);
1142
1143 // top singular vertex
1144 // (1+c)/2 x (1+b)/2 x (1+a)/2 component
1145 Blas::Daxpy(m_nquad2, input[1 + i * totmodes],
1146 m_base2.get() + m_nquad2, 1,
1147 &wsp[(m_nmodes1 + 1) * m_nquad2 * m_numElmt] +
1148 i * m_nquad2,
1149 1);
1150 }
1151 }
1152
1153 // Perform summation over '1' direction
1154 mode = 0;
1155 for (i = 0; i < m_nmodes0; ++i)
1156 {
1158 1.0, m_base1.get(), m_nquad1,
1159 wsp.get() + mode * m_nquad2 * m_numElmt,
1160 m_nquad2 * m_numElmt, 0.0,
1161 wsp2.get() + i * m_nquad1 * m_nquad2 * m_numElmt,
1162 m_nquad1);
1163 mode += m_nmodes1;
1164 }
1165
1166 // Perform summation over '0' direction
1168 m_nmodes0, 1.0, m_base0.get(), m_nquad0, wsp2.get(),
1169 m_nquad1 * m_nquad2 * m_numElmt, 0.0, output0.get(),
1170 m_nquad0);
1171 }
#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_Pyr::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 1173 of file BwdTrans.cpp.

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

References ASSERTL0.

Member Data Documentation

◆ m_base0

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

Definition at line 1188 of file BwdTrans.cpp.

Referenced by operator()().

◆ m_base1

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

Definition at line 1189 of file BwdTrans.cpp.

Referenced by operator()().

◆ m_base2

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

Definition at line 1190 of file BwdTrans.cpp.

Referenced by operator()().

◆ m_nmodes0

const int Nektar::Collections::BwdTrans_SumFac_Pyr::m_nmodes0
protected

Definition at line 1185 of file BwdTrans.cpp.

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

◆ m_nmodes1

const int Nektar::Collections::BwdTrans_SumFac_Pyr::m_nmodes1
protected

Definition at line 1186 of file BwdTrans.cpp.

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

◆ m_nmodes2

const int Nektar::Collections::BwdTrans_SumFac_Pyr::m_nmodes2
protected

Definition at line 1187 of file BwdTrans.cpp.

Referenced by operator()().

◆ m_nquad0

const int Nektar::Collections::BwdTrans_SumFac_Pyr::m_nquad0
protected

Definition at line 1182 of file BwdTrans.cpp.

Referenced by operator()().

◆ m_nquad1

const int Nektar::Collections::BwdTrans_SumFac_Pyr::m_nquad1
protected

Definition at line 1183 of file BwdTrans.cpp.

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

◆ m_nquad2

const int Nektar::Collections::BwdTrans_SumFac_Pyr::m_nquad2
protected

Definition at line 1184 of file BwdTrans.cpp.

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

◆ m_sortTopVertex

bool Nektar::Collections::BwdTrans_SumFac_Pyr::m_sortTopVertex
protected

Definition at line 1191 of file BwdTrans.cpp.

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