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

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) final
 Perform operation. More...
 
void operator() (int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
 
virtual void CheckFactors (StdRegions::FactorMap factors, int coll_phys_offset)
 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 1175 of file BwdTrans.cpp.

Constructor & Destructor Documentation

◆ ~BwdTrans_SumFac_Pyr()

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

Definition at line 1180 of file BwdTrans.cpp.

1181  {
1182  }

◆ BwdTrans_SumFac_Pyr()

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

Definition at line 1305 of file BwdTrans.cpp.

1308  : Operator(pCollExp, pGeomData, factors), m_nquad0(m_stdExp->GetNumPoints(0)),
1309  m_nquad1(m_stdExp->GetNumPoints(1)),
1310  m_nquad2(m_stdExp->GetNumPoints(2)),
1311  m_nmodes0(m_stdExp->GetBasisNumModes(0)),
1312  m_nmodes1(m_stdExp->GetBasisNumModes(1)),
1313  m_nmodes2(m_stdExp->GetBasisNumModes(2)),
1314  m_base0(m_stdExp->GetBasis(0)->GetBdata()),
1315  m_base1(m_stdExp->GetBasis(1)->GetBdata()),
1316  m_base2(m_stdExp->GetBasis(2)->GetBdata())
1317  {
1319 
1320  if (m_stdExp->GetBasis(0)->GetBasisType() == LibUtilities::eModified_A)
1321  {
1322  m_sortTopVertex = true;
1323  }
1324  else
1325  {
1326  m_sortTopVertex = false;
1327  }
1328  }
Array< OneD, const NekDouble > m_base2
Definition: BwdTrans.cpp:1301
Array< OneD, const NekDouble > m_base1
Definition: BwdTrans.cpp:1300
Array< OneD, const NekDouble > m_base0
Definition: BwdTrans.cpp:1299
StdRegions::StdExpansionSharedPtr m_stdExp
Definition: Operator.h:167
Operator(std::vector< StdRegions::StdExpansionSharedPtr > pCollExp, std::shared_ptr< CoalescedGeomData > GeomData, StdRegions::FactorMap factors)
Constructor.
Definition: Operator.cpp:41
@ eModified_A
Principle Modified Functions .
Definition: BasisType.h:48

References Nektar::LibUtilities::eModified_A.

Member Function Documentation

◆ CheckFactors()

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

Check the validity of the supplied factor map.

Implements Nektar::Collections::Operator.

Definition at line 1284 of file BwdTrans.cpp.

1286  {
1287  boost::ignore_unused(factors, coll_phys_offset);
1288  ASSERTL0(false, "Not valid for this operator.");
1289  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216

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 
)
inlinefinalvirtual

Perform operation.

Implements Nektar::Collections::Operator.

Definition at line 1184 of file BwdTrans.cpp.

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

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 
)
inlinefinalvirtual

Implements Nektar::Collections::Operator.

Definition at line 1276 of file BwdTrans.cpp.

1279  {
1280  boost::ignore_unused(dir, input, output, wsp);
1281  ASSERTL0(false, "Not valid for this operator.");
1282  }

References ASSERTL0.

Member Data Documentation

◆ m_base0

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

Definition at line 1299 of file BwdTrans.cpp.

◆ m_base1

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

Definition at line 1300 of file BwdTrans.cpp.

◆ m_base2

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

Definition at line 1301 of file BwdTrans.cpp.

◆ m_nmodes0

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

Definition at line 1296 of file BwdTrans.cpp.

◆ m_nmodes1

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

Definition at line 1297 of file BwdTrans.cpp.

◆ m_nmodes2

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

Definition at line 1298 of file BwdTrans.cpp.

◆ m_nquad0

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

Definition at line 1293 of file BwdTrans.cpp.

◆ m_nquad1

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

Definition at line 1294 of file BwdTrans.cpp.

◆ m_nquad2

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

Definition at line 1295 of file BwdTrans.cpp.

◆ m_sortTopVertex

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

Definition at line 1302 of file BwdTrans.cpp.