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
 
void CheckFactors (StdRegions::FactorMap factors, int coll_phys_offset) override
 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 ~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 CheckFactors (StdRegions::FactorMap factors, int coll_phys_offset)=0
 Check the validity of the supplied factor map. 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 ()
 
unsigned int GetOutputSize ()
 

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...
 

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::Operator
virtual int v_GetInputSize ()
 This purely virtual function needs to be set-up for every operator inside Collections. It is responsible for returning the size of input collection, that the operator is applied on either in physical or coefficient space. More...
 
virtual int v_GetOutputSize ()
 This purely virtual function needs to be set-up for every operator inside Collections. It is responsible for returning the output size either in physical or coefficient space of an operator inside Collections. More...
 
- Protected Member Functions inherited from Nektar::Collections::BwdTrans_Helper
 BwdTrans_Helper ()
 

Detailed Description

Backward transform operator using sum-factorisation (Tet)

Definition at line 830 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 965 of file BwdTrans.cpp.

968 : Operator(pCollExp, pGeomData, factors), BwdTrans_Helper(),
969 m_nquad0(m_stdExp->GetNumPoints(0)),
970 m_nquad1(m_stdExp->GetNumPoints(1)),
971 m_nquad2(m_stdExp->GetNumPoints(2)),
972 m_nmodes0(m_stdExp->GetBasisNumModes(0)),
973 m_nmodes1(m_stdExp->GetBasisNumModes(1)),
974 m_nmodes2(m_stdExp->GetBasisNumModes(2)),
975 m_base0(m_stdExp->GetBasis(0)->GetBdata()),
976 m_base1(m_stdExp->GetBasis(1)->GetBdata()),
977 m_base2(m_stdExp->GetBasis(2)->GetBdata())
978 {
980 (2 * m_nmodes1 - m_nmodes0 + 1) / 2 +
982
983 if (m_stdExp->GetBasis(0)->GetBasisType() == LibUtilities::eModified_A)
984 {
985 m_sortTopEdge = true;
986 }
987 else
988 {
989 m_sortTopEdge = false;
990 }
991 }
Array< OneD, const NekDouble > m_base1
Definition: BwdTrans.cpp:960
Array< OneD, const NekDouble > m_base0
Definition: BwdTrans.cpp:959
Array< OneD, const NekDouble > m_base2
Definition: BwdTrans.cpp:961
StdRegions::StdExpansionSharedPtr m_stdExp
Definition: Operator.h:188
unsigned int m_numElmt
number of elements that the operator is applied on
Definition: Operator.h:190
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

◆ CheckFactors()

void Nektar::Collections::BwdTrans_SumFac_Tet::CheckFactors ( StdRegions::FactorMap  factors,
int  coll_phys_offset 
)
inlineoverridevirtual

Check the validity of the supplied factor map.

Implements Nektar::Collections::Operator.

Definition at line 946 of file BwdTrans.cpp.

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

References ASSERTL0.

◆ 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 838 of file BwdTrans.cpp.

843 {
844 ASSERTL1(wsp.size() == m_wspSize, "Incorrect workspace size");
845
846 Array<OneD, NekDouble> tmp = wsp;
847 Array<OneD, NekDouble> tmp1 =
848 tmp + m_numElmt * m_nquad2 * m_nmodes0 *
849 (2 * m_nmodes1 - m_nmodes0 + 1) / 2;
850
851 int mode = 0;
852 int mode1 = 0;
853 int cnt = 0;
854 int ncoeffs = m_stdExp->GetNcoeffs();
855
856 // Perform summation over '2' direction
857 for (int i = 0; i < m_nmodes0; ++i)
858 {
859 for (int j = 0; j < m_nmodes1 - i; ++j, ++cnt)
860 {
861 Blas::Dgemm('N', 'N', m_nquad2, m_numElmt, m_nmodes2 - i - j,
862 1.0, m_base2.get() + mode * m_nquad2, m_nquad2,
863 input.get() + mode1, ncoeffs, 0.0,
864 tmp.get() + cnt * m_nquad2 * m_numElmt, m_nquad2);
865 mode += m_nmodes2 - i - j;
866 mode1 += m_nmodes2 - i - j;
867 }
868
869 // increment mode in case m_nmodes1!=m_nmodes2
870 mode += (m_nmodes2 - m_nmodes1) * (m_nmodes2 - m_nmodes1 + 1) / 2;
871 }
872
873 // vertex mode - currently (1+c)/2 x (1-b)/2 x (1-a)/2
874 // component is evaluated
875 if (m_sortTopEdge)
876 {
877 for (int i = 0; i < m_numElmt; ++i)
878 {
879 // top singular vertex
880 // (1+c)/2 x (1+b)/2 x (1-a)/2 component
881 Blas::Daxpy(m_nquad2, input[1 + i * ncoeffs],
882 m_base2.get() + m_nquad2, 1,
883 &tmp[m_nquad2 * m_numElmt] + i * m_nquad2, 1);
884
885 // top singular vertex
886 // (1+c)/2 x (1-b)/2 x (1+a)/2 component
888 m_nquad2, input[1 + i * ncoeffs], m_base2.get() + m_nquad2,
889 1, &tmp[m_nmodes1 * m_nquad2 * m_numElmt] + i * m_nquad2,
890 1);
891 }
892 }
893
894 // Perform summation over '1' direction
895 mode = 0;
896 for (int i = 0; i < m_nmodes0; ++i)
897 {
899 1.0, m_base1.get() + mode * m_nquad1, m_nquad1,
900 tmp.get() + mode * m_nquad2 * m_numElmt,
901 m_nquad2 * m_numElmt, 0.0,
902 tmp1.get() + i * m_nquad1 * m_nquad2 * m_numElmt,
903 m_nquad1);
904 mode += m_nmodes1 - i;
905 }
906
907 // fix for modified basis by adding additional split of
908 // top and base singular vertex modes as well as singular
909 // edge
910 if (m_sortTopEdge)
911 {
912 // this could probably be a dgemv or higher if we
913 // made a specialised m_base1[m_nuqad1] array
914 // containing multiply copies
915 for (int i = 0; i < m_numElmt; ++i)
916 {
917 // sort out singular vertices and singular
918 // edge components with (1+b)/2 (1+a)/2 form
919 for (int j = 0; j < m_nquad2; ++j)
920 {
922 tmp[m_nquad2 * m_numElmt + i * m_nquad2 + j],
923 m_base1.get() + m_nquad1, 1,
924 &tmp1[m_nquad1 * m_nquad2 * m_numElmt] +
925 i * m_nquad1 * m_nquad2 + j * m_nquad1,
926 1);
927 }
928 }
929 }
930
931 // Perform summation over '0' direction
933 m_nmodes0, 1.0, m_base0.get(), m_nquad0, tmp1.get(),
934 m_nquad1 * m_nquad2 * m_numElmt, 0.0, output0.get(),
935 m_nquad0);
936 }
#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 938 of file BwdTrans.cpp.

942 {
943 ASSERTL0(false, "Not valid for this operator.");
944 }

References ASSERTL0.

Member Data Documentation

◆ m_base0

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

Definition at line 959 of file BwdTrans.cpp.

Referenced by operator()().

◆ m_base1

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

Definition at line 960 of file BwdTrans.cpp.

Referenced by operator()().

◆ m_base2

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

Definition at line 961 of file BwdTrans.cpp.

Referenced by operator()().

◆ m_nmodes0

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

Definition at line 956 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 957 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 958 of file BwdTrans.cpp.

Referenced by operator()().

◆ m_nquad0

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

Definition at line 953 of file BwdTrans.cpp.

Referenced by operator()().

◆ m_nquad1

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

Definition at line 954 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 955 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 962 of file BwdTrans.cpp.

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