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

Phys deriv operator using sum-factorisation (Segment) More...

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

Public Member Functions

 ~PhysDeriv_SumFac_Seg () 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

int m_coordim
 
const int m_nquad0
 
Array< TwoD, const NekDoublem_derivFac
 
NekDoublem_Deriv0
 
- 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

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

Additional Inherited Members

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

Detailed Description

Phys deriv operator using sum-factorisation (Segment)

Definition at line 696 of file PhysDeriv.cpp.

Constructor & Destructor Documentation

◆ ~PhysDeriv_SumFac_Seg()

Nektar::Collections::PhysDeriv_SumFac_Seg::~PhysDeriv_SumFac_Seg ( )
finaldefault

◆ PhysDeriv_SumFac_Seg()

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

Definition at line 802 of file PhysDeriv.cpp.

805 : Operator(pCollExp, pGeomData, factors), PhysDeriv_Helper(),
806 m_nquad0(m_stdExp->GetNumPoints(0))
807 {
808 m_coordim = pCollExp[0]->GetCoordim();
809
810 m_derivFac = pGeomData->GetDerivFactors(pCollExp);
811
812 m_Deriv0 = &((m_stdExp->GetBasis(0)->GetD())->GetPtr())[0];
814 }
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
Array< TwoD, const NekDouble > m_derivFac
Definition: PhysDeriv.cpp:798
StdRegions::ConstFactorMap factors

References m_coordim, m_Deriv0, m_derivFac, m_nquad0, Nektar::Collections::Operator::m_numElmt, Nektar::Collections::Operator::m_stdExp, and Nektar::Collections::Operator::m_wspSize.

Member Function Documentation

◆ operator()() [1/2]

void Nektar::Collections::PhysDeriv_SumFac_Seg::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 704 of file PhysDeriv.cpp.

709 {
710 const int nqcol = m_nquad0 * m_numElmt;
711
712 ASSERTL1(wsp.size() == m_wspSize, "Incorrect workspace size");
713 ASSERTL1(input.size() >= nqcol, "Incorrect input size");
714
715 Array<OneD, NekDouble> diff0(nqcol, wsp);
716
718 m_nquad0, input.get(), m_nquad0, 0.0, diff0.get(),
719 m_nquad0);
720
721 if (m_isDeformed)
722 {
723 Vmath::Vmul(nqcol, m_derivFac[0], 1, diff0, 1, output0, 1);
724
725 if (m_coordim == 2)
726 {
727 Vmath::Vmul(nqcol, m_derivFac[1], 1, diff0, 1, output1, 1);
728 }
729 else if (m_coordim == 3)
730 {
731 Vmath::Vmul(nqcol, m_derivFac[1], 1, diff0, 1, output1, 1);
732 Vmath::Vmul(nqcol, m_derivFac[2], 1, diff0, 1, output2, 1);
733 }
734 }
735 else
736 {
737 Array<OneD, NekDouble> t;
738 for (int e = 0; e < m_numElmt; ++e)
739 {
740 Vmath::Smul(m_nqe, m_derivFac[0][e], diff0 + e * m_nqe, 1,
741 t = output0 + e * m_nqe, 1);
742 }
743
744 if (m_coordim == 2)
745 {
746 for (int e = 0; e < m_numElmt; ++e)
747 {
748 Vmath::Smul(m_nqe, m_derivFac[1][e], diff0 + e * m_nqe, 1,
749 t = output1 + e * m_nqe, 1);
750 }
751 }
752 else if (m_coordim == 3)
753 {
754 for (int e = 0; e < m_numElmt; ++e)
755 {
756 Vmath::Smul(m_nqe, m_derivFac[1][e], diff0 + e * m_nqe, 1,
757 t = output1 + e * m_nqe, 1);
758 Vmath::Smul(m_nqe, m_derivFac[2][e], diff0 + e * m_nqe, 1,
759 t = output2 + e * m_nqe, 1);
760 }
761 }
762 }
763 }
#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
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
Definition: Vmath.hpp:72
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
Definition: Vmath.hpp:100

References ASSERTL1, Blas::Dgemm(), m_coordim, m_Deriv0, m_derivFac, Nektar::Collections::Operator::m_isDeformed, Nektar::Collections::Operator::m_nqe, m_nquad0, Nektar::Collections::Operator::m_numElmt, Nektar::Collections::Operator::m_wspSize, Vmath::Smul(), and Vmath::Vmul().

◆ operator()() [2/2]

void Nektar::Collections::PhysDeriv_SumFac_Seg::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 765 of file PhysDeriv.cpp.

768 {
769 const int nqcol = m_nquad0 * m_numElmt;
770
771 ASSERTL1(wsp.size() == m_wspSize, "Incorrect workspace size");
772 ASSERTL1(input.size() >= nqcol, "Incorrect input size");
773
774 Array<OneD, NekDouble> diff0(nqcol, wsp);
775
777 m_nquad0, input.get(), m_nquad0, 0.0, diff0.get(),
778 m_nquad0);
779
780 if (m_isDeformed)
781 {
782 Vmath::Vmul(nqcol, m_derivFac[dir], 1, diff0, 1, output, 1);
783 }
784 else
785 {
786 Array<OneD, NekDouble> t;
787 for (int e = 0; e < m_numElmt; ++e)
788 {
789 Vmath::Smul(m_nqe, m_derivFac[0][e], diff0 + e * m_nqe, 1,
790 t = output + e * m_nqe, 1);
791 }
792 }
793 }

References ASSERTL1, Blas::Dgemm(), m_Deriv0, m_derivFac, Nektar::Collections::Operator::m_isDeformed, Nektar::Collections::Operator::m_nqe, m_nquad0, Nektar::Collections::Operator::m_numElmt, Nektar::Collections::Operator::m_wspSize, Vmath::Smul(), and Vmath::Vmul().

Member Data Documentation

◆ m_coordim

int Nektar::Collections::PhysDeriv_SumFac_Seg::m_coordim
protected

Definition at line 796 of file PhysDeriv.cpp.

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

◆ m_Deriv0

NekDouble* Nektar::Collections::PhysDeriv_SumFac_Seg::m_Deriv0
protected

Definition at line 799 of file PhysDeriv.cpp.

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

◆ m_derivFac

Array<TwoD, const NekDouble> Nektar::Collections::PhysDeriv_SumFac_Seg::m_derivFac
protected

Definition at line 798 of file PhysDeriv.cpp.

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

◆ m_nquad0

const int Nektar::Collections::PhysDeriv_SumFac_Seg::m_nquad0
protected

Definition at line 797 of file PhysDeriv.cpp.

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