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

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

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

Public Member Functions

 ~BwdTrans_SumFac_Tet () final
 
void operator() (const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &output1, Array< OneD, NekDouble > &output2, Array< OneD, NekDouble > &wsp) override final
 Perform operation. More...
 
void operator() (int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) override final
 
virtual void CheckFactors (StdRegions::FactorMap factors, int coll_phys_offset) override
 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

const int m_nquad0
 
const int m_nquad1
 
const int m_nquad2
 
const int m_nmodes0
 
const int m_nmodes1
 
const int m_nmodes2
 
Array< OneD, const NekDoublem_base0
 
Array< OneD, const NekDoublem_base1
 
Array< OneD, const NekDoublem_base2
 
bool m_sortTopEdge
 
- 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

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

Detailed Description

Backward transform operator using sum-factorisation (Tet)

Definition at line 845 of file BwdTrans.cpp.

Constructor & Destructor Documentation

◆ ~BwdTrans_SumFac_Tet()

Nektar::Collections::BwdTrans_SumFac_Tet::~BwdTrans_SumFac_Tet ( )
inlinefinal

Definition at line 850 of file BwdTrans.cpp.

851  {
852  }

◆ BwdTrans_SumFac_Tet()

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

Definition at line 984 of file BwdTrans.cpp.

987  : Operator(pCollExp, pGeomData, factors),
988  m_nquad0(m_stdExp->GetNumPoints(0)),
989  m_nquad1(m_stdExp->GetNumPoints(1)),
990  m_nquad2(m_stdExp->GetNumPoints(2)),
991  m_nmodes0(m_stdExp->GetBasisNumModes(0)),
992  m_nmodes1(m_stdExp->GetBasisNumModes(1)),
993  m_nmodes2(m_stdExp->GetBasisNumModes(2)),
994  m_base0(m_stdExp->GetBasis(0)->GetBdata()),
995  m_base1(m_stdExp->GetBasis(1)->GetBdata()),
996  m_base2(m_stdExp->GetBasis(2)->GetBdata())
997  {
999  (2 * m_nmodes1 - m_nmodes0 + 1) / 2 +
1001 
1002  if (m_stdExp->GetBasis(0)->GetBasisType() == LibUtilities::eModified_A)
1003  {
1004  m_sortTopEdge = true;
1005  }
1006  else
1007  {
1008  m_sortTopEdge = false;
1009  }
1010  }
Array< OneD, const NekDouble > m_base1
Definition: BwdTrans.cpp:979
Array< OneD, const NekDouble > m_base0
Definition: BwdTrans.cpp:978
Array< OneD, const NekDouble > m_base2
Definition: BwdTrans.cpp:980
StdRegions::StdExpansionSharedPtr m_stdExp
Definition: Operator.h:165
Operator(std::vector< StdRegions::StdExpansionSharedPtr > pCollExp, std::shared_ptr< CoalescedGeomData > GeomData, StdRegions::FactorMap factors)
Constructor.
Definition: Operator.cpp:43
@ eModified_A
Principle Modified Functions .
Definition: BasisType.h:50

References Nektar::LibUtilities::eModified_A.

Member Function Documentation

◆ CheckFactors()

virtual void Nektar::Collections::BwdTrans_SumFac_Tet::CheckFactors ( StdRegions::FactorMap  factors,
int  coll_phys_offset 
)
inlineoverridevirtual

Check the validity of the supplied factor map.

Implements Nektar::Collections::Operator.

Definition at line 964 of file BwdTrans.cpp.

966  {
967  boost::ignore_unused(factors, coll_phys_offset);
968  ASSERTL0(false, "Not valid for this operator.");
969  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:215

References ASSERTL0.

◆ operator()() [1/2]

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

Perform operation.

Implements Nektar::Collections::Operator.

Definition at line 854 of file BwdTrans.cpp.

859  {
860  boost::ignore_unused(output1, output2);
861 
862  ASSERTL1(wsp.size() == m_wspSize, "Incorrect workspace size");
863 
864  Array<OneD, NekDouble> tmp = wsp;
865  Array<OneD, NekDouble> tmp1 =
866  tmp + m_numElmt * m_nquad2 * m_nmodes0 *
867  (2 * m_nmodes1 - m_nmodes0 + 1) / 2;
868 
869  int mode = 0;
870  int mode1 = 0;
871  int cnt = 0;
872  int ncoeffs = m_stdExp->GetNcoeffs();
873 
874  // Perform summation over '2' direction
875  for (int i = 0; i < m_nmodes0; ++i)
876  {
877  for (int j = 0; j < m_nmodes1 - i; ++j, ++cnt)
878  {
879  Blas::Dgemm('N', 'N', m_nquad2, m_numElmt, m_nmodes2 - i - j,
880  1.0, m_base2.get() + mode * m_nquad2, m_nquad2,
881  input.get() + mode1, ncoeffs, 0.0,
882  tmp.get() + cnt * m_nquad2 * m_numElmt, m_nquad2);
883  mode += m_nmodes2 - i - j;
884  mode1 += m_nmodes2 - i - j;
885  }
886 
887  // increment mode in case m_nmodes1!=m_nmodes2
888  mode += (m_nmodes2 - m_nmodes1) * (m_nmodes2 - m_nmodes1 + 1) / 2;
889  }
890 
891  // vertex mode - currently (1+c)/2 x (1-b)/2 x (1-a)/2
892  // component is evaluated
893  if (m_sortTopEdge)
894  {
895  for (int i = 0; i < m_numElmt; ++i)
896  {
897  // top singular vertex
898  // (1+c)/2 x (1+b)/2 x (1-a)/2 component
899  Blas::Daxpy(m_nquad2, input[1 + i * ncoeffs],
900  m_base2.get() + m_nquad2, 1,
901  &tmp[m_nquad2 * m_numElmt] + i * m_nquad2, 1);
902 
903  // top singular vertex
904  // (1+c)/2 x (1-b)/2 x (1+a)/2 component
905  Blas::Daxpy(
906  m_nquad2, input[1 + i * ncoeffs], m_base2.get() + m_nquad2,
907  1, &tmp[m_nmodes1 * m_nquad2 * m_numElmt] + i * m_nquad2,
908  1);
909  }
910  }
911 
912  // Perform summation over '1' direction
913  mode = 0;
914  for (int i = 0; i < m_nmodes0; ++i)
915  {
916  Blas::Dgemm('N', 'T', m_nquad1, m_nquad2 * m_numElmt, m_nmodes1 - i,
917  1.0, m_base1.get() + mode * m_nquad1, m_nquad1,
918  tmp.get() + mode * m_nquad2 * m_numElmt,
919  m_nquad2 * m_numElmt, 0.0,
920  tmp1.get() + i * m_nquad1 * m_nquad2 * m_numElmt,
921  m_nquad1);
922  mode += m_nmodes1 - i;
923  }
924 
925  // fix for modified basis by adding additional split of
926  // top and base singular vertex modes as well as singular
927  // edge
928  if (m_sortTopEdge)
929  {
930  // this could probably be a dgemv or higher if we
931  // made a specialised m_base1[m_nuqad1] array
932  // containing multiply copies
933  for (int i = 0; i < m_numElmt; ++i)
934  {
935  // sort out singular vertices and singular
936  // edge components with (1+b)/2 (1+a)/2 form
937  for (int j = 0; j < m_nquad2; ++j)
938  {
940  tmp[m_nquad2 * m_numElmt + i * m_nquad2 + j],
941  m_base1.get() + m_nquad1, 1,
942  &tmp1[m_nquad1 * m_nquad2 * m_numElmt] +
943  i * m_nquad1 * m_nquad2 + j * m_nquad1,
944  1);
945  }
946  }
947  }
948 
949  // Perform summation over '0' direction
951  m_nmodes0, 1.0, m_base0.get(), m_nquad0, tmp1.get(),
952  m_nquad1 * m_nquad2 * m_numElmt, 0.0, output.get(),
953  m_nquad0);
954  }
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:249
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:368
static void Daxpy(const int &n, const double &alpha, const double *x, const int &incx, const double *y, const int &incy)
BLAS level 1: y = alpha x plus y.
Definition: Blas.hpp:154

References ASSERTL1, Blas::Daxpy(), and Blas::Dgemm().

◆ operator()() [2/2]

void Nektar::Collections::BwdTrans_SumFac_Tet::operator() ( int  dir,
const Array< OneD, const NekDouble > &  input,
Array< OneD, NekDouble > &  output,
Array< OneD, NekDouble > &  wsp 
)
inlinefinaloverridevirtual

Implements Nektar::Collections::Operator.

Definition at line 956 of file BwdTrans.cpp.

959  {
960  boost::ignore_unused(dir, input, output, wsp);
961  ASSERTL0(false, "Not valid for this operator.");
962  }

References ASSERTL0.

Member Data Documentation

◆ m_base0

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

Definition at line 978 of file BwdTrans.cpp.

◆ m_base1

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

Definition at line 979 of file BwdTrans.cpp.

◆ m_base2

Array<OneD, const NekDouble> Nektar::Collections::BwdTrans_SumFac_Tet::m_base2
protected

Definition at line 980 of file BwdTrans.cpp.

◆ m_nmodes0

const int Nektar::Collections::BwdTrans_SumFac_Tet::m_nmodes0
protected

Definition at line 975 of file BwdTrans.cpp.

◆ m_nmodes1

const int Nektar::Collections::BwdTrans_SumFac_Tet::m_nmodes1
protected

Definition at line 976 of file BwdTrans.cpp.

◆ m_nmodes2

const int Nektar::Collections::BwdTrans_SumFac_Tet::m_nmodes2
protected

Definition at line 977 of file BwdTrans.cpp.

◆ m_nquad0

const int Nektar::Collections::BwdTrans_SumFac_Tet::m_nquad0
protected

Definition at line 972 of file BwdTrans.cpp.

◆ m_nquad1

const int Nektar::Collections::BwdTrans_SumFac_Tet::m_nquad1
protected

Definition at line 973 of file BwdTrans.cpp.

◆ m_nquad2

const int Nektar::Collections::BwdTrans_SumFac_Tet::m_nquad2
protected

Definition at line 974 of file BwdTrans.cpp.

◆ m_sortTopEdge

bool Nektar::Collections::BwdTrans_SumFac_Tet::m_sortTopEdge
protected

Definition at line 981 of file BwdTrans.cpp.