75 int nquad0 =
m_base[0]->GetNumPoints();
76 int nquad1 =
m_base[1]->GetNumPoints();
78 if (outarray_d0.size() > 0)
81 if(inarray.data() == outarray_d0.data())
84 Vmath::Vcopy(nquad0 * nquad1,inarray.get(),1,wsp.get(),1);
86 &(D0->GetPtr())[0], nquad0, &wsp[0], nquad0, 0.0,
87 &outarray_d0[0], nquad0);
92 &(D0->GetPtr())[0], nquad0, &inarray[0], nquad0, 0.0,
93 &outarray_d0[0], nquad0);
97 if (outarray_d1.size() > 0)
100 if(inarray.data() == outarray_d1.data())
103 Vmath::Vcopy(nquad0 * nquad1,inarray.get(),1,wsp.get(),1);
104 Blas:: Dgemm(
'N',
'T', nquad0, nquad1, nquad1, 1.0, &wsp[0], nquad0,
105 &(D1->GetPtr())[0], nquad1, 0.0, &outarray_d1[0], nquad0);
109 Blas:: Dgemm(
'N',
'T', nquad0, nquad1, nquad1, 1.0, &inarray[0], nquad0,
110 &(D1->GetPtr())[0], nquad1, 0.0, &outarray_d1[0], nquad0);
131 const int nq0 =
m_base[0]->GetNumPoints();
132 const int nq1 =
m_base[1]->GetNumPoints();
135 for (
int i = 0; i < nq1; ++i)
137 wsp[i] = StdExpansion::BaryEvaluate<0>(
138 coll[0], &physvals[0] + i * nq0);
141 return StdExpansion::BaryEvaluate<1>(coll[1], &wsp[0]);
150 int nq0 =
m_base[0]->GetNumPoints();
151 int nq1 =
m_base[1]->GetNumPoints();
155 for (i = 0; i < nq1;++i)
157 wsp1[i] =
Blas::Ddot(nq0, &(I[0]->GetPtr())[0], 1,
158 &physvals[i * nq0], 1);
162 val =
Blas::Ddot(nq1, I[1]->GetPtr(), 1, wsp1, 1);
177 int nquad0 =
m_base[0]->GetNumPoints();
178 int nquad1 =
m_base[1]->GetNumPoints();
182 for (i = 0; i < nquad1; ++i)
184 Vmath::Vmul(nquad0, &inarray[0] + i*nquad0, 1, w0.get(),
185 1, &tmp[0] + i*nquad0, 1);
188 for (i = 0; i < nquad0; ++i)
190 Vmath::Vmul(nquad1, &tmp[0]+ i, nquad0, w1.get(), 1,
191 &tmp[0] + i, nquad0);
204 bool doCheckCollDir0,
205 bool doCheckCollDir1)
216 bool doCheckCollDir0,
217 bool doCheckCollDir1)
227 "Invalid direction.");
229 int nquad0 =
m_base[0]->GetNumPoints();
230 int nquad1 =
m_base[1]->GetNumPoints();
231 int nqtot = nquad0*nquad1;
232 int nmodes0 =
m_base[0]->GetNumModes();
241 for(
int i=0; i<nqtot;i++)
246 tmp1, tmp3, tmp4,
false,
true);
251 (*mat)(j,i) = tmp3[j];
256 for(
int i=0; i<nqtot;i++)
261 tmp1, tmp3, tmp4,
true,
false);
266 (*mat)(j,i) = tmp3[j];
288 int nquad0 =
m_base[0]->GetNumPoints();
289 int nquad1 =
m_base[1]->GetNumPoints();
290 int nqtot = nquad0*nquad1;
291 int nmodes0 =
m_base[0]->GetNumModes();
292 int nmodes1 =
m_base[1]->GetNumModes();
293 int wspsize = max(max(max(nqtot,
m_ncoeffs),nquad1*nmodes0),nquad0*nmodes1);
302 if(!(
m_base[0]->Collocation() &&
m_base[1]->Collocation()))
319 inarray,outarray,mkey);
335 int nquad0 =
m_base[0]->GetNumPoints();
336 int nquad1 =
m_base[1]->GetNumPoints();
337 int nqtot = nquad0*nquad1;
338 int nmodes0 =
m_base[0]->GetNumModes();
339 int nmodes1 =
m_base[1]->GetNumModes();
340 int wspsize = max(max(max(nqtot,
m_ncoeffs),nquad1*nmodes0),
353 if (!(
m_base[0]->Collocation() &&
m_base[1]->Collocation()))
361 wsp0, wsp2,
true,
true);
377 &wsp1[0], 1, &outarray[0], 1);
382 inarray,outarray,mkey);
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed to...
Describes the specification for a Basis.
virtual void v_IProductWRTBase_SumFacKernel(const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1)=0
void PhysTensorDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray_d0, Array< OneD, NekDouble > &outarray_d1)
Calculate the 2D derivative in the local tensor/collapsed coordinate at the physical points.
virtual void v_BwdTrans_SumFacKernel(const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1)=0
virtual NekDouble v_PhysEvaluate(const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &physvals)
This function evaluates the expansion at a single (arbitrary) point of the domain.
NekDouble Integral(const Array< OneD, const NekDouble > &inarray, const Array< OneD, const NekDouble > &w0, const Array< OneD, const NekDouble > &w1)
void BwdTrans_SumFacKernel(const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0=true, bool doCheckCollDir1=true)
virtual ~StdExpansion2D()
virtual void v_HelmholtzMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
virtual void v_LaplacianMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
void IProductWRTBase_SumFacKernel(const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0=true, bool doCheckCollDir1=true)
virtual void v_GenStdMatBwdDeriv(const int dir, DNekMatSharedPtr &mat)
The base class for all shapes.
void LaplacianMatrixOp_MatFree_GenericImpl(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void LocCoordToLocCollapsed(const Array< OneD, const NekDouble > &xi, Array< OneD, NekDouble > &eta)
Convert local cartesian coordinate xi into local collapsed coordinates eta.
void MultiplyByQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void HelmholtzMatrixOp_MatFree_GenericImpl(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
Array< OneD, LibUtilities::BasisSharedPtr > m_base
void LaplacianMatrixOp_MatFree_Kernel(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp)
NekDouble GetConstFactor(const ConstFactorType &factor) const
bool ConstFactorExists(const ConstFactorType &factor) const
static double Ddot(const int &n, const double *x, const int &incx, const double *y, const int &incy)
BLAS level 1: output = .
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...
static const NekDouble kNekZeroTol
The above copyright notice and this permission notice shall be included.
std::shared_ptr< DNekMat > DNekMatSharedPtr
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.
void Svtvp(int n, const T alpha, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
svtvp (scalar times vector plus vector): z = alpha*x + y
T Vsum(int n, const T *x, const int incx)
Subtract return sum(x)
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)