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

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

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

Public Member Functions

 ~BwdTrans_SumFac_Tet () final=default
 
void operator() (const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output0, 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
 
- 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 ~Operator ()=default
 
virtual COLLECTIONS_EXPORT void operator() (const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output0, Array< OneD, NekDouble > &output1, Array< OneD, NekDouble > &output2, Array< OneD, NekDouble > &wsp=NullNekDouble1DArray)=0
 Perform operation. More...
 
virtual COLLECTIONS_EXPORT void operator() (int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp=NullNekDouble1DArray)=0
 
virtual COLLECTIONS_EXPORT void UpdateFactors (StdRegions::FactorMap factors)
 Update the supplied factor map. More...
 
virtual COLLECTIONS_EXPORT void UpdateVarcoeffs (StdRegions::VarCoeffMap &varcoeffs)
 Update the supplied variable coefficients. More...
 
unsigned int GetWspSize ()
 Get the size of the required workspace. More...
 
unsigned int GetNumElmt ()
 Get number of elements. More...
 
StdRegions::StdExpansionSharedPtr GetExpSharedPtr ()
 Get expansion pointer. More...
 
unsigned int GetInputSize (bool defaultIn=true)
 
unsigned int GetOutputSize (bool defaultOut=true)
 

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
bool m_isDeformed
 
StdRegions::StdExpansionSharedPtr m_stdExp
 
unsigned int m_numElmt
 number of elements that the operator is applied on More...
 
unsigned int m_nqe
 
unsigned int m_wspSize
 
unsigned int m_inputSize
 number of modes or quadrature points that are passed as input to an operator More...
 
unsigned int m_outputSize
 number of modes or quadrature points that are taken as output from an operator More...
 
unsigned int m_inputSizeOther
 Number of modes or quadrature points, opposite to m_inputSize. More...
 
unsigned int m_outputSizeOther
 Number of modes or quadrature points, opposite to m_outputSize. More...
 

Private Member Functions

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

Additional Inherited Members

- Protected Member Functions inherited from Nektar::Collections::BwdTrans_Helper
 BwdTrans_Helper ()
 

Detailed Description

Backward transform operator using sum-factorisation (Tet)

Definition at line 772 of file BwdTrans.cpp.

Constructor & Destructor Documentation

◆ ~BwdTrans_SumFac_Tet()

Nektar::Collections::BwdTrans_SumFac_Tet::~BwdTrans_SumFac_Tet ( )
finaldefault

◆ BwdTrans_SumFac_Tet()

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

Definition at line 901 of file BwdTrans.cpp.

904 : Operator(pCollExp, pGeomData, factors), BwdTrans_Helper(),
905 m_nquad0(m_stdExp->GetNumPoints(0)),
906 m_nquad1(m_stdExp->GetNumPoints(1)),
907 m_nquad2(m_stdExp->GetNumPoints(2)),
908 m_nmodes0(m_stdExp->GetBasisNumModes(0)),
909 m_nmodes1(m_stdExp->GetBasisNumModes(1)),
910 m_nmodes2(m_stdExp->GetBasisNumModes(2)),
911 m_base0(m_stdExp->GetBasis(0)->GetBdata()),
912 m_base1(m_stdExp->GetBasis(1)->GetBdata()),
913 m_base2(m_stdExp->GetBasis(2)->GetBdata())
914 {
916 (2 * m_nmodes1 - m_nmodes0 + 1) / 2 +
918
919 if (m_stdExp->GetBasis(0)->GetBasisType() == LibUtilities::eModified_A)
920 {
921 m_sortTopEdge = true;
922 }
923 else
924 {
925 m_sortTopEdge = false;
926 }
927 }
Array< OneD, const NekDouble > m_base1
Definition: BwdTrans.cpp:896
Array< OneD, const NekDouble > m_base0
Definition: BwdTrans.cpp:895
Array< OneD, const NekDouble > m_base2
Definition: BwdTrans.cpp:897
StdRegions::StdExpansionSharedPtr m_stdExp
Definition: Operator.h:217
unsigned int m_numElmt
number of elements that the operator is applied on
Definition: Operator.h:219
Operator(std::vector< StdRegions::StdExpansionSharedPtr > pCollExp, std::shared_ptr< CoalescedGeomData > GeomData, StdRegions::FactorMap factors)
Constructor.
Definition: Operator.cpp:66
@ eModified_A
Principle Modified Functions .
Definition: BasisType.h:48
StdRegions::ConstFactorMap factors

References Nektar::LibUtilities::eModified_A, m_nmodes0, m_nmodes1, m_nquad1, m_nquad2, Nektar::Collections::Operator::m_numElmt, m_sortTopEdge, Nektar::Collections::Operator::m_stdExp, and Nektar::Collections::Operator::m_wspSize.

Member Function Documentation

◆ operator()() [1/2]

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

Perform operation.

Implements Nektar::Collections::Operator.

Definition at line 780 of file BwdTrans.cpp.

785 {
786 ASSERTL1(wsp.size() == m_wspSize, "Incorrect workspace size");
787
788 Array<OneD, NekDouble> tmp = wsp;
789 Array<OneD, NekDouble> tmp1 =
790 tmp + m_numElmt * m_nquad2 * m_nmodes0 *
791 (2 * m_nmodes1 - m_nmodes0 + 1) / 2;
792
793 int mode = 0;
794 int mode1 = 0;
795 int cnt = 0;
796 int ncoeffs = m_stdExp->GetNcoeffs();
797
798 // Perform summation over '2' direction
799 for (int i = 0; i < m_nmodes0; ++i)
800 {
801 for (int j = 0; j < m_nmodes1 - i; ++j, ++cnt)
802 {
803 Blas::Dgemm('N', 'N', m_nquad2, m_numElmt, m_nmodes2 - i - j,
804 1.0, m_base2.get() + mode * m_nquad2, m_nquad2,
805 input.get() + mode1, ncoeffs, 0.0,
806 tmp.get() + cnt * m_nquad2 * m_numElmt, m_nquad2);
807 mode += m_nmodes2 - i - j;
808 mode1 += m_nmodes2 - i - j;
809 }
810
811 // increment mode in case m_nmodes1!=m_nmodes2
812 mode += (m_nmodes2 - m_nmodes1) * (m_nmodes2 - m_nmodes1 + 1) / 2;
813 }
814
815 // vertex mode - currently (1+c)/2 x (1-b)/2 x (1-a)/2
816 // component is evaluated
817 if (m_sortTopEdge)
818 {
819 for (int i = 0; i < m_numElmt; ++i)
820 {
821 // top singular vertex
822 // (1+c)/2 x (1+b)/2 x (1-a)/2 component
823 Blas::Daxpy(m_nquad2, input[1 + i * ncoeffs],
824 m_base2.get() + m_nquad2, 1,
825 &tmp[m_nquad2 * m_numElmt] + i * m_nquad2, 1);
826
827 // top singular vertex
828 // (1+c)/2 x (1-b)/2 x (1+a)/2 component
830 m_nquad2, input[1 + i * ncoeffs], m_base2.get() + m_nquad2,
831 1, &tmp[m_nmodes1 * m_nquad2 * m_numElmt] + i * m_nquad2,
832 1);
833 }
834 }
835
836 // Perform summation over '1' direction
837 mode = 0;
838 for (int i = 0; i < m_nmodes0; ++i)
839 {
841 1.0, m_base1.get() + mode * m_nquad1, m_nquad1,
842 tmp.get() + mode * m_nquad2 * m_numElmt,
843 m_nquad2 * m_numElmt, 0.0,
844 tmp1.get() + i * m_nquad1 * m_nquad2 * m_numElmt,
845 m_nquad1);
846 mode += m_nmodes1 - i;
847 }
848
849 // fix for modified basis by adding additional split of
850 // top and base singular vertex modes as well as singular
851 // edge
852 if (m_sortTopEdge)
853 {
854 // this could probably be a dgemv or higher if we
855 // made a specialised m_base1[m_nuqad1] array
856 // containing multiply copies
857 for (int i = 0; i < m_numElmt; ++i)
858 {
859 // sort out singular vertices and singular
860 // edge components with (1+b)/2 (1+a)/2 form
861 for (int j = 0; j < m_nquad2; ++j)
862 {
864 tmp[m_nquad2 * m_numElmt + i * m_nquad2 + j],
865 m_base1.get() + m_nquad1, 1,
866 &tmp1[m_nquad1 * m_nquad2 * m_numElmt] +
867 i * m_nquad1 * m_nquad2 + j * m_nquad1,
868 1);
869 }
870 }
871 }
872
873 // Perform summation over '0' direction
875 m_nmodes0, 1.0, m_base0.get(), m_nquad0, tmp1.get(),
876 m_nquad1 * m_nquad2 * m_numElmt, 0.0, output0.get(),
877 m_nquad0);
878 }
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:242
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:383
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:135

References ASSERTL1, Blas::Daxpy(), Blas::Dgemm(), m_base0, m_base1, m_base2, m_nmodes0, m_nmodes1, m_nmodes2, m_nquad0, m_nquad1, m_nquad2, Nektar::Collections::Operator::m_numElmt, m_sortTopEdge, Nektar::Collections::Operator::m_stdExp, and Nektar::Collections::Operator::m_wspSize.

◆ operator()() [2/2]

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

884 {
885 ASSERTL0(false, "Not valid for this operator.");
886 }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:208

References ASSERTL0.

Member Data Documentation

◆ m_base0

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

Definition at line 895 of file BwdTrans.cpp.

Referenced by operator()().

◆ m_base1

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

Definition at line 896 of file BwdTrans.cpp.

Referenced by operator()().

◆ m_base2

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

Definition at line 897 of file BwdTrans.cpp.

Referenced by operator()().

◆ m_nmodes0

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

Definition at line 892 of file BwdTrans.cpp.

Referenced by BwdTrans_SumFac_Tet(), and operator()().

◆ m_nmodes1

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

Definition at line 893 of file BwdTrans.cpp.

Referenced by BwdTrans_SumFac_Tet(), and operator()().

◆ m_nmodes2

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

Definition at line 894 of file BwdTrans.cpp.

Referenced by operator()().

◆ m_nquad0

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

Definition at line 889 of file BwdTrans.cpp.

Referenced by operator()().

◆ m_nquad1

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

Definition at line 890 of file BwdTrans.cpp.

Referenced by BwdTrans_SumFac_Tet(), and operator()().

◆ m_nquad2

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

Definition at line 891 of file BwdTrans.cpp.

Referenced by BwdTrans_SumFac_Tet(), and operator()().

◆ m_sortTopEdge

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

Definition at line 898 of file BwdTrans.cpp.

Referenced by BwdTrans_SumFac_Tet(), and operator()().