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

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) 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

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 852 of file BwdTrans.cpp.

Constructor & Destructor Documentation

◆ ~BwdTrans_SumFac_Tet()

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

Definition at line 857 of file BwdTrans.cpp.

858  {
859  }

◆ BwdTrans_SumFac_Tet()

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

Definition at line 992 of file BwdTrans.cpp.

995  : Operator(pCollExp, pGeomData, factors), m_nquad0(m_stdExp->GetNumPoints(0)),
996  m_nquad1(m_stdExp->GetNumPoints(1)),
997  m_nquad2(m_stdExp->GetNumPoints(2)),
998  m_nmodes0(m_stdExp->GetBasisNumModes(0)),
999  m_nmodes1(m_stdExp->GetBasisNumModes(1)),
1000  m_nmodes2(m_stdExp->GetBasisNumModes(2)),
1001  m_base0(m_stdExp->GetBasis(0)->GetBdata()),
1002  m_base1(m_stdExp->GetBasis(1)->GetBdata()),
1003  m_base2(m_stdExp->GetBasis(2)->GetBdata())
1004  {
1006  (2 * m_nmodes1 - m_nmodes0 + 1) / 2 +
1008 
1009  if (m_stdExp->GetBasis(0)->GetBasisType() == LibUtilities::eModified_A)
1010  {
1011  m_sortTopEdge = true;
1012  }
1013  else
1014  {
1015  m_sortTopEdge = false;
1016  }
1017  }
Array< OneD, const NekDouble > m_base1
Definition: BwdTrans.cpp:987
Array< OneD, const NekDouble > m_base0
Definition: BwdTrans.cpp:986
Array< OneD, const NekDouble > m_base2
Definition: BwdTrans.cpp:988
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
@ eModified_A
Principle Modified Functions .
Definition: BasisType.h:48

References Nektar::LibUtilities::eModified_A.

Member Function Documentation

◆ CheckFactors()

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

Check the validity of the supplied factor map.

Implements Nektar::Collections::Operator.

Definition at line 971 of file BwdTrans.cpp.

973  {
974  boost::ignore_unused(factors, coll_phys_offset);
975  ASSERTL0(false, "Not valid for this operator.");
976  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216

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 
)
inlinefinalvirtual

Perform operation.

Implements Nektar::Collections::Operator.

Definition at line 861 of file BwdTrans.cpp.

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

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 
)
inlinefinalvirtual

Implements Nektar::Collections::Operator.

Definition at line 963 of file BwdTrans.cpp.

966  {
967  boost::ignore_unused(dir, input, output, wsp);
968  ASSERTL0(false, "Not valid for this operator.");
969  }

References ASSERTL0.

Member Data Documentation

◆ m_base0

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

Definition at line 986 of file BwdTrans.cpp.

◆ m_base1

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

Definition at line 987 of file BwdTrans.cpp.

◆ m_base2

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

Definition at line 988 of file BwdTrans.cpp.

◆ m_nmodes0

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

Definition at line 983 of file BwdTrans.cpp.

◆ m_nmodes1

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

Definition at line 984 of file BwdTrans.cpp.

◆ m_nmodes2

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

Definition at line 985 of file BwdTrans.cpp.

◆ m_nquad0

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

Definition at line 980 of file BwdTrans.cpp.

◆ m_nquad1

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

Definition at line 981 of file BwdTrans.cpp.

◆ m_nquad2

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

Definition at line 982 of file BwdTrans.cpp.

◆ m_sortTopEdge

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

Definition at line 989 of file BwdTrans.cpp.