Nektar++
NodalTriExp.cpp
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File NodalTriExp.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: NodalTriExp routines
32 //
33 ///////////////////////////////////////////////////////////////////////////////
34 
37 
38 using namespace std;
39 
40 namespace Nektar
41 {
42 namespace LocalRegions
43 {
44 NodalTriExp::NodalTriExp(const LibUtilities::BasisKey &Ba,
45  const LibUtilities::BasisKey &Bb,
46  const LibUtilities::PointsType Ntype,
48  : StdExpansion(LibUtilities::StdTriData::getNumberOfCoefficients(
49  Ba.GetNumModes(), (Bb.GetNumModes())),
50  2, Ba, Bb),
51  StdExpansion2D(LibUtilities::StdTriData::getNumberOfCoefficients(
52  Ba.GetNumModes(), (Bb.GetNumModes())),
53  Ba, Bb),
54  StdNodalTriExp(Ba, Bb, Ntype), Expansion(geom), Expansion2D(geom),
55  m_matrixManager(
56  std::bind(&Expansion2D::CreateMatrix, this, std::placeholders::_1),
57  std::string("NodalTriExpMatrix")),
58  m_staticCondMatrixManager(std::bind(&Expansion::CreateStaticCondMatrix,
59  this, std::placeholders::_1),
60  std::string("NodalTriExpStaticCondMatrix"))
61 {
62 }
63 
65  : StdExpansion(T), StdExpansion2D(T), StdRegions::StdNodalTriExp(T),
66  Expansion(T), Expansion2D(T), m_matrixManager(T.m_matrixManager),
67  m_staticCondMatrixManager(T.m_staticCondMatrixManager)
68 {
69 }
70 
72 {
73 }
74 
75 //----------------------------
76 // Integration Methods
77 //----------------------------
78 
79 /** \brief Integrate the physical point list \a inarray over region
80  and return the value
81 
82  Inputs:\n
83 
84  - \a inarray: definition of function to be returned at quadrature point
85  of expansion.
86 
87  Outputs:\n
88 
89  - returns \f$\int^1_{-1}\int^1_{-1} u(\xi_1, \xi_2) J[i,j] d
90  \xi_1 d \xi_2 \f$ where \f$inarray[i,j] = u(\xi_{1i},\xi_{2j})
91  \f$ and \f$ J[i,j] \f$ is the Jacobian evaluated at the
92  quadrature point.
93 */
94 
96 {
97  int nquad0 = m_base[0]->GetNumPoints();
98  int nquad1 = m_base[1]->GetNumPoints();
100  NekDouble ival;
101  Array<OneD, NekDouble> tmp(nquad0 * nquad1);
102 
103  // multiply inarray with Jacobian
104  if (m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
105  {
106  Vmath::Vmul(nquad0 * nquad1, jac, 1, inarray, 1, tmp, 1);
107  }
108  else
109  {
110  Vmath::Smul(nquad0 * nquad1, jac[0], inarray, 1, tmp, 1);
111  }
112 
113  // call StdQuadExp version;
114  ival = StdNodalTriExp::v_Integral(tmp);
115  return ival;
116 }
117 
119  const Array<OneD, const NekDouble> &inarray,
120  Array<OneD, NekDouble> &outarray, bool multiplybyweights)
121 {
122  int nquad0 = m_base[0]->GetNumPoints();
123  int nquad1 = m_base[1]->GetNumPoints();
124  int order1 = m_base[1]->GetNumModes();
125 
126  if (multiplybyweights)
127  {
128  Array<OneD, NekDouble> tmp(nquad0 * nquad1 + nquad0 * order1);
129  Array<OneD, NekDouble> wsp(tmp + nquad0 * nquad1);
130 
131  MultiplyByQuadratureMetric(inarray, tmp);
132  StdTriExp::IProductWRTBase_SumFacKernel(
133  m_base[0]->GetBdata(), m_base[1]->GetBdata(), tmp, outarray, wsp);
134  NodalToModalTranspose(outarray, outarray);
135  }
136  else
137  {
138  Array<OneD, NekDouble> wsp(nquad0 * order1);
139 
140  StdTriExp::IProductWRTBase_SumFacKernel(m_base[0]->GetBdata(),
141  m_base[1]->GetBdata(), inarray,
142  outarray, wsp);
143  NodalToModalTranspose(outarray, outarray);
144  }
145 }
146 
148  const Array<OneD, const NekDouble> &inarray,
149  Array<OneD, NekDouble> &outarray)
150 {
151  int nq = GetTotPoints();
152  MatrixKey iprodmatkey(StdRegions::eIProductWRTBase, DetShapeType(), *this);
153  DNekScalMatSharedPtr iprodmat = m_matrixManager[iprodmatkey];
154 
155  Blas::Dgemv('N', m_ncoeffs, nq, iprodmat->Scale(),
156  (iprodmat->GetOwnedMatrix())->GetPtr().get(), m_ncoeffs,
157  inarray.get(), 1, 0.0, outarray.get(), 1);
158 }
159 
161  const int dir, const Array<OneD, const NekDouble> &inarray,
162  Array<OneD, NekDouble> &outarray)
163 {
164  int nquad0 = m_base[0]->GetNumPoints();
165  int nquad1 = m_base[1]->GetNumPoints();
166  int nqtot = nquad0 * nquad1;
167  int wspsize = max(nqtot, m_ncoeffs);
168 
169  Array<OneD, NekDouble> tmp0(4 * wspsize);
170  Array<OneD, NekDouble> tmp1(tmp0 + wspsize);
171  Array<OneD, NekDouble> tmp2(tmp0 + 2 * wspsize);
172  Array<OneD, NekDouble> tmp3(tmp0 + 3 * wspsize);
173 
175  tmp2D[0] = tmp1;
176  tmp2D[1] = tmp2;
177 
178  AlignVectorToCollapsedDir(dir, inarray, tmp2D);
179 
180  MultiplyByQuadratureMetric(tmp1, tmp1);
181  MultiplyByQuadratureMetric(tmp2, tmp2);
182 
183  IProductWRTBase_SumFacKernel(m_base[0]->GetDbdata(), m_base[1]->GetBdata(),
184  tmp1, tmp3, tmp0);
185  IProductWRTBase_SumFacKernel(m_base[0]->GetBdata(), m_base[1]->GetDbdata(),
186  tmp2, outarray, tmp0);
187  Vmath::Vadd(m_ncoeffs, tmp3, 1, outarray, 1, outarray, 1);
188 
189  NodalToModalTranspose(outarray, outarray);
190 }
191 
193  const int dir, const Array<OneD, const NekDouble> &inarray,
194  Array<OneD, Array<OneD, NekDouble>> &outarray)
195 {
196  ASSERTL1((dir == 0) || (dir == 1) || (dir == 2), "Invalid direction.");
197  ASSERTL1((dir == 2) ? (m_geom->GetCoordim() == 3) : true,
198  "Invalid direction.");
199 
200  int nquad0 = m_base[0]->GetNumPoints();
201  int nquad1 = m_base[1]->GetNumPoints();
202  int nqtot = nquad0 * nquad1;
203  int wspsize = max(nqtot, m_ncoeffs);
204 
205  const Array<TwoD, const NekDouble> &df =
206  m_metricinfo->GetDerivFactors(GetPointsKeys());
207 
208  Array<OneD, NekDouble> tmp0(4 * wspsize);
209  Array<OneD, NekDouble> tmp3(tmp0 + wspsize);
210  Array<OneD, NekDouble> gfac0(tmp0 + 2 * wspsize);
211  Array<OneD, NekDouble> gfac1(tmp0 + 3 * wspsize);
212 
213  Array<OneD, NekDouble> tmp1 = outarray[0];
214  Array<OneD, NekDouble> tmp2 = outarray[1];
215 
216  const Array<OneD, const NekDouble> &z0 = m_base[0]->GetZ();
217  const Array<OneD, const NekDouble> &z1 = m_base[1]->GetZ();
218 
219  // set up geometric factor: 2/(1-z1)
220  for (int i = 0; i < nquad1; ++i)
221  {
222  gfac0[i] = 2.0 / (1 - z1[i]);
223  }
224  for (int i = 0; i < nquad0; ++i)
225  {
226  gfac1[i] = 0.5 * (1 + z0[i]);
227  }
228 
229  for (int i = 0; i < nquad1; ++i)
230  {
231  Vmath::Smul(nquad0, gfac0[i], &inarray[0] + i * nquad0, 1,
232  &tmp0[0] + i * nquad0, 1);
233  }
234 
235  for (int i = 0; i < nquad1; ++i)
236  {
237  Vmath::Vmul(nquad0, &gfac1[0], 1, &tmp0[0] + i * nquad0, 1,
238  &tmp1[0] + i * nquad0, 1);
239  }
240 
241  if (m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
242  {
243  Vmath::Vmul(nqtot, &df[2 * dir][0], 1, &tmp0[0], 1, &tmp0[0], 1);
244  Vmath::Vmul(nqtot, &df[2 * dir + 1][0], 1, &tmp1[0], 1, &tmp1[0], 1);
245  Vmath::Vmul(nqtot, &df[2 * dir + 1][0], 1, &inarray[0], 1, &tmp2[0], 1);
246  }
247  else
248  {
249  Vmath::Smul(nqtot, df[2 * dir][0], tmp0, 1, tmp0, 1);
250  Vmath::Smul(nqtot, df[2 * dir + 1][0], tmp1, 1, tmp1, 1);
251  Vmath::Smul(nqtot, df[2 * dir + 1][0], inarray, 1, tmp2, 1);
252  }
253  Vmath::Vadd(nqtot, tmp0, 1, tmp1, 1, tmp1, 1);
254 }
255 
257  const int dir, const Array<OneD, const NekDouble> &inarray,
258  Array<OneD, NekDouble> &outarray)
259 {
260  int nq = GetTotPoints();
262 
263  switch (dir)
264  {
265  case 0:
266  {
268  }
269  break;
270  case 1:
271  {
273  }
274  break;
275  case 2:
276  {
278  }
279  break;
280  default:
281  {
282  ASSERTL1(false, "input dir is out of range");
283  }
284  break;
285  }
286 
287  MatrixKey iprodmatkey(mtype, DetShapeType(), *this);
288  DNekScalMatSharedPtr iprodmat = m_matrixManager[iprodmatkey];
289 
290  Blas::Dgemv('N', m_ncoeffs, nq, iprodmat->Scale(),
291  (iprodmat->GetOwnedMatrix())->GetPtr().get(), m_ncoeffs,
292  inarray.get(), 1, 0.0, outarray.get(), 1);
293 }
294 
295 ///////////////////////////////
296 /// Differentiation Methods
297 ///////////////////////////////
298 
299 /**
300  \brief Calculate the deritive of the physical points
301 **/
303  Array<OneD, NekDouble> &out_d0,
304  Array<OneD, NekDouble> &out_d1,
305  Array<OneD, NekDouble> &out_d2)
306 {
307  int nquad0 = m_base[0]->GetNumPoints();
308  int nquad1 = m_base[1]->GetNumPoints();
309  int nqtot = nquad0 * nquad1;
310  const Array<TwoD, const NekDouble> &df =
311  m_metricinfo->GetDerivFactors(GetPointsKeys());
312 
313  Array<OneD, NekDouble> diff0(2 * nqtot);
314  Array<OneD, NekDouble> diff1(diff0 + nqtot);
315 
316  StdNodalTriExp::v_PhysDeriv(inarray, diff0, diff1);
317 
318  if (m_metricinfo->GetGtype() == SpatialDomains::eDeformed)
319  {
320  if (out_d0.size())
321  {
322  Vmath::Vmul(nqtot, df[0], 1, diff0, 1, out_d0, 1);
323  Vmath::Vvtvp(nqtot, df[1], 1, diff1, 1, out_d0, 1, out_d0, 1);
324  }
325 
326  if (out_d1.size())
327  {
328  Vmath::Vmul(nqtot, df[2], 1, diff0, 1, out_d1, 1);
329  Vmath::Vvtvp(nqtot, df[3], 1, diff1, 1, out_d1, 1, out_d1, 1);
330  }
331 
332  if (out_d2.size())
333  {
334  Vmath::Vmul(nqtot, df[4], 1, diff0, 1, out_d2, 1);
335  Vmath::Vvtvp(nqtot, df[5], 1, diff1, 1, out_d2, 1, out_d2, 1);
336  }
337  }
338  else // regular geometry
339  {
340  if (out_d0.size())
341  {
342  Vmath::Smul(nqtot, df[0][0], diff0, 1, out_d0, 1);
343  Blas::Daxpy(nqtot, df[1][0], diff1, 1, out_d0, 1);
344  }
345 
346  if (out_d1.size())
347  {
348  Vmath::Smul(nqtot, df[2][0], diff0, 1, out_d1, 1);
349  Blas::Daxpy(nqtot, df[3][0], diff1, 1, out_d1, 1);
350  }
351 
352  if (out_d2.size())
353  {
354  Vmath::Smul(nqtot, df[4][0], diff0, 1, out_d2, 1);
355  Blas::Daxpy(nqtot, df[5][0], diff1, 1, out_d2, 1);
356  }
357  }
358 }
359 
360 /** \brief Forward transform from physical quadrature space
361  stored in \a inarray and evaluate the expansion coefficients and
362  store in \a (this)->m_coeffs
363 
364  Inputs:\n
365 
366  - \a inarray: array of physical quadrature points to be transformed
367 
368  Outputs:\n
369 
370  - (this)->_coeffs: updated array of expansion coefficients.
371 
372 */
374  Array<OneD, NekDouble> &outarray)
375 {
376  IProductWRTBase(inarray, outarray);
377 
378  // get Mass matrix inverse
379  MatrixKey masskey(StdRegions::eInvMass, DetShapeType(), *this,
383  DNekScalMatSharedPtr matsys = m_matrixManager[masskey];
384 
385  // copy inarray in case inarray == outarray
386  NekVector<NekDouble> in(m_ncoeffs, outarray, eCopy);
387  NekVector<NekDouble> out(m_ncoeffs, outarray, eWrapper);
388 
389  out = (*matsys) * in;
390 }
391 
393  const Array<OneD, const NekDouble> &inarray,
394  Array<OneD, NekDouble> &outarray, const StdRegions::StdMatrixKey &mkey)
395 {
397 
398  if (inarray.get() == outarray.get())
399  {
401  Vmath::Vcopy(m_ncoeffs, inarray.get(), 1, tmp.get(), 1);
402 
403  Blas::Dgemv('N', m_ncoeffs, m_ncoeffs, mat->Scale(),
404  (mat->GetOwnedMatrix())->GetPtr().get(), m_ncoeffs,
405  tmp.get(), 1, 0.0, outarray.get(), 1);
406  }
407  else
408  {
409  Blas::Dgemv('N', m_ncoeffs, m_ncoeffs, mat->Scale(),
410  (mat->GetOwnedMatrix())->GetPtr().get(), m_ncoeffs,
411  inarray.get(), 1, 0.0, outarray.get(), 1);
412  }
413 }
414 
416  Array<OneD, NekDouble> &coords_1,
417  Array<OneD, NekDouble> &coords_2)
418 {
419  Expansion::v_GetCoords(coords_0, coords_1, coords_2);
420 }
421 
422 // get the coordinates "coords" at the local coordinates "Lcoords"
424  Array<OneD, NekDouble> &coords)
425 {
426  int i;
427 
428  ASSERTL1(Lcoords[0] >= -1.0 && Lcoords[1] <= 1.0 && Lcoords[1] >= -1.0 &&
429  Lcoords[1] <= 1.0,
430  "Local coordinates are not in region [-1,1]");
431 
432  m_geom->FillGeom();
433 
434  for (i = 0; i < m_geom->GetCoordim(); ++i)
435  {
436  coords[i] = m_geom->GetCoord(i, Lcoords);
437  }
438 }
439 
441  const StdRegions::StdMatrixKey &mkey)
442 {
443  LibUtilities::BasisKey bkey0 = m_base[0]->GetBasisKey();
444  LibUtilities::BasisKey bkey1 = m_base[1]->GetBasisKey();
448 
449  return tmp->GetStdMatrix(mkey);
450 }
451 
453  const Array<OneD, const NekDouble> &coord,
454  const Array<OneD, const NekDouble> &physvals)
455 
456 {
458 
459  ASSERTL0(m_geom, "m_geom not defined");
460  m_geom->GetLocCoords(coord, Lcoord);
461 
462  return StdNodalTriExp::v_PhysEvaluate(Lcoord, physvals);
463 }
464 
466 {
467 
469  m_base[0]->GetBasisKey(), m_base[1]->GetBasisKey(),
471 }
472 
474 {
476  m_base[0]->GetPointsKey());
478  m_base[1]->GetPointsKey());
479 
481  bkey0, bkey1, m_nodalPointsKey.GetPointsType());
482 }
483 
485 {
486  DNekMatSharedPtr returnval;
487 
488  switch (mkey.GetMatrixType())
489  {
496  returnval = Expansion2D::v_GenMatrix(mkey);
497  break;
498  default:
499  returnval = StdNodalTriExp::v_GenMatrix(mkey);
500  break;
501  }
502  return returnval;
503 }
504 
506 {
507  int i;
508  const SpatialDomains::GeomFactorsSharedPtr &geomFactors =
509  GetGeom()->GetMetricInfo();
510  const SpatialDomains::GeomType type = geomFactors->GetGtype();
511 
513  const Array<TwoD, const NekDouble> &df =
514  geomFactors->GetDerivFactors(ptsKeys);
515  const Array<OneD, const NekDouble> &jac = geomFactors->GetJac(ptsKeys);
516  int nqe = m_base[0]->GetNumPoints();
517  int dim = GetCoordim();
518 
521  for (i = 0; i < dim; ++i)
522  {
523  normal[i] = Array<OneD, NekDouble>(nqe);
524  }
525 
526  size_t nqb = nqe;
527  size_t nbnd = edge;
530 
531  // Regular geometry case
532  if ((type == SpatialDomains::eRegular) ||
534  {
535  NekDouble fac;
536  // Set up normals
537  switch (edge)
538  {
539  case 0:
540  for (i = 0; i < GetCoordim(); ++i)
541  {
542  Vmath::Fill(nqe, -df[2 * i + 1][0], normal[i], 1);
543  }
544  break;
545  case 1:
546  for (i = 0; i < GetCoordim(); ++i)
547  {
548  Vmath::Fill(nqe, df[2 * i + 1][0] + df[2 * i][0], normal[i],
549  1);
550  }
551  break;
552  case 2:
553  for (i = 0; i < GetCoordim(); ++i)
554  {
555  Vmath::Fill(nqe, -df[2 * i][0], normal[i], 1);
556  }
557  break;
558  default:
559  ASSERTL0(false, "Edge is out of range (edge < 3)");
560  }
561 
562  // normalise
563  fac = 0.0;
564  for (i = 0; i < GetCoordim(); ++i)
565  {
566  fac += normal[i][0] * normal[i][0];
567  }
568  fac = 1.0 / sqrt(fac);
569 
570  Vmath::Fill(nqb, fac, length, 1);
571 
572  for (i = 0; i < GetCoordim(); ++i)
573  {
574  Vmath::Smul(nqe, fac, normal[i], 1, normal[i], 1);
575  }
576  }
577  else // Set up deformed normals
578  {
579  int j;
580 
581  int nquad0 = ptsKeys[0].GetNumPoints();
582  int nquad1 = ptsKeys[1].GetNumPoints();
583 
584  LibUtilities::PointsKey from_key;
585 
586  Array<OneD, NekDouble> normals(GetCoordim() * max(nquad0, nquad1), 0.0);
587  Array<OneD, NekDouble> edgejac(GetCoordim() * max(nquad0, nquad1), 0.0);
588 
589  // Extract Jacobian along edges and recover local
590  // derivates (dx/dr) for polynomial interpolation by
591  // multiplying m_gmat by jacobian
592  switch (edge)
593  {
594  case 0:
595  for (j = 0; j < nquad0; ++j)
596  {
597  edgejac[j] = jac[j];
598  for (i = 0; i < GetCoordim(); ++i)
599  {
600  normals[i * nquad0 + j] =
601  -df[2 * i + 1][j] * edgejac[j];
602  }
603  }
604  from_key = ptsKeys[0];
605  break;
606  case 1:
607  for (j = 0; j < nquad1; ++j)
608  {
609  edgejac[j] = jac[nquad0 * j + nquad0 - 1];
610  for (i = 0; i < GetCoordim(); ++i)
611  {
612  normals[i * nquad1 + j] =
613  (df[2 * i][nquad0 * j + nquad0 - 1] +
614  df[2 * i + 1][nquad0 * j + nquad0 - 1]) *
615  edgejac[j];
616  }
617  }
618  from_key = ptsKeys[1];
619  break;
620  case 2:
621  for (j = 0; j < nquad1; ++j)
622  {
623  edgejac[j] = jac[nquad0 * j];
624  for (i = 0; i < GetCoordim(); ++i)
625  {
626  normals[i * nquad1 + j] =
627  -df[2 * i][nquad0 * j] * edgejac[j];
628  }
629  }
630  from_key = ptsKeys[1];
631  break;
632  default:
633  ASSERTL0(false, "edge is out of range (edge < 3)");
634  }
635 
636  int nq = from_key.GetNumPoints();
637  Array<OneD, NekDouble> work(nqe, 0.0);
638 
639  // interpolate Jacobian and invert
640  LibUtilities::Interp1D(from_key, jac, m_base[0]->GetPointsKey(), work);
641  Vmath::Sdiv(nq, 1.0, &work[0], 1, &work[0], 1);
642 
643  // interpolate
644  for (i = 0; i < GetCoordim(); ++i)
645  {
646  LibUtilities::Interp1D(from_key, &normals[i * nq],
647  m_base[0]->GetPointsKey(), &normal[i][0]);
648  Vmath::Vmul(nqe, work, 1, normal[i], 1, normal[i], 1);
649  }
650 
651  // normalise normal vectors
652  Vmath::Zero(nqe, work, 1);
653  for (i = 0; i < GetCoordim(); ++i)
654  {
655  Vmath::Vvtvp(nqe, normal[i], 1, normal[i], 1, work, 1, work, 1);
656  }
657 
658  Vmath::Vsqrt(nqe, work, 1, work, 1);
659  Vmath::Sdiv(nqe, 1.0, work, 1, work, 1);
660 
661  Vmath::Vcopy(nqb, work, 1, length, 1);
662 
663  for (i = 0; i < GetCoordim(); ++i)
664  {
665  Vmath::Vmul(nqe, normal[i], 1, work, 1, normal[i], 1);
666  }
667 
668  // Reverse direction so that points are in
669  // anticlockwise direction if edge >=2
670  if (edge >= 2)
671  {
672  for (i = 0; i < GetCoordim(); ++i)
673  {
674  Vmath::Reverse(nqe, normal[i], 1, normal[i], 1);
675  }
676  }
677  }
678 }
679 
680 } // namespace LocalRegions
681 } // namespace Nektar
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:215
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:249
Describes the specification for a Basis.
Definition: Basis.h:50
Defines a specification for a set of points.
Definition: Points.h:59
PointsType GetPointsType() const
Definition: Points.h:109
unsigned int GetNumPoints() const
Definition: Points.h:104
virtual DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey)
std::map< int, NormalVector > m_traceNormals
Definition: Expansion.h:275
std::map< int, Array< OneD, NekDouble > > m_elmtBndNormDirElmtLen
the element length in each element boundary(Vertex, edge or face) normal direction calculated based o...
Definition: Expansion.h:285
SpatialDomains::GeometrySharedPtr GetGeom() const
Definition: Expansion.cpp:166
SpatialDomains::GeometrySharedPtr m_geom
Definition: Expansion.h:272
SpatialDomains::GeomFactorsSharedPtr m_metricinfo
Definition: Expansion.h:273
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3)
Definition: Expansion.cpp:524
DNekScalMatSharedPtr GetLocMatrix(const LocalRegions::MatrixKey &mkey)
Definition: Expansion.cpp:88
void AlignVectorToCollapsedDir(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray)
Definition: Expansion.h:150
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition: NodalTriExp.h:191
void GetCoord(const Array< OneD, const NekDouble > &Lcoords, Array< OneD, NekDouble > &coords)
virtual void v_AlignVectorToCollapsedDir(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray)
void PhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray)
Differentiation Methods.
DNekMatSharedPtr CreateStdMatrix(const StdRegions::StdMatrixKey &mkey)
void GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3=NullNekDouble1DArray)
void GeneralMatrixOp_MatOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
void IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Inner product of inarray over region with respect to the expansion basis (this)->_Base[0] and return ...
Definition: NodalTriExp.h:86
void IProductWRTDerivBase_MatOp(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void 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...
void IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
NekDouble PhysEvaluate(const Array< OneD, const NekDouble > &coord, const Array< OneD, const NekDouble > &physvals)
NekDouble Integral(const Array< OneD, const NekDouble > &inarray)
Integrate the physical point list inarray over region.
Definition: NodalTriExp.cpp:95
void IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)
void v_ComputeTraceNormal(const int edge)
void IProductWRTBase_MatOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual StdRegions::StdExpansionSharedPtr v_GetStdExp(void) const
virtual DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey)
NodalTriExp(const LibUtilities::BasisKey &Ba, const LibUtilities::BasisKey &Bb, const LibUtilities::PointsType Ntype, const SpatialDomains::TriGeomSharedPtr &geom)
Constructor using BasisKey class for quadrature points and order definition.
Definition: NodalTriExp.cpp:44
virtual StdRegions::StdExpansionSharedPtr v_GetLinStdExp(void) const
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
void IProductWRTBase_SumFacKernel(const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0=true, bool doCheckCollDir1=true)
int GetTotPoints() const
This function returns the total number of quadrature points used in the element.
Definition: StdExpansion.h:140
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
Definition: StdExpansion.h:163
const LibUtilities::PointsKeyVector GetPointsKeys() const
LibUtilities::ShapeType DetShapeType() const
This function returns the shape of the expansion domain.
Definition: StdExpansion.h:375
void MultiplyByQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: StdExpansion.h:731
Array< OneD, LibUtilities::BasisSharedPtr > m_base
MatrixType GetMatrixType() const
Definition: StdMatrixKey.h:85
void NodalToModalTranspose(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
LibUtilities::PointsKey m_nodalPointsKey
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:246
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:154
void Interp1D(const BasisKey &fbasis0, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, Array< OneD, NekDouble > &to)
this function interpolates a 1D function evaluated at the quadrature points of the basis fbasis0 to ...
Definition: Interp.cpp:52
std::vector< PointsKey > PointsKeyVector
Definition: Points.h:250
std::shared_ptr< GeomFactors > GeomFactorsSharedPtr
Pointer to a GeomFactors object.
Definition: GeomFactors.h:62
GeomType
Indicates the type of element geometry.
@ eRegular
Geometry is straight-sided with constant geometric factors.
@ eMovingRegular
Currently unused.
@ eDeformed
Geometry is curved or has non-constant factors.
std::shared_ptr< TriGeom > TriGeomSharedPtr
Definition: TriGeom.h:58
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
std::shared_ptr< StdNodalTriExp > StdNodalTriExpSharedPtr
static ConstFactorMap NullConstFactorMap
Definition: StdRegions.hpp:283
static VarCoeffMap NullVarCoeffMap
Definition: StdRegions.hpp:241
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:1
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:75
double NekDouble
void Vsqrt(int n, const T *x, const int incx, T *y, const int incy)
sqrt y = sqrt(x)
Definition: Vmath.cpp:534
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:209
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:574
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:359
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:248
void Sdiv(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha/y.
Definition: Vmath.cpp:324
void Zero(int n, T *x, const int incx)
Zero vector.
Definition: Vmath.cpp:492
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
Definition: Vmath.cpp:45
void Reverse(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1286
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1255
scalarT< T > sqrt(scalarT< T > in)
Definition: scalar.hpp:291