Nektar++
Loading...
Searching...
No Matches
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.
 
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< LocalRegions::ExpansionSharedPtr > pCollExp, std::shared_ptr< CoalescedGeomData > GeomData, StdRegions::FactorMap factors)
 Constructor.
 
virtual ~Operator ()=default
 
virtual COLLECTIONS_EXPORT void UpdateFactors (StdRegions::FactorMap factors)
 Update the supplied factor map.
 
virtual COLLECTIONS_EXPORT void UpdateVarcoeffs (StdRegions::VarCoeffMap &varcoeffs)
 Update the supplied variable coefficients.
 
unsigned int GetWspSize ()
 Get the size of the required workspace.
 
unsigned int GetNumElmt ()
 Get number of elements.
 
StdRegions::StdExpansionSharedPtr GetExpSharedPtr ()
 Get expansion pointer.
 
unsigned int GetInputSize (void)
 
unsigned int GetOutputSize (void)
 
unsigned int GetPhysSize (void)
 
unsigned int GetCoeffSize (void)
 

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
 
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
 
unsigned int m_outputSize
 number of modes or quadrature points that are taken as output from an operator
 

Private Member Functions

 PhysDeriv_SumFac_Seg (vector< LocalRegions::ExpansionSharedPtr > 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 698 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< LocalRegions::ExpansionSharedPtr pCollExp,
CoalescedGeomDataSharedPtr  pGeomData,
StdRegions::FactorMap  factors 
)
inlineprivate

Definition at line 804 of file PhysDeriv.cpp.

807 : Operator(pCollExp, pGeomData, factors), PhysDeriv_Helper(),
808 m_nquad0(m_stdExp->GetNumPoints(0))
809 {
810 m_coordim = pCollExp[0]->GetCoordim();
811
812 m_derivFac = pGeomData->GetDerivFactors(pCollExp);
813
814 m_Deriv0 = &((m_stdExp->GetBasis(0)->GetD())->GetPtr())[0];
816 }
StdRegions::StdExpansionSharedPtr m_stdExp
Definition Operator.h:230
unsigned int m_numElmt
number of elements that the operator is applied on
Definition Operator.h:232
Operator(std::vector< LocalRegions::ExpansionSharedPtr > pCollExp, std::shared_ptr< CoalescedGeomData > GeomData, StdRegions::FactorMap factors)
Constructor.
Definition Operator.cpp:66
Array< TwoD, const NekDouble > m_derivFac

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 706 of file PhysDeriv.cpp.

711 {
712 const int nqcol = m_nquad0 * m_numElmt;
713
714 ASSERTL1(wsp.size() == m_wspSize, "Incorrect workspace size");
715 ASSERTL1(input.size() >= nqcol, "Incorrect input size");
716
717 Array<OneD, NekDouble> diff0(nqcol, wsp);
718
720 m_nquad0, input.data(), m_nquad0, 0.0, diff0.data(),
721 m_nquad0);
722
723 if (m_isDeformed)
724 {
725 Vmath::Vmul(nqcol, m_derivFac[0], 1, diff0, 1, output0, 1);
726
727 if (m_coordim == 2)
728 {
729 Vmath::Vmul(nqcol, m_derivFac[1], 1, diff0, 1, output1, 1);
730 }
731 else if (m_coordim == 3)
732 {
733 Vmath::Vmul(nqcol, m_derivFac[1], 1, diff0, 1, output1, 1);
734 Vmath::Vmul(nqcol, m_derivFac[2], 1, diff0, 1, output2, 1);
735 }
736 }
737 else
738 {
739 Array<OneD, NekDouble> t;
740 for (int e = 0; e < m_numElmt; ++e)
741 {
742 Vmath::Smul(m_nqe, m_derivFac[0][e], diff0 + e * m_nqe, 1,
743 t = output0 + e * m_nqe, 1);
744 }
745
746 if (m_coordim == 2)
747 {
748 for (int e = 0; e < m_numElmt; ++e)
749 {
750 Vmath::Smul(m_nqe, m_derivFac[1][e], diff0 + e * m_nqe, 1,
751 t = output1 + e * m_nqe, 1);
752 }
753 }
754 else if (m_coordim == 3)
755 {
756 for (int e = 0; e < m_numElmt; ++e)
757 {
758 Vmath::Smul(m_nqe, m_derivFac[1][e], diff0 + e * m_nqe, 1,
759 t = output1 + e * m_nqe, 1);
760 Vmath::Smul(m_nqe, m_derivFac[2][e], diff0 + e * m_nqe, 1,
761 t = output2 + e * m_nqe, 1);
762 }
763 }
764 }
765 }
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
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:324
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 767 of file PhysDeriv.cpp.

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

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 798 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 801 of file PhysDeriv.cpp.

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

◆ m_derivFac

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

Definition at line 800 of file PhysDeriv.cpp.

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

◆ m_nquad0

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

Definition at line 799 of file PhysDeriv.cpp.

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