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::BwdTrans_SumFac_Quad Class Reference

Backward transform operator using sum-factorisation (Quad) More...

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

Public Member Functions

virtual ~BwdTrans_SumFac_Quad ()
 
virtual void operator() (const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, 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

const int m_nquad0
 
const int m_nquad1
 
const int m_nmodes0
 
const int m_nmodes1
 
const bool m_colldir0
 
const bool m_colldir1
 
Array< OneD, const NekDoublem_base0
 
Array< OneD, const NekDoublem_base1
 
- Protected Attributes inherited from Nektar::Collections::Operator
StdRegions::StdExpansionSharedPtr m_stdExp
 
unsigned int m_numElmt
 
unsigned int m_wspSize
 

Private Member Functions

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

Detailed Description

Backward transform operator using sum-factorisation (Quad)

Definition at line 381 of file BwdTrans.cpp.

Constructor & Destructor Documentation

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

Definition at line 386 of file BwdTrans.cpp.

387  {
388  }
Nektar::Collections::BwdTrans_SumFac_Quad::BwdTrans_SumFac_Quad ( vector< StdRegions::StdExpansionSharedPtr pCollExp,
CoalescedGeomDataSharedPtr  pGeomData 
)
inlineprivate

Definition at line 465 of file BwdTrans.cpp.

468  : Operator (pCollExp, pGeomData),
469  m_nquad0 (m_stdExp->GetNumPoints(0)),
470  m_nquad1 (m_stdExp->GetNumPoints(1)),
471  m_nmodes0 (m_stdExp->GetBasisNumModes(0)),
472  m_nmodes1 (m_stdExp->GetBasisNumModes(1)),
473  m_colldir0(m_stdExp->GetBasis(0)->Collocation()),
474  m_colldir1(m_stdExp->GetBasis(1)->Collocation()),
475  m_base0 (m_stdExp->GetBasis(0)->GetBdata()),
476  m_base1 (m_stdExp->GetBasis(1)->GetBdata())
477  {
479  }
Operator(std::vector< StdRegions::StdExpansionSharedPtr > pCollExp, boost::shared_ptr< CoalescedGeomData > GeomData)
Constructor.
Definition: Operator.h:112
Array< OneD, const NekDouble > m_base1
Definition: BwdTrans.cpp:462
StdRegions::StdExpansionSharedPtr m_stdExp
Definition: Operator.h:146
Array< OneD, const NekDouble > m_base0
Definition: BwdTrans.cpp:461

Member Function Documentation

virtual void Nektar::Collections::BwdTrans_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 390 of file BwdTrans.cpp.

References ASSERTL1, and Vmath::Vcopy().

396  {
397  int i = 0;
398  if(m_colldir0 && m_colldir1)
399  {
401  input.get(), 1, output.get(), 1);
402  }
403  else if(m_colldir0)
404  {
405  Array<OneD, const NekDouble> base1
406  = m_stdExp->GetBasis(1)->GetBdata();
407 
408  for(i = 0; i < m_numElmt; ++i)
409  {
410  Blas::Dgemm('N', 'T', m_nquad0, m_nquad1, m_nmodes1,
411  1.0, &input[i*m_nquad0*m_nmodes1], m_nquad0,
412  base1.get(), m_nquad1, 0.0,
413  &output[i*m_nquad0*m_nquad1], m_nquad0);
414  }
415  }
416  else if(m_colldir1)
417  {
418  Blas::Dgemm('N', 'N', m_nquad0, m_nmodes1*m_numElmt, m_nmodes0,
419  1.0, m_base0.get(), m_nquad0,
420  &input[0], m_nmodes0, 0.0,
421  &output[0], m_nquad0);
422  }
423  else
424  {
425  ASSERTL1(wsp.num_elements() == m_wspSize,
426  "Incorrect workspace size");
427 
428  // Those two calls correpsond to the operation
429  // out = B0*in*Transpose(B1);
430  Blas::Dgemm('N', 'N', m_nquad0, m_nmodes1*m_numElmt, m_nmodes0,
431  1.0, m_base0.get(), m_nquad0,
432  &input[0], m_nmodes0, 0.0,
433  &wsp[0], m_nquad0);
434 
435  for(i = 0; i < m_numElmt; ++i)
436  {
437  Blas::Dgemm('N','T', m_nquad0, m_nquad1, m_nmodes1,
438  1.0, &wsp[i*m_nquad0*m_nmodes1], m_nquad0,
439  m_base1.get(), m_nquad1, 0.0,
440  &output[i*m_nquad0*m_nquad1], m_nquad0);
441  }
442  }
443  }
Array< OneD, const NekDouble > m_base1
Definition: BwdTrans.cpp:462
StdRegions::StdExpansionSharedPtr m_stdExp
Definition: Operator.h:146
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:228
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1061
Array< OneD, const NekDouble > m_base0
Definition: BwdTrans.cpp:461
virtual void Nektar::Collections::BwdTrans_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 445 of file BwdTrans.cpp.

References ASSERTL0.

450  {
451  ASSERTL0(false, "Not valid for this operator.");
452  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:198

Member Data Documentation

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

Definition at line 461 of file BwdTrans.cpp.

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

Definition at line 462 of file BwdTrans.cpp.

const bool Nektar::Collections::BwdTrans_SumFac_Quad::m_colldir0
protected

Definition at line 459 of file BwdTrans.cpp.

const bool Nektar::Collections::BwdTrans_SumFac_Quad::m_colldir1
protected

Definition at line 460 of file BwdTrans.cpp.

const int Nektar::Collections::BwdTrans_SumFac_Quad::m_nmodes0
protected

Definition at line 457 of file BwdTrans.cpp.

const int Nektar::Collections::BwdTrans_SumFac_Quad::m_nmodes1
protected

Definition at line 458 of file BwdTrans.cpp.

const int Nektar::Collections::BwdTrans_SumFac_Quad::m_nquad0
protected

Definition at line 455 of file BwdTrans.cpp.

const int Nektar::Collections::BwdTrans_SumFac_Quad::m_nquad1
protected

Definition at line 456 of file BwdTrans.cpp.