Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Member Functions | Protected Attributes | Private Member Functions | List of all members
Nektar::Collections::PhysDeriv_SumFac_Quad Class Reference

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

Inheritance diagram for Nektar::Collections::PhysDeriv_SumFac_Quad:
Inheritance graph
[legend]
Collaboration diagram for Nektar::Collections::PhysDeriv_SumFac_Quad:
Collaboration graph
[legend]

Public Member Functions

virtual ~PhysDeriv_SumFac_Quad ()
 
virtual void operator() (const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output0, Array< OneD, NekDouble > &output1, Array< OneD, NekDouble > &output2, Array< OneD, NekDouble > &wsp)
 Perform operation. More...
 
virtual void operator() (int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp)
 
- Public Member Functions inherited from Nektar::Collections::Operator
 Operator (std::vector< StdRegions::StdExpansionSharedPtr > pCollExp, boost::shared_ptr< CoalescedGeomData > GeomData)
 Constructor. More...
 
virtual COLLECTIONS_EXPORT ~Operator ()
 
int GetWspSize ()
 Get the size of the required workspace. More...
 

Protected Attributes

int m_coordim
 
const int m_nquad0
 
const int m_nquad1
 
Array< TwoD, const NekDoublem_derivFac
 
NekDoublem_Deriv0
 
NekDoublem_Deriv1
 
- Protected Attributes inherited from Nektar::Collections::Operator
StdRegions::StdExpansionSharedPtr m_stdExp
 
unsigned int m_numElmt
 
unsigned int m_wspSize
 

Private Member Functions

 PhysDeriv_SumFac_Quad (vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData)
 

Detailed Description

Phys deriv operator using sum-factorisation (Quad)

Definition at line 607 of file PhysDeriv.cpp.

Constructor & Destructor Documentation

virtual Nektar::Collections::PhysDeriv_SumFac_Quad::~PhysDeriv_SumFac_Quad ( )
inlinevirtual

Definition at line 612 of file PhysDeriv.cpp.

613  {
614  }
Nektar::Collections::PhysDeriv_SumFac_Quad::PhysDeriv_SumFac_Quad ( vector< StdRegions::StdExpansionSharedPtr pCollExp,
CoalescedGeomDataSharedPtr  pGeomData 
)
inlineprivate

Definition at line 708 of file PhysDeriv.cpp.

711  : Operator (pCollExp, pGeomData),
712  m_nquad0 (m_stdExp->GetNumPoints(0)),
713  m_nquad1 (m_stdExp->GetNumPoints(1))
714  {
715  LibUtilities::PointsKeyVector PtsKey = m_stdExp->GetPointsKeys();
716  m_coordim = m_stdExp->GetCoordim();
717 
718  m_derivFac = pGeomData->GetDerivFactors(pCollExp);
719 
720  m_Deriv0 = &((m_stdExp->GetBasis(0)->GetD())->GetPtr())[0];
721  m_Deriv1 = &((m_stdExp->GetBasis(1)->GetD())->GetPtr())[0];
723  }
Operator(std::vector< StdRegions::StdExpansionSharedPtr > pCollExp, boost::shared_ptr< CoalescedGeomData > GeomData)
Constructor.
Definition: Operator.h:112
std::vector< PointsKey > PointsKeyVector
Definition: Points.h:242
Array< TwoD, const NekDouble > m_derivFac
Definition: PhysDeriv.cpp:703
StdRegions::StdExpansionSharedPtr m_stdExp
Definition: Operator.h:146

Member Function Documentation

virtual void Nektar::Collections::PhysDeriv_SumFac_Quad::operator() ( const Array< OneD, const NekDouble > &  input,
Array< OneD, NekDouble > &  output0,
Array< OneD, NekDouble > &  output1,
Array< OneD, NekDouble > &  output2,
Array< OneD, NekDouble > &  wsp 
)
inlinevirtual

Perform operation.

Implements Nektar::Collections::Operator.

Definition at line 616 of file PhysDeriv.cpp.

References ASSERTL1, Vmath::Vmul(), and Vmath::Vvtvp().

622  {
623  const int nqtot = m_nquad0 * m_nquad1;
624  const int nqcol = nqtot*m_numElmt;
625 
626  ASSERTL1(wsp.num_elements() == m_wspSize,
627  "Incorrect workspace size");
628  ASSERTL1(input.num_elements() >= nqcol,
629  "Incorrect input size");
630 
631  Array<OneD, NekDouble> diff0(nqcol, wsp );
632  Array<OneD, NekDouble> diff1(nqcol, wsp + nqcol);
633 
634  Blas::Dgemm('N', 'N', m_nquad0, m_nquad1*m_numElmt,
635  m_nquad0, 1.0, m_Deriv0, m_nquad0,
636  input.get(), m_nquad0, 0.0,
637  diff0.get(), m_nquad0);
638 
639  int cnt = 0;
640  for (int i = 0; i < m_numElmt; ++i, cnt += nqtot)
641  {
642  Blas::Dgemm('N', 'T', m_nquad0, m_nquad1, m_nquad1, 1.0,
643  input.get() + cnt, m_nquad0,
644  m_Deriv1, m_nquad1, 0.0,
645  diff1.get() + cnt, m_nquad0);
646  }
647 
648  Vmath::Vmul (nqcol, m_derivFac[0], 1, diff0, 1, output0, 1);
649  Vmath::Vvtvp (nqcol, m_derivFac[1], 1, diff1, 1, output0, 1,
650  output0, 1);
651  Vmath::Vmul (nqcol, m_derivFac[2], 1, diff0, 1, output1, 1);
652  Vmath::Vvtvp (nqcol, m_derivFac[3], 1, diff1, 1, output1, 1,
653  output1, 1);
654 
655  if (m_coordim == 3)
656  {
657  Vmath::Vmul (nqcol, m_derivFac[4], 1, diff0, 1, output2, 1);
658  Vmath::Vvtvp (nqcol, m_derivFac[5], 1, diff1, 1, output2, 1,
659  output2, 1);
660  }
661  }
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
Definition: Vmath.cpp:442
Array< TwoD, const NekDouble > m_derivFac
Definition: PhysDeriv.cpp:703
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:228
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:183
virtual void Nektar::Collections::PhysDeriv_SumFac_Quad::operator() ( int  dir,
const Array< OneD, const NekDouble > &  input,
Array< OneD, NekDouble > &  output,
Array< OneD, NekDouble > &  wsp 
)
inlinevirtual

Implements Nektar::Collections::Operator.

Definition at line 663 of file PhysDeriv.cpp.

References ASSERTL1, Vmath::Vmul(), and Vmath::Vvtvp().

668  {
669  const int nqtot = m_nquad0 * m_nquad1;
670  const int nqcol = nqtot*m_numElmt;
671 
672  ASSERTL1(wsp.num_elements() == m_wspSize,
673  "Incorrect workspace size");
674  ASSERTL1(input.num_elements() >= nqcol,
675  "Incorrect input size");
676 
677  Array<OneD, NekDouble> diff0(nqcol, wsp );
678  Array<OneD, NekDouble> diff1(nqcol, wsp + nqcol);
679 
680  Blas::Dgemm('N', 'N', m_nquad0, m_nquad1*m_numElmt,
681  m_nquad0, 1.0, m_Deriv0, m_nquad0,
682  input.get(), m_nquad0, 0.0,
683  diff0.get(), m_nquad0);
684 
685  int cnt = 0;
686  for (int i = 0; i < m_numElmt; ++i, cnt += nqtot)
687  {
688  Blas::Dgemm('N', 'T', m_nquad0, m_nquad1, m_nquad1, 1.0,
689  input.get() + cnt, m_nquad0,
690  m_Deriv1, m_nquad1, 0.0,
691  diff1.get() + cnt, m_nquad0);
692  }
693 
694  Vmath::Vmul (nqcol, m_derivFac[2*dir] , 1, diff0, 1, output, 1);
695  Vmath::Vvtvp (nqcol, m_derivFac[2*dir+1], 1, diff1, 1, output, 1,
696  output, 1);
697  }
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
Definition: Vmath.cpp:442
Array< TwoD, const NekDouble > m_derivFac
Definition: PhysDeriv.cpp:703
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:228
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:183

Member Data Documentation

int Nektar::Collections::PhysDeriv_SumFac_Quad::m_coordim
protected

Definition at line 700 of file PhysDeriv.cpp.

NekDouble* Nektar::Collections::PhysDeriv_SumFac_Quad::m_Deriv0
protected

Definition at line 704 of file PhysDeriv.cpp.

NekDouble* Nektar::Collections::PhysDeriv_SumFac_Quad::m_Deriv1
protected

Definition at line 705 of file PhysDeriv.cpp.

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

Definition at line 703 of file PhysDeriv.cpp.

const int Nektar::Collections::PhysDeriv_SumFac_Quad::m_nquad0
protected

Definition at line 701 of file PhysDeriv.cpp.

const int Nektar::Collections::PhysDeriv_SumFac_Quad::m_nquad1
protected

Definition at line 702 of file PhysDeriv.cpp.