Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Member Functions | Protected Attributes | Private Member Functions | List of all members
Nektar::Collections::BwdTrans_SumFac_Prism Class Reference

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

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

Public Member Functions

virtual ~BwdTrans_SumFac_Prism ()
 
virtual 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...
 
virtual void operator() (int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp)
 
- Public Member Functions inherited from Nektar::Collections::Operator
 Operator (std::vector< StdRegions::StdExpansionSharedPtr > pCollExp, boost::shared_ptr< CoalescedGeomData > GeomData)
 Constructor. More...
 
virtual COLLECTIONS_EXPORT ~Operator ()
 
int GetWspSize ()
 Get the size of the required workspace. 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
StdRegions::StdExpansionSharedPtr m_stdExp
 
unsigned int m_numElmt
 
unsigned int m_wspSize
 

Private Member Functions

 BwdTrans_SumFac_Prism (vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData)
 

Detailed Description

Backward transform operator using sum-factorisation (Prism)

Definition at line 883 of file BwdTrans.cpp.

Constructor & Destructor Documentation

virtual Nektar::Collections::BwdTrans_SumFac_Prism::~BwdTrans_SumFac_Prism ( )
inlinevirtual

Definition at line 888 of file BwdTrans.cpp.

889  {
890  }
Nektar::Collections::BwdTrans_SumFac_Prism::BwdTrans_SumFac_Prism ( vector< StdRegions::StdExpansionSharedPtr pCollExp,
CoalescedGeomDataSharedPtr  pGeomData 
)
inlineprivate

Definition at line 985 of file BwdTrans.cpp.

References Nektar::LibUtilities::eModified_A.

988  : Operator (pCollExp, pGeomData),
989  m_nquad0 (m_stdExp->GetNumPoints(0)),
990  m_nquad1 (m_stdExp->GetNumPoints(1)),
991  m_nquad2 (m_stdExp->GetNumPoints(2)),
992  m_nmodes0 (m_stdExp->GetBasisNumModes(0)),
993  m_nmodes1 (m_stdExp->GetBasisNumModes(1)),
994  m_nmodes2 (m_stdExp->GetBasisNumModes(2)),
995  m_base0 (m_stdExp->GetBasis(0)->GetBdata()),
996  m_base1 (m_stdExp->GetBasis(1)->GetBdata()),
997  m_base2 (m_stdExp->GetBasis(2)->GetBdata())
998  {
1000  + m_nquad1*m_nquad2);
1001 
1002  if(m_stdExp->GetBasis(0)->GetBasisType()
1004  {
1005  m_sortTopVertex = true;
1006  }
1007  else
1008  {
1009  m_sortTopVertex = false;
1010  }
1011 
1012  }
Operator(std::vector< StdRegions::StdExpansionSharedPtr > pCollExp, boost::shared_ptr< CoalescedGeomData > GeomData)
Constructor.
Definition: Operator.h:112
Array< OneD, const NekDouble > m_base1
Definition: BwdTrans.cpp:980
Array< OneD, const NekDouble > m_base0
Definition: BwdTrans.cpp:979
Principle Modified Functions .
Definition: BasisType.h:49
Array< OneD, const NekDouble > m_base2
Definition: BwdTrans.cpp:981
StdRegions::StdExpansionSharedPtr m_stdExp
Definition: Operator.h:146

Member Function Documentation

virtual 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 
)
inlinevirtual

Perform operation.

Implements Nektar::Collections::Operator.

Definition at line 892 of file BwdTrans.cpp.

References ASSERTL1, and Vmath::Zero().

898  {
899  ASSERTL1(wsp.num_elements() == m_wspSize,
900  "Incorrect workspace size");
901 
902  // Assign second half of workspace for 2nd DGEMM operation.
903  int totmodes = m_stdExp->GetNcoeffs();
904 
905  Array<OneD, NekDouble> wsp2
907 
908  Vmath::Zero(m_nmodes0*m_nmodes1*m_nquad2*m_numElmt, wsp, 1);
909  int i = 0;
910  int j = 0;
911  int mode = 0;
912  int mode1 = 0;
913  int cnt = 0;
914  for (i = mode = mode1 = 0; i < m_nmodes0; ++i)
915  {
916  cnt = i * m_nquad2 * m_numElmt;
917  for (j = 0; j < m_nmodes1; ++j)
918  {
919  Blas::Dgemm('N', 'N', m_nquad2, m_numElmt, m_nmodes2-i,
920  1.0, m_base2.get()+mode*m_nquad2, m_nquad2,
921  &input[0]+mode1, totmodes, 0.0,
922  &wsp[j*m_nquad2*m_numElmt*m_nmodes0+ cnt],
923  m_nquad2);
924  mode1 += m_nmodes2-i;
925  }
926  mode += m_nmodes2-i;
927  }
928 
929  // fix for modified basis by splitting top vertex mode
930  if(m_sortTopVertex)
931  {
932  for(j = 0; j < m_nmodes1; ++j)
933  {
934  for(i = 0; i < m_numElmt; ++i)
935  {
936  Blas::Daxpy(m_nquad2,input[1+i*totmodes+j*m_nmodes2],
937  m_base2.get()+m_nquad2,1,
938  &wsp[j*m_nquad2*m_numElmt*m_nmodes0 +
940  }
941  }
942  // Believe this could be made into a m_nmodes1
943  // dgemv if we made an array of m_numElmt copies
944  // of m_base2[m_quad2] (which are of size
945  // m_nquad2.
946  }
947 
948  // Perform summation over '1' direction
949  Blas::Dgemm('N', 'T', m_nquad1, m_nquad2*m_numElmt*m_nmodes0,
950  m_nmodes1,1.0, m_base1.get(), m_nquad1,
951  wsp.get(), m_nquad2*m_numElmt*m_nmodes0,
952  0.0, wsp2.get(), m_nquad1);
953 
954 
955  // Perform summation over '0' direction
956  Blas::Dgemm('N', 'T', m_nquad0, m_nquad1*m_nquad2*m_numElmt,
957  m_nmodes0, 1.0, m_base0.get(), m_nquad0,
958  wsp2.get(), m_nquad1*m_nquad2*m_numElmt,
959  0.0, output.get(), m_nquad0);
960  }
Array< OneD, const NekDouble > m_base1
Definition: BwdTrans.cpp:980
Array< OneD, const NekDouble > m_base0
Definition: BwdTrans.cpp:979
Array< OneD, const NekDouble > m_base2
Definition: BwdTrans.cpp:981
StdRegions::StdExpansionSharedPtr m_stdExp
Definition: Operator.h:146
void Zero(int n, T *x, const int incx)
Zero vector.
Definition: Vmath.cpp:373
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:228
virtual void Nektar::Collections::BwdTrans_SumFac_Prism::operator() ( int  dir,
const Array< OneD, const NekDouble > &  input,
Array< OneD, NekDouble > &  output,
Array< OneD, NekDouble > &  wsp 
)
inlinevirtual

Implements Nektar::Collections::Operator.

Definition at line 962 of file BwdTrans.cpp.

References ASSERTL0.

967  {
968  ASSERTL0(false, "Not valid for this operator.");
969  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:198

Member Data Documentation

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

Definition at line 979 of file BwdTrans.cpp.

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

Definition at line 980 of file BwdTrans.cpp.

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

Definition at line 981 of file BwdTrans.cpp.

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

Definition at line 976 of file BwdTrans.cpp.

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

Definition at line 977 of file BwdTrans.cpp.

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

Definition at line 978 of file BwdTrans.cpp.

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

Definition at line 973 of file BwdTrans.cpp.

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

Definition at line 974 of file BwdTrans.cpp.

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

Definition at line 975 of file BwdTrans.cpp.

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

Definition at line 982 of file BwdTrans.cpp.