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

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

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

Public Member Functions

 ~BwdTrans_SumFac_Hex () 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)
 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
 
const bool m_colldir0
 
const bool m_colldir1
 
const bool m_colldir2
 
- 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_Hex (vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
 

Detailed Description

Backward transform operator using sum-factorisation (Hex)

Definition at line 736 of file BwdTrans.cpp.

Constructor & Destructor Documentation

◆ ~BwdTrans_SumFac_Hex()

Nektar::Collections::BwdTrans_SumFac_Hex::~BwdTrans_SumFac_Hex ( )
inlinefinal

Definition at line 741 of file BwdTrans.cpp.

742  {
743  }

◆ BwdTrans_SumFac_Hex()

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

Definition at line 822 of file BwdTrans.cpp.

825  : Operator(pCollExp, pGeomData, factors), m_nquad0(pCollExp[0]->GetNumPoints(0)),
826  m_nquad1(pCollExp[0]->GetNumPoints(1)),
827  m_nquad2(pCollExp[0]->GetNumPoints(2)),
828  m_nmodes0(pCollExp[0]->GetBasisNumModes(0)),
829  m_nmodes1(pCollExp[0]->GetBasisNumModes(1)),
830  m_nmodes2(pCollExp[0]->GetBasisNumModes(2)),
831  m_base0(pCollExp[0]->GetBasis(0)->GetBdata()),
832  m_base1(pCollExp[0]->GetBasis(1)->GetBdata()),
833  m_base2(pCollExp[0]->GetBasis(2)->GetBdata()),
834  m_colldir0(pCollExp[0]->GetBasis(0)->Collocation()),
835  m_colldir1(pCollExp[0]->GetBasis(1)->Collocation()),
836  m_colldir2(pCollExp[0]->GetBasis(2)->Collocation())
837  {
840  }
Array< OneD, const NekDouble > m_base1
Definition: BwdTrans.cpp:815
Array< OneD, const NekDouble > m_base2
Definition: BwdTrans.cpp:816
Array< OneD, const NekDouble > m_base0
Definition: BwdTrans.cpp:814
Operator(std::vector< StdRegions::StdExpansionSharedPtr > pCollExp, std::shared_ptr< CoalescedGeomData > GeomData, StdRegions::FactorMap factors)
Constructor.
Definition: Operator.cpp:41

Member Function Documentation

◆ CheckFactors()

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

Check the validity of the supplied factor map.

Implements Nektar::Collections::Operator.

Definition at line 800 of file BwdTrans.cpp.

802  {
803  boost::ignore_unused(factors, coll_phys_offset);
804  ASSERTL0(false, "Not valid for this operator.");
805  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216

References ASSERTL0.

◆ operator()() [1/2]

void Nektar::Collections::BwdTrans_SumFac_Hex::operator() ( const Array< OneD, const NekDouble > &  input,
Array< OneD, NekDouble > &  output0,
Array< OneD, NekDouble > &  output1,
Array< OneD, NekDouble > &  output2,
Array< OneD, NekDouble > &  wsp 
)
inlinevirtual

Perform operation.

Implements Nektar::Collections::Operator.

Definition at line 745 of file BwdTrans.cpp.

750  {
751  boost::ignore_unused(output1, output2);
752 
753  if (m_colldir0 && m_colldir1 && m_colldir2)
754  {
756  input.get(), 1,
757  output.get(), 1);
758  }
759  else
760  {
761  ASSERTL1(wsp.size() == m_wspSize, "Incorrect workspace size");
762 
763  // Assign second half of workspace for 2nd DGEMM operation.
764  int totmodes = m_nmodes0 * m_nmodes1 * m_nmodes2;
765 
766  Array<OneD, NekDouble> wsp2 =
768 
769  // loop over elements and do bwd trans wrt c
770  for (int n = 0; n < m_numElmt; ++n)
771  {
773  m_nmodes2, 1.0, m_base2.get(), m_nquad2,
774  &input[n * totmodes], m_nmodes0 * m_nmodes1, 0.0,
775  &wsp[n * m_nquad2], m_nquad2 * m_numElmt);
776  }
777 
778  // trans wrt b
780  m_nmodes1, 1.0, m_base1.get(), m_nquad1, wsp.get(),
781  m_nquad2 * m_numElmt * m_nmodes0, 0.0, wsp2.get(),
782  m_nquad1);
783 
784  // trans wrt a
786  m_nmodes0, 1.0, m_base0.get(), m_nquad0, wsp2.get(),
787  m_nquad1 * m_nquad2 * m_numElmt, 0.0, output.get(),
788  m_nquad0);
789  }
790  }
#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
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1199

References ASSERTL1, Blas::Dgemm(), and Vmath::Vcopy().

◆ operator()() [2/2]

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

795  {
796  boost::ignore_unused(dir, input, output, wsp);
797  ASSERTL0(false, "Not valid for this operator.");
798  }

References ASSERTL0.

Member Data Documentation

◆ m_base0

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

Definition at line 814 of file BwdTrans.cpp.

◆ m_base1

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

Definition at line 815 of file BwdTrans.cpp.

◆ m_base2

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

Definition at line 816 of file BwdTrans.cpp.

◆ m_colldir0

const bool Nektar::Collections::BwdTrans_SumFac_Hex::m_colldir0
protected

Definition at line 817 of file BwdTrans.cpp.

◆ m_colldir1

const bool Nektar::Collections::BwdTrans_SumFac_Hex::m_colldir1
protected

Definition at line 818 of file BwdTrans.cpp.

◆ m_colldir2

const bool Nektar::Collections::BwdTrans_SumFac_Hex::m_colldir2
protected

Definition at line 819 of file BwdTrans.cpp.

◆ m_nmodes0

const int Nektar::Collections::BwdTrans_SumFac_Hex::m_nmodes0
protected

Definition at line 811 of file BwdTrans.cpp.

◆ m_nmodes1

const int Nektar::Collections::BwdTrans_SumFac_Hex::m_nmodes1
protected

Definition at line 812 of file BwdTrans.cpp.

◆ m_nmodes2

const int Nektar::Collections::BwdTrans_SumFac_Hex::m_nmodes2
protected

Definition at line 813 of file BwdTrans.cpp.

◆ m_nquad0

const int Nektar::Collections::BwdTrans_SumFac_Hex::m_nquad0
protected

Definition at line 808 of file BwdTrans.cpp.

◆ m_nquad1

const int Nektar::Collections::BwdTrans_SumFac_Hex::m_nquad1
protected

Definition at line 809 of file BwdTrans.cpp.

◆ m_nquad2

const int Nektar::Collections::BwdTrans_SumFac_Hex::m_nquad2
protected

Definition at line 810 of file BwdTrans.cpp.