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

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

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

Public Member Functions

 ~PhysDeriv_SumFac_Seg () final
 
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
 
virtual void CheckFactors (StdRegions::FactorMap factors, int coll_phys_offset)
 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 COLLECTIONS_EXPORT ~Operator ()
 
unsigned int GetWspSize ()
 Get the size of the required workspace. More...
 
unsigned int GetNumElmt ()
 Get expansion pointer. More...
 
StdRegions::StdExpansionSharedPtr GetExpSharedPtr ()
 Get expansion pointer. More...
 

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
 
unsigned int m_nqe
 
unsigned int m_wspSize
 

Private Member Functions

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

Detailed Description

Phys deriv operator using sum-factorisation (Segment)

Definition at line 779 of file PhysDeriv.cpp.

Constructor & Destructor Documentation

◆ ~PhysDeriv_SumFac_Seg()

Nektar::Collections::PhysDeriv_SumFac_Seg::~PhysDeriv_SumFac_Seg ( )
inlinefinal

Definition at line 784 of file PhysDeriv.cpp.

785  {
786  }

◆ PhysDeriv_SumFac_Seg()

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

Definition at line 902 of file PhysDeriv.cpp.

906  : Operator(pCollExp, pGeomData, factors),
907  m_nquad0 (m_stdExp->GetNumPoints(0))
908  {
909  LibUtilities::PointsKeyVector PtsKey = m_stdExp->GetPointsKeys();
910  m_coordim = pCollExp[0]->GetCoordim();
911 
912  m_derivFac = pGeomData->GetDerivFactors(pCollExp);
913 
914  m_Deriv0 = &((m_stdExp->GetBasis(0)->GetD())->GetPtr())[0];
916  }
StdRegions::StdExpansionSharedPtr m_stdExp
Definition: Operator.h:167
Operator(std::vector< StdRegions::StdExpansionSharedPtr > pCollExp, std::shared_ptr< CoalescedGeomData > GeomData, StdRegions::FactorMap factors)
Constructor.
Definition: Operator.cpp:41
Array< TwoD, const NekDouble > m_derivFac
Definition: PhysDeriv.cpp:898
std::vector< PointsKey > PointsKeyVector
Definition: Points.h:246

Member Function Documentation

◆ CheckFactors()

virtual void Nektar::Collections::PhysDeriv_SumFac_Seg::CheckFactors ( StdRegions::FactorMap  factors,
int  coll_phys_offset 
)
inlinevirtual

Check the validity of the supplied factor map.

Implements Nektar::Collections::Operator.

Definition at line 888 of file PhysDeriv.cpp.

890  {
891  boost::ignore_unused(factors, coll_phys_offset);
892  ASSERTL0(false, "Not valid for this operator.");
893  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216

References ASSERTL0.

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

794  {
795 
796  const int nqcol = m_nquad0*m_numElmt;
797 
798  ASSERTL1(wsp.size() == m_wspSize,
799  "Incorrect workspace size");
800  ASSERTL1(input.size() >= nqcol,
801  "Incorrect input size");
802 
803  Array<OneD, NekDouble> diff0(nqcol, wsp);
804 
805  Blas::Dgemm('N', 'N', m_nquad0, m_numElmt,
806  m_nquad0, 1.0, m_Deriv0, m_nquad0,
807  input.get(), m_nquad0, 0.0,
808  diff0.get(), m_nquad0);
809 
810  if(m_isDeformed)
811  {
812  Vmath::Vmul (nqcol, m_derivFac[0], 1, diff0, 1, output0, 1);
813 
814  if (m_coordim == 2)
815  {
816  Vmath::Vmul (nqcol, m_derivFac[1], 1, diff0, 1, output1, 1);
817  }
818  else if (m_coordim == 3)
819  {
820  Vmath::Vmul (nqcol, m_derivFac[1], 1, diff0, 1, output1, 1);
821  Vmath::Vmul (nqcol, m_derivFac[2], 1, diff0, 1, output2, 1);
822  }
823  }
824  else
825  {
826  Array<OneD, NekDouble> t;
827  for(int e = 0; e < m_numElmt; ++e)
828  {
829  Vmath::Smul (m_nqe, m_derivFac[0][e], diff0 + e*m_nqe, 1,
830  t = output0 + e*m_nqe, 1);
831  }
832 
833  if (m_coordim == 2)
834  {
835  for(int e = 0; e < m_numElmt; ++e)
836  {
837  Vmath::Smul (m_nqe, m_derivFac[1][e], diff0 + e*m_nqe, 1,
838  t = output1 + e*m_nqe, 1);
839  }
840  }
841  else if (m_coordim == 3)
842  {
843  for(int e = 0; e < m_numElmt; ++e)
844  {
845  Vmath::Smul (m_nqe, m_derivFac[1][e], diff0 + e*m_nqe, 1,
846  t = output1 + e*m_nqe, 1);
847  Vmath::Smul (m_nqe, m_derivFac[2][e], diff0 + e*m_nqe, 1,
848  t = output2 + e*m_nqe, 1);}
849  }
850 
851  }
852  }
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:250
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:394
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.cpp:192
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.cpp:225

References ASSERTL1, Blas::Dgemm(), 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 854 of file PhysDeriv.cpp.

858  {
859  const int nqcol = m_nquad0*m_numElmt;
860 
861  ASSERTL1(wsp.size() == m_wspSize,
862  "Incorrect workspace size");
863  ASSERTL1(input.size() >= nqcol,
864  "Incorrect input size");
865 
866  Array<OneD, NekDouble> diff0(nqcol, wsp);
867 
868  Blas::Dgemm('N', 'N', m_nquad0, m_numElmt,
869  m_nquad0, 1.0, m_Deriv0, m_nquad0,
870  input.get(), m_nquad0, 0.0,
871  diff0.get(), m_nquad0);
872 
873  if(m_isDeformed)
874  {
875  Vmath::Vmul(nqcol, m_derivFac[dir], 1, diff0, 1, output, 1);
876  }
877  else
878  {
879  Array<OneD, NekDouble> t;
880  for(int e = 0; e < m_numElmt; ++e)
881  {
882  Vmath::Smul (m_nqe, m_derivFac[0][e], diff0 + e*m_nqe, 1,
883  t = output + e*m_nqe, 1);
884  }
885  }
886  }

References ASSERTL1, Blas::Dgemm(), Vmath::Smul(), and Vmath::Vmul().

Member Data Documentation

◆ m_coordim

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

Definition at line 896 of file PhysDeriv.cpp.

◆ m_Deriv0

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

Definition at line 899 of file PhysDeriv.cpp.

◆ m_derivFac

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

Definition at line 898 of file PhysDeriv.cpp.

◆ m_nquad0

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

Definition at line 897 of file PhysDeriv.cpp.