Nektar++
StdSegExp.cpp
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File StdSegExp.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: Routines within Standard Segment Expansions
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #include <StdRegions/StdSegExp.h>
37 
38 namespace Nektar
39 {
40  namespace StdRegions
41  {
42 
43  /** \brief Default constructor */
44 
46  {
47  }
48 
49 
50  /** \brief Constructor using BasisKey class for quadrature points and
51  * order definition
52  *
53  * \param Ba BasisKey class definition containing order and quadrature
54  * points.
55  */
56 
58  StdExpansion(Ba.GetNumModes(), 1, Ba),
59  StdExpansion1D(Ba.GetNumModes(),Ba)
60  {
61  }
62 
63 
64  /** \brief Copy Constructor */
65 
67  StdExpansion(T),
69  {
70  }
71 
72 
74  {
75  }
76 
77  /** \brief Return Shape of region, using ShapeType enum list.
78  * i.e. Segment
79  */
81  {
83  }
84 
86  {
87 
88  bool returnval = false;
89 
91  {
92  returnval = true;
93  }
94 
96  {
97  returnval = true;
98  }
99 
100  return returnval;
101  }
102 
103 
104 
105 
106  //---------------------------------------------------------------------
107  // Integration Methods
108  //---------------------------------------------------------------------
109 
110  /** \brief Integrate the physical point list \a inarray over region
111  * and return the value
112  *
113  * \param inarray definition of function to be integrated evauluated at
114  * quadrature point of expansion.
115  * \return returns \f$\int^1_{-1} u(\xi_1)d \xi_1 \f$ where \f$inarray[i]
116  * = u(\xi_{1i}) \f$
117  */
119  {
120  NekDouble Int = 0.0;
121  int nquad0 = m_base[0]->GetNumPoints();
122  Array<OneD, NekDouble> tmp(nquad0);
123  Array<OneD, const NekDouble> z = m_base[0]->GetZ();
124  Array<OneD, const NekDouble> w0 = m_base[0]->GetW();
125 
126  // multiply by integration constants
127  Vmath::Vmul(nquad0, inarray, 1, w0, 1, tmp, 1);
128 
129  Int = Vmath::Vsum(nquad0, tmp, 1);
130 
131  return Int;
132  }
133 
134 
135 
136 
137  //---------------------------------------------------------------------
138  // Differentiation Methods
139  //---------------------------------------------------------------------
140 
141 
142  /** \brief Evaluate the derivative \f$ d/d{\xi_1} \f$ at the physical
143  * quadrature points given by \a inarray and return in \a outarray.
144  *
145  * This is a wrapper around StdExpansion1D::Tensor_Deriv
146  * \param inarray array of a function evaluated at the quadrature points
147  * \param outarray the resulting array of the derivative \f$
148  * du/d_{\xi_1}|_{\xi_{1i}} \f$ will be stored in the array \a outarra
149  */
150 
152  Array<OneD, NekDouble> &out_d0,
153  Array<OneD, NekDouble> &out_d1,
154  Array<OneD, NekDouble> &out_d2)
155  {
156  PhysTensorDeriv(inarray,out_d0);
157  }
158 
159 
160  void StdSegExp::v_PhysDeriv(const int dir,
161  const Array<OneD, const NekDouble>& inarray,
162  Array<OneD, NekDouble> &outarray)
163  {
164  ASSERTL1(dir==0,"input dir is out of range");
165  PhysTensorDeriv(inarray,outarray);
166  // PhysDeriv(inarray, outarray);
167  }
168 
170  const Array<OneD, const NekDouble>& inarray,
171  Array<OneD, NekDouble> &out_d0,
172  Array<OneD, NekDouble> &out_d1,
173  Array<OneD, NekDouble> &out_d2)
174  {
175  PhysTensorDeriv(inarray,out_d0);
176  // PhysDeriv(inarray, out_d0);
177  }
178 
180  const int dir,
181  const Array<OneD, const NekDouble>& inarray,
182  Array<OneD, NekDouble> &outarray)
183  {
184  ASSERTL1(dir==0,"input dir is out of range");
185  PhysTensorDeriv(inarray,outarray);
186  // PhysDeriv(inarray, outarray);
187  }
188 
189 
190 
191  //---------------------------------------------------------------------
192  // Transforms
193  //---------------------------------------------------------------------
194 
195  /** \brief Backward transform from coefficient space given
196  * in \a inarray and evaluate at the physical quadrature
197  * points \a outarray
198  *
199  * Operation can be evaluated as \f$ u(\xi_{1i}) =
200  * \sum_{p=0}^{order-1} \hat{u}_p \phi_p(\xi_{1i}) \f$ or equivalently
201  * \f$ {\bf u} = {\bf B}^T {\bf \hat{u}} \f$ where
202  * \f${\bf B}[i][j] = \phi_i(\xi_{1j}), \mbox{\_coeffs}[p] = {\bf
203  * \hat{u}}[p] \f$
204  *
205  * The function takes the coefficient array \a inarray as
206  * input for the transformation
207  *
208  * \param inarray: the coeffficients of the expansion
209  *
210  * \param outarray: the resulting array of the values of the function at
211  * the physical quadrature points will be stored in the array \a outarray
212  */
213 
215  const Array<OneD, const NekDouble>& inarray,
216  Array<OneD, NekDouble> &outarray)
217  {
218  int nquad = m_base[0]->GetNumPoints();
219 
220  if(m_base[0]->Collocation())
221  {
222  Vmath::Vcopy(nquad, inarray, 1, outarray, 1);
223  }
224  else
225  {
226 
227 #ifdef NEKTAR_USING_DIRECT_BLAS_CALLS
228 
229  Blas::Dgemv('N',nquad,m_base[0]->GetNumModes(),1.0, (m_base[0]->GetBdata()).get(),
230  nquad,&inarray[0],1,0.0,&outarray[0],1);
231 
232 #else //NEKTAR_USING_DIRECT_BLAS_CALLS
233 
235  NekVector<NekDouble> out(nquad,outarray,eWrapper);
236  NekMatrix<NekDouble> B(nquad,m_ncoeffs,m_base[0]->GetBdata(),eWrapper);
237  out = B * in;
238 
239 #endif //NEKTAR_USING_DIRECT_BLAS_CALLS
240 
241  }
242  }
243 
244  /** \brief Forward transform from physical quadrature space stored in
245  * \a inarray and evaluate the expansion coefficients and store in
246  * \a outarray
247  *
248  * Perform a forward transform using a Galerkin projection by taking the
249  * inner product of the physical points and multiplying by the inverse of
250  * the mass matrix using the Solve method of the standard matrix
251  * container holding the local mass matrix, i.e. \f$ {\bf \hat{u}} =
252  * {\bf M}^{-1} {\bf I} \f$ where \f$ {\bf I}[p] = \int^1_{-1}
253  * \phi_p(\xi_1) u(\xi_1) d\xi_1 \f$
254  *
255  * This function stores the expansion coefficients calculated by the
256  * transformation in the coefficient space array \a outarray
257  *
258  * \param inarray: array of physical quadrature points to be transformed
259  *
260  * \param outarray: the coeffficients of the expansion
261  */
262 
264  Array<OneD, NekDouble> &outarray)
265  {
266  if(m_base[0]->Collocation())
267  {
268  Vmath::Vcopy(m_ncoeffs, inarray, 1, outarray, 1);
269  }
270  else
271  {
272  v_IProductWRTBase(inarray,outarray);
273 
274  // get Mass matrix inverse
275  StdMatrixKey masskey(eInvMass,v_DetShapeType(),*this);
276  DNekMatSharedPtr matsys = GetStdMatrix(masskey);
277 
278  NekVector<NekDouble> in(m_ncoeffs,outarray,eCopy);
280 
281  out = (*matsys)*in;
282  }
283  }
284 
286  const Array<OneD, const NekDouble>& inarray,
287  Array<OneD, NekDouble> &outarray)
288  {
289  if(m_base[0]->Collocation())
290  {
291  Vmath::Vcopy(m_ncoeffs, inarray, 1, outarray, 1);
292  }
293  else
294  {
295  int nInteriorDofs = m_ncoeffs-2;
296  int offset;
297 
298  switch(m_base[0]->GetBasisType())
299  {
301  {
302  offset = 1;
303  }
304  break;
306  {
307  nInteriorDofs = m_ncoeffs;
308  offset = 0;
309  }
310  break;
313  {
314  offset = 2;
315  }
316  break;
317  default:
318  ASSERTL0(false,"This type of FwdTrans is not defined for this expansion type");
319  }
320 
321  fill(outarray.get(), outarray.get()+m_ncoeffs, 0.0 );
322 
324  {
325  outarray[GetVertexMap(0)] = inarray[0];
326  outarray[GetVertexMap(1)] = inarray[m_base[0]->GetNumPoints()-1];
327 
328  if(m_ncoeffs>2)
329  {
330  // ideally, we would like to have tmp0 to be replaced by
331  // outarray (currently MassMatrixOp does not allow aliasing)
334 
335  StdMatrixKey masskey(eMass,v_DetShapeType(),*this);
336  MassMatrixOp(outarray,tmp0,masskey);
337  v_IProductWRTBase(inarray,tmp1);
338 
339  Vmath::Vsub(m_ncoeffs, tmp1, 1, tmp0, 1, tmp1, 1);
340 
341  // get Mass matrix inverse (only of interior DOF)
342  DNekMatSharedPtr matsys =
343  (m_stdStaticCondMatrixManager[masskey])-> GetBlock(1,1);
344 
345  Blas::Dgemv('N',nInteriorDofs,nInteriorDofs,1.0,
346  &(matsys->GetPtr())[0],nInteriorDofs,tmp1.get()
347  +offset,1,0.0,outarray.get()+offset,1);
348  }
349  }
350  else
351  {
352  StdSegExp::v_FwdTrans(inarray, outarray);
353  }
354  }
355 
356  }
357 
358 
360  Array<OneD, NekDouble> &outarray)
361  {
362  v_BwdTrans(inarray, outarray);
363  }
364 
365 
366 
367  //---------------------------------------------------------------------
368  // Inner product functions
369  //---------------------------------------------------------------------
370 
371 
372 
373  /** \brief Inner product of \a inarray over region with respect to
374  * expansion basis \a base and return in \a outarray
375  *
376  * Calculate \f$ I[p] = \int^{1}_{-1} \phi_p(\xi_1) u(\xi_1) d\xi_1
377  * = \sum_{i=0}^{nq-1} \phi_p(\xi_{1i}) u(\xi_{1i}) w_i \f$ where
378  * \f$ outarray[p] = I[p], inarray[i] = u(\xi_{1i}), base[p*nq+i] =
379  * \phi_p(\xi_{1i}) \f$.
380  *
381  * \param base an array defining the local basis for the inner product
382  * usually passed from Basis->GetBdata() or Basis->GetDbdata()
383  * \param inarray: physical point array of function to be integrated
384  * \f$ u(\xi_1) \f$
385  * \param coll_check flag to identify when a Basis->Collocation() call
386  * should be performed to see if this is a GLL_Lagrange basis with a
387  * collocation property. (should be set to 0 if taking the inner
388  * product with respect to the derivative of basis)
389  * \param outarray the values of the inner product with respect to
390  * each basis over region will be stored in the array \a outarray as
391  * output of the function
392  */
393 
395  const Array<OneD, const NekDouble> &base,
396  const Array<OneD, const NekDouble> &inarray,
397  Array<OneD, NekDouble> &outarray,
398  int coll_check)
399  {
400  int nquad = m_base[0]->GetNumPoints();
401  Array<OneD, NekDouble> tmp(nquad);
402  Array<OneD, const NekDouble> w = m_base[0]->GetW();
403 
404  Vmath::Vmul(nquad, inarray, 1, w, 1, tmp, 1);
405 
406  /* Comment below was a bug for collocated basis
407  if(coll_check&&m_base[0]->Collocation())
408  {
409  Vmath::Vcopy(nquad, tmp, 1, outarray, 1);
410  }
411  else
412  {
413  Blas::Dgemv('T',nquad,m_ncoeffs,1.0,base.get(),nquad,
414  &tmp[0],1,0.0,outarray.get(),1);
415  }*/
416 
417  // Correct implementation
418  Blas::Dgemv('T',nquad,m_ncoeffs,1.0,base.get(),nquad,
419  &tmp[0],1,0.0,outarray.get(),1);
420  }
421 
422  /** \brief Inner product of \a inarray over region with respect to the
423  * expansion basis (this)->m_base[0] and return in \a outarray
424  *
425  * Wrapper call to StdSegExp::IProductWRTBase
426  * \param inarray array of function values evaluated at the physical
427  * collocation points
428  * \param outarray the values of the inner product with respect to
429  * each basis over region will be stored in the array \a outarray as
430  * output of the function
431  */
433  Array<OneD, NekDouble> &outarray)
434  {
435  v_IProductWRTBase(m_base[0]->GetBdata(),inarray,outarray,1);
436  }
437 
439  const int dir,
440  const Array<OneD, const NekDouble>& inarray,
441  Array<OneD, NekDouble> & outarray)
442  {
443  ASSERTL1(dir >= 0 && dir < 1,"input dir is out of range");
444  v_IProductWRTBase(m_base[0]->GetDbdata(),inarray,outarray,1);
445  }
446 
448  const Array<OneD, const NekDouble>& inarray,
449  Array<OneD, NekDouble> &outarray,
450  bool multiplybyweights)
451  {
452  int nquad = m_base[0]->GetNumPoints();
453  Array<OneD, NekDouble> tmp(nquad);
454  Array<OneD, const NekDouble> w = m_base[0]->GetW();
455  Array<OneD, const NekDouble> base = m_base[0]->GetBdata();
456 
457  if(multiplybyweights)
458  {
459  Vmath::Vmul(nquad, inarray, 1, w, 1, tmp, 1);
460 
461  Blas::Dgemv('T',nquad,m_ncoeffs,1.0,base.get(),nquad,
462  &tmp[0],1,0.0,outarray.get(),1);
463  }
464  else
465  {
466  Blas::Dgemv('T',nquad,m_ncoeffs,1.0,base.get(),nquad,
467  &inarray[0],1,0.0,outarray.get(),1);
468  }
469  }
470 
471 
472 
473 
474 
475  //----------------------------
476  // Evaluation
477  //----------------------------
478 
479  void StdSegExp::v_FillMode(const int mode, Array<OneD, NekDouble> &outarray)
480  {
481  int nquad = m_base[0]->GetNumPoints();
482  const NekDouble * base = m_base[0]->GetBdata().get();
483 
484  ASSERTL2(mode <= m_ncoeffs,
485  "calling argument mode is larger than total expansion order");
486 
487  Vmath::Vcopy(nquad,(NekDouble *)base+mode*nquad,1, &outarray[0],1);
488  }
489 
490 
492  const Array<OneD, const NekDouble>& coords,
493  const Array<OneD, const NekDouble>& physvals)
494  {
495  return StdExpansion1D::v_PhysEvaluate(coords, physvals);
496  }
497 
499  const Array<OneD, const NekDouble> &inarray,
500  Array<OneD, NekDouble> &outarray,
501  const StdMatrixKey &mkey)
502  {
503  int nquad = m_base[0]->GetNumPoints();
504 
505  Array<OneD,NekDouble> physValues(nquad);
506  Array<OneD,NekDouble> dPhysValuesdx(nquad);
507 
508  v_BwdTrans(inarray,physValues);
509 
510  // Laplacian matrix operation
511  v_PhysDeriv(physValues,dPhysValuesdx);
512  v_IProductWRTBase(m_base[0]->GetDbdata(),dPhysValuesdx,outarray,1);
513  }
514 
515 
517  const Array<OneD, const NekDouble> &inarray,
518  Array<OneD, NekDouble> &outarray,
519  const StdMatrixKey &mkey)
520  {
521  int nquad = m_base[0]->GetNumPoints();
522 
523  Array<OneD,NekDouble> physValues(nquad);
524  Array<OneD,NekDouble> dPhysValuesdx(nquad);
526 
527  v_BwdTrans(inarray,physValues);
528 
529  // mass matrix operation
530  v_IProductWRTBase((m_base[0]->GetBdata()),physValues,wsp,1);
531 
532  // Laplacian matrix operation
533  v_PhysDeriv(physValues,dPhysValuesdx);
534  v_IProductWRTBase(m_base[0]->GetDbdata(),dPhysValuesdx,outarray,1);
535  Blas::Daxpy(m_ncoeffs, mkey.GetConstFactor(eFactorLambda), wsp.get(), 1, outarray.get(), 1);
536  }
537 
538  //up to here
540  const Array<OneD, const NekDouble> &inarray,
541  Array<OneD, NekDouble> &outarray)
542  {
543  int nquad0 = m_base[0]->GetNumPoints();
544 
545  const Array<OneD, const NekDouble>& w0 = m_base[0]->GetW();
546 
547  Vmath::Vmul(nquad0, inarray.get(),1,
548  w0.get(),1,outarray.get(),1);
549  }
550 
552  Array<OneD, NekDouble> &coords_0,
553  Array<OneD, NekDouble> &coords_1,
554  Array<OneD, NekDouble> &coords_2)
555  {
556  Blas::Dcopy(GetNumPoints(0),(m_base[0]->GetZ()).get(),
557  1,&coords_0[0],1);
558  }
559 
560 
561 
562 
563 
564  //---------------------------------------------------------------------
565  // Helper functions
566  //---------------------------------------------------------------------
567 
569  {
570  return 2;
571  }
572 
574  {
575  return 2;
576  }
577 
579  {
580  return 2;
581  }
582 
584  const std::vector<unsigned int> &nummodes,
585  int &modes_offset)
586  {
587  int nmodes = nummodes[modes_offset];
588  modes_offset += 1;
589 
590  return nmodes;
591  }
592 
593  //---------------------------------------------------------------------
594  // Wrapper functions
595  //---------------------------------------------------------------------
596 
598  {
599  DNekMatSharedPtr Mat;
600  MatrixType mattype;
601 
602  switch(mattype = mkey.GetMatrixType())
603  {
604  case eFwdTrans:
605  {
607  StdMatrixKey iprodkey(eIProductWRTBase,v_DetShapeType(),*this);
608  DNekMat &Iprod = *GetStdMatrix(iprodkey);
609  StdMatrixKey imasskey(eInvMass,v_DetShapeType(),*this);
610  DNekMat &Imass = *GetStdMatrix(imasskey);
611 
612  (*Mat) = Imass*Iprod;
613  }
614  break;
615  default:
616  {
618 
619  if(mattype == eMass)
620  {
621  // For Fourier basis set the imaginary component
622  // of mean mode to have a unit diagonal component
623  // in mass matrix
625  {
626  (*Mat)(1,1) = 1.0;
627  }
628  }
629  }
630  break;
631  }
632 
633  return Mat;
634  }
635 
636 
638  {
639  return v_GenMatrix(mkey);
640  }
641 
642  //---------------------------------------------------------------------
643  // Mappings
644  //---------------------------------------------------------------------
645 
646 
648  {
649  if(outarray.num_elements() != NumBndryCoeffs())
650  {
652  }
653  const LibUtilities::BasisType Btype = GetBasisType(0);
654  int nummodes = m_base[0]->GetNumModes();
655 
656  outarray[0] = 0;
657 
658  switch(Btype)
659  {
664  outarray[1]= nummodes-1;
665  break;
668  outarray[1] = 1;
669  break;
670  default:
671  ASSERTL0(0,"Mapping array is not defined for this expansion");
672  break;
673  }
674  }
675 
677  {
678  int i;
679  if(outarray.num_elements()!=GetNcoeffs()-NumBndryCoeffs())
680  {
682  }
683  const LibUtilities::BasisType Btype = GetBasisType(0);
684 
685  switch(Btype)
686  {
691  for(i = 0 ; i < GetNcoeffs()-2;i++)
692  {
693  outarray[i] = i+1;
694  }
695  break;
698  for(i = 0 ; i < GetNcoeffs()-2;i++)
699  {
700  outarray[i] = i+2;
701  }
702  break;
703  default:
704  ASSERTL0(0,"Mapping array is not defined for this expansion");
705  break;
706  }
707  }
708 
709  int StdSegExp::v_GetVertexMap(int localVertexId,bool useCoeffPacking)
710  {
711  ASSERTL0((localVertexId==0)||(localVertexId==1),"local vertex id"
712  "must be between 0 or 1");
713 
714  int localDOF = localVertexId;
715 
717  (localVertexId==1) )
718  {
719  localDOF = m_base[0]->GetNumModes()-1;
720  }
721  return localDOF;
722  }
723 
724 
725  }//end namespace
726 }//end namespace
727 
virtual NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray)
Integrate the physical point list inarray over region and return the value.
Definition: StdSegExp.cpp:118
virtual void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: StdSegExp.cpp:438
NekDouble GetConstFactor(const ConstFactorType &factor) const
Definition: StdMatrixKey.h:122
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:161
virtual void v_GetBoundaryMap(Array< OneD, unsigned int > &outarray)
Definition: StdSegExp.cpp:647
virtual int v_NumDGBndryCoeffs() const
Definition: StdSegExp.cpp:578
virtual void v_StdPhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1=NullNekDouble1DArray, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray)
Definition: StdSegExp.cpp:169
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_0, Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2)
Definition: StdSegExp.cpp:551
MatrixType GetMatrixType() const
Definition: StdMatrixKey.h:82
void MassMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
Definition: StdExpansion.h:931
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
virtual void v_BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Backward transform from coefficient space given in inarray and evaluate at the physical quadrature po...
Definition: StdSegExp.cpp:214
virtual void v_BwdTrans_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: StdSegExp.cpp:359
virtual int v_NumBndryCoeffs() const
Definition: StdSegExp.cpp:573
int GetNumPoints(const int dir) const
This function returns the number of quadrature points in the dir direction.
Definition: StdExpansion.h:229
virtual void v_FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Forward transform from physical quadrature space stored in inarray and evaluate the expansion coeffic...
Definition: StdSegExp.cpp:263
Principle Modified Functions .
Definition: BasisType.h:49
Lagrange Polynomials using the Gauss points .
Definition: BasisType.h:54
virtual void v_FillMode(const int mode, Array< OneD, NekDouble > &outarray)
Definition: StdSegExp.cpp:479
StdSegExp()
Default constructor.
Definition: StdSegExp.cpp:45
Fourier Expansion .
Definition: BasisType.h:52
Chebyshev Polynomials .
Definition: BasisType.h:56
LibUtilities::NekManager< StdMatrixKey, DNekBlkMat, StdMatrixKey::opLess > m_stdStaticCondMatrixManager
boost::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:70
DNekMatSharedPtr GetStdMatrix(const StdMatrixKey &mkey)
Definition: StdExpansion.h:684
virtual bool v_IsBoundaryInteriorExpansion()
Definition: StdSegExp.cpp:85
virtual int v_GetVertexMap(int localVertexId, bool useCoeffPacking=false)
Definition: StdSegExp.cpp:709
virtual int v_CalcNumberOfCoefficients(const std::vector< unsigned int > &nummodes, int &modes_offset)
Definition: StdSegExp.cpp:583
Class representing a segment element in reference space.
Definition: StdSegExp.h:54
The base class for all shapes.
Definition: StdExpansion.h:69
int GetVertexMap(const int localVertexId, bool useCoeffPacking=false)
Definition: StdExpansion.h:800
virtual int v_GetNverts() const
Definition: StdSegExp.cpp:568
virtual DNekMatSharedPtr v_GenMatrix(const StdMatrixKey &mkey)
Definition: StdSegExp.cpp:597
Principle Modified Functions .
Definition: BasisType.h:50
virtual DNekMatSharedPtr v_CreateStdMatrix(const StdMatrixKey &mkey)
Definition: StdSegExp.cpp:637
DNekMatSharedPtr CreateGeneralMatrix(const StdMatrixKey &mkey)
this function generates the mass matrix
double NekDouble
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Inner product of inarray over region with respect to the expansion basis (this)->m_base[0] and return...
Definition: StdSegExp.cpp:432
virtual NekDouble v_PhysEvaluate(const Array< OneD, const NekDouble > &Lcoords, const Array< OneD, const NekDouble > &physvals)
Definition: StdSegExp.cpp:491
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
Definition: StdExpansion.h:165
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:329
void PhysTensorDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Evaluate the derivative at the physical quadrature points given by inarray and return in outarray...
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed t...
Definition: ErrorUtil.hpp:213
virtual void v_HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
Definition: StdSegExp.cpp:516
virtual void v_FwdTrans_BndConstrained(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: StdSegExp.cpp:285
int GetNcoeffs(void) const
This function returns the total number of coefficients used in the expansion.
Definition: StdExpansion.h:131
virtual void v_MultiplyByStdQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: StdSegExp.cpp:539
virtual LibUtilities::ShapeType v_DetShapeType() const
Return Shape of region, using ShapeType enum list. i.e. Segment.
Definition: StdSegExp.cpp:80
Lagrange for SEM basis .
Definition: BasisType.h:53
T Vsum(int n, const T *x, const int incx)
Subtract return sum(x)
Definition: Vmath.cpp:714
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
Array< OneD, LibUtilities::BasisSharedPtr > m_base
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1038
virtual void v_LaplacianMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey)
Definition: StdSegExp.cpp:498
Describes the specification for a Basis.
Definition: Basis.h:50
virtual NekDouble v_PhysEvaluate(const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &physvals)
virtual void v_PhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1=NullNekDouble1DArray, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray)
Evaluate the derivative at the physical quadrature points given by inarray and return in outarray...
Definition: StdSegExp.cpp:151
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:169
virtual void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)
Definition: StdSegExp.cpp:447
virtual void v_GetInteriorMap(Array< OneD, unsigned int > &outarray)
Definition: StdSegExp.cpp:676