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

Inner product operator using standard matrix approach. More...

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

Public Member Functions

 ~IProductWRTBase_StdMat () final=default
 
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
 
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 ~Operator ()=default
 
virtual COLLECTIONS_EXPORT void operator() (const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output0, Array< OneD, NekDouble > &output1, Array< OneD, NekDouble > &output2, Array< OneD, NekDouble > &wsp=NullNekDouble1DArray)=0
 Perform operation. More...
 
virtual COLLECTIONS_EXPORT void operator() (int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp=NullNekDouble1DArray)=0
 
virtual COLLECTIONS_EXPORT void CheckFactors (StdRegions::FactorMap factors, int coll_phys_offset)=0
 Check the validity of the supplied factor map. More...
 
unsigned int GetWspSize ()
 Get the size of the required workspace. More...
 
unsigned int GetNumElmt ()
 Get number of elements. More...
 
StdRegions::StdExpansionSharedPtr GetExpSharedPtr ()
 Get expansion pointer. More...
 
unsigned int GetInputSize ()
 
unsigned int GetOutputSize ()
 

Protected Attributes

DNekMatSharedPtr m_mat
 
Array< OneD, const NekDoublem_jac
 
- Protected Attributes inherited from Nektar::Collections::Operator
bool m_isDeformed
 
StdRegions::StdExpansionSharedPtr m_stdExp
 
unsigned int m_numElmt
 number of elements that the operator is applied on More...
 
unsigned int m_nqe
 
unsigned int m_wspSize
 
unsigned int m_inputSize
 number of modes or quadrature points that are passed as input to an operator More...
 
unsigned int m_outputSize
 number of modes or quadrature points that are taken as output from an operator More...
 

Private Member Functions

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

Additional Inherited Members

- Protected Member Functions inherited from Nektar::Collections::Operator
virtual int v_GetInputSize ()
 This purely virtual function needs to be set-up for every operator inside Collections. It is responsible for returning the size of input collection, that the operator is applied on either in physical or coefficient space. More...
 
virtual int v_GetOutputSize ()
 This purely virtual function needs to be set-up for every operator inside Collections. It is responsible for returning the output size either in physical or coefficient space of an operator inside Collections. More...
 
- Protected Member Functions inherited from Nektar::Collections::IProductWRTBase_Helper
 IProductWRTBase_Helper ()
 

Detailed Description

Inner product operator using standard matrix approach.

Definition at line 75 of file IProductWRTBase.cpp.

Constructor & Destructor Documentation

◆ ~IProductWRTBase_StdMat()

Nektar::Collections::IProductWRTBase_StdMat::~IProductWRTBase_StdMat ( )
finaldefault

◆ IProductWRTBase_StdMat()

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

Definition at line 130 of file IProductWRTBase.cpp.

133 : Operator(pCollExp, pGeomData, factors), IProductWRTBase_Helper()
134 {
135 m_jac = pGeomData->GetJac(pCollExp);
136 StdRegions::StdMatrixKey key(StdRegions::eIProductWRTBase,
137 m_stdExp->DetShapeType(), *m_stdExp);
138 m_mat = m_stdExp->GetStdMatrix(key);
139 m_nqe = m_stdExp->GetTotPoints();
141 }
StdRegions::StdExpansionSharedPtr m_stdExp
Definition: Operator.h:188
unsigned int m_numElmt
number of elements that the operator is applied on
Definition: Operator.h:190
Operator(std::vector< StdRegions::StdExpansionSharedPtr > pCollExp, std::shared_ptr< CoalescedGeomData > GeomData, StdRegions::FactorMap factors)
Constructor.
Definition: Operator.cpp:66
StdRegions::ConstFactorMap factors

References Nektar::StdRegions::eIProductWRTBase, m_jac, m_mat, Nektar::Collections::Operator::m_nqe, Nektar::Collections::Operator::m_numElmt, Nektar::Collections::Operator::m_stdExp, and Nektar::Collections::Operator::m_wspSize.

Member Function Documentation

◆ CheckFactors()

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

Check the validity of the supplied factor map.

Implements Nektar::Collections::Operator.

Definition at line 119 of file IProductWRTBase.cpp.

121 {
122 ASSERTL0(false, "Not valid for this operator.");
123 }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:208

References ASSERTL0.

◆ operator()() [1/2]

void Nektar::Collections::IProductWRTBase_StdMat::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 83 of file IProductWRTBase.cpp.

88 {
89 ASSERTL1(wsp.size() == m_wspSize, "Incorrect workspace size");
90
91 if (m_isDeformed)
92 {
93 Vmath::Vmul(m_jac.size(), m_jac, 1, input, 1, wsp, 1);
94 }
95 else
96 {
97 Array<OneD, NekDouble> tmp;
98 for (int e = 0; e < m_numElmt; ++e)
99 {
100 Vmath::Smul(m_nqe, m_jac[e], input + e * m_nqe, 1,
101 tmp = wsp + e * m_nqe, 1);
102 }
103 }
104
105 Blas::Dgemm('N', 'N', m_mat->GetRows(), m_numElmt, m_mat->GetColumns(),
106 1.0, m_mat->GetRawPtr(), m_mat->GetRows(), wsp.get(),
107 m_stdExp->GetTotPoints(), 0.0, output.get(),
108 m_stdExp->GetNcoeffs());
109 }
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:242
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:383
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.hpp:72
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.hpp:100

References ASSERTL1, Blas::Dgemm(), Nektar::Collections::Operator::m_isDeformed, m_jac, m_mat, Nektar::Collections::Operator::m_nqe, Nektar::Collections::Operator::m_numElmt, Nektar::Collections::Operator::m_stdExp, Nektar::Collections::Operator::m_wspSize, Vmath::Smul(), and Vmath::Vmul().

◆ operator()() [2/2]

void Nektar::Collections::IProductWRTBase_StdMat::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 111 of file IProductWRTBase.cpp.

115 {
116 NEKERROR(ErrorUtil::efatal, "Not valid for this operator.");
117 }
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
Definition: ErrorUtil.hpp:202

References Nektar::ErrorUtil::efatal, and NEKERROR.

Member Data Documentation

◆ m_jac

Array<OneD, const NekDouble> Nektar::Collections::IProductWRTBase_StdMat::m_jac
protected

Definition at line 127 of file IProductWRTBase.cpp.

Referenced by IProductWRTBase_StdMat(), and operator()().

◆ m_mat

DNekMatSharedPtr Nektar::Collections::IProductWRTBase_StdMat::m_mat
protected

Definition at line 126 of file IProductWRTBase.cpp.

Referenced by IProductWRTBase_StdMat(), and operator()().