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_Tet Class Reference

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

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

Public Member Functions

virtual ~BwdTrans_SumFac_Tet ()
 
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_sortTopEdge
 
- Protected Attributes inherited from Nektar::Collections::Operator
StdRegions::StdExpansionSharedPtr m_stdExp
 
unsigned int m_numElmt
 
unsigned int m_wspSize
 

Private Member Functions

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

Detailed Description

Backward transform operator using sum-factorisation (Tet)

Definition at line 709 of file BwdTrans.cpp.

Constructor & Destructor Documentation

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

Definition at line 714 of file BwdTrans.cpp.

715  {
716  }
Nektar::Collections::BwdTrans_SumFac_Tet::BwdTrans_SumFac_Tet ( vector< StdRegions::StdExpansionSharedPtr pCollExp,
CoalescedGeomDataSharedPtr  pGeomData 
)
inlineprivate

Definition at line 843 of file BwdTrans.cpp.

References Nektar::LibUtilities::eModified_A.

846  : Operator (pCollExp, pGeomData),
847  m_nquad0 (m_stdExp->GetNumPoints(0)),
848  m_nquad1 (m_stdExp->GetNumPoints(1)),
849  m_nquad2 (m_stdExp->GetNumPoints(2)),
850  m_nmodes0 (m_stdExp->GetBasisNumModes(0)),
851  m_nmodes1 (m_stdExp->GetBasisNumModes(1)),
852  m_nmodes2 (m_stdExp->GetBasisNumModes(2)),
853  m_base0 (m_stdExp->GetBasis(0)->GetBdata()),
854  m_base1 (m_stdExp->GetBasis(1)->GetBdata()),
855  m_base2 (m_stdExp->GetBasis(2)->GetBdata())
856  {
860 
861  if(m_stdExp->GetBasis(0)->GetBasisType()
863  {
864  m_sortTopEdge = true;
865  }
866  else
867  {
868  m_sortTopEdge = false;
869  }
870  }
Operator(std::vector< StdRegions::StdExpansionSharedPtr > pCollExp, boost::shared_ptr< CoalescedGeomData > GeomData)
Constructor.
Definition: Operator.h:112
Principle Modified Functions .
Definition: BasisType.h:49
StdRegions::StdExpansionSharedPtr m_stdExp
Definition: Operator.h:146
Array< OneD, const NekDouble > m_base0
Definition: BwdTrans.cpp:837
Array< OneD, const NekDouble > m_base2
Definition: BwdTrans.cpp:839
Array< OneD, const NekDouble > m_base1
Definition: BwdTrans.cpp:838

Member Function Documentation

virtual void Nektar::Collections::BwdTrans_SumFac_Tet::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 718 of file BwdTrans.cpp.

References ASSERTL1.

724  {
725  ASSERTL1(wsp.num_elements() == m_wspSize,
726  "Incorrect workspace size");
727 
728  Array<OneD, NekDouble > tmp = wsp;
729  Array<OneD, NekDouble > tmp1 = tmp
731 
732  int i = 0;
733  int j = 0;
734  int mode = 0;
735  int mode1 = 0;
736  int cnt = 0;
737  int ncoeffs = m_stdExp->GetNcoeffs();
738 
739  // Perform summation over '2' direction
740  for(i = 0; i < m_nmodes0; ++i)
741  {
742  for(j = 0; j < m_nmodes1-i; ++j, ++cnt)
743  {
744  Blas::Dgemm('N', 'N', m_nquad2, m_numElmt, m_nmodes2-i-j,
745  1.0, m_base2.get()+mode*m_nquad2, m_nquad2,
746  input.get()+ mode1, ncoeffs, 0.0,
747  tmp.get() + cnt*m_nquad2*m_numElmt, m_nquad2);
748  mode += m_nmodes2-i-j;
749  mode1 += m_nmodes2-i-j;
750  }
751 
752  //increment mode in case m_nmodes1!=m_nmodes2
753  mode += (m_nmodes2-m_nmodes1)*(m_nmodes2-m_nmodes1+1)/2;
754  }
755 
756  // vertex mode - currently (1+c)/2 x (1-b)/2 x (1-a)/2
757  // component is evaluated
758  if(m_sortTopEdge)
759  {
760  for(i = 0; i < m_numElmt; ++i)
761  {
762  // top singular vertex
763  // (1+c)/2 x (1+b)/2 x (1-a)/2 component
764  Blas::Daxpy(m_nquad2, input[1+i*ncoeffs],
765  m_base2.get() + m_nquad2, 1,
766  &tmp[m_nquad2*m_numElmt] + i*m_nquad2, 1);
767 
768  // top singular vertex
769  // (1+c)/2 x (1-b)/2 x (1+a)/2 component
770  Blas::Daxpy(m_nquad2, input[1+i*ncoeffs],
771  m_base2.get() + m_nquad2, 1,
772  &tmp[m_nmodes1*m_nquad2*m_numElmt]
773  + i*m_nquad2, 1);
774  }
775  }
776 
777  // Perform summation over '1' direction
778  mode = 0;
779  for(i = 0; i < m_nmodes0; ++i)
780  {
781  Blas::Dgemm('N', 'T', m_nquad1, m_nquad2*m_numElmt, m_nmodes1-i,
782  1.0, m_base1.get()+mode*m_nquad1, m_nquad1,
783  tmp.get() + mode*m_nquad2*m_numElmt,
784  m_nquad2*m_numElmt,
785  0.0, tmp1.get() + i*m_nquad1*m_nquad2*m_numElmt,
786  m_nquad1);
787  mode += m_nmodes1-i;
788  }
789 
790  // fix for modified basis by adding additional split of
791  // top and base singular vertex modes as well as singular
792  // edge
793  if(m_sortTopEdge)
794  {
795  // this could probably be a dgemv or higher if we
796  // made a specialised m_base1[m_nuqad1] array
797  // containing multiply copies
798  for(i = 0; i < m_numElmt; ++i)
799  {
800  // sort out singular vertices and singular
801  // edge components with (1+b)/2 (1+a)/2 form
802  for(int j = 0; j < m_nquad2; ++j)
803  {
804  Blas::Daxpy(m_nquad1,
805  tmp[m_nquad2*m_numElmt + i*m_nquad2 + j],
806  m_base1.get() + m_nquad1,1,
807  &tmp1[m_nquad1*m_nquad2*m_numElmt]
808  + i*m_nquad1*m_nquad2 + j*m_nquad1, 1);
809  }
810  }
811  }
812 
813  // Perform summation over '0' direction
814  Blas::Dgemm('N', 'T', m_nquad0, m_nquad1*m_nquad2*m_numElmt,
815  m_nmodes0, 1.0, m_base0.get(), m_nquad0,
816  tmp1.get(), m_nquad1*m_nquad2*m_numElmt, 0.0,
817  output.get(), m_nquad0);
818 
819  }
StdRegions::StdExpansionSharedPtr m_stdExp
Definition: Operator.h:146
Array< OneD, const NekDouble > m_base0
Definition: BwdTrans.cpp:837
Array< OneD, const NekDouble > m_base2
Definition: BwdTrans.cpp:839
Array< OneD, const NekDouble > m_base1
Definition: BwdTrans.cpp:838
#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_Tet::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 821 of file BwdTrans.cpp.

References ASSERTL0.

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

Member Data Documentation

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

Definition at line 837 of file BwdTrans.cpp.

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

Definition at line 838 of file BwdTrans.cpp.

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

Definition at line 839 of file BwdTrans.cpp.

const int Nektar::Collections::BwdTrans_SumFac_Tet::m_nmodes0
protected

Definition at line 834 of file BwdTrans.cpp.

const int Nektar::Collections::BwdTrans_SumFac_Tet::m_nmodes1
protected

Definition at line 835 of file BwdTrans.cpp.

const int Nektar::Collections::BwdTrans_SumFac_Tet::m_nmodes2
protected

Definition at line 836 of file BwdTrans.cpp.

const int Nektar::Collections::BwdTrans_SumFac_Tet::m_nquad0
protected

Definition at line 831 of file BwdTrans.cpp.

const int Nektar::Collections::BwdTrans_SumFac_Tet::m_nquad1
protected

Definition at line 832 of file BwdTrans.cpp.

const int Nektar::Collections::BwdTrans_SumFac_Tet::m_nquad2
protected

Definition at line 833 of file BwdTrans.cpp.

bool Nektar::Collections::BwdTrans_SumFac_Tet::m_sortTopEdge
protected

Definition at line 840 of file BwdTrans.cpp.