Nektar++
StdExpansion.cpp
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File StdExpansion.cpp
4 //
5 // For more information, please see: http://www.nektar.info
6 //
7 // The MIT License
8 //
9 // Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10 // Department of Aeronautics, Imperial College London (UK), and Scientific
11 // Computing and Imaging Institute, University of Utah (USA).
12 //
13 // Permission is hereby granted, free of charge, to any person obtaining a
14 // copy of this software and associated documentation files (the "Software"),
15 // to deal in the Software without restriction, including without limitation
16 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
17 // and/or sell copies of the Software, and to permit persons to whom the
18 // Software is furnished to do so, subject to the following conditions:
19 //
20 // The above copyright notice and this permission notice shall be included
21 // in all copies or substantial portions of the Software.
22 //
23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29 // DEALINGS IN THE SOFTWARE.
30 //
31 // Description: Definition of methods in class StdExpansion which is
32 // the base class to all expansion shapes
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #include <boost/core/ignore_unused.hpp>
37 
39 #include <LibUtilities/Foundations/ManagerAccess.h> // for BasisManager, etc
40 
41 namespace Nektar
42 {
43  namespace StdRegions
44  {
46  m_elmt_id(0),
47  m_ncoeffs(0)
48  {
49  }
50 
51  StdExpansion::StdExpansion(const int numcoeffs, const int numbases,
52  const LibUtilities::BasisKey &Ba,
53  const LibUtilities::BasisKey &Bb,
54  const LibUtilities::BasisKey &Bc):
55  m_base(numbases),
56  m_elmt_id(0),
57  m_ncoeffs(numcoeffs),
58  m_stdMatrixManager(
59  std::bind(&StdExpansion::CreateStdMatrix, this, std::placeholders::_1),
60  std::string("StdExpansionStdMatrix")),
61  m_stdStaticCondMatrixManager(
62  std::bind(&StdExpansion::CreateStdStaticCondMatrix, this, std::placeholders::_1),
63  std::string("StdExpansionStdStaticCondMatrix"))
64  {
65  switch(m_base.size())
66  {
67  case 3:
69  "NULL Basis attempting to be used.");
71  /* Falls through. */
72  case 2:
74  "NULL Basis attempting to be used.");
76  /* Falls through. */
77  case 1:
79  "NULL Basis attempting to be used.");
81  break;
82  default:
83  break;
84  // ASSERTL0(false, "numbases incorrectly specified");
85  };
86 
87  } //end constructor
88 
89 
91  std::enable_shared_from_this<StdExpansion>(T),
92  m_base(T.m_base),
93  m_elmt_id(T.m_elmt_id),
94  m_ncoeffs(T.m_ncoeffs),
95  m_stdMatrixManager(T.m_stdMatrixManager),
96  m_stdStaticCondMatrixManager(T.m_stdStaticCondMatrixManager)
97  {
98  }
99 
101  {
102  }
103 
105  const Array<OneD, const NekDouble>& sol)
106  {
107  NekDouble val;
108  int ntot = GetTotPoints();
109  Array<OneD, NekDouble> wsp(ntot);
110 
111  if(sol == NullNekDouble1DArray)
112  {
113  Vmath::Vabs(ntot, phys, 1, wsp, 1);
114  }
115  else
116  {
117  Vmath::Vsub(ntot, sol, 1, phys, 1, wsp, 1);
118  Vmath::Vabs(ntot, wsp, 1, wsp, 1);
119  }
120 
121  val = Vmath::Vamax(ntot, wsp, 1);
122  return val;
123  }
124 
126  const Array<OneD, const NekDouble>& sol)
127  {
128  NekDouble val;
129  int ntot = GetTotPoints();
130  Array<OneD, NekDouble> wsp(ntot);
131 
132  if (sol.size() == 0)
133  {
134  Vmath::Vmul(ntot, phys, 1, phys, 1, wsp, 1);
135  }
136  else
137  {
138  Vmath::Vsub(ntot, sol, 1, phys, 1, wsp, 1);
139  Vmath::Vmul(ntot, wsp, 1, wsp, 1, wsp, 1);
140  }
141 
142  val = v_Integral(wsp);
143 
144  // if val too small, sqrt returns nan.
146  {
147  return 0.0;
148  }
149  else
150  {
151  return sqrt(val);
152  }
153  }
154 
156  const Array<OneD, const NekDouble>& sol)
157  {
158  int i;
159  NekDouble val;
160  int ntot = GetTotPoints();
161  int coordim = v_GetCoordim();
162  Array<OneD, NekDouble> wsp(3*ntot);
163  Array<OneD, NekDouble> wsp_deriv = wsp + ntot;
164  Array<OneD, NekDouble> sum = wsp_deriv + ntot;
165 
166  if(sol == NullNekDouble1DArray)
167  {
168  Vmath::Vcopy(ntot,phys, 1, wsp, 1);
169  Vmath::Vmul(ntot, phys, 1, phys, 1, sum, 1);
170  }
171  else
172  {
173  Vmath::Vsub(ntot, sol, 1, phys, 1, wsp, 1);
174  Vmath::Vmul(ntot, wsp, 1, wsp, 1, sum, 1);
175  }
176 
177 
178  for(i = 0; i < coordim; ++i)
179  {
180  v_PhysDeriv(i,wsp,wsp_deriv);
181  Vmath::Vvtvp(ntot,wsp_deriv,1,wsp_deriv,1,sum,1,sum,1);
182  }
183 
184  val = sqrt(v_Integral(sum));
185 
186  return val;
187  }
188 
190  (const StdMatrixKey &mkey)
191  {
192  DNekBlkMatSharedPtr returnval;
193 
194  DNekMatSharedPtr mat = GetStdMatrix(mkey);
195  int nbdry = NumBndryCoeffs(); // also checks to see if this is a boundary interior decomposed expansion
196  int nint = m_ncoeffs - nbdry;
201 
202  int i,j;
203 
204  Array<OneD,unsigned int> bmap(nbdry);
205  Array<OneD,unsigned int> imap(nint);
206  GetBoundaryMap(bmap);
207  GetInteriorMap(imap);
208 
209  for(i = 0; i < nbdry; ++i)
210  {
211  for(j = 0; j < nbdry; ++j)
212  {
213  (*A)(i,j) = (*mat)(bmap[i],bmap[j]);
214  }
215 
216  for(j = 0; j < nint; ++j)
217  {
218  (*B)(i,j) = (*mat)(bmap[i],imap[j]);
219  }
220  }
221 
222  for(i = 0; i < nint; ++i)
223  {
224  for(j = 0; j < nbdry; ++j)
225  {
226  (*C)(i,j) = (*mat)(imap[i],bmap[j]);
227  }
228 
229  for(j = 0; j < nint; ++j)
230  {
231  (*D)(i,j) = (*mat)(imap[i],imap[j]);
232  }
233  }
234 
235  // Calculate static condensed system
236  if(nint)
237  {
238  D->Invert();
239  (*B) = (*B)*(*D);
240  (*A) = (*A) - (*B)*(*C);
241  }
242 
243  // set up block matrix system
244  Array<OneD, unsigned int> exp_size(2);
245  exp_size[0] = nbdry;
246  exp_size[1] = nint;
247  returnval = MemoryManager<DNekBlkMat>::AllocateSharedPtr(exp_size,exp_size);
248 
249  returnval->SetBlock(0,0,A);
250  returnval->SetBlock(0,1,B);
251  returnval->SetBlock(1,0,C);
252  returnval->SetBlock(1,1,D);
253 
254  return returnval;
255  }
256 
257 
259  {
260  int i;
261  DNekMatSharedPtr returnval;
262 
263  switch(mkey.GetMatrixType())
264  {
265  case eInvMass:
266  {
268  DNekMatSharedPtr mmat = GetStdMatrix(masskey);
269 
270  returnval = MemoryManager<DNekMat>::AllocateSharedPtr(*mmat); //Populate standard mass matrix.
271  returnval->Invert();
272  }
273  break;
274  case eInvNBasisTrans:
275  {
277  DNekMatSharedPtr tmpmat = GetStdMatrix(tmpkey);
278  returnval = MemoryManager<DNekMat>::AllocateSharedPtr(*tmpmat); //Populate matrix.
279  returnval->Invert();
280  }
281  break;
282  case eBwdMat:
283  {
284  int nq = GetTotPoints();
286  Array<OneD, NekDouble> tmpout(nq);
287 
289  Array<OneD, NekDouble> Bwd_data = returnval->GetPtr();
290 
292  this->DetShapeType(), *this);
293  DNekMatSharedPtr MatBwdTrans = GetStdMatrix(matkey);
294  Array<OneD, NekDouble> BwdTrans_data = MatBwdTrans->GetPtr();
295 
296  for(int i=0; i<m_ncoeffs; ++i)
297  {
298  Array<OneD, NekDouble> tmpinn = BwdTrans_data + nq*i;
299  Array<OneD, NekDouble> tmpout = Bwd_data + i;
300 
301  Vmath::Vcopy(nq,tmpinn,1,tmpout,m_ncoeffs);
302  }
303  }
304  break;
305  case eBwdTrans:
306  {
307  int nq = GetTotPoints();
309  Array<OneD, NekDouble> tmpout(nq);
310 
312 
313  for(int i=0; i<m_ncoeffs; ++i)
314  {
315  Vmath::Zero(m_ncoeffs, tmpin, 1);
316  tmpin[i] = 1.0;
317 
318  BwdTrans_SumFac(tmpin,tmpout);
319 
320  Vmath::Vcopy(nq,tmpout.get(),1,
321  returnval->GetRawPtr()+i*nq,1);
322  }
323  }
324  break;
325  case eIProductWRTBase:
326  {
327  int nq = GetTotPoints();
328  Array<OneD, NekDouble> tmpin(nq);
330 
332 
333  for(i=0; i < nq; ++i)
334  {
335  Vmath::Zero(nq, tmpin, 1);
336  tmpin[i] = 1.0;
337 
338  IProductWRTBase_SumFac(tmpin,tmpout);
339 
340  Vmath::Vcopy(m_ncoeffs,tmpout.get(),1,
341  returnval->GetRawPtr()+i*m_ncoeffs,1);
342  }
343  }
344  break;
346  {
347  int nq = GetTotPoints();
348  Array<OneD, NekDouble> tmpin(nq);
350 
352 
353  for(i=0; i < nq; ++i)
354  {
355  Vmath::Zero(nq, tmpin, 1);
356  tmpin[i] = 1.0;
357 
358  IProductWRTDerivBase_SumFac(0,tmpin,tmpout);
359 
360  Vmath::Vcopy(m_ncoeffs,tmpout.get(),1,
361  returnval->GetRawPtr()+i*m_ncoeffs,1);
362  }
363  }
364  break;
366  {
367  int nq = GetTotPoints();
368  Array<OneD, NekDouble> tmpin(nq);
370 
372 
373  for(i=0; i < nq; ++i)
374  {
375  Vmath::Zero(nq, tmpin, 1);
376  tmpin[i] = 1.0;
377 
378  IProductWRTDerivBase_SumFac(1,tmpin,tmpout);
379 
380  Vmath::Vcopy(m_ncoeffs,tmpout.get(),1,
381  returnval->GetRawPtr()+i*m_ncoeffs,1);
382  }
383  }
384  break;
386  {
387  int nq = GetTotPoints();
388  Array<OneD, NekDouble> tmpin(nq);
390 
392 
393  for(i=0; i < nq; ++i)
394  {
395  Vmath::Zero(nq, tmpin, 1);
396  tmpin[i] = 1.0;
397 
398  IProductWRTDerivBase_SumFac(2,tmpin,tmpout);
399 
400  Vmath::Vcopy(m_ncoeffs,tmpout.get(),1,
401  returnval->GetRawPtr()+i*m_ncoeffs,1);
402  }
403  }
404  break;
405  case eDerivBase0:
406  {
407  int nq = GetTotPoints();
409  GenStdMatBwdDeriv(0,returnval);
410  }
411  break;
412  case eDerivBase1:
413  {
414  int nq = GetTotPoints();
416  GenStdMatBwdDeriv(1,returnval);
417  }
418  break;
419  case eDerivBase2:
420  {
421  int nq = GetTotPoints();
423  GenStdMatBwdDeriv(2,returnval);
424  }
425  break;
426  case eEquiSpacedToCoeffs:
427  {
428  // check to see if equispaced basis
429  int nummodes = m_base[0]->GetNumModes();
430  bool equispaced = true;
431  for(int i = 1; i < m_base.size(); ++i)
432  {
433  if(m_base[i]->GetNumModes() != nummodes)
434  {
435  equispaced = false;
436  }
437  }
438 
439  ASSERTL0(equispaced,
440  "Currently need to have same num modes in all "
441  "directionmodes to use EquiSpacedToCoeff method");
442 
443  int ntot = GetTotPoints();
444  Array<OneD, NekDouble> qmode(ntot);
446 
449  for(int i = 0; i < m_ncoeffs; ++i)
450  {
451  // Get mode at quadrature points
452  FillMode(i,qmode);
453 
454  // interpolate to equi spaced
455  PhysInterpToSimplexEquiSpaced(qmode,emode,nummodes);
456 
457  // fill matrix
458  Vmath::Vcopy(m_ncoeffs, &emode[0], 1,
459  returnval->GetRawPtr() + i*m_ncoeffs, 1);
460  }
461  // invert matrix
462  returnval->Invert();
463 
464  }
465  break;
466  case eMass:
467  case eHelmholtz:
468  case eLaplacian:
469  case eLaplacian00:
470  case eLaplacian01:
471  case eLaplacian02:
472  case eLaplacian11:
473  case eLaplacian12:
474  case eLaplacian22:
475  case eWeakDeriv0:
476  case eWeakDeriv1:
477  case eWeakDeriv2:
479  case eMassLevelCurvature:
482  {
485  DNekMat &Mat = *returnval;
486 
487  for(i=0; i < m_ncoeffs; ++i)
488  {
489  Vmath::Zero(m_ncoeffs, tmp, 1);
490  tmp[i] = 1.0;
491 
492  GeneralMatrixOp_MatFree(tmp,tmp,mkey);
493 
494  Vmath::Vcopy(m_ncoeffs,&tmp[0],1,
495  &(Mat.GetPtr())[0]+i*m_ncoeffs,1);
496  }
497  }
498  break;
499  default:
500  {
501  NEKERROR(ErrorUtil::efatal, "This type of matrix can not be created using a general approach");
502  }
503  break;
504  }
505 
506  return returnval;
507  }
508 
510  Array<OneD,NekDouble> &outarray,
511  const StdMatrixKey &mkey)
512  {
513  switch(mkey.GetMatrixType())
514  {
515  case eMass:
516  MassMatrixOp(inarray,outarray,mkey);
517  break;
518  case eWeakDeriv0:
519  WeakDerivMatrixOp(0,inarray,outarray,mkey);
520  break;
521  case eWeakDeriv1:
522  WeakDerivMatrixOp(1,inarray,outarray,mkey);
523  break;
524  case eWeakDeriv2:
525  WeakDerivMatrixOp(2,inarray,outarray,mkey);
526  break;
528  WeakDirectionalDerivMatrixOp(inarray,outarray,mkey);
529  break;
530  case eMassLevelCurvature:
531  MassLevelCurvatureMatrixOp(inarray,outarray,mkey);
532  break;
534  LinearAdvectionDiffusionReactionMatrixOp(inarray,outarray,mkey,false);
535  break;
537  LinearAdvectionDiffusionReactionMatrixOp(inarray,outarray,mkey);
538  break;
539  case eLaplacian:
540  LaplacianMatrixOp(inarray,outarray,mkey);
541  break;
542  case eLaplacian00:
543  LaplacianMatrixOp(0,0,inarray,outarray,mkey);
544  break;
545  case eLaplacian01:
546  LaplacianMatrixOp(0,1,inarray,outarray,mkey);
547  break;
548  case eLaplacian02:
549  LaplacianMatrixOp(0,2,inarray,outarray,mkey);
550  break;
551  case eLaplacian10:
552  LaplacianMatrixOp(1,0,inarray,outarray,mkey);
553  break;
554  case eLaplacian11:
555  LaplacianMatrixOp(1,1,inarray,outarray,mkey);
556  break;
557  case eLaplacian12:
558  LaplacianMatrixOp(1,2,inarray,outarray,mkey);
559  break;
560  case eLaplacian20:
561  LaplacianMatrixOp(2,0,inarray,outarray,mkey);
562  break;
563  case eLaplacian21:
564  LaplacianMatrixOp(2,1,inarray,outarray,mkey);
565  break;
566  case eLaplacian22:
567  LaplacianMatrixOp(2,2,inarray,outarray,mkey);
568  break;
569  case eHelmholtz:
570  HelmholtzMatrixOp(inarray,outarray,mkey);
571  break;
572  default:
573  NEKERROR(ErrorUtil::efatal, "This matrix does not have an operator");
574  break;
575  }
576  }
577 
579  Array<OneD,NekDouble> &outarray,
580  const StdMatrixKey &mkey)
581  {
582  switch(mkey.GetMatrixType())
583  {
584  case eMass:
585  MassMatrixOp_MatFree(inarray,outarray,mkey);
586  break;
587  case eWeakDeriv0:
588  WeakDerivMatrixOp_MatFree(0,inarray,outarray,mkey);
589  break;
590  case eWeakDeriv1:
591  WeakDerivMatrixOp_MatFree(1,inarray,outarray,mkey);
592  break;
593  case eWeakDeriv2:
594  WeakDerivMatrixOp_MatFree(2,inarray,outarray,mkey);
595  break;
597  WeakDirectionalDerivMatrixOp_MatFree(inarray,outarray,mkey);
598  break;
599  case eMassLevelCurvature:
600  MassLevelCurvatureMatrixOp_MatFree(inarray,outarray,mkey);
601  break;
603  LinearAdvectionDiffusionReactionMatrixOp_MatFree(inarray,outarray,mkey,false);
604  break;
607  break;
608  case eLaplacian:
609  LaplacianMatrixOp_MatFree(inarray,outarray,mkey);
610  break;
611  case eLaplacian00:
612  LaplacianMatrixOp_MatFree(0,0,inarray,outarray,mkey);
613  break;
614  case eLaplacian01:
615  LaplacianMatrixOp_MatFree(0,1,inarray,outarray,mkey);
616  break;
617  case eLaplacian02:
618  LaplacianMatrixOp_MatFree(0,2,inarray,outarray,mkey);
619  break;
620  case eLaplacian10:
621  LaplacianMatrixOp_MatFree(1,0,inarray,outarray,mkey);
622  break;
623  case eLaplacian11:
624  LaplacianMatrixOp_MatFree(1,1,inarray,outarray,mkey);
625  break;
626  case eLaplacian12:
627  LaplacianMatrixOp_MatFree(1,2,inarray,outarray,mkey);
628  break;
629  case eLaplacian20:
630  LaplacianMatrixOp_MatFree(2,0,inarray,outarray,mkey);
631  break;
632  case eLaplacian21:
633  LaplacianMatrixOp_MatFree(2,1,inarray,outarray,mkey);
634  break;
635  case eLaplacian22:
636  LaplacianMatrixOp_MatFree(2,2,inarray,outarray,mkey);
637  break;
638  case eHelmholtz:
639  HelmholtzMatrixOp_MatFree(inarray,outarray,mkey);
640  break;
641  default:
642  NEKERROR(ErrorUtil::efatal, "This matrix does not have an operator");
643  break;
644  }
645  }
646 
648  Array<OneD,NekDouble> &outarray,
649  const StdMatrixKey &mkey)
650  {
651  int nq = GetTotPoints();
652  Array<OneD, NekDouble> tmp(nq);
653 
654  v_BwdTrans(inarray,tmp);
655 
656  if(mkey.HasVarCoeff(eVarCoeffMass))
657  {
658  Vmath::Vmul(nq, mkey.GetVarCoeff(eVarCoeffMass), 1, tmp, 1, tmp, 1);
659  }
660 
661  v_IProductWRTBase(tmp, outarray);
662  }
663 
664  void StdExpansion::LaplacianMatrixOp_MatFree(const int k1, const int k2,
665  const Array<OneD, const NekDouble> &inarray,
666  Array<OneD,NekDouble> &outarray,
667  const StdMatrixKey &mkey)
668  {
669  ASSERTL1(k1 >= 0 && k1 < GetCoordim(),"invalid first argument");
670  ASSERTL1(k2 >= 0 && k2 < GetCoordim(),"invalid second argument");
671 
672  int nq = GetTotPoints();
673  Array<OneD, NekDouble> tmp(nq);
674  Array<OneD, NekDouble> dtmp(nq);
675  VarCoeffType varcoefftypes[3][3]
679  };
680 
681  ConstFactorType constcoefftypes[3][3]
685  };
686 
687  v_BwdTrans(inarray,tmp);
688  v_PhysDeriv(k2,tmp,dtmp);
689  if (mkey.GetNVarCoeff()&&
691  {
692  if (k1 == k2)
693  {
694  // By default, k1 == k2 has \sigma = 1 (diagonal entries)
695  if(mkey.HasVarCoeff(varcoefftypes[k1][k1]))
696  {
697  Vmath::Vmul(nq, mkey.GetVarCoeff(varcoefftypes[k1][k1]), 1, dtmp, 1, dtmp, 1);
698  }
699  v_IProductWRTDerivBase(k1, dtmp, outarray);
700  }
701  else
702  {
703  // By default, k1 != k2 has \sigma = 0 (off-diagonal entries)
704  if(mkey.HasVarCoeff(varcoefftypes[k1][k2]))
705  {
706  Vmath::Vmul(nq, mkey.GetVarCoeff(varcoefftypes[k1][k2]), 1, dtmp, 1, dtmp, 1);
707  v_IProductWRTDerivBase(k1, dtmp, outarray);
708  }
709  else
710  {
711  Vmath::Zero(GetNcoeffs(), outarray, 1);
712  }
713  }
714 
715  }
716  else if (mkey.ConstFactorExists(eFactorCoeffD00)&&
718  {
719  if (k1 == k2)
720  {
721  // By default, k1 == k2 has \sigma = 1 (diagonal entries)
722  if(mkey.ConstFactorExists(constcoefftypes[k1][k1]))
723  {
724  Vmath::Smul(nq, mkey.GetConstFactor(constcoefftypes[k1][k1]), dtmp, 1, dtmp, 1);
725  }
726  v_IProductWRTDerivBase(k1, dtmp, outarray);
727  }
728  else
729  {
730  // By default, k1 != k2 has \sigma = 0 (off-diagonal entries)
731  if(mkey.ConstFactorExists(constcoefftypes[k1][k2]))
732  {
733  Vmath::Smul(nq, mkey.GetConstFactor(constcoefftypes[k1][k2]), dtmp, 1, dtmp, 1);
734  v_IProductWRTDerivBase(k1, dtmp, outarray);
735  }
736  else
737  {
738  Vmath::Zero(GetNcoeffs(), outarray, 1);
739  }
740  }
741  }
742  else
743  {
744  // Multiply by svv tensor
746  {
747  Vmath::Vcopy(nq, dtmp, 1, tmp, 1);
748  SVVLaplacianFilter(dtmp,mkey);
749  Vmath::Vadd(nq, tmp, 1, dtmp, 1, dtmp, 1);
750  }
751  v_IProductWRTDerivBase(k1, dtmp, outarray);
752  }
753  }
754 
756  Array<OneD,NekDouble> &outarray,
757  const StdMatrixKey &mkey)
758  {
759  const int dim = GetCoordim();
760 
761  int i,j;
762 
764  Array<OneD,NekDouble> store2(m_ncoeffs,0.0);
765 
767  {
768  // just call diagonal matrix form of laplcian operator
769  for(i = 0; i < dim; ++i)
770  {
771  LaplacianMatrixOp(i,i,inarray,store,mkey);
772  Vmath::Vadd(m_ncoeffs, store, 1, store2, 1, store2, 1);
773  }
774  }
775  else
776  {
777  const MatrixType mtype[3][3]
781  StdMatrixKeySharedPtr mkeyij;
782 
783  for(i = 0; i < dim; i++)
784  {
785  for(j = 0; j < dim; j++)
786  {
787  mkeyij = MemoryManager<StdMatrixKey>::AllocateSharedPtr(mkey,mtype[i][j]);
788  LaplacianMatrixOp(i,j,inarray,store,*mkeyij);
789  Vmath::Vadd(m_ncoeffs, store, 1, store2, 1, store2, 1);
790  }
791  }
792  }
793 
794  Vmath::Vcopy(m_ncoeffs,store2.get(),1,outarray.get(),1);
795  }
796 
798  const Array<OneD, const NekDouble> &inarray,
799  Array<OneD,NekDouble> &outarray,
800  const StdMatrixKey &mkey)
801  {
803  int nq = GetTotPoints();
804 
805  v_BwdTrans(inarray,tmp);
806  v_PhysDeriv(k1,tmp,tmp);
807 
809  if(mkey.HasVarCoeff(keys[k1]))
810  {
811  Vmath::Vmul(nq, &(mkey.GetVarCoeff(keys[k1]))[0], 1, &tmp[0], 1, &tmp[0], 1);
812  }
813 
814  v_IProductWRTBase(tmp, outarray);
815  }
816 
818  const Array<OneD, const NekDouble> &inarray,
819  Array<OneD,NekDouble> &outarray,
820  const StdMatrixKey &mkey)
821  {
822  int nq = GetTotPoints();
823 
824  Array<OneD, NekDouble> tmp(nq), Dtmp(nq);
825  Array<OneD, NekDouble> Mtmp(nq), Mout(m_ncoeffs);
826 
827  v_BwdTrans(inarray,tmp);
829 
830  v_IProductWRTBase(Dtmp, outarray);
831 
832  // Compte M_{div tv}
833  Vmath::Vmul(nq, &(mkey.GetVarCoeff(eVarCoeffMFDiv))[0], 1,
834  &tmp[0], 1,
835  &Mtmp[0], 1);
836 
837  v_IProductWRTBase(Mtmp, Mout);
838 
839  // Add D_tv + M_{div tv}
840  Vmath::Vadd(m_ncoeffs, &Mout[0], 1,
841  &outarray[0], 1,
842  &outarray[0], 1);
843  }
844 
846  (const Array<OneD, const NekDouble> &inarray,
847  Array<OneD,NekDouble> &outarray,
848  const StdMatrixKey &mkey)
849  {
850  boost::ignore_unused(inarray, outarray, mkey);
851  }
852 
854  ( const Array<OneD, const NekDouble> &inarray,
855  Array<OneD,NekDouble> &outarray,
856  const StdMatrixKey &mkey,
857  bool addDiffusionTerm)
858  {
859 
860  int i;
861  int ndir = mkey.GetNVarCoeff(); // assume num.r consts corresponds to directions
862  ASSERTL0(ndir,"Must define at least one advection velocity");
863 
864  NekDouble lambda = mkey.GetConstFactor(eFactorLambda);
865  int totpts = GetTotPoints();
866  Array<OneD, NekDouble> tmp(3*totpts);
867  Array<OneD, NekDouble> tmp_deriv = tmp + totpts;
868  Array<OneD, NekDouble> tmp_adv = tmp_deriv + totpts;
869 
870 
871  ASSERTL1(ndir <= GetCoordim(),"Number of constants is larger than coordinate dimensions");
872 
873  v_BwdTrans(inarray,tmp);
874 
876 
877  //calculate u dx + v dy + ..
878  Vmath::Zero(totpts,tmp_adv,1);
879  for(i = 0; i < ndir; ++i)
880  {
881  v_PhysDeriv(i,tmp,tmp_deriv);
882  Vmath::Vvtvp(totpts,mkey.GetVarCoeff(varcoefftypes[i]),1,tmp_deriv,1,tmp_adv,1,tmp_adv,1);
883  }
884 
885  if(lambda) // add -lambda*u
886  {
887  Vmath::Svtvp(totpts,-lambda,tmp,1,tmp_adv,1,tmp_adv,1);
888  }
889 
890 
891  if(addDiffusionTerm)
892  {
894  StdMatrixKey mkeylap(eLaplacian,DetShapeType(),*this,
895  mkey.GetConstFactors(),
896  mkey.GetVarCoeffs(),
897  mkey.GetNodalPointsType());
898  LaplacianMatrixOp(inarray,lap,mkeylap);
899 
900  v_IProductWRTBase(tmp_adv, outarray);
901  // Lap v - u.grad v + lambda*u
902  // => (grad u, grad v) + u.grad v - lambda*u
903  Vmath::Vadd(m_ncoeffs,lap,1,outarray,1,outarray,1);
904  }
905  else
906  {
907  v_IProductWRTBase(tmp_adv, outarray);
908  }
909  }
910 
912  (const Array<OneD, const NekDouble> &inarray,
913  Array<OneD,NekDouble> &outarray,
914  const StdMatrixKey &mkey)
915  {
916  NekDouble lambda = mkey.GetConstFactor(eFactorLambda);
918  StdMatrixKey mkeymass(eMass,DetShapeType(),*this);
919  StdMatrixKey mkeylap(eLaplacian,DetShapeType(),*this,
920  mkey.GetConstFactors(),
921  mkey.GetVarCoeffs(),
922  mkey.GetNodalPointsType());
923 
924  MassMatrixOp(inarray,tmp,mkeymass);
925  LaplacianMatrixOp(inarray,outarray,mkeylap);
926 
927  Blas::Daxpy(m_ncoeffs, lambda, tmp, 1, outarray, 1);
928  }
929 
931  Array<OneD, NekDouble> &outarray)
932  {
933  int nq = GetTotPoints();
934  StdMatrixKey bwdtransmatkey(eBwdTrans,DetShapeType(),*this);
935  DNekMatSharedPtr bwdtransmat = GetStdMatrix(bwdtransmatkey);
936 
937  Blas::Dgemv('N',nq,m_ncoeffs,1.0,bwdtransmat->GetPtr().get(),
938  nq, inarray.get(), 1, 0.0, outarray.get(), 1);
939  }
940 
941  // VIRTUAL INLINE FUNCTIONS FROM HEADER FILE
943  const Array<OneD, const NekDouble> &physvals)
944  {
945  return v_StdPhysEvaluate(Lcoord,physvals);
946  }
947 
948  int StdExpansion::v_CalcNumberOfCoefficients(const std::vector<unsigned int> &nummodes, int &modes_offset)
949  {
950  boost::ignore_unused(nummodes, modes_offset);
951  NEKERROR(ErrorUtil::efatal, "This function is not defined for this class");
952  return 0;
953  }
954 
956  {
957  boost::ignore_unused(Fx, outarray);
958  NEKERROR(ErrorUtil::efatal, "This function is not valid for this class");
959  }
960 
962  {
963  boost::ignore_unused(Fx, Fy, outarray);
964  NEKERROR(ErrorUtil::efatal, "This function is not valid for this class");
965  }
966 
970  Array< OneD, NekDouble> &outarray)
971  {
972  boost::ignore_unused(Fx, Fy, Fz, outarray);
973  NEKERROR(ErrorUtil::efatal, "This function is not valid for this class");
974  }
975 
977  {
978  boost::ignore_unused(Fvec, outarray);
979  NEKERROR(ErrorUtil::efatal, "This function is not valid for this class");
980  }
981 
982 
984  (const LocalRegions::MatrixKey &mkey)
985  {
986  boost::ignore_unused(mkey);
987  NEKERROR(ErrorUtil::efatal, "This function is only valid for LocalRegions");
989  }
990 
992  (const LocalRegions::MatrixKey &mkey)
993  {
994  boost::ignore_unused(mkey);
995  NEKERROR(ErrorUtil::efatal, "This function is only valid for LocalRegions");
996  }
997 
1000  Array<OneD, NekDouble> &outarray)
1001  {
1002  boost::ignore_unused(dir, inarray, outarray);
1003  NEKERROR(ErrorUtil::efatal, "This function is not defined for this shape");
1004  }
1005 
1007  Array<OneD, NekDouble> &coeffs,
1009  {
1010  boost::ignore_unused(coeffs, dir);
1011  NEKERROR(ErrorUtil::efatal, "This function is not defined for this shape");
1012  }
1013 
1014 
1016  const Array<OneD, const NekDouble> &physvals)
1017 
1018  {
1019  boost::ignore_unused(Lcoord, physvals);
1020  NEKERROR(ErrorUtil::efatal, "This function is not defined for this shape");
1021  return 0;
1022  }
1023 
1025  {
1026  boost::ignore_unused(xi, eta);
1027  NEKERROR(ErrorUtil::efatal, "This function is not defined for this shape");
1028  }
1029 
1031  {
1032  boost::ignore_unused(eta, xi);
1033  NEKERROR(ErrorUtil::efatal, "This function is not defined for this shape");
1034  }
1035 
1037  {
1038  ASSERTL0(false, "This function is needs defining for this shape");
1039  return 0;
1040  }
1041 
1043  {
1044  ASSERTL0(false, "This function is needs defining for this shape");
1045  return 0;
1046  }
1047 
1049  {
1050  ASSERTL0(false, "This function is needs defining for this shape");
1051  return 0;
1052  }
1053 
1055  const int k) const
1056  {
1057  boost::ignore_unused(i, k);
1058  ASSERTL0(false, "This function is not valid or not defined");
1060  }
1061 
1062  int StdExpansion::v_GetTraceNumPoints(const int i) const
1063  {
1064  boost::ignore_unused(i);
1065  ASSERTL0(false, "This function is not valid or not defined");
1066  return 0;
1067  }
1068 
1069  int StdExpansion::v_GetTraceNcoeffs(const int i) const
1070  {
1071  boost::ignore_unused(i);
1072  ASSERTL0(false, "This function is not valid or not defined");
1073  return 0;
1074  }
1075 
1076  int StdExpansion::v_GetTraceIntNcoeffs(const int i) const
1077  {
1078  boost::ignore_unused(i);
1079  ASSERTL0(false, "This function is not valid or not defined");
1080  return 0;
1081  }
1082 
1084  {
1085  ASSERTL0(false, "This function is not valid or not defined");
1086  return 0;
1087  }
1088 
1090  {
1091  boost::ignore_unused(i, j);
1092  ASSERTL0(false, "This function is not valid or not defined");
1094  }
1095 
1097  {
1098  ASSERTL0(false, "This function is not valid or not defined");
1099 
1101  }
1102 
1104  {
1105  ASSERTL0(false, "This expansion does not have a shape type defined");
1107  }
1108 
1109  std::shared_ptr<StdExpansion>
1111  {
1112  ASSERTL0(false,"This method is not defined for this expansion");
1113  StdExpansionSharedPtr returnval;
1114  return returnval;
1115  }
1116 
1117  std::shared_ptr<StdExpansion>
1119  {
1120  ASSERTL0(false,"This method is not defined for this expansion");
1121  StdExpansionSharedPtr returnval;
1122  return returnval;
1123  }
1124 
1126  {
1127  ASSERTL0(false, "This function is not valid or not defined");
1128  return 0;
1129  }
1130 
1132  {
1133  ASSERTL0(false,"This function has not been defined for this expansion");
1134  return false;
1135  }
1136 
1137 
1139  {
1140  return false;
1141  }
1142 
1144  (const int dir,
1145  const Array<OneD, const NekDouble>& inarray,
1146  Array<OneD, NekDouble> &outarray)
1147  {
1148  boost::ignore_unused(dir, inarray, outarray);
1149  NEKERROR(ErrorUtil::efatal, "This method has not been defined");
1150  }
1151 
1152 
1153  /**
1154  *
1155  */
1157  const Array<OneD, const NekDouble>& direction,
1158  const Array<OneD, const NekDouble>& inarray,
1159  Array<OneD, NekDouble> &outarray)
1160  {
1161  boost::ignore_unused(direction, inarray, outarray);
1162  NEKERROR(ErrorUtil::efatal, "This method has not been defined");
1163  }
1164 
1165 
1166  /**
1167  *
1168  */
1170  (const Array<OneD, const NekDouble>& inarray,
1171  Array<OneD, NekDouble> &outarray)
1172  {
1173  boost::ignore_unused(inarray, outarray);
1174  NEKERROR(ErrorUtil::efatal, "This method has not been defined");
1175  }
1176 
1177 
1178  /**
1179  * @brief Integrates the specified function over the domain.
1180  * @see StdRegions#StdExpansion#Integral.
1181  */
1183  {
1184  boost::ignore_unused(inarray);
1185  NEKERROR(ErrorUtil::efatal, "This function is only valid for "
1186  "local expansions");
1187  return 0;
1188  }
1189 
1190  /**
1191  * @brief Calculate the derivative of the physical points
1192  * @see StdRegions#StdExpansion#PhysDeriv
1193  */
1195  Array<OneD, NekDouble> &out_d1,
1196  Array<OneD, NekDouble> &out_d2,
1197  Array<OneD, NekDouble> &out_d3)
1198  {
1199  boost::ignore_unused(inarray, out_d1, out_d2, out_d3);
1200  NEKERROR(ErrorUtil::efatal, "This function is only valid for "
1201  "local expansions");
1202  }
1203 
1205  Array<OneD, NekDouble> &out_ds)
1206  {
1207  boost::ignore_unused(inarray, out_ds);
1208  NEKERROR(ErrorUtil::efatal, "This function is only valid for "
1209  "local expansions");
1210  }
1212  Array<OneD, NekDouble>& out_dn)
1213  {
1214  boost::ignore_unused(inarray, out_dn);
1215  NEKERROR(ErrorUtil::efatal, "This function is only valid for "
1216  "local expansions");
1217  }
1218 
1219  /**
1220  * @brief Calculate the derivative of the physical points in a
1221  * given direction
1222  * @see StdRegions#StdExpansion#PhysDeriv
1223  */
1224  void StdExpansion::v_PhysDeriv(const int dir,
1225  const Array<OneD, const NekDouble>& inarray,
1226  Array<OneD, NekDouble> &out_d0)
1227 
1228  {
1229  boost::ignore_unused(dir, inarray, out_d0);
1230  NEKERROR(ErrorUtil::efatal, "This function is only valid for "
1231  "specific element types");
1232  }
1233 
1234  /**
1235  * @brief Physical derivative along a direction vector.
1236  * @see StdRegions#StdExpansion#PhysDirectionalDeriv
1237  */
1239  (const Array<OneD, const NekDouble>& inarray,
1240  const Array<OneD, const NekDouble>& direction,
1241  Array<OneD, NekDouble> &outarray)
1242  {
1243  boost::ignore_unused(inarray, direction, outarray);
1244  NEKERROR(ErrorUtil::efatal, "This function is only valid for "
1245  "specific element types");
1246  }
1247 
1249  Array<OneD, NekDouble> &out_d1,
1250  Array<OneD, NekDouble> &out_d2,
1251  Array<OneD, NekDouble> &out_d3)
1252  {
1253  boost::ignore_unused(inarray, out_d1, out_d2, out_d3);
1254  NEKERROR(ErrorUtil::efatal, "Method does not exist for this shape");
1255  }
1256 
1258  (const int dir,
1259  const Array<OneD, const NekDouble>& inarray,
1260  Array<OneD, NekDouble> &outarray)
1261  {
1262  boost::ignore_unused(dir, inarray, outarray);
1263  NEKERROR(ErrorUtil::efatal, "Method does not exist for this shape");
1264  }
1265 
1266 
1268  (const Array<OneD,
1269  const NekDouble>& coords,
1270  const Array<OneD, const NekDouble>& physvals)
1271  {
1272  boost::ignore_unused(coords, physvals);
1273  NEKERROR(ErrorUtil::efatal, "Method does not exist for this shape");
1274  return 0;
1275  }
1276 
1277 
1279  (const Array<OneD, DNekMatSharedPtr > & I,
1280  const Array<OneD, const NekDouble>& physvals)
1281  {
1282  boost::ignore_unused(I, physvals);
1283  NEKERROR(ErrorUtil::efatal, "Method does not exist for this shape");
1284  return 0;
1285  }
1286 
1288  {
1289  boost::ignore_unused(coords, mode);
1290  NEKERROR(ErrorUtil::efatal, "Method does not exist for this shape");
1291  return 0;
1292  }
1293 
1294  void StdExpansion::v_FillMode(const int mode, Array<OneD, NekDouble> &outarray)
1295  {
1296  boost::ignore_unused(mode, outarray);
1297  NEKERROR(ErrorUtil::efatal, "This function has not "
1298  "been defined for this shape");
1299  }
1300 
1302  {
1303  boost::ignore_unused(mkey);
1304  NEKERROR(ErrorUtil::efatal, "This function has not "
1305  "been defined for this element");
1306  DNekMatSharedPtr returnval;
1307  return returnval;
1308  }
1309 
1311  {
1312  boost::ignore_unused(mkey);
1313  NEKERROR(ErrorUtil::efatal, "This function has not "
1314  "been defined for this element");
1315  DNekMatSharedPtr returnval;
1316  return returnval;
1317  }
1318 
1320  Array<OneD, NekDouble> &coords_1,
1321  Array<OneD, NekDouble> &coords_2)
1322  {
1323  boost::ignore_unused(coords_0, coords_1, coords_2);
1324  NEKERROR(ErrorUtil::efatal, "Write coordinate definition method");
1325  }
1326 
1328  Array<OneD, NekDouble> &coord)
1329  {
1330  boost::ignore_unused(Lcoord, coord);
1331  NEKERROR(ErrorUtil::efatal, "Write coordinate definition method");
1332  }
1333 
1335  {
1336  NEKERROR(ErrorUtil::efatal, "Write method");
1337  return -1;
1338  }
1339 
1341  {
1342  boost::ignore_unused(outarray);
1343  NEKERROR(ErrorUtil::efatal,"Method does not exist for this shape" );
1344  }
1345 
1347  {
1348  boost::ignore_unused(outarray);
1349  NEKERROR(ErrorUtil::efatal,"Method does not exist for this shape" );
1350  }
1351 
1352  int StdExpansion::v_GetVertexMap(const int localVertexId,
1353  bool useCoeffPacking)
1354  {
1355  boost::ignore_unused(localVertexId, useCoeffPacking);
1356  NEKERROR(ErrorUtil::efatal,"Method does not exist for this shape" );
1357  return 0;
1358  }
1359 
1361  const int tid,
1362  Array<OneD, unsigned int> &maparray,
1363  Array<OneD, int> &signarray,
1364  Orientation traceOrient,
1365  int P, int Q)
1366  {
1367  boost::ignore_unused(tid,maparray,signarray,traceOrient,P,Q);
1368  NEKERROR(ErrorUtil::efatal,"Method does not exist for this shape" );
1369  }
1370 
1372  const int tid,
1373  Array<OneD, unsigned int> &maparray,
1374  Array<OneD, int> &signarray,
1375  const Orientation traceOrient)
1376  {
1377  boost::ignore_unused(tid,maparray,signarray,traceOrient);
1378  NEKERROR(ErrorUtil::efatal,"Method does not exist for this shape" );
1379  }
1380 
1382  (const int tid,
1383  int &numModes0,
1384  int &numModes1,
1385  Orientation traceOrient)
1386  {
1387  boost::ignore_unused(tid, traceOrient, numModes0, numModes1);
1388  NEKERROR(ErrorUtil::efatal,"Method does not exist for this shape" );
1389  }
1390 
1392  (const int vertex,
1393  const Array<OneD, const NekDouble> &inarray,
1394  NekDouble &outarray)
1395  {
1396  boost::ignore_unused(vertex, inarray, outarray);
1397  NEKERROR(ErrorUtil::efatal,"Method does not exist for "
1398  "this shape or library" );
1399  }
1400 
1402  const Array<OneD, const NekDouble> &inarray,
1403  Array<OneD, NekDouble> &outarray)
1404  {
1405  v_MultiplyByStdQuadratureMetric(inarray,outarray);
1406  }
1407 
1409  const Array<OneD, const NekDouble> &inarray,
1410  Array<OneD, NekDouble> &outarray)
1411  {
1412  boost::ignore_unused(inarray, outarray);
1414  "Method does not exist for this shape or library");
1415  }
1416 
1418  (const Array<OneD, const NekDouble>& inarray,
1419  Array<OneD, NekDouble> &outarray)
1420  {
1421  boost::ignore_unused(inarray, outarray);
1422  NEKERROR(ErrorUtil::efatal,"Method does not exist for this shape" );
1423  }
1424 
1426  (const Array<OneD, const NekDouble>& inarray,
1427  Array<OneD, NekDouble> &outarray,
1428  bool multiplybyweights)
1429  {
1430  boost::ignore_unused(inarray, outarray, multiplybyweights);
1431  NEKERROR(ErrorUtil::efatal,"Method does not exist for this shape" );
1432  }
1433 
1434  /**
1435  *
1436  */
1438  const Array<OneD, const NekDouble>& direction,
1439  const Array<OneD, const NekDouble>& inarray,
1440  Array<OneD, NekDouble> &outarray)
1441  {
1442  boost::ignore_unused(direction, inarray, outarray);
1444  "Method does not exist for this shape" );
1445  }
1446 
1448  (const int dir,
1449  const Array<OneD, const NekDouble>& inarray,
1450  Array<OneD, NekDouble> &outarray)
1451  {
1452  boost::ignore_unused(dir, inarray, outarray);
1453  NEKERROR(ErrorUtil::efatal,"Method does not exist for this shape" );
1454  }
1455 
1457  (const Array<OneD, const NekDouble> &inarray,
1458  Array<OneD,NekDouble> &outarray,
1459  const StdMatrixKey &mkey)
1460  {
1461  // If this function is not reimplemented on shape level, the function
1462  // below will be called
1463  MassMatrixOp_MatFree(inarray,outarray,mkey);
1464  }
1465 
1467  (const Array<OneD, const NekDouble> &inarray,
1468  Array<OneD,NekDouble> &outarray,
1469  const StdMatrixKey &mkey)
1470  {
1471  // If this function is not reimplemented on shape level, the function
1472  // below will be called
1473  LaplacianMatrixOp_MatFree(inarray,outarray,mkey);
1474  }
1475 
1476 
1478  const StdMatrixKey &mkey)
1479  {
1480  boost::ignore_unused(array, mkey);
1481  ASSERTL0(false, "This function is not defined in StdExpansion.");
1482  }
1483 
1485  Array<OneD, NekDouble> &array,
1486  const NekDouble alpha,
1487  const NekDouble exponent,
1488  const NekDouble cutoff)
1489  {
1490  boost::ignore_unused(array, alpha, exponent, cutoff);
1491  ASSERTL0(false, "This function is not defined in StdExpansion.");
1492  }
1493 
1495  (int numMin,
1496  const Array<OneD, const NekDouble> &inarray,
1497  Array<OneD, NekDouble> &outarray)
1498  {
1499  boost::ignore_unused(numMin, inarray, outarray);
1500  ASSERTL0(false, "This function is not defined in StdExpansion.");
1501  }
1502 
1504  (const int k1, const int k2,
1505  const Array<OneD, const NekDouble> &inarray,
1506  Array<OneD,NekDouble> &outarray,
1507  const StdMatrixKey &mkey)
1508  {
1509  // If this function is not reimplemented on shape level, the function
1510  // below will be called
1511  LaplacianMatrixOp_MatFree(k1,k2,inarray,outarray,mkey);
1512  }
1513 
1515  (const int i,
1516  const Array<OneD, const NekDouble> &inarray,
1517  Array<OneD,NekDouble> &outarray,
1518  const StdMatrixKey &mkey)
1519  {
1520  // If this function is not reimplemented on shape level, the function
1521  // below will be called
1522  WeakDerivMatrixOp_MatFree(i,inarray,outarray,mkey);
1523 
1524  }
1525 
1527  (const Array<OneD, const NekDouble> &inarray,
1528  Array<OneD,NekDouble> &outarray,
1529  const StdMatrixKey &mkey)
1530  {
1531  // If this function is not reimplemented on shape level, the function
1532  // below will be called
1533  WeakDirectionalDerivMatrixOp_MatFree(inarray,outarray,mkey);
1534 
1535  }
1536 
1538  (const Array<OneD, const NekDouble> &inarray,
1539  Array<OneD,NekDouble> &outarray,
1540  const StdMatrixKey &mkey)
1541  {
1542  // If this function is not reimplemented on shape level, the function
1543  // below will be called
1544  MassLevelCurvatureMatrixOp_MatFree(inarray,outarray,mkey);
1545  }
1546 
1548  (const Array<OneD, const NekDouble> &inarray,
1549  Array<OneD,NekDouble> &outarray,
1550  const StdMatrixKey &mkey, bool addDiffusionTerm)
1551  {
1552  // If this function is not reimplemented on shape level, the function
1553  // below will be called
1555  mkey,addDiffusionTerm);
1556 
1557  }
1558 
1560  const NekDouble> &inarray,
1561  Array<OneD,NekDouble> &outarray,
1562  const StdMatrixKey &mkey)
1563  {
1564  // If this function is not reimplemented on shape level, the function
1565  // below will be called
1566  HelmholtzMatrixOp_MatFree(inarray,outarray,mkey);
1567  }
1568 
1570  const NekDouble> &inarray,
1571  Array<OneD,NekDouble> &outarray,
1572  const StdMatrixKey &mkey)
1573  {
1574  // If this function is not reimplemented on shape level, the function
1575  // below will be called
1576  LaplacianMatrixOp_MatFree_GenericImpl(inarray,outarray,mkey);
1577  }
1578 
1580  const Array<OneD, const NekDouble> &inarray,
1581  Array<OneD, NekDouble> &outarray,
1583  {
1584  boost::ignore_unused(inarray, outarray, wsp);
1585  ASSERTL0(false, "Not implemented.");
1586  }
1587 
1589  Array<OneD,NekDouble> &outarray,
1590  const StdMatrixKey &mkey)
1591  {
1592  // If this function is not reimplemented on shape level, the function
1593  // below will be called
1594  HelmholtzMatrixOp_MatFree_GenericImpl(inarray,outarray,mkey);
1595  }
1596 
1599  const DNekScalMatSharedPtr & m_transformationmatrix)
1600  {
1601  boost::ignore_unused(m_transformationmatrix);
1602  NEKERROR(ErrorUtil::efatal, "This function is only valid for LocalRegions");
1603  return NullDNekMatSharedPtr;
1604  }
1605 
1607  const Array<OneD, const NekDouble> &inarray,
1608  Array<OneD, NekDouble> &outarray,
1609  int npset)
1610  {
1612  DNekMatSharedPtr intmat;
1613 
1614  int nqtot = GetTotPoints();
1615  int np = 0;
1616  if(npset == -1) // use values from basis num points()
1617  {
1618  int nqbase;
1619  for(int i = 0; i < m_base.size(); ++i)
1620  {
1621  nqbase = m_base[i]->GetNumPoints();
1622  np = std::max(np,nqbase);
1623  }
1624 
1625  StdMatrixKey Ikey(ePhysInterpToEquiSpaced, shape, *this);
1626  intmat = GetStdMatrix(Ikey);
1627  }
1628  else
1629  {
1630  np = npset;
1631 
1632  ConstFactorMap cmap;
1633  cmap[eFactorConst] = np;
1634  StdMatrixKey Ikey(ePhysInterpToEquiSpaced, shape, *this, cmap);
1635  intmat = GetStdMatrix(Ikey);
1636 
1637  }
1638 
1639  NekVector<NekDouble> in (nqtot,inarray,eWrapper);
1641  (shape,np,np,np),outarray,eWrapper);
1642  out = (*intmat) * in;
1643  }
1644 
1646  Array<OneD, int> &conn,
1647  bool standard)
1648  {
1649  boost::ignore_unused(conn, standard);
1650  ASSERTL0(false, "Not implemented.");
1651  }
1652 
1654  const Array<OneD, const NekDouble> &inarray,
1655  Array<OneD, NekDouble> &outarray)
1656  {
1658 
1659  // inarray has to be consistent with NumModes definition
1660  // There is also a check in GetStdMatrix to see if all
1661  // modes are of the same size
1662  ConstFactorMap cmap;
1663 
1664  cmap[eFactorConst] = m_base[0]->GetNumModes();
1665  StdMatrixKey Ikey(eEquiSpacedToCoeffs, shape, *this,cmap);
1666  DNekMatSharedPtr intmat = GetStdMatrix(Ikey);
1667 
1668  NekVector<NekDouble> in (m_ncoeffs, inarray, eWrapper);
1669  NekVector<NekDouble> out(m_ncoeffs, outarray,eWrapper);
1670  out = (*intmat) * in;
1671  }
1672 
1673  }//end namespace
1674 }//end namespace
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
Definition: ErrorUtil.hpp:209
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:250
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed to...
Definition: ErrorUtil.hpp:274
Describes the specification for a Basis.
Definition: Basis.h:50
Defines a specification for a set of points.
Definition: Points.h:60
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
The base class for all shapes.
Definition: StdExpansion.h:63
void GetBoundaryMap(Array< OneD, unsigned int > &outarray)
Definition: StdExpansion.h:687
virtual void v_LaplacianMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
virtual int v_GetVertexMap(int localVertexId, bool useCoeffPacking=false)
virtual void v_LocCollapsedToLocCoord(const Array< OneD, const NekDouble > &eta, Array< OneD, NekDouble > &xi)
virtual ~StdExpansion()
Destructor.
virtual void v_PhysDeriv_n(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_dn)
virtual void v_PhysDirectionalDeriv(const Array< OneD, const NekDouble > &inarray, const Array< OneD, const NekDouble > &direction, Array< OneD, NekDouble > &outarray)
Physical derivative along a direction vector.
StdExpansion()
Default Constructor.
int GetNcoeffs(void) const
This function returns the total number of coefficients used in the expansion.
Definition: StdExpansion.h:124
virtual void v_GetTraceToElementMap(const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation traceOrient=eForwards, int P=-1, int Q=-1)
int GetTotPoints() const
This function returns the total number of quadrature points used in the element.
Definition: StdExpansion.h:134
virtual void v_GetCoord(const Array< OneD, const NekDouble > &Lcoord, Array< OneD, NekDouble > &coord)
void GeneralMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void FillMode(const int mode, Array< OneD, NekDouble > &outarray)
This function fills the array outarray with the mode-th mode of the expansion.
Definition: StdExpansion.h:500
virtual NekDouble v_StdPhysEvaluate(const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
void PhysInterpToSimplexEquiSpaced(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, int npset=-1)
This function performs an interpolation from the physical space points provided at input into an arra...
void WeakDirectionalDerivMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
Definition: StdExpansion.h:813
void WeakDerivMatrixOp_MatFree(const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
DNekBlkMatSharedPtr CreateStdStaticCondMatrix(const StdMatrixKey &mkey)
Create the static condensation of a matrix when using a boundary interior decomposition.
void LaplacianMatrixOp_MatFree_GenericImpl(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
virtual void v_IProductWRTDirectionalDerivBase_SumFac(const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual int v_GetTraceNumPoints(const int i) const
void HelmholtzMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void BwdTrans_MatOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void MassLevelCurvatureMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
Definition: StdExpansion.h:820
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_0, Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2)
void LinearAdvectionDiffusionReactionMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey, bool addDiffusionTerm=true)
virtual std::shared_ptr< StdExpansion > v_GetStdExp(void) const
DNekMatSharedPtr GetStdMatrix(const StdMatrixKey &mkey)
Definition: StdExpansion.h:617
virtual bool v_IsBoundaryInteriorExpansion()
virtual void v_NormVectorIProductWRTBase(const Array< OneD, const NekDouble > &Fx, Array< OneD, NekDouble > &outarray)
virtual int v_GetTraceNcoeffs(const int i) const
virtual void v_GetSimplexEquiSpacedConnectivity(Array< OneD, int > &conn, bool standard=true)
virtual void v_SVVLaplacianFilter(Array< OneD, NekDouble > &array, const StdMatrixKey &mkey)
virtual std::shared_ptr< StdExpansion > v_GetLinStdExp(void) const
void WeakDerivMatrixOp(const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
Definition: StdExpansion.h:805
virtual void v_GetInteriorMap(Array< OneD, unsigned int > &outarray)
virtual void v_SetCoeffsToOrientation(StdRegions::Orientation dir, Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
NekDouble Linf(const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &sol=NullNekDouble1DArray)
Function to evaluate the discrete error where is given by the array sol.
void EquiSpacedToCoeffs(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function performs a projection/interpolation from the equispaced points sometimes used in post-p...
void MassMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
Definition: StdExpansion.h:762
virtual int v_GetTotalTraceIntNcoeffs() const
virtual void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
virtual void v_HelmholtzMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
virtual void v_WeakDirectionalDerivMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void BwdTrans_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual NekDouble v_PhysEvaluate(const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &physvals)
virtual DNekMatSharedPtr v_BuildInverseTransformationMatrix(const DNekScalMatSharedPtr &m_transformationmatrix)
NekDouble L2(const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &sol=NullNekDouble1DArray)
Function to evaluate the discrete error, where is given by the array sol.
virtual void v_GetVertexPhysVals(const int vertex, const Array< OneD, const NekDouble > &inarray, NekDouble &outarray)
virtual int v_GetShapeDimension() const
void IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual int v_GetTraceIntNcoeffs(const int i) const
DNekMatSharedPtr CreateGeneralMatrix(const StdMatrixKey &mkey)
this function generates the mass matrix
virtual int v_NumBndryCoeffs() const
virtual void v_MassLevelCurvatureMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
virtual void v_MultiplyByQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual LibUtilities::ShapeType v_DetShapeType() const
void LaplacianMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
Definition: StdExpansion.h:769
virtual void v_FillMode(const int mode, Array< OneD, NekDouble > &outarray)
void LaplacianMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
virtual void v_MultiplyByStdQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_ExponentialFilter(Array< OneD, NekDouble > &array, const NekDouble alpha, const NekDouble exponent, const NekDouble cutoff)
void MassLevelCurvatureMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
LibUtilities::ShapeType DetShapeType() const
This function returns the shape of the expansion domain.
Definition: StdExpansion.h:376
virtual void v_LaplacianMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
virtual void v_IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual DNekMatSharedPtr v_GenMatrix(const StdMatrixKey &mkey)
void GetInteriorMap(Array< OneD, unsigned int > &outarray)
Definition: StdExpansion.h:692
virtual DNekMatSharedPtr v_CreateStdMatrix(const StdMatrixKey &mkey)
virtual void v_BwdTrans_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual int v_NumDGBndryCoeffs() const
virtual void v_FwdTrans_BndConstrained(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_GetTraceNumModes(const int fid, int &numModes0, int &numModes1, Orientation traceOrient=eDir1FwdDir1_Dir2FwdDir2)
virtual void v_PhysDeriv_s(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_ds)
virtual void v_GetBoundaryMap(Array< OneD, unsigned int > &outarray)
void GenStdMatBwdDeriv(const int dir, DNekMatSharedPtr &mat)
virtual void v_MassMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
virtual const LibUtilities::PointsKey v_GetNodalPointsKey() const
virtual void v_WeakDerivMatrixOp(const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void LinearAdvectionDiffusionReactionMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey, bool addDiffusionTerm=true)
Definition: StdExpansion.h:827
void IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)
virtual void v_LocCoordToLocCollapsed(const Array< OneD, const NekDouble > &xi, Array< OneD, NekDouble > &eta)
virtual NekDouble v_PhysEvaluateBasis(const Array< OneD, const NekDouble > &coords, int mode)
virtual void v_GetTraceInteriorToElementMap(const int eid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, const Orientation traceOrient=eForwards)
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)=0
Calculates the inner product of a given function f with the different modes of the expansion.
virtual void v_LinearAdvectionDiffusionReactionMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey, bool addDiffusionTerm=true)
void HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
Definition: StdExpansion.h:843
virtual void v_ReduceOrderCoeffs(int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_DropLocStaticCondMatrix(const LocalRegions::MatrixKey &mkey)
void WeakDirectionalDerivMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
virtual void v_LaplacianMatrixOp_MatFree_Kernel(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp)
NekDouble H1(const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &sol=NullNekDouble1DArray)
Function to evaluate the discrete error, where is given by the array sol.
virtual int v_CalcNumberOfCoefficients(const std::vector< unsigned int > &nummodes, int &modes_offset)
virtual NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray)
Integrates the specified function over the domain.
void SVVLaplacianFilter(Array< OneD, NekDouble > &array, const StdMatrixKey &mkey)
Definition: StdExpansion.h:783
void HelmholtzMatrixOp_MatFree_GenericImpl(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
virtual void v_BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)=0
virtual LibUtilities::PointsKey v_GetTracePointsKey(const int i, const int j) const
Array< OneD, LibUtilities::BasisSharedPtr > m_base
virtual void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)
virtual void v_IProductWRTDirectionalDerivBase(const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_PhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2, Array< OneD, NekDouble > &out_d3)
Calculate the derivative of the physical points.
virtual const LibUtilities::BasisKey v_GetTraceBasisKey(const int i, const int k) const
virtual void v_StdPhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2, Array< OneD, NekDouble > &out_d3)
NekDouble StdPhysEvaluate(const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
void MassMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void GeneralMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
virtual DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix(const LocalRegions::MatrixKey &mkey)
const ConstFactorMap & GetConstFactors() const
Definition: StdMatrixKey.h:135
LibUtilities::ShapeType GetShapeType() const
Definition: StdMatrixKey.h:86
const VarCoeffMap & GetVarCoeffs() const
Definition: StdMatrixKey.h:161
MatrixType GetMatrixType() const
Definition: StdMatrixKey.h:81
const Array< OneD, const NekDouble > & GetVarCoeff(const StdRegions::VarCoeffType &coeff) const
Definition: StdMatrixKey.h:145
bool HasVarCoeff(const StdRegions::VarCoeffType &coeff) const
Definition: StdMatrixKey.h:166
LibUtilities::PointsType GetNodalPointsType() const
Definition: StdMatrixKey.h:91
NekDouble GetConstFactor(const ConstFactorType &factor) const
Definition: StdMatrixKey.h:121
bool ConstFactorExists(const ConstFactorType &factor) const
Definition: StdMatrixKey.h:130
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 = A x where A[m x n].
Definition: Blas.hpp:265
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
BasisManagerT & BasisManager(void)
static const BasisKey NullBasisKey(eNoBasisType, 0, NullPointsKey)
Defines a null basis with no type or points.
int GetNumberOfCoefficients(ShapeType shape, std::vector< unsigned int > &modes, int offset)
Definition: ShapeType.hpp:313
static const PointsKey NullPointsKey(0, eNoPointsType)
static const NekDouble kNekSqrtTol
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
std::map< ConstFactorType, NekDouble > ConstFactorMap
Definition: StdRegions.hpp:314
static ConstFactorMap NullConstFactorMap
Definition: StdRegions.hpp:315
static VarCoeffMap NullVarCoeffMap
Definition: StdRegions.hpp:273
std::shared_ptr< StdMatrixKey > StdMatrixKeySharedPtr
Definition: StdMatrixKey.h:189
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:1
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
std::shared_ptr< DNekBlkMat > DNekBlkMatSharedPtr
Definition: NekTypeDefs.hpp:71
static DNekScalBlkMatSharedPtr NullDNekScalBlkMatSharedPtr
Definition: NekTypeDefs.hpp:80
std::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
Definition: NekTypeDefs.hpp:73
static DNekMatSharedPtr NullDNekMatSharedPtr
Definition: NekTypeDefs.hpp:78
static Array< OneD, NekDouble > NullNekDouble1DArray
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:69
double NekDouble
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.cpp:192
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
Definition: Vmath.cpp:565
void Vabs(int n, const T *x, const int incx, T *y, const int incy)
vabs: y = |x|
Definition: Vmath.cpp:493
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
Definition: Vmath.cpp:513
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
Definition: Vmath.cpp:322
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.cpp:225
void Zero(int n, T *x, const int incx)
Zero vector.
Definition: Vmath.cpp:436
T Vamax(int n, const T *x, const int incx)
Return the maximum absolute element in x called vamax to avoid conflict with max.
Definition: Vmath.cpp:942
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1199
void Vsub(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Subtract vector z = x-y.
Definition: Vmath.cpp:372
P
Definition: main.py:133
scalarT< T > sqrt(scalarT< T > in)
Definition: scalar.hpp:267