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

PhysInterp1DScaled operator using LocalRegions implementation. More...

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

Public Member Functions

 ~PhysInterp1DScaled_NoCollection () 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
 Perform operation. More...
 
void operator() (int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
 
void UpdateFactors (StdRegions::FactorMap factors) override
 Update 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 UpdateFactors (StdRegions::FactorMap factors)
 Update the supplied factor map. More...
 
virtual COLLECTIONS_EXPORT void UpdateVarcoeffs (StdRegions::VarCoeffMap &varcoeffs)
 Update the supplied variable coefficients. 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 (bool defaultIn=true)
 
unsigned int GetOutputSize (bool defaultOut=true)
 

Private Member Functions

 PhysInterp1DScaled_NoCollection (vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
 
void UpdateFactors (StdRegions::FactorMap factors) override
 Update the supplied factor map. More...
 
 PhysInterp1DScaled_Helper ()
 

Private Attributes

StdRegions::FactorMap m_factors
 
vector< StdRegions::StdExpansionSharedPtrm_expList
 
- Private Attributes inherited from Nektar::Collections::PhysInterp1DScaled_Helper
StdRegions::FactorMap m_factors
 

Additional Inherited Members

- 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...
 
unsigned int m_inputSizeOther
 Number of modes or quadrature points, opposite to m_inputSize. More...
 
unsigned int m_outputSizeOther
 Number of modes or quadrature points, opposite to m_outputSize. More...
 

Detailed Description

PhysInterp1DScaled operator using LocalRegions implementation.

Definition at line 279 of file PhysInterp1DScaled.cpp.

Constructor & Destructor Documentation

◆ ~PhysInterp1DScaled_NoCollection()

Nektar::Collections::PhysInterp1DScaled_NoCollection::~PhysInterp1DScaled_NoCollection ( )
inlinefinal

Definition at line 285 of file PhysInterp1DScaled.cpp.

286 {
287 }

◆ PhysInterp1DScaled_NoCollection()

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

Definition at line 454 of file PhysInterp1DScaled.cpp.

457 : Operator(pCollExp, pGeomData, factors), PhysInterp1DScaled_Helper()
458 {
459 m_expList = pCollExp;
461 }
Operator(std::vector< StdRegions::StdExpansionSharedPtr > pCollExp, std::shared_ptr< CoalescedGeomData > GeomData, StdRegions::FactorMap factors)
Constructor.
Definition: Operator.cpp:66
vector< StdRegions::StdExpansionSharedPtr > m_expList
StdRegions::ConstFactorMap factors

References Nektar::VarcoeffHashingTest::factors, m_expList, and m_factors.

Member Function Documentation

◆ operator()() [1/2]

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

Perform operation.

Implements Nektar::Collections::Operator.

Definition at line 289 of file PhysInterp1DScaled.cpp.

294 {
295 int cnt{0};
296 int cnt1{0};
298 int dim{m_expList[0]->GetShapeDimension()}; // same as m_expType
299 switch (dim)
300 {
301 case 1:
302 {
304 // the number of points before and after interpolation are the
305 // same for each element inside a single collection
306 int pt0 = m_expList[0]->GetNumPoints(0);
307 int npt0 = (int)pt0 * scale;
308 // current points key - use first entry
309 LibUtilities::PointsKey PointsKey0(
310 pt0, m_expList[0]->GetPointsType(0));
311 // get new points key
312 LibUtilities::PointsKey newPointsKey0(
313 npt0, m_expList[0]->GetPointsType(0));
314 // Interpolate points;
315 I0 = LibUtilities::PointsManager()[PointsKey0]->GetI(
316 newPointsKey0);
317
318 for (int i = 0; i < m_numElmt; ++i)
319 {
320
321 Blas::Dgemv('N', npt0, pt0, 1.0, I0->GetPtr().data(), npt0,
322 &input[cnt], 1, 0.0, &output[cnt1], 1);
323 cnt += pt0;
324 cnt1 += npt0;
325 }
326 }
327 break;
328 case 2:
329 {
330 DNekMatSharedPtr I0, I1;
331 // the number of points before and after interpolation are
332 // the same for each element inside a single collection
333 int pt0 = m_expList[0]->GetNumPoints(0);
334 int pt1 = m_expList[0]->GetNumPoints(1);
335 int npt0 = (int)pt0 * scale;
336 int npt1 = (int)pt1 * scale;
337 // workspace declaration
338 Array<OneD, NekDouble> wsp(npt1 * pt0); // fnp0*tnp1
339
340 // current points key - using first entry
341 LibUtilities::PointsKey PointsKey0(
342 pt0, m_expList[0]->GetPointsType(0));
343 LibUtilities::PointsKey PointsKey1(
344 pt1, m_expList[0]->GetPointsType(1));
345 // get new points key
346 LibUtilities::PointsKey newPointsKey0(
347 npt0, m_expList[0]->GetPointsType(0));
348 LibUtilities::PointsKey newPointsKey1(
349 npt1, m_expList[0]->GetPointsType(1));
350
351 // Interpolate points;
352 I0 = LibUtilities::PointsManager()[PointsKey0]->GetI(
353 newPointsKey0);
354 I1 = LibUtilities::PointsManager()[PointsKey1]->GetI(
355 newPointsKey1);
356
357 for (int i = 0; i < m_numElmt; ++i)
358 {
359 Blas::Dgemm('N', 'T', pt0, npt1, pt1, 1.0, &input[cnt], pt0,
360 I1->GetPtr().data(), npt1, 0.0, wsp.data(),
361 pt0);
362
363 Blas::Dgemm('N', 'N', npt0, npt1, pt0, 1.0,
364 I0->GetPtr().data(), npt0, wsp.data(), pt0, 0.0,
365 &output[cnt1], npt0);
366
367 cnt += pt0 * pt1;
368 cnt1 += npt0 * npt1;
369 }
370 }
371 break;
372 case 3:
373 {
374 DNekMatSharedPtr I0, I1, I2;
375
376 int pt0 = m_expList[0]->GetNumPoints(0);
377 int pt1 = m_expList[0]->GetNumPoints(1);
378 int pt2 = m_expList[0]->GetNumPoints(2);
379 int npt0 = (int)pt0 * scale;
380 int npt1 = (int)pt1 * scale;
381 int npt2 = (int)pt2 * scale;
382 Array<OneD, NekDouble> wsp1(npt0 * npt1 * pt2);
383 Array<OneD, NekDouble> wsp2(npt0 * pt1 * pt2);
384
385 // current points key
386 LibUtilities::PointsKey PointsKey0(
387 pt0, m_expList[0]->GetPointsType(0));
388 LibUtilities::PointsKey PointsKey1(
389 pt1, m_expList[0]->GetPointsType(1));
390 LibUtilities::PointsKey PointsKey2(
391 pt2, m_expList[0]->GetPointsType(2));
392 // get new points key
393 LibUtilities::PointsKey newPointsKey0(
394 npt0, m_expList[0]->GetPointsType(0));
395 LibUtilities::PointsKey newPointsKey1(
396 npt1, m_expList[0]->GetPointsType(1));
397 LibUtilities::PointsKey newPointsKey2(
398 npt2, m_expList[0]->GetPointsType(2));
399
400 I0 = LibUtilities::PointsManager()[PointsKey0]->GetI(
401 newPointsKey0);
402 I1 = LibUtilities::PointsManager()[PointsKey1]->GetI(
403 newPointsKey1);
404 I2 = LibUtilities::PointsManager()[PointsKey2]->GetI(
405 newPointsKey2);
406
407 for (int i = 0; i < m_numElmt; ++i)
408 {
409 // Interpolate points
410 Blas::Dgemm('N', 'N', npt0, pt1 * pt2, pt0, 1.0,
411 I0->GetPtr().data(), npt0, &input[cnt], pt0,
412 0.0, wsp2.data(), npt0);
413
414 for (int j = 0; j < pt2; j++)
415 {
416 Blas::Dgemm('N', 'T', npt0, npt1, pt1, 1.0,
417 wsp2.data() + j * npt0 * pt1, npt0,
418 I1->GetPtr().data(), npt1, 0.0,
419 wsp1.data() + j * npt0 * npt1, npt0);
420 }
421
422 Blas::Dgemm('N', 'T', npt0 * npt1, npt2, pt2, 1.0,
423 wsp1.data(), npt0 * npt1, I2->GetPtr().data(),
424 npt2, 0.0, &output[cnt1], npt0 * npt1);
425
426 cnt += pt0 * pt1 * pt2;
427 cnt1 += npt0 * npt1 * npt2;
428 }
429 }
430 break;
431 default:
432 {
433 NEKERROR(ErrorUtil::efatal, "This expansion is not set for the "
434 "PhysInterp1DScaled operator.");
435 }
436 break;
437 }
438 }
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
Definition: ErrorUtil.hpp:202
unsigned int m_numElmt
number of elements that the operator is applied on
Definition: Operator.h:219
static void Dgemv(const char &trans, const int &m, const int &n, const double &alpha, const double *a, const int &lda, const double *x, const int &incx, const double &beta, double *y, const int &incy)
BLAS level 2: Matrix vector multiply y = alpha A x plus beta y where A[m x n].
Definition: Blas.hpp:211
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
PointsManagerT & PointsManager(void)
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:75
double NekDouble

References Blas::Dgemm(), Blas::Dgemv(), Nektar::StdRegions::eFactorConst, Nektar::ErrorUtil::efatal, m_expList, m_factors, Nektar::Collections::Operator::m_numElmt, NEKERROR, and Nektar::LibUtilities::PointsManager().

◆ operator()() [2/2]

void Nektar::Collections::PhysInterp1DScaled_NoCollection::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 439 of file PhysInterp1DScaled.cpp.

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

References ASSERTL0.

◆ UpdateFactors()

void Nektar::Collections::PhysInterp1DScaled_NoCollection::UpdateFactors ( StdRegions::FactorMap  factors)
inlineoverridevirtual

Update the supplied factor map.

Reimplemented from Nektar::Collections::Operator.

Definition at line 447 of file PhysInterp1DScaled.cpp.

448 {
451 }
void UpdateFactors(StdRegions::FactorMap factors) override
Update the supplied factor map.

References Nektar::VarcoeffHashingTest::factors, m_factors, and Nektar::Collections::PhysInterp1DScaled_Helper::UpdateFactors().

Member Data Documentation

◆ m_expList

vector<StdRegions::StdExpansionSharedPtr> Nektar::Collections::PhysInterp1DScaled_NoCollection::m_expList
private

Definition at line 464 of file PhysInterp1DScaled.cpp.

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

◆ m_factors

StdRegions::FactorMap Nektar::Collections::PhysInterp1DScaled_NoCollection::m_factors
private