Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 // License for the specific language governing rights and limitations under
14 // Permission is hereby granted, free of charge, to any person obtaining a
15 // copy of this software and associated documentation files (the "Software"),
16 // to deal in the Software without restriction, including without limitation
17 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
18 // and/or sell copies of the Software, and to permit persons to whom the
19 // Software is furnished to do so, subject to the following conditions:
20 //
21 // The above copyright notice and this permission notice shall be included
22 // in all copies or substantial portions of the Software.
23 //
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
30 // DEALINGS IN THE SOFTWARE.
31 //
32 // Description: Definition of methods in class StdExpansion which is
33 // the base class to all expansion shapes
34 //
35 ///////////////////////////////////////////////////////////////////////////////
36 
38 #include <LibUtilities/Foundations/ManagerAccess.h> // for BasisManager, etc
39 
40 namespace Nektar
41 {
42  namespace StdRegions
43  {
45  m_elmt_id(0),
46  m_ncoeffs(0)
47  {
48  }
49 
50  StdExpansion::StdExpansion(const int numcoeffs, const int numbases,
51  const LibUtilities::BasisKey &Ba,
52  const LibUtilities::BasisKey &Bb,
53  const LibUtilities::BasisKey &Bc):
54  m_base(numbases),
55  m_elmt_id(0),
56  m_ncoeffs(numcoeffs),
57  m_stdMatrixManager(
58  boost::bind(&StdExpansion::CreateStdMatrix, this, _1),
59  std::string("StdExpansionStdMatrix")),
60  m_stdStaticCondMatrixManager(
61  boost::bind(&StdExpansion::CreateStdStaticCondMatrix, this, _1),
62  std::string("StdExpansionStdStaticCondMatrix")),
63  m_IndexMapManager(
64  boost::bind(&StdExpansion::CreateIndexMap,this, _1),
65  std::string("StdExpansionIndexMap"))
66  {
67  switch(m_base.num_elements())
68  {
69  case 3:
71  "NULL Basis attempting to be used.");
73 
74  case 2:
76  "NULL Basis attempting to be used.");
77 
79  case 1:
81  "NULL Basis attempting to be used.");
83  break;
84  default:
85  break;
86 // ASSERTL0(false, "numbases incorrectly specified");
87  };
88 
89  } //end constructor
90 
91 
93  m_base(T.m_base),
94  m_elmt_id(T.m_elmt_id),
95  m_ncoeffs(T.m_ncoeffs),
96  m_stdMatrixManager(T.m_stdMatrixManager),
97  m_stdStaticCondMatrixManager(T.m_stdStaticCondMatrixManager),
98  m_IndexMapManager(T.m_IndexMapManager)
99  {
100  }
101 
103  {
104  }
105 
107  const Array<OneD, const NekDouble>& sol)
108  {
109  NekDouble val;
110  int ntot = GetTotPoints();
111  Array<OneD, NekDouble> wsp(ntot);
112 
113  if(sol == NullNekDouble1DArray)
114  {
115  Vmath::Vabs(ntot, phys, 1, wsp, 1);
116  }
117  else
118  {
119  Vmath::Vsub(ntot, sol, 1, phys, 1, wsp, 1);
120  Vmath::Vabs(ntot, wsp, 1, wsp, 1);
121  }
122 
123  val = Vmath::Vamax(ntot, wsp, 1);
124 
125  return val;
126  }
127 
129  const Array<OneD, const NekDouble>& sol)
130  {
131  NekDouble val;
132  int ntot = GetTotPoints();
133  Array<OneD, NekDouble> wsp(ntot);
134 
135  if (sol.num_elements() == 0)
136  {
137  Vmath::Vmul(ntot, phys, 1, phys, 1, wsp, 1);
138  }
139  else
140  {
141  Vmath::Vsub(ntot, sol, 1, phys, 1, wsp, 1);
142  Vmath::Vmul(ntot, wsp, 1, wsp, 1, wsp, 1);
143  }
144 
145  val = v_Integral(wsp);
146 
147  // if val too small, sqrt returns nan.
149  {
150  return 0.0;
151  }
152  else
153  {
154  return sqrt(val);
155  }
156  }
157 
159  const Array<OneD, const NekDouble>& sol)
160  {
161  int i;
162  NekDouble val;
163  int ntot = GetTotPoints();
164  int coordim = v_GetCoordim();
165  Array<OneD, NekDouble> wsp(3*ntot);
166  Array<OneD, NekDouble> wsp_deriv = wsp + ntot;
167  Array<OneD, NekDouble> sum = wsp_deriv + ntot;
168 
169  if(sol == NullNekDouble1DArray)
170  {
171  Vmath::Vcopy(ntot,phys, 1, wsp, 1);
172  Vmath::Vmul(ntot, phys, 1, phys, 1, sum, 1);
173  }
174  else
175  {
176  Vmath::Vsub(ntot, sol, 1, phys, 1, wsp, 1);
177  Vmath::Vmul(ntot, wsp, 1, wsp, 1, sum, 1);
178  }
179 
180 
181  for(i = 0; i < coordim; ++i)
182  {
183  v_PhysDeriv(i,wsp,wsp_deriv);
184  Vmath::Vvtvp(ntot,wsp_deriv,1,wsp_deriv,1,sum,1,sum,1);
185  }
186 
187  val = sqrt(v_Integral(sum));
188 
189  return val;
190  }
191 
192 
194  {
195  DNekBlkMatSharedPtr returnval;
196 
197  DNekMatSharedPtr mat = GetStdMatrix(mkey);
198  int nbdry = NumBndryCoeffs(); // also checks to see if this is a boundary interior decomposed expansion
199  int nint = m_ncoeffs - nbdry;
204 
205  int i,j;
206 
207  Array<OneD,unsigned int> bmap(nbdry);
208  Array<OneD,unsigned int> imap(nint);
209  GetBoundaryMap(bmap);
210  GetInteriorMap(imap);
211 
212  for(i = 0; i < nbdry; ++i)
213  {
214  for(j = 0; j < nbdry; ++j)
215  {
216  (*A)(i,j) = (*mat)(bmap[i],bmap[j]);
217  }
218 
219  for(j = 0; j < nint; ++j)
220  {
221  (*B)(i,j) = (*mat)(bmap[i],imap[j]);
222  }
223  }
224 
225  for(i = 0; i < nint; ++i)
226  {
227  for(j = 0; j < nbdry; ++j)
228  {
229  (*C)(i,j) = (*mat)(imap[i],bmap[j]);
230  }
231 
232  for(j = 0; j < nint; ++j)
233  {
234  (*D)(i,j) = (*mat)(imap[i],imap[j]);
235  }
236  }
237 
238  // Calculate static condensed system
239  if(nint)
240  {
241  D->Invert();
242  (*B) = (*B)*(*D);
243  (*A) = (*A) - (*B)*(*C);
244  }
245 
246  // set up block matrix system
247  Array<OneD, unsigned int> exp_size(2);
248  exp_size[0] = nbdry;
249  exp_size[1] = nint;
250  returnval = MemoryManager<DNekBlkMat>::AllocateSharedPtr(exp_size,exp_size);
251 
252  returnval->SetBlock(0,0,A);
253  returnval->SetBlock(0,1,B);
254  returnval->SetBlock(1,0,C);
255  returnval->SetBlock(1,1,D);
256 
257  return returnval;
258  }
259 
261  {
262  IndexMapValuesSharedPtr returnval;
263 
264  IndexMapType itype = ikey.GetIndexMapType();
265 
266  int entity = ikey.GetIndexEntity();
267 
268  Orientation orient = ikey.GetIndexOrientation();
269 
272 
273  switch(itype)
274  {
275  case eEdgeToElement:
276  {
277  v_GetEdgeToElementMap(entity,orient,map,sign);
278  }
279  break;
280  case eFaceToElement:
281  {
282  v_GetFaceToElementMap(entity,orient,map,sign);
283  }
284  break;
285  case eEdgeInterior:
286  {
287  v_GetEdgeInteriorMap(entity,orient,map,sign);
288  }
289  break;
290  case eFaceInterior:
291  {
292  v_GetFaceInteriorMap(entity,orient,map,sign);
293  }
294  break;
295  case eBoundary:
296  {
297  ASSERTL0(false,"Boundary Index Map not implemented yet.");
298  }
299  break;
300  case eVertex:
301  {
302  ASSERTL0(false,"Vertex Index Map not implemented yet.");
303  }
304  break;
305  default:
306  {
307  ASSERTL0(false,"The Index Map you are requiring is not between the possible options.");
308  }
309  }
310 
311  returnval = MemoryManager<IndexMapValues>::AllocateSharedPtr(map.num_elements());
312 
313  for(int i = 0; i < map.num_elements(); i++)
314  {
315  (*returnval)[i].index = map[i];
316  (*returnval)[i].sign = sign[i];
317  }
318 
319  return returnval;
320  }
321 
323  {
324  int i;
325  DNekMatSharedPtr returnval;
326 
327  switch(mkey.GetMatrixType())
328  {
329  case eInvMass:
330  {
332  DNekMatSharedPtr mmat = GetStdMatrix(masskey);
333 
334  returnval = MemoryManager<DNekMat>::AllocateSharedPtr(*mmat); //Populate standard mass matrix.
335  returnval->Invert();
336  }
337  break;
338  case eInvNBasisTrans:
339  {
341  DNekMatSharedPtr tmpmat = GetStdMatrix(tmpkey);
342  returnval = MemoryManager<DNekMat>::AllocateSharedPtr(*tmpmat); //Populate matrix.
343  returnval->Invert();
344  }
345  break;
346  case eBwdTrans:
347  {
348  int nq = GetTotPoints();
350  Array<OneD, NekDouble> tmpout(nq);
351 
353 
354  for(int i=0; i<m_ncoeffs; ++i)
355  {
356  Vmath::Zero(m_ncoeffs, tmpin, 1);
357  tmpin[i] = 1.0;
358 
359  BwdTrans_SumFac(tmpin,tmpout);
360 
361  Vmath::Vcopy(nq,tmpout.get(),1,
362  returnval->GetRawPtr()+i*nq,1);
363  }
364  }
365  break;
366  case eIProductWRTBase:
367  {
368  int nq = GetTotPoints();
369  Array<OneD, NekDouble> tmpin(nq);
371 
373 
374  for(i=0; i < nq; ++i)
375  {
376  Vmath::Zero(nq, tmpin, 1);
377  tmpin[i] = 1.0;
378 
379  IProductWRTBase_SumFac(tmpin,tmpout);
380 
381  Vmath::Vcopy(m_ncoeffs,tmpout.get(),1,
382  returnval->GetRawPtr()+i*m_ncoeffs,1);
383  }
384  }
385  break;
387  {
388  int nq = GetTotPoints();
389  Array<OneD, NekDouble> tmpin(nq);
391 
393 
394  for(i=0; i < nq; ++i)
395  {
396  Vmath::Zero(nq, tmpin, 1);
397  tmpin[i] = 1.0;
398 
399  IProductWRTDerivBase_SumFac(0,tmpin,tmpout);
400 
401  Vmath::Vcopy(m_ncoeffs,tmpout.get(),1,
402  returnval->GetRawPtr()+i*m_ncoeffs,1);
403  }
404  }
405  break;
407  {
408  int nq = GetTotPoints();
409  Array<OneD, NekDouble> tmpin(nq);
411 
413 
414  for(i=0; i < nq; ++i)
415  {
416  Vmath::Zero(nq, tmpin, 1);
417  tmpin[i] = 1.0;
418 
419  IProductWRTDerivBase_SumFac(1,tmpin,tmpout);
420 
421  Vmath::Vcopy(m_ncoeffs,tmpout.get(),1,
422  returnval->GetRawPtr()+i*m_ncoeffs,1);
423  }
424  }
425  break;
427  {
428  int nq = GetTotPoints();
429  Array<OneD, NekDouble> tmpin(nq);
431 
433 
434  for(i=0; i < nq; ++i)
435  {
436  Vmath::Zero(nq, tmpin, 1);
437  tmpin[i] = 1.0;
438 
439  IProductWRTDerivBase_SumFac(2,tmpin,tmpout);
440 
441  Vmath::Vcopy(m_ncoeffs,tmpout.get(),1,
442  returnval->GetRawPtr()+i*m_ncoeffs,1);
443  }
444  }
445  break;
446  case eEquiSpacedToCoeffs:
447  {
448  // check to see if equispaced basis
449  int nummodes = m_base[0]->GetNumModes();
450  bool equispaced = true;
451  for(int i = 1; i < m_base.num_elements(); ++i)
452  {
453  if(m_base[i]->GetNumModes() != nummodes)
454  {
455  equispaced = false;
456  }
457  }
458 
459  ASSERTL0(equispaced,
460  "Currently need to have same num modes in all "
461  "directionmodes to use EquiSpacedToCoeff method");
462 
463  int ntot = GetTotPoints();
464  Array<OneD, NekDouble> qmode(ntot);
466 
469  for(int i = 0; i < m_ncoeffs; ++i)
470  {
471  // Get mode at quadrature points
472  FillMode(i,qmode);
473 
474  // interpolate to equi spaced
475  PhysInterpToSimplexEquiSpaced(qmode,emode,nummodes);
476 
477  // fill matrix
478  Vmath::Vcopy(m_ncoeffs, &emode[0], 1,
479  returnval->GetRawPtr() + i*m_ncoeffs, 1);
480  }
481  // invert matrix
482  returnval->Invert();
483 
484  }
485  break;
486  case eMass:
487  case eHelmholtz:
488  case eLaplacian:
489  case eLaplacian00:
490  case eLaplacian01:
491  case eLaplacian02:
492  case eLaplacian11:
493  case eLaplacian12:
494  case eLaplacian22:
495  case eWeakDeriv0:
496  case eWeakDeriv1:
497  case eWeakDeriv2:
499  case eMassLevelCurvature:
502  {
505  DNekMat &Mat = *returnval;
506 
507  for(i=0; i < m_ncoeffs; ++i)
508  {
509  Vmath::Zero(m_ncoeffs, tmp, 1);
510  tmp[i] = 1.0;
511 
512  GeneralMatrixOp_MatFree(tmp,tmp,mkey);
513 
514  Vmath::Vcopy(m_ncoeffs,&tmp[0],1,
515  &(Mat.GetPtr())[0]+i*m_ncoeffs,1);
516  }
517  }
518  break;
519  default:
520  {
521  NEKERROR(ErrorUtil::efatal, "This type of matrix can not be created using a general approach");
522  }
523  break;
524  }
525 
526  return returnval;
527  }
528 
530  Array<OneD,NekDouble> &outarray,
531  const StdMatrixKey &mkey)
532  {
533  switch(mkey.GetMatrixType())
534  {
535  case eMass:
536  MassMatrixOp(inarray,outarray,mkey);
537  break;
538  case eWeakDeriv0:
539  WeakDerivMatrixOp(0,inarray,outarray,mkey);
540  break;
541  case eWeakDeriv1:
542  WeakDerivMatrixOp(1,inarray,outarray,mkey);
543  break;
544  case eWeakDeriv2:
545  WeakDerivMatrixOp(2,inarray,outarray,mkey);
546  break;
548  WeakDirectionalDerivMatrixOp(inarray,outarray,mkey);
549  break;
550  case eMassLevelCurvature:
551  MassLevelCurvatureMatrixOp(inarray,outarray,mkey);
552  break;
554  LinearAdvectionDiffusionReactionMatrixOp(inarray,outarray,mkey,false);
555  break;
557  LinearAdvectionDiffusionReactionMatrixOp(inarray,outarray,mkey);
558  break;
559  case eLaplacian:
560  LaplacianMatrixOp(inarray,outarray,mkey);
561  break;
562  case eLaplacian00:
563  LaplacianMatrixOp(0,0,inarray,outarray,mkey);
564  break;
565  case eLaplacian01:
566  LaplacianMatrixOp(0,1,inarray,outarray,mkey);
567  break;
568  case eLaplacian02:
569  LaplacianMatrixOp(0,2,inarray,outarray,mkey);
570  break;
571  case eLaplacian10:
572  LaplacianMatrixOp(1,0,inarray,outarray,mkey);
573  break;
574  case eLaplacian11:
575  LaplacianMatrixOp(1,1,inarray,outarray,mkey);
576  break;
577  case eLaplacian12:
578  LaplacianMatrixOp(1,2,inarray,outarray,mkey);
579  break;
580  case eLaplacian20:
581  LaplacianMatrixOp(2,0,inarray,outarray,mkey);
582  break;
583  case eLaplacian21:
584  LaplacianMatrixOp(2,1,inarray,outarray,mkey);
585  break;
586  case eLaplacian22:
587  LaplacianMatrixOp(2,2,inarray,outarray,mkey);
588  break;
589  case eHelmholtz:
590  HelmholtzMatrixOp(inarray,outarray,mkey);
591  break;
592  default:
593  NEKERROR(ErrorUtil::efatal, "This matrix does not have an operator");
594  break;
595  }
596  }
597 
599  Array<OneD,NekDouble> &outarray,
600  const StdMatrixKey &mkey)
601  {
602  switch(mkey.GetMatrixType())
603  {
604  case eMass:
605  MassMatrixOp_MatFree(inarray,outarray,mkey);
606  break;
607  case eWeakDeriv0:
608  WeakDerivMatrixOp_MatFree(0,inarray,outarray,mkey);
609  break;
610  case eWeakDeriv1:
611  WeakDerivMatrixOp_MatFree(1,inarray,outarray,mkey);
612  break;
613  case eWeakDeriv2:
614  WeakDerivMatrixOp_MatFree(2,inarray,outarray,mkey);
615  break;
617  WeakDirectionalDerivMatrixOp_MatFree(inarray,outarray,mkey);
618  break;
619  case eMassLevelCurvature:
620  MassLevelCurvatureMatrixOp_MatFree(inarray,outarray,mkey);
621  break;
623  LinearAdvectionDiffusionReactionMatrixOp_MatFree(inarray,outarray,mkey,false);
624  break;
627  break;
628  case eLaplacian:
629  LaplacianMatrixOp_MatFree(inarray,outarray,mkey);
630  break;
631  case eLaplacian00:
632  LaplacianMatrixOp_MatFree(0,0,inarray,outarray,mkey);
633  break;
634  case eLaplacian01:
635  LaplacianMatrixOp_MatFree(0,1,inarray,outarray,mkey);
636  break;
637  case eLaplacian02:
638  LaplacianMatrixOp_MatFree(0,2,inarray,outarray,mkey);
639  break;
640  case eLaplacian10:
641  LaplacianMatrixOp_MatFree(1,0,inarray,outarray,mkey);
642  break;
643  case eLaplacian11:
644  LaplacianMatrixOp_MatFree(1,1,inarray,outarray,mkey);
645  break;
646  case eLaplacian12:
647  LaplacianMatrixOp_MatFree(1,2,inarray,outarray,mkey);
648  break;
649  case eLaplacian20:
650  LaplacianMatrixOp_MatFree(2,0,inarray,outarray,mkey);
651  break;
652  case eLaplacian21:
653  LaplacianMatrixOp_MatFree(2,1,inarray,outarray,mkey);
654  break;
655  case eLaplacian22:
656  LaplacianMatrixOp_MatFree(2,2,inarray,outarray,mkey);
657  break;
658  case eHelmholtz:
659  HelmholtzMatrixOp_MatFree(inarray,outarray,mkey);
660  break;
661  default:
662  NEKERROR(ErrorUtil::efatal, "This matrix does not have an operator");
663  break;
664  }
665  }
666 
668  Array<OneD,NekDouble> &outarray,
669  const StdMatrixKey &mkey)
670  {
671  int nq = GetTotPoints();
672  Array<OneD, NekDouble> tmp(nq);
673 
674  v_BwdTrans(inarray,tmp);
675 
676  if(mkey.HasVarCoeff(eVarCoeffMass))
677  {
678  Vmath::Vmul(nq, mkey.GetVarCoeff(eVarCoeffMass), 1, tmp, 1, tmp, 1);
679  }
680 
681  v_IProductWRTBase(tmp, outarray);
682  }
683 
684  void StdExpansion::LaplacianMatrixOp_MatFree(const int k1, const int k2,
685  const Array<OneD, const NekDouble> &inarray,
686  Array<OneD,NekDouble> &outarray,
687  const StdMatrixKey &mkey)
688  {
689  ASSERTL1(k1 >= 0 && k1 < GetCoordim(),"invalid first argument");
690  ASSERTL1(k2 >= 0 && k2 < GetCoordim(),"invalid second argument");
691 
692  int nq = GetTotPoints();
693  Array<OneD, NekDouble> tmp(nq);
694  Array<OneD, NekDouble> dtmp(nq);
695  VarCoeffType varcoefftypes[3][3]
699  };
700 
701  v_BwdTrans(inarray,tmp);
702  v_PhysDeriv(k2,tmp,dtmp);
703  if (mkey.GetNVarCoeff()&&
705  {
706  if (k1 == k2)
707  {
708  // By default, k1 == k2 has \sigma = 1 (diagonal entries)
709  if(mkey.HasVarCoeff(varcoefftypes[k1][k1]))
710  {
711  Vmath::Vmul(nq, mkey.GetVarCoeff(varcoefftypes[k1][k1]), 1, dtmp, 1, dtmp, 1);
712  }
713  v_IProductWRTDerivBase(k1, dtmp, outarray);
714  }
715  else
716  {
717  // By default, k1 != k2 has \sigma = 0 (off-diagonal entries)
718  if(mkey.HasVarCoeff(varcoefftypes[k1][k2]))
719  {
720  Vmath::Vmul(nq, mkey.GetVarCoeff(varcoefftypes[k1][k2]), 1, dtmp, 1, dtmp, 1);
721  v_IProductWRTDerivBase(k1, dtmp, outarray);
722  }
723  else
724  {
725  Vmath::Zero(GetNcoeffs(), outarray, 1);
726  }
727  }
728  }
729  else
730  {
731  // Multiply by svv tensor
733  {
734  Vmath::Vcopy(nq, dtmp, 1, tmp, 1);
735  SVVLaplacianFilter(dtmp,mkey);
736  Vmath::Vadd(nq, tmp, 1, dtmp, 1, dtmp, 1);
737  }
738  v_IProductWRTDerivBase(k1, dtmp, outarray);
739  }
740  }
741 
743  Array<OneD,NekDouble> &outarray,
744  const StdMatrixKey &mkey)
745  {
746  const int dim = GetCoordim();
747 
748  int i,j;
749 
751  Array<OneD,NekDouble> store2(m_ncoeffs,0.0);
752 
753  if(mkey.GetNVarCoeff() == 0||mkey.ConstFactorExists(eFactorSVVDiffCoeff))
754  {
755  // just call diagonal matrix form of laplcian operator
756  for(i = 0; i < dim; ++i)
757  {
758  LaplacianMatrixOp(i,i,inarray,store,mkey);
759  Vmath::Vadd(m_ncoeffs, store, 1, store2, 1, store2, 1);
760  }
761  }
762  else
763  {
764  const MatrixType mtype[3][3]
768  StdMatrixKeySharedPtr mkeyij;
769 
770  for(i = 0; i < dim; i++)
771  {
772  for(j = 0; j < dim; j++)
773  {
774  mkeyij = MemoryManager<StdMatrixKey>::AllocateSharedPtr(mkey,mtype[i][j]);
775  LaplacianMatrixOp(i,j,inarray,store,*mkeyij);
776  Vmath::Vadd(m_ncoeffs, store, 1, store2, 1, store2, 1);
777  }
778  }
779  }
780 
781  Vmath::Vcopy(m_ncoeffs,store2.get(),1,outarray.get(),1);
782  }
783 
785  const Array<OneD, const NekDouble> &inarray,
786  Array<OneD,NekDouble> &outarray,
787  const StdMatrixKey &mkey)
788  {
790  int nq = GetTotPoints();
791 
792  v_BwdTrans(inarray,tmp);
793  v_PhysDeriv(k1,tmp,tmp);
794 
796  if(mkey.HasVarCoeff(keys[k1]))
797  {
798  Vmath::Vmul(nq, &(mkey.GetVarCoeff(keys[k1]))[0], 1, &tmp[0], 1, &tmp[0], 1);
799  }
800 
801  v_IProductWRTBase(tmp, outarray);
802  }
803 
805  Array<OneD,NekDouble> &outarray,
806  const StdMatrixKey &mkey)
807  {
808  int nq = GetTotPoints();
809  // int varsize = ((mkey.GetVariableCoefficient(0)).num_elements())/dim;
810  Array<OneD, NekDouble> tmp(nq);
811 
812  v_BwdTrans(inarray,tmp);
813  // For Deformed mesh ==============
814  // if (varsize==nq)
815  // {
816  // v_PhysDirectionalDeriv(tmp,mkey.GetVariableCoefficient(0),tmp);
817  // }
818  //
819  // // For Regular mesh ==========
820  // else
821  // {
822  // ASSERTL0(false, "Wrong route");
823  // }
824 
825  v_IProductWRTBase(tmp, outarray);
826  }
827 
829  Array<OneD,NekDouble> &outarray,
830  const StdMatrixKey &mkey)
831  {
832  ///@todo fix this
833  // int nqtot = GetTotPoints();
834  // int matrixid = mkey.GetMatrixID();
835  //
836  // NekDouble checkweight=0.0;
837  // Array<OneD, NekDouble> tmp(nqtot), tan(nqtot), dtan0(nqtot), dtan1(nqtot), weight(nqtot,0.0);
838  //
839  // int gmatnumber = (mkey.GetVariableCoefficient(1)).num_elements();
840  //
841  // v_BwdTrans(inarray,tmp);
842  //
843  // // weight = \grad \cdot tanvec
844  // for(int k = 0; k < GetCoordim(); ++k)
845  // {
846  // Vmath::Vcopy(nqtot, &(mkey.GetVariableCoefficient(0))[k*nqtot],
847  // 1, &tan[0], 1);
848  //
849  // // For Regular mesh ...
850  // if(gmatnumber==1)
851  // {
852  // // D_{/xi} and D_{/eta}
853  // v_PhysDeriv(0,tan,dtan0);
854  // v_PhysDeriv(1,tan,dtan1);
855  //
856  // // d v / d x_i = (d \xi / d x_i)*( d v / d \xi ) + (d \eta / d x_i)*( d v / d \eta )
857  // Vmath::Svtvp(nqtot,(mkey.GetVariableCoefficient(2*k+1))[0],&dtan0[0],1,&weight[0],1,&weight[0],1);
858  // Vmath::Svtvp(nqtot,(mkey.GetVariableCoefficient(2*k+2))[0],&dtan1[0],1,&weight[0],1,&weight[0],1);
859  // }
860  //
861  // // For Curved mesh ...
862  // else if(gmatnumber==nqtot)
863  // {
864  // // D_{x} and D_{y}
865  // v_PhysDeriv(k,tan,dtan0);
866  // Vmath::Vadd(nqtot,&dtan0[0],1,&weight[0],1,&weight[0],1);
867  // }
868  //
869  // else
870  // {
871  // ASSERTL1( ((gmatnumber=1) || (gmatnumber==nqtot) ), "Gmat is not in a right size");
872  // }
873  // }
874  //
875  // Vmath::Vmul(nqtot, &weight[0], 1, &tmp[0], 1, &tmp[0], 1);
876  // v_IProductWRTBase(tmp, outarray);
877  }
878 
880  Array<OneD,NekDouble> &outarray,
881  const StdMatrixKey &mkey,
882  bool addDiffusionTerm)
883  {
884 
885  int i;
886  int ndir = mkey.GetNVarCoeff(); // assume num.r consts corresponds to directions
887  ASSERTL0(ndir,"Must define at least one advection velocity");
888 
889  NekDouble lambda = mkey.GetConstFactor(eFactorLambda);
890  int totpts = GetTotPoints();
891  Array<OneD, NekDouble> tmp(3*totpts);
892  Array<OneD, NekDouble> tmp_deriv = tmp + totpts;
893  Array<OneD, NekDouble> tmp_adv = tmp_deriv + totpts;
894 
895 
896  ASSERTL1(ndir <= GetCoordim(),"Number of constants is larger than coordinate dimensions");
897 
898  v_BwdTrans(inarray,tmp);
899 
901 
902  //calculate u dx + v dy + ..
903  Vmath::Zero(totpts,tmp_adv,1);
904  for(i = 0; i < ndir; ++i)
905  {
906  v_PhysDeriv(i,tmp,tmp_deriv);
907  Vmath::Vvtvp(totpts,mkey.GetVarCoeff(varcoefftypes[i]),1,tmp_deriv,1,tmp_adv,1,tmp_adv,1);
908  }
909 
910  if(lambda) // add -lambda*u
911  {
912  Vmath::Svtvp(totpts,-lambda,tmp,1,tmp_adv,1,tmp_adv,1);
913  }
914 
915 
916  if(addDiffusionTerm)
917  {
919  StdMatrixKey mkeylap(eLaplacian,DetShapeType(),*this);
920  LaplacianMatrixOp(inarray,lap,mkeylap);
921 
922  v_IProductWRTBase(tmp_adv, outarray);
923  // Lap v - u.grad v + lambda*u
924  // => (grad u, grad v) + u.grad v - lambda*u
925  Vmath::Vadd(m_ncoeffs,lap,1,outarray,1,outarray,1);
926  }
927  else
928  {
929  v_IProductWRTBase(tmp_adv, outarray);
930  }
931 
932  }
933 
934 
936  Array<OneD,NekDouble> &outarray,
937  const StdMatrixKey &mkey)
938  {
939  NekDouble lambda = mkey.GetConstFactor(eFactorLambda);
941  StdMatrixKey mkeymass(eMass,DetShapeType(),*this);
942  StdMatrixKey mkeylap(eLaplacian,DetShapeType(),*this);
943 
944  MassMatrixOp(inarray,tmp,mkeymass);
945  LaplacianMatrixOp(inarray,outarray,mkeylap);
946 
947  Blas::Daxpy(m_ncoeffs, lambda, tmp, 1, outarray, 1);
948  }
949 
951  Array<OneD, NekDouble> &outarray)
952  {
953  int nq = GetTotPoints();
954  StdMatrixKey bwdtransmatkey(eBwdTrans,DetShapeType(),*this);
955  DNekMatSharedPtr bwdtransmat = GetStdMatrix(bwdtransmatkey);
956 
957  Blas::Dgemv('N',nq,m_ncoeffs,1.0,bwdtransmat->GetPtr().get(),
958  nq, inarray.get(), 1, 0.0, outarray.get(), 1);
959  }
960 
961  // VIRTUAL INLINE FUNCTIONS FROM HEADER FILE
962  void StdExpansion::SetUpPhysNormals(const int edge)
963  {
964  v_SetUpPhysNormals(edge);
965  }
966 
968  const Array<OneD, const NekDouble> &physvals)
969  {
970  return v_StdPhysEvaluate(Lcoord,physvals);
971  }
972 
974  {
975  return m_elmt_id;
976  }
977 
979  {
980  NEKERROR(ErrorUtil::efatal, "This function is not valid for this class");
981  return NullNekDouble1DArray;
982  }
983 
984 
986  {
987  NEKERROR(ErrorUtil::efatal, "This function is not valid for this class");
988  }
989 
990  void StdExpansion::v_SetUpPhysNormals(const int edge)
991  {
992  NEKERROR(ErrorUtil::efatal, "This function is not valid for this class");
993  }
994 
995  int StdExpansion::v_CalcNumberOfCoefficients(const std::vector<unsigned int> &nummodes, int &modes_offset)
996  {
997  NEKERROR(ErrorUtil::efatal, "This function is not defined for this class");
998  return 0;
999  }
1000 
1002  {
1003  NEKERROR(ErrorUtil::efatal, "This function is not valid for this class");
1004  }
1005 
1007  {
1008  NEKERROR(ErrorUtil::efatal, "This function is not valid for this class");
1009  }
1010 
1012  const Array<OneD, const NekDouble> &Fy,
1013  const Array<OneD, const NekDouble> &Fz,
1014  Array< OneD, NekDouble> &outarray)
1015  {
1016  NEKERROR(ErrorUtil::efatal, "This function is not valid for this class");
1017  }
1018 
1020  {
1021  NEKERROR(ErrorUtil::efatal, "This function is not valid for this class");
1022  }
1023 
1024 
1026  {
1027  NEKERROR(ErrorUtil::efatal, "This function is only valid for LocalRegions");
1029  }
1030 
1032  {
1033  NEKERROR(ErrorUtil::efatal, "This function is only valid for LocalRegions");
1034  }
1035 
1037 
1038  {
1039  NEKERROR(ErrorUtil::efatal, "This function is only valid for three-dimensional LocalRegions");
1040  return eDir1FwdDir1_Dir2FwdDir2;
1041  }
1042 
1044  {
1045  NEKERROR(ErrorUtil::efatal, "This function is only valid for two-dimensional LocalRegions");
1046  return eForwards;
1047  }
1048 
1050  {
1051  NEKERROR(ErrorUtil::efatal, "This function is only valid for one-dimensional LocalRegions");
1052  return eFwd;
1053  }
1054 
1055 
1057  {
1058  NEKERROR(ErrorUtil::efatal, "This function is only valid for two-dimensional LocalRegions");
1059  return eForwards;
1060  }
1061 
1062 
1065  Array<OneD, NekDouble> &outarray)
1066  {
1067  NEKERROR(ErrorUtil::efatal, "This function is not defined for this shape");
1068  }
1069 
1071  Array<OneD, NekDouble> &coeffs,
1073  {
1074  NEKERROR(ErrorUtil::efatal, "This function is not defined for this shape");
1075  }
1076 
1077 
1079  const Array<OneD, const NekDouble> &physvals)
1080 
1081  {
1082  NEKERROR(ErrorUtil::efatal, "This function is not defined for this shape");
1083  return 0;
1084  }
1085 
1087  {
1088  NEKERROR(ErrorUtil::efatal, "This function is not defined for this shape");
1089  }
1090 
1092  {
1093  ASSERTL0(false, "This function is needs defining for this shape");
1094  return 0;
1095  }
1096 
1098  {
1099  ASSERTL0(false, "This function is needs defining for this shape");
1100  return 0;
1101  }
1102 
1104  {
1105  ASSERTL0(false, "This function is needs defining for this shape");
1106  return 0;
1107  }
1108 
1110  {
1111  ASSERTL0(false, "This function is needs defining for this shape");
1112  return 0;
1113  }
1114 
1115  int StdExpansion::v_GetEdgeNcoeffs(const int i) const
1116  {
1117  ASSERTL0(false, "This function is not valid or not defined");
1118  return 0;
1119  }
1120 
1122  {
1123  ASSERTL0(false, "This function is not valid or not defined");
1124  return 0;
1125  }
1126 
1127  int StdExpansion::v_GetEdgeNumPoints(const int i) const
1128  {
1129  ASSERTL0(false, "This function is not valid or not defined");
1130  return 0;
1131  }
1132 
1134  {
1135  ASSERTL0(false, "This function is not valid or not defined");
1136  return 0;
1137  }
1138 
1140  {
1141  ASSERTL0(false, "This function is not valid or not defined");
1143  }
1144 
1145  const LibUtilities::BasisKey StdExpansion::v_DetFaceBasisKey(const int i, const int k) const
1146  {
1147  ASSERTL0(false, "This function is not valid or not defined");
1149  }
1150 
1151  int StdExpansion::v_GetFaceNumPoints(const int i) const
1152  {
1153  ASSERTL0(false, "This function is not valid or not defined");
1154  return 0;
1155  }
1156 
1157  int StdExpansion::v_GetFaceNcoeffs(const int i) const
1158  {
1159  ASSERTL0(false, "This function is not valid or not defined");
1160  return 0;
1161  }
1162 
1163  int StdExpansion::v_GetFaceIntNcoeffs(const int i) const
1164  {
1165  ASSERTL0(false, "This function is not valid or not defined");
1166  return 0;
1167  }
1168 
1170  {
1171  ASSERTL0(false, "This function is not valid or not defined");
1172  return 0;
1173  }
1174 
1175  int StdExpansion::v_GetTraceNcoeffs(const int i) const
1176  {
1177  ASSERTL0(false, "This function is not valid or not defined");
1178  return 0;
1179  }
1180 
1181 
1183  {
1184  ASSERTL0(false, "This function is not valid or not defined");
1186  }
1187 
1189  {
1190  ASSERTL0(false, "This function is not valid or not defined");
1191 
1193  }
1194 
1196  {
1197  ASSERTL0(false, "This function is not valid or not defined");
1198 
1200  }
1201 
1203  {
1204  ASSERTL0(false, "This expansion does not have a shape type defined");
1206  }
1207 
1208  boost::shared_ptr<StdExpansion>
1210  {
1211  ASSERTL0(false,"This method is not defined for this expansion");
1212  StdExpansionSharedPtr returnval;
1213  return returnval;
1214  }
1215 
1216  boost::shared_ptr<StdExpansion>
1218  {
1219  ASSERTL0(false,"This method is not defined for this expansion");
1220  StdExpansionSharedPtr returnval;
1221  return returnval;
1222  }
1223 
1225  {
1226  ASSERTL0(false, "This function is not valid or not defined");
1227  return 0;
1228  }
1229 
1231  {
1232  ASSERTL0(false,"This function has not been defined for this expansion");
1233  return false;
1234  }
1235 
1236 
1238  {
1239  return false;
1240  }
1241 
1243  const Array<OneD, const NekDouble>& inarray,
1244  Array<OneD, NekDouble> &outarray)
1245  {
1246  NEKERROR(ErrorUtil::efatal, "This method has not been defined");
1247  }
1248 
1249  /**
1250  *
1251  */
1253  Array<OneD, NekDouble> &outarray)
1254  {
1255  NEKERROR(ErrorUtil::efatal, "This method has not been defined");
1256  }
1257 
1258 
1259  /**
1260  * @brief Integrates the specified function over the domain.
1261  * @see StdRegions#StdExpansion#Integral.
1262  */
1264  {
1265  NEKERROR(ErrorUtil::efatal, "This function is only valid for "
1266  "local expansions");
1267  return 0;
1268  }
1269 
1270 
1271  void StdExpansion::v_AddRobinMassMatrix(const int edgeid, const Array<OneD, const NekDouble > &primCoeffs, DNekMatSharedPtr &inoutmat)
1272  {
1273  NEKERROR(ErrorUtil::efatal, "This function is only valid for "
1274  "specific element types");
1275  }
1276 
1278  {
1279  NEKERROR(ErrorUtil::efatal, "This function is only valid for "
1280  "specific element types");
1281  }
1282 
1283  /**
1284  * @brief Calculate the derivative of the physical points
1285  * @see StdRegions#StdExpansion#PhysDeriv
1286  */
1288  Array<OneD, NekDouble> &out_d1,
1289  Array<OneD, NekDouble> &out_d2,
1290  Array<OneD, NekDouble> &out_d3)
1291  {
1292  NEKERROR(ErrorUtil::efatal, "This function is only valid for "
1293  "local expansions");
1294  }
1295 
1297  Array<OneD, NekDouble> &out_ds)
1298  {
1299  NEKERROR(ErrorUtil::efatal, "This function is only valid for "
1300  "local expansions");
1301  }
1303  Array<OneD, NekDouble>& out_dn)
1304  {
1305  NEKERROR(ErrorUtil::efatal, "This function is only valid for "
1306  "local expansions");
1307  }
1308 
1309  /**
1310  * @brief Calculate the derivative of the physical points in a
1311  * given direction
1312  * @see StdRegions#StdExpansion#PhysDeriv
1313  */
1314  void StdExpansion::v_PhysDeriv(const int dir,
1315  const Array<OneD, const NekDouble>& inarray,
1316  Array<OneD, NekDouble> &out_d0)
1317 
1318  {
1319  NEKERROR(ErrorUtil::efatal, "This function is only valid for "
1320  "specific element types");
1321  }
1322 
1323  /**
1324  * @brief Physical derivative along a direction vector.
1325  * @see StdRegions#StdExpansion#PhysDirectionalDeriv
1326  */
1328  const Array<OneD, const NekDouble>& direction,
1329  Array<OneD, NekDouble> &outarray)
1330  {
1331  NEKERROR(ErrorUtil::efatal, "This function is only valid for "
1332  "specific element types");
1333  }
1334 
1336  Array<OneD, NekDouble> &out_d1,
1337  Array<OneD, NekDouble> &out_d2,
1338  Array<OneD, NekDouble> &out_d3)
1339  {
1340  NEKERROR(ErrorUtil::efatal, "Method does not exist for this shape");
1341  }
1342 
1343  void StdExpansion::v_StdPhysDeriv (const int dir,
1344  const Array<OneD, const NekDouble>& inarray,
1345  Array<OneD, NekDouble> &outarray)
1346  {
1347  NEKERROR(ErrorUtil::efatal, "Method does not exist for this shape");
1348  }
1349 
1350 
1352  {
1353  NEKERROR(ErrorUtil::efatal, "Method does not exist for this shape");
1354  return 0;
1355  }
1356 
1357 
1359  {
1360  NEKERROR(ErrorUtil::efatal, "Method does not exist for this shape");
1361  return 0;
1362  }
1363 
1364 
1365  void StdExpansion::v_FillMode(const int mode, Array<OneD, NekDouble> &outarray)
1366  {
1367  NEKERROR(ErrorUtil::efatal, "This function has not "
1368  "been defined for this shape");
1369  }
1370 
1372  {
1373  NEKERROR(ErrorUtil::efatal, "This function has not "
1374  "been defined for this element");
1375  DNekMatSharedPtr returnval;
1376  return returnval;
1377  }
1378 
1380  {
1381  NEKERROR(ErrorUtil::efatal, "This function has not "
1382  "been defined for this element");
1383  DNekMatSharedPtr returnval;
1384  return returnval;
1385  }
1386 
1388  Array<OneD, NekDouble> &coords_1,
1389  Array<OneD, NekDouble> &coords_2)
1390  {
1391  NEKERROR(ErrorUtil::efatal, "Write coordinate definition method");
1392  }
1393 
1395  Array<OneD, NekDouble> &coord)
1396  {
1397  NEKERROR(ErrorUtil::efatal, "Write coordinate definition method");
1398  }
1399 
1401  {
1402  NEKERROR(ErrorUtil::efatal, "Write method");
1403  return -1;
1404  }
1405 
1407  {
1408  NEKERROR(ErrorUtil::efatal,"Method does not exist for this shape" );
1409  }
1410 
1412  {
1413  NEKERROR(ErrorUtil::efatal,"Method does not exist for this shape" );
1414  }
1415 
1416  int StdExpansion::v_GetVertexMap(const int localVertexId,
1417  bool useCoeffPacking)
1418  {
1419  NEKERROR(ErrorUtil::efatal,"Method does not exist for this shape" );
1420  return 0;
1421  }
1422 
1423  void StdExpansion::v_GetEdgeInteriorMap(const int eid, const Orientation edgeOrient,
1424  Array<OneD, unsigned int> &maparray,
1425  Array<OneD, int> &signarray)
1426  {
1427  NEKERROR(ErrorUtil::efatal,"Method does not exist for this shape" );
1428  }
1429 
1431  const int fid,
1432  const Orientation faceOrient,
1433  int &numModes0,
1434  int &numModes1)
1435  {
1436  NEKERROR(ErrorUtil::efatal,"Method does not exist for this shape" );
1437  }
1438 
1439  void StdExpansion::v_GetFaceInteriorMap(const int fid, const Orientation faceOrient,
1440  Array<OneD, unsigned int> &maparray,
1441  Array<OneD, int> &signarray)
1442  {
1443  NEKERROR(ErrorUtil::efatal,"Method does not exist for this shape" );
1444  }
1445 
1447  const int eid,
1448  const Orientation edgeOrient,
1449  Array<OneD, unsigned int>& maparray,
1450  Array<OneD, int>& signarray,
1451  int P)
1452  {
1453  NEKERROR(ErrorUtil::efatal, "Method does not exist for this shape");
1454  }
1455 
1456  void StdExpansion::v_GetFaceToElementMap(const int fid, const Orientation faceOrient,
1457  Array<OneD, unsigned int> &maparray,
1458  Array<OneD, int> &signarray,
1459  int nummodesA, int nummodesB)
1460  {
1461  NEKERROR(ErrorUtil::efatal,"Method does not exist for this shape" );
1462  }
1463 
1465  {
1466  NEKERROR(ErrorUtil::efatal,"Method does not exist for this shape or library" );
1467  }
1468 
1469  void StdExpansion::v_GetEdgePhysVals(const int edge, const boost::shared_ptr<StdExpansion> &EdgeExp, const Array<OneD, const NekDouble> &inarray, Array<OneD,NekDouble> &outarray)
1470  {
1471  NEKERROR(ErrorUtil::efatal,"Method does not exist for this shape or library" );
1472  }
1473 
1474  void StdExpansion::v_GetTracePhysVals(const int edge, const boost::shared_ptr<StdExpansion> &EdgeExp, const Array<OneD, const NekDouble> &inarray, Array<OneD,NekDouble> &outarray, StdRegions::Orientation orient)
1475  {
1476  NEKERROR(ErrorUtil::efatal,"Method does not exist for this shape or library" );
1477  }
1478 
1480  {
1481  NEKERROR(ErrorUtil::efatal,"Method does not exist for this shape or library" );
1482  }
1483 
1485  {
1486  NEKERROR(ErrorUtil::efatal,"Method does not exist for this shape or library" );
1487  }
1488 
1490  const int edge,
1491  Array<OneD, NekDouble> &outarray)
1492  {
1494  "Method does not exist for this shape or library");
1495  }
1496 
1497  void StdExpansion::v_GetFacePhysVals( const int face,
1498  const boost::shared_ptr<StdExpansion> &FaceExp,
1499  const Array<OneD, const NekDouble> &inarray,
1500  Array<OneD, NekDouble> &outarray,
1501  StdRegions::Orientation orient)
1502  {
1503  NEKERROR(ErrorUtil::efatal,"Method does not exist for this shape or library" );
1504  }
1505 
1507  const int edge,
1508  Array<OneD, int> &outarray)
1509  {
1511  "Method does not exist for this shape or library" );
1512  }
1513 
1514  void StdExpansion::v_GetFacePhysMap(const int face,
1515  Array<OneD, int> &outarray)
1516  {
1517  NEKERROR(ErrorUtil::efatal,"Method does not exist for this shape or library" );
1518  }
1519 
1521  const Array<OneD, const NekDouble> &inarray,
1522  Array<OneD, NekDouble> &outarray)
1523  {
1524  v_MultiplyByStdQuadratureMetric(inarray,outarray);
1525  }
1526 
1528  const Array<OneD, const NekDouble> &inarray,
1529  Array<OneD, NekDouble> &outarray)
1530  {
1531  NEKERROR(ErrorUtil::efatal, "Method does not exist for this shape or library");
1532  }
1533 
1534  const boost::shared_ptr<SpatialDomains::GeomFactors>& StdExpansion::v_GetMetricInfo() const
1535  {
1536  NEKERROR(ErrorUtil::efatal, "This function is only valid for LocalRegions");
1538 
1539  }
1540 
1542  Array<OneD, NekDouble> &outarray)
1543  {
1544  NEKERROR(ErrorUtil::efatal,"Method does not exist for this shape" );
1545  }
1546 
1548  Array<OneD, NekDouble> &outarray,
1549  bool multiplybyweights)
1550  {
1551  NEKERROR(ErrorUtil::efatal,"Method does not exist for this shape" );
1552  }
1553 
1555  const Array<OneD, const NekDouble>& inarray,
1556  Array<OneD, NekDouble> &outarray)
1557  {
1558  NEKERROR(ErrorUtil::efatal,"Method does not exist for this shape" );
1559  }
1560 
1562  Array<OneD,NekDouble> &outarray,
1563  const StdMatrixKey &mkey)
1564  {
1565  // If this function is not reimplemented on shape level, the function
1566  // below will be called
1567  MassMatrixOp_MatFree(inarray,outarray,mkey);
1568  }
1569 
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(inarray,outarray,mkey);
1577  }
1578 
1579 
1581  const StdMatrixKey &mkey)
1582  {
1583  ASSERTL0(false, "This function is not defined in StdExpansion.");
1584  }
1585 
1587  const Array<OneD, const NekDouble> &inarray,
1588  Array<OneD, NekDouble> &outarray)
1589  {
1590  ASSERTL0(false, "This function is not defined in StdExpansion.");
1591  }
1592 
1593  void StdExpansion::v_LaplacianMatrixOp(const int k1, const int k2,
1594  const Array<OneD, const NekDouble> &inarray,
1595  Array<OneD,NekDouble> &outarray,
1596  const StdMatrixKey &mkey)
1597  {
1598  // If this function is not reimplemented on shape level, the function
1599  // below will be called
1600  LaplacianMatrixOp_MatFree(k1,k2,inarray,outarray,mkey);
1601  }
1602 
1604  const Array<OneD, const NekDouble> &inarray,
1605  Array<OneD,NekDouble> &outarray,
1606  const StdMatrixKey &mkey)
1607  {
1608  // If this function is not reimplemented on shape level, the function
1609  // below will be called
1610  WeakDerivMatrixOp_MatFree(i,inarray,outarray,mkey);
1611 
1612  }
1613 
1615  Array<OneD,NekDouble> &outarray,
1616  const StdMatrixKey &mkey)
1617  {
1618  // If this function is not reimplemented on shape level, the function
1619  // below will be called
1620  WeakDirectionalDerivMatrixOp_MatFree(inarray,outarray,mkey);
1621 
1622  }
1623 
1625  Array<OneD,NekDouble> &outarray,
1626  const StdMatrixKey &mkey)
1627  {
1628  // If this function is not reimplemented on shape level, the function
1629  // below will be called
1630  MassLevelCurvatureMatrixOp_MatFree(inarray,outarray,mkey);
1631  }
1632 
1634  const NekDouble> &inarray,
1635  Array<OneD,NekDouble> &outarray,
1636  const StdMatrixKey &mkey, bool addDiffusionTerm)
1637  {
1638  // If this function is not reimplemented on shape level, the function
1639  // below will be called
1640  LinearAdvectionDiffusionReactionMatrixOp_MatFree(inarray,outarray,mkey,addDiffusionTerm);
1641 
1642  }
1643 
1645  Array<OneD,NekDouble> &outarray,
1646  const StdMatrixKey &mkey)
1647  {
1648  // If this function is not reimplemented on shape level, the function
1649  // below will be called
1650  HelmholtzMatrixOp_MatFree(inarray,outarray,mkey);
1651  }
1652 
1654  Array<OneD,NekDouble> &outarray,
1655  const StdMatrixKey &mkey)
1656  {
1657  // If this function is not reimplemented on shape level, the function
1658  // below will be called
1659  LaplacianMatrixOp_MatFree_GenericImpl(inarray,outarray,mkey);
1660  }
1661 
1663  const Array<OneD, const NekDouble> &inarray,
1664  Array<OneD, NekDouble> &outarray,
1666  {
1667  ASSERTL0(false, "Not implemented.");
1668  }
1669 
1671  Array<OneD,NekDouble> &outarray,
1672  const StdMatrixKey &mkey)
1673  {
1674  // If this function is not reimplemented on shape level, the function
1675  // below will be called
1676  HelmholtzMatrixOp_MatFree_GenericImpl(inarray,outarray,mkey);
1677  }
1678 
1679  const NormalVector & StdExpansion::v_GetEdgeNormal(const int edge) const
1680  {
1681  ASSERTL0(false, "Cannot get edge normals for this expansion.");
1682  static NormalVector result;
1683  return result;
1684  }
1685 
1687  {
1688  ASSERTL0(false, "Cannot compute edge normal for this expansion.");
1689  }
1690 
1692  {
1693  ASSERTL0(false, "Not implemented.");
1694  }
1695 
1697  {
1698  ASSERTL0(false, "Not implemented.");
1699  return false;
1700  }
1701 
1703  {
1704  ASSERTL0(false, "Cannot compute face normal for this expansion.");
1705  }
1706 
1708  {
1709  ASSERTL0(false, "Not implemented.");
1710  }
1711 
1713  {
1714  ASSERTL0(false, "Not implemented.");
1715  return false;
1716  }
1717 
1719  {
1720  ASSERTL0(false, "Cannot compute vertex normal for this expansion.");
1721  }
1722 
1723  const NormalVector & StdExpansion::v_GetFaceNormal(const int face) const
1724  {
1725  ASSERTL0(false, "Cannot get face normals for this expansion.");
1726  static NormalVector result;
1727  return result;
1728  }
1729 
1731  {
1732  ASSERTL0(false, "Cannot get vertex normals for this expansion.");
1733  static NormalVector result;
1734  return result;
1735  }
1736 
1738  {
1739  ASSERTL0(false, "Cannot get face normals for this expansion.");
1740  static NormalVector result;
1741  return result;
1742  }
1743 
1746  {
1747  ASSERTL0(false, "Not implemented.");
1748  Array<OneD, unsigned int> noinversemap(1);
1749  return noinversemap;
1750  }
1751 
1754  StdRegions::Orientation faceOrient)
1755  {
1756  ASSERTL0(false, "Not implemented.");
1757  Array<OneD, unsigned int> noinversemap(1);
1758  return noinversemap;
1759  }
1760 
1763  const DNekScalMatSharedPtr & m_transformationmatrix)
1764  {
1765  NEKERROR(ErrorUtil::efatal, "This function is only valid for LocalRegions");
1766  return NullDNekMatSharedPtr;
1767  }
1768 
1770  const Array<OneD, const NekDouble> &inarray,
1771  Array<OneD, NekDouble> &outarray,
1772  int npset)
1773  {
1775  DNekMatSharedPtr intmat;
1776 
1777  int nqtot = GetTotPoints();
1778  int np = 0;
1779  if(npset == -1) // use values from basis num points()
1780  {
1781  int nqbase;
1782  for(int i = 0; i < m_base.num_elements(); ++i)
1783  {
1784  nqbase = m_base[i]->GetNumPoints();
1785  np = std::max(np,nqbase);
1786  }
1787 
1788  StdMatrixKey Ikey(ePhysInterpToEquiSpaced, shape, *this);
1789  intmat = GetStdMatrix(Ikey);
1790  }
1791  else
1792  {
1793  np = npset;
1794 
1795  ConstFactorMap cmap;
1796  cmap[eFactorConst] = np;
1797  StdMatrixKey Ikey(ePhysInterpToEquiSpaced, shape, *this, cmap);
1798  intmat = GetStdMatrix(Ikey);
1799 
1800  }
1801 
1802  NekVector<NekDouble> in (nqtot,inarray,eWrapper);
1804  out = (*intmat) * in;
1805  }
1806 
1808  Array<OneD, int> &conn,
1809  bool standard)
1810  {
1811  ASSERTL0(false, "Not implemented.");
1812  }
1813 
1815  const Array<OneD, const NekDouble> &inarray,
1816  Array<OneD, NekDouble> &outarray)
1817  {
1819 
1820  // inarray has to be consistent with NumModes definition
1821  // There is also a check in GetStdMatrix to see if all
1822  // modes are of the same size
1823  ConstFactorMap cmap;
1824 
1825  cmap[eFactorConst] = m_base[0]->GetNumModes();
1826  StdMatrixKey Ikey(eEquiSpacedToCoeffs, shape, *this,cmap);
1827  DNekMatSharedPtr intmat = GetStdMatrix(Ikey);
1828 
1829  NekVector<NekDouble> in (m_ncoeffs, inarray, eWrapper);
1830  NekVector<NekDouble> out(m_ncoeffs, outarray,eWrapper);
1831  out = (*intmat) * in;
1832  }
1833 
1834  }//end namespace
1835 }//end namespace
virtual bool v_EdgeNormalNegated(const int edge)
void HelmholtzMatrixOp_MatFree_GenericImpl(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
virtual void v_GetFaceNumModes(const int fid, const Orientation faceOrient, int &numModes0, int &numModes1)
static const PointsKey NullPointsKey(0, eNoPointsType)
virtual int v_GetVertexMap(int localVertexId, bool useCoeffPacking=false)
virtual void v_ComputeFaceNormal(const int face)
LibUtilities::ShapeType DetShapeType() const
This function returns the shape of the expansion domain.
Definition: StdExpansion.h:470
NekDouble GetConstFactor(const ConstFactorType &factor) const
Definition: StdMatrixKey.h:122
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:198
virtual void v_GetInteriorMap(Array< OneD, unsigned int > &outarray)
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mod...
Definition: ErrorUtil.hpp:191
void LaplacianMatrixOp_MatFree_GenericImpl(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)
virtual int v_GetTotalEdgeIntNcoeffs() const
boost::shared_ptr< IndexMapValues > IndexMapValuesSharedPtr
Definition: IndexMapKey.h:126
MatrixType GetMatrixType() const
Definition: StdMatrixKey.h:82
virtual int v_NumBndryCoeffs() const
static boost::shared_ptr< GeomFactors > NullGeomFactorsSharedPtr
virtual void v_NegateFaceNormal(const int face)
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:598
void MassMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
Definition: StdExpansion.h:976
static Array< OneD, NekDouble > NullNekDouble1DArray
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
virtual void v_FwdTrans_BndConstrained(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
bool HasVarCoeff(const StdRegions::VarCoeffType &coeff) const
Definition: StdMatrixKey.h:173
#define sign(a, b)
return the sign(b)*a
Definition: Polylib.cpp:27
void IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_ReduceOrderCoeffs(int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual LibUtilities::ShapeType v_DetShapeType() const
virtual const NormalVector & v_GetVertexNormal(const int vertex) const
virtual void v_GetEdgePhysVals(const int edge, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Extract the physical values along edge edge from inarray into outarray following the local edge orien...
virtual void v_FillMode(const int mode, Array< OneD, NekDouble > &outarray)
virtual void v_GetFaceInteriorMap(const int fid, const Orientation faceOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray)
virtual int v_GetShapeDimension() const
void WeakDirectionalDerivMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
virtual const NormalVector & v_GetEdgeNormal(const int edge) const
virtual void v_MassMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
virtual void v_PhysDeriv_n(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_dn)
virtual void v_HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void SVVLaplacianFilter(Array< OneD, NekDouble > &array, const StdMatrixKey &mkey)
Definition: StdExpansion.h:997
virtual void v_MultiplyByQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void LaplacianMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
virtual void v_GetBoundaryMap(Array< OneD, unsigned int > &outarray)
const Array< OneD, const NekDouble > & GetVarCoeff(const StdRegions::VarCoeffType &coeff) const
Definition: StdMatrixKey.h:152
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:485
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:442
virtual void v_IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
STL namespace.
virtual int v_NumDGBndryCoeffs() const
static const NekDouble kNekSqrtTol
virtual void v_DropLocStaticCondMatrix(const LocalRegions::MatrixKey &mkey)
virtual ~StdExpansion()
Destructor.
virtual void v_GetEdgeToElementMap(const int eid, const Orientation edgeOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, int P=-1)
LibUtilities::ShapeType GetShapeType() const
Definition: StdMatrixKey.h:87
std::map< ConstFactorType, NekDouble > ConstFactorMap
Definition: StdRegions.hpp:252
virtual DNekMatSharedPtr v_GenMatrix(const StdMatrixKey &mkey)
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 int v_GetEdgeNcoeffs(const int i) const
virtual StdRegions::Orientation v_GetForient(int face)
virtual void v_GetEdgeInteriorMap(const int eid, const Orientation edgeOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray)
virtual void v_NormVectorIProductWRTBase(const Array< OneD, const NekDouble > &Fx, Array< OneD, NekDouble > &outarray)
boost::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:70
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.
void Vabs(int n, const T *x, const int incx, T *y, const int incy)
vabs: y = |x|
Definition: Vmath.cpp:424
virtual const LibUtilities::PointsKey v_GetNodalPointsKey() const
DNekMatSharedPtr GetStdMatrix(const StdMatrixKey &mkey)
Definition: StdExpansion.h:706
boost::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
void IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)
int GetNumberOfCoefficients(ShapeType shape, std::vector< unsigned int > &modes, int offset)
Definition: ShapeType.hpp:312
virtual void v_GetEdgePhysMap(const int edge, Array< OneD, int > &outarray)
static DNekMatSharedPtr NullDNekMatSharedPtr
Definition: NekTypeDefs.hpp:79
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_AddRobinMassMatrix(const int edgeid, const Array< OneD, const NekDouble > &primCoeffs, DNekMatSharedPtr &inoutmat)
virtual int v_GetFaceNcoeffs(const int i) const
void WeakDerivMatrixOp(const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void MassLevelCurvatureMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
bool ConstFactorExists(const ConstFactorType &factor) const
Definition: StdMatrixKey.h:131
BasisManagerT & BasisManager(void)
int GetTotPoints() const
This function returns the total number of quadrature points used in the element.
Definition: StdExpansion.h:141
virtual void v_BwdTrans_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_MassLevelCurvatureMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void LinearAdvectionDiffusionReactionMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey, bool addDiffusionTerm=true)
virtual void v_LaplacianMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
virtual int v_GetElmtId()
Get the element id of this expansion when used in a list by returning value of m_elmt_id.
virtual void v_SetUpPhysNormals(const int edge)
virtual NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray)
Integrates the specified function over the domain.
virtual void v_GetEdgeInterpVals(const int edge, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual LibUtilities::BasisType v_GetEdgeBasisType(const int i) const
The base class for all shapes.
Definition: StdExpansion.h:69
virtual int v_GetEdgeNumPoints(const int i) const
virtual void SetUpPhysNormals(const int edge)
virtual void v_NegateEdgeNormal(const int edge)
virtual void v_AddRobinEdgeContribution(const int edgeid, const Array< OneD, const NekDouble > &primCoeffs, Array< OneD, NekDouble > &coeffs)
void GeneralMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
virtual const NormalVector & v_GetSurfaceNormal(const int id) const
LibUtilities::PointsType GetNodalPointsType() const
Definition: StdMatrixKey.h:92
virtual void v_GetCoord(const Array< OneD, const NekDouble > &Lcoord, Array< OneD, NekDouble > &coord)
virtual DNekMatSharedPtr v_CreateStdMatrix(const StdMatrixKey &mkey)
IndexMapValuesSharedPtr CreateIndexMap(const IndexMapKey &ikey)
Create an IndexMap which contains mapping information linking any specific element shape with either ...
virtual LibUtilities::PointsKey v_GetFacePointsKey(const int i, const int j) const
virtual void v_PhysDeriv_s(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_ds)
virtual void v_GetSimplexEquiSpacedConnectivity(Array< OneD, int > &conn, bool standard=true)
virtual const LibUtilities::BasisKey v_DetEdgeBasisKey(const int i) const
virtual void v_WeakDirectionalDerivMatrixOp(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)
boost::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
Definition: NekTypeDefs.hpp:74
virtual NekDouble v_PhysEvaluate(const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &physvals)
virtual void v_GetVertexPhysVals(const int vertex, const Array< OneD, const NekDouble > &inarray, NekDouble &outarray)
void WeakDerivMatrixOp_MatFree(const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
virtual boost::shared_ptr< StdExpansion > v_GetStdExp(void) const
virtual int v_GetFaceIntNcoeffs(const int i) const
void GetInteriorMap(Array< OneD, unsigned int > &outarray)
Definition: StdExpansion.h:819
DNekMatSharedPtr CreateGeneralMatrix(const StdMatrixKey &mkey)
this function generates the mass matrix
virtual int v_GetTotalFaceIntNcoeffs() const
virtual void v_SVVLaplacianFilter(Array< OneD, NekDouble > &array, const StdMatrixKey &mkey)
Defines a specification for a set of points.
Definition: Points.h:58
virtual const LibUtilities::BasisKey v_DetFaceBasisKey(const int i, const int k) const
double NekDouble
virtual bool v_IsBoundaryInteriorExpansion()
void BwdTrans_MatOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_GetTracePhysVals(const int edge, const boost::shared_ptr< StdExpansion > &EdgeExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, StdRegions::Orientation orient=eNoOrientation)
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:825
virtual void v_GetEdgeQFactors(const int edge, Array< OneD, NekDouble > &outarray)
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_StdPhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2, Array< OneD, NekDouble > &out_d3)
virtual Array< OneD, unsigned int > v_GetFaceInverseBoundaryMap(int fid, StdRegions::Orientation faceOrient=eNoOrientation)
virtual void v_GetFaceToElementMap(const int fid, const Orientation faceOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, int nummodesA=-1, int nummodesB=-1)
NekDouble StdPhysEvaluate(const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
virtual void v_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)
void HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
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.
void MassLevelCurvatureMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
virtual const NormalVector & v_GetFaceNormal(const int face) const
virtual Array< OneD, unsigned int > v_GetEdgeInverseBoundaryMap(int eid)
bg::model::point< double, 3, bg::cs::cartesian > point
Definition: BLMesh.cpp:54
virtual DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix(const LocalRegions::MatrixKey &mkey)
virtual void v_ComputeEdgeNormal(const int edge)
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:343
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...
boost::shared_ptr< DNekBlkMat > DNekBlkMatSharedPtr
Definition: NekTypeDefs.hpp:72
virtual StdRegions::Orientation v_GetCartesianEorient(int edge)
virtual int v_DetCartesianDirOfEdge(const int edge)
void LaplacianMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
Definition: StdExpansion.h:983
virtual void v_SetCoeffsToOrientation(StdRegions::Orientation dir, Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual const boost::shared_ptr< SpatialDomains::GeomFactors > & v_GetMetricInfo() const
virtual void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual int v_GetNedges() const
virtual void v_ComputeVertexNormal(const int vertex)
virtual void v_GetFacePhysMap(const int face, Array< OneD, int > &outarray)
virtual NekDouble v_StdPhysEvaluate(const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed t...
Definition: ErrorUtil.hpp:250
virtual StdRegions::Orientation v_GetEorient(int edge)
void MassMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
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.
virtual int v_CalcNumberOfCoefficients(const std::vector< unsigned int > &nummodes, int &modes_offset)
void HelmholtzMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
virtual void v_WeakDerivMatrixOp(const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
virtual bool v_FaceNormalNegated(const int face)
Orientation GetIndexOrientation() const
Definition: IndexMapKey.h:93
virtual void v_SetPhysNormals(Array< OneD, const NekDouble > &normal)
DNekBlkMatSharedPtr CreateStdStaticCondMatrix(const StdMatrixKey &mkey)
Create the static condensation of a matrix when using a boundary interior decomposition.
static DNekScalBlkMatSharedPtr NullDNekScalBlkMatSharedPtr
Definition: NekTypeDefs.hpp:81
static const BasisKey NullBasisKey(eNoBasisType, 0, NullPointsKey)
Defines a null basis with no type or points.
virtual const Array< OneD, const NekDouble > & v_GetPhysNormals(void)
int GetNcoeffs(void) const
This function returns the total number of coefficients used in the expansion.
Definition: StdExpansion.h:131
virtual int v_GetFaceNumPoints(const int i) const
StdExpansion()
Default Constructor.
IndexMapType GetIndexMapType() const
Definition: IndexMapKey.h:88
void WeakDirectionalDerivMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
virtual int v_GetNfaces() const
void Zero(int n, T *x, const int incx)
Zero vector.
Definition: Vmath.cpp:373
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...
boost::shared_ptr< StdExpansion > StdExpansionSharedPtr
virtual boost::shared_ptr< StdExpansion > v_GetLinStdExp(void) const
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:228
Array< OneD, LibUtilities::BasisSharedPtr > m_base
void GeneralMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1061
virtual void v_MultiplyByStdQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_LinearAdvectionDiffusionReactionMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey, bool addDiffusionTerm=true)
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_0, Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2)
virtual StdRegions::Orientation v_GetPorient(int point)
virtual void v_LaplacianMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
void GetBoundaryMap(Array< OneD, unsigned int > &outarray)
Definition: StdExpansion.h:814
boost::shared_ptr< StdMatrixKey > StdMatrixKeySharedPtr
Definition: StdMatrixKey.h:196
virtual DNekMatSharedPtr v_BuildInverseTransformationMatrix(const DNekScalMatSharedPtr &m_transformationmatrix)
Describes the specification for a Basis.
Definition: Basis.h:50
virtual void v_BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)=0
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:299
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:183
void BwdTrans_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
static VarCoeffMap NullVarCoeffMap
Definition: StdRegions.hpp:228
virtual int v_GetTraceNcoeffs(const int i) const
static ConstFactorMap NullConstFactorMap
Definition: StdRegions.hpp:253
void LinearAdvectionDiffusionReactionMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey, bool addDiffusionTerm=true)
virtual void v_GetFacePhysVals(const int face, const boost::shared_ptr< StdExpansion > &FaceExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, StdRegions::Orientation orient)