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
 
void operator() (const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &output1, Array< OneD, NekDouble > &output2, Array< OneD, NekDouble > &wsp) override final
 Perform operation. More...
 
void operator() (int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) override final
 
virtual void CheckFactors (StdRegions::FactorMap factors, int coll_phys_offset) override
 Check the validity of the supplied factor map. More...
 
- 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 COLLECTIONS_EXPORT ~Operator ()
 
unsigned int GetWspSize ()
 Get the size of the required workspace. More...
 
unsigned int GetNumElmt ()
 Get expansion pointer. More...
 
StdRegions::StdExpansionSharedPtr GetExpSharedPtr ()
 Get expansion pointer. More...
 

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
 
unsigned int m_nqe
 
unsigned int m_wspSize
 

Private Member Functions

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

Detailed Description

Backward transform operator using sum-factorisation (Pyr)

Definition at line 1168 of file BwdTrans.cpp.

Constructor & Destructor Documentation

◆ ~BwdTrans_SumFac_Pyr()

Nektar::Collections::BwdTrans_SumFac_Pyr::~BwdTrans_SumFac_Pyr ( )
inlinefinal

Definition at line 1173 of file BwdTrans.cpp.

1174  {
1175  }

◆ BwdTrans_SumFac_Pyr()

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

Definition at line 1297 of file BwdTrans.cpp.

1300  : Operator(pCollExp, pGeomData, factors),
1301  m_nquad0(m_stdExp->GetNumPoints(0)),
1302  m_nquad1(m_stdExp->GetNumPoints(1)),
1303  m_nquad2(m_stdExp->GetNumPoints(2)),
1304  m_nmodes0(m_stdExp->GetBasisNumModes(0)),
1305  m_nmodes1(m_stdExp->GetBasisNumModes(1)),
1306  m_nmodes2(m_stdExp->GetBasisNumModes(2)),
1307  m_base0(m_stdExp->GetBasis(0)->GetBdata()),
1308  m_base1(m_stdExp->GetBasis(1)->GetBdata()),
1309  m_base2(m_stdExp->GetBasis(2)->GetBdata())
1310  {
1312 
1313  if (m_stdExp->GetBasis(0)->GetBasisType() == LibUtilities::eModified_A)
1314  {
1315  m_sortTopVertex = true;
1316  }
1317  else
1318  {
1319  m_sortTopVertex = false;
1320  }
1321  }
Array< OneD, const NekDouble > m_base2
Definition: BwdTrans.cpp:1293
Array< OneD, const NekDouble > m_base1
Definition: BwdTrans.cpp:1292
Array< OneD, const NekDouble > m_base0
Definition: BwdTrans.cpp:1291
StdRegions::StdExpansionSharedPtr m_stdExp
Definition: Operator.h:165
Operator(std::vector< StdRegions::StdExpansionSharedPtr > pCollExp, std::shared_ptr< CoalescedGeomData > GeomData, StdRegions::FactorMap factors)
Constructor.
Definition: Operator.cpp:43
@ eModified_A
Principle Modified Functions .
Definition: BasisType.h:50

References Nektar::LibUtilities::eModified_A.

Member Function Documentation

◆ CheckFactors()

virtual void Nektar::Collections::BwdTrans_SumFac_Pyr::CheckFactors ( StdRegions::FactorMap  factors,
int  coll_phys_offset 
)
inlineoverridevirtual

Check the validity of the supplied factor map.

Implements Nektar::Collections::Operator.

Definition at line 1277 of file BwdTrans.cpp.

1279  {
1280  boost::ignore_unused(factors, coll_phys_offset);
1281  ASSERTL0(false, "Not valid for this operator.");
1282  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:215

References ASSERTL0.

◆ 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 
)
inlinefinaloverridevirtual

Perform operation.

Implements Nektar::Collections::Operator.

Definition at line 1177 of file BwdTrans.cpp.

1182  {
1183  boost::ignore_unused(output1, output2);
1184 
1185  ASSERTL1(wsp.size() == m_wspSize, "Incorrect workspace size");
1186 
1187  // Assign second half of workspace for 2nd DGEMM operation.
1188  int totmodes = m_stdExp->GetNcoeffs();
1189 
1190  Array<OneD, NekDouble> wsp2 =
1191  wsp + m_nmodes0 * m_nmodes1 * m_nquad2 * m_numElmt;
1192 
1194  int i = 0;
1195  int j = 0;
1196  int mode = 0;
1197  int mode1 = 0;
1198  int cnt = 0;
1199  for (i = 0; i < m_nmodes0; ++i)
1200  {
1201  for (j = 0; j < m_nmodes1; ++j, ++cnt)
1202  {
1203  int ijmax = max(i, j);
1204  Blas::Dgemm('N', 'N', m_nquad2, m_numElmt, m_nmodes2 - ijmax,
1205  1.0, m_base2.get() + mode * m_nquad2, m_nquad2,
1206  input.get() + mode1, totmodes, 0.0,
1207  wsp.get() + cnt * m_nquad2 * m_numElmt, m_nquad2);
1208  mode += m_nmodes2 - ijmax;
1209  mode1 += m_nmodes2 - ijmax;
1210  }
1211 
1212  // increment mode in case order1!=order2
1213  for (j = m_nmodes1; j < m_nmodes2 - i; ++j)
1214  {
1215  int ijmax = max(i, j);
1216  mode += m_nmodes2 - ijmax;
1217  }
1218  }
1219 
1220  // vertex mode - currently (1+c)/2 x (1-b)/2 x (1-a)/2
1221  // component is evaluated
1222  if (m_sortTopVertex)
1223  {
1224  for (i = 0; i < m_numElmt; ++i)
1225  {
1226  // top singular vertex
1227  // (1+c)/2 x (1+b)/2 x (1-a)/2 component
1228  Blas::Daxpy(m_nquad2, input[1 + i * totmodes],
1229  m_base2.get() + m_nquad2, 1,
1230  &wsp[m_nquad2 * m_numElmt] + i * m_nquad2, 1);
1231 
1232  // top singular vertex
1233  // (1+c)/2 x (1-b)/2 x (1+a)/2 component
1234  Blas::Daxpy(
1235  m_nquad2, input[1 + i * totmodes], m_base2.get() + m_nquad2,
1236  1, &wsp[m_nmodes1 * m_nquad2 * m_numElmt] + i * m_nquad2,
1237  1);
1238 
1239  // top singular vertex
1240  // (1+c)/2 x (1+b)/2 x (1+a)/2 component
1241  Blas::Daxpy(m_nquad2, input[1 + i * totmodes],
1242  m_base2.get() + m_nquad2, 1,
1243  &wsp[(m_nmodes1 + 1) * m_nquad2 * m_numElmt] +
1244  i * m_nquad2,
1245  1);
1246  }
1247  }
1248 
1249  // Perform summation over '1' direction
1250  mode = 0;
1251  for (i = 0; i < m_nmodes0; ++i)
1252  {
1254  1.0, m_base1.get(), m_nquad1,
1255  wsp.get() + mode * m_nquad2 * m_numElmt,
1256  m_nquad2 * m_numElmt, 0.0,
1257  wsp2.get() + i * m_nquad1 * m_nquad2 * m_numElmt,
1258  m_nquad1);
1259  mode += m_nmodes1;
1260  }
1261 
1262  // Perform summation over '0' direction
1264  m_nmodes0, 1.0, m_base0.get(), m_nquad0, wsp2.get(),
1265  m_nquad1 * m_nquad2 * m_numElmt, 0.0, output.get(),
1266  m_nquad0);
1267  }
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:249
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:368
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:154
void Zero(int n, T *x, const int incx)
Zero vector.
Definition: Vmath.cpp:492

References ASSERTL1, Blas::Daxpy(), Blas::Dgemm(), 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 
)
inlinefinaloverridevirtual

Implements Nektar::Collections::Operator.

Definition at line 1269 of file BwdTrans.cpp.

1272  {
1273  boost::ignore_unused(dir, input, output, wsp);
1274  ASSERTL0(false, "Not valid for this operator.");
1275  }

References ASSERTL0.

Member Data Documentation

◆ m_base0

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

Definition at line 1291 of file BwdTrans.cpp.

◆ m_base1

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

Definition at line 1292 of file BwdTrans.cpp.

◆ m_base2

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

Definition at line 1293 of file BwdTrans.cpp.

◆ m_nmodes0

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

Definition at line 1288 of file BwdTrans.cpp.

◆ m_nmodes1

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

Definition at line 1289 of file BwdTrans.cpp.

◆ m_nmodes2

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

Definition at line 1290 of file BwdTrans.cpp.

◆ m_nquad0

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

Definition at line 1285 of file BwdTrans.cpp.

◆ m_nquad1

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

Definition at line 1286 of file BwdTrans.cpp.

◆ m_nquad2

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

Definition at line 1287 of file BwdTrans.cpp.

◆ m_sortTopVertex

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

Definition at line 1294 of file BwdTrans.cpp.