Nektar++
library/Collections/Helmholtz.cpp
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File: Helmholtz.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: Helmholtz operator implementations
32 //
33 ///////////////////////////////////////////////////////////////////////////////
34 
35 #include <boost/core/ignore_unused.hpp>
36 
37 #include <MatrixFreeOps/Operator.hpp>
38 
39 #include <Collections/Operator.h>
41 #include <Collections/Collection.h>
42 #include <Collections/IProduct.h>
43 
44 using namespace std;
45 
46 namespace Nektar {
47 namespace Collections {
48 
56 
57 /**
58  * @brief Helmholtz operator using LocalRegions implementation.
59  */
61 {
62  public:
64 
66  {
67  }
68 
69  void operator()(
70  const Array<OneD, const NekDouble> &entry0,
71  Array<OneD, NekDouble> &entry1,
72  Array<OneD, NekDouble> &entry2,
73  Array<OneD, NekDouble> &entry3,
74  Array<OneD, NekDouble> &wsp) final
75  {
76  boost::ignore_unused(entry2,entry3,wsp);
77 
78  unsigned int nmodes = m_expList[0]->GetNcoeffs();
80 
81  for(int n = 0; n < m_numElmt; ++n)
82  {
84  (m_expList)[n]->DetShapeType(),
85  *(m_expList)[n], m_factors);
86  m_expList[n]->GeneralMatrixOp(entry0 + n *nmodes,
87  tmp = entry1 + n * nmodes,
88  mkey);
89  }
90  }
91 
92  void operator()(int dir,
93  const Array<OneD, const NekDouble> &input,
94  Array<OneD, NekDouble> &output,
95  Array<OneD, NekDouble> &wsp) final
96  {
97  boost::ignore_unused(dir, input, output, wsp);
98  NEKERROR(ErrorUtil::efatal, "Not valid for this operator.");
99  }
100 
101  virtual void CheckFactors(StdRegions::FactorMap factors,
102  int coll_phys_offset)
103  {
104  boost::ignore_unused(coll_phys_offset);
105  m_factors = factors;
106  }
107 
108 
109  protected:
110  int m_dim;
112  vector<StdRegions::StdExpansionSharedPtr> m_expList;
114 
115  private:
117  vector<StdRegions::StdExpansionSharedPtr> pCollExp,
118  CoalescedGeomDataSharedPtr pGeomData,
119  StdRegions::FactorMap factors)
120  : Operator(pCollExp, pGeomData, factors)
121  {
122  m_expList = pCollExp;
123  m_dim = pCollExp[0]->GetNumBases();
124  m_coordim = pCollExp[0]->GetCoordim();
125 
126  m_factors = factors;
127  }
128 };
129 
130 /// Factory initialisation for the Helmholtz_NoCollection operators
131 OperatorKey Helmholtz_NoCollection::m_typeArr[] = {
134  Helmholtz_NoCollection::create,
135  "Helmholtz_NoCollection_Seg"),
138  Helmholtz_NoCollection::create,
139  "Helmholtz_NoCollection_Tri"),
142  Helmholtz_NoCollection::create,
143  "Helmholtz_NoCollection_NodalTri"),
146  Helmholtz_NoCollection::create,
147  "Helmholtz_NoCollection_Quad"),
150  Helmholtz_NoCollection::create,
151  "Helmholtz_NoCollection_Tet"),
154  Helmholtz_NoCollection::create,
155  "Helmholtz_NoCollection_NodalTet"),
158  Helmholtz_NoCollection::create,
159  "Helmholtz_NoCollection_Pyr"),
162  Helmholtz_NoCollection::create,
163  "Helmholtz_NoCollection_Prism"),
166  Helmholtz_NoCollection::create,
167  "Helmholtz_NoCollection_NodalPrism"),
170  Helmholtz_NoCollection::create,
171  "Helmholtz_NoCollection_Hex")
172 };
173 
174 
175 /**
176  * @brief Helmholtz operator using LocalRegions implementation.
177  */
179 {
180  public:
182 
184  {
185  }
186 
188  const Array<OneD, const NekDouble> &input,
189  Array<OneD, NekDouble> &output,
190  Array<OneD, NekDouble> &output1,
191  Array<OneD, NekDouble> &output2,
192  Array<OneD, NekDouble> &wsp) final
193  {
194  boost::ignore_unused(output1,output2);
195 
196  const int nCoeffs = m_stdExp->GetNcoeffs();
197  const int nPhys = m_stdExp->GetTotPoints();
198 
199  ASSERTL1(input.size() >= m_numElmt*nCoeffs,
200  "input array size is insufficient");
201  ASSERTL1(output.size() >= m_numElmt*nCoeffs,
202  "output array size is insufficient");
203 
204  Array<OneD, NekDouble> tmpphys, t1;
207 
208  tmpphys = wsp;
209  for(int i = 1; i < m_coordim+1; ++i)
210  {
211  dtmp[i-1] = wsp + i*nPhys;
212  tmp [i-1] = wsp + (i+m_coordim)*nPhys;
213  }
214 
215  for (int i = 0; i < m_numElmt; ++i)
216  {
217  m_stdExp->BwdTrans(input + i*nCoeffs, tmpphys);
218 
219  // local derivative
220  m_stdExp->PhysDeriv(tmpphys, dtmp[0], dtmp[1], dtmp[2]);
221 
222  // determine mass matrix term
223  if(m_isDeformed)
224  {
225  Vmath::Vmul(nPhys,m_jac+i*nPhys,1,tmpphys,1,tmpphys,1);
226  }
227  else
228  {
229  Vmath::Smul(nPhys,m_jac[i],tmpphys,1,tmpphys,1);
230  }
231 
232  m_stdExp->IProductWRTBase(tmpphys,t1 = output + i*nCoeffs);
233  Vmath::Smul(nCoeffs,m_lambda,output + i*nCoeffs,1,
234  t1 = output+i*nCoeffs,1);
235 
236  if(m_isDeformed)
237  {
238  // calculate full derivative
239  for(int j = 0; j < m_coordim; ++j)
240  {
241  Vmath::Vmul(nPhys,
242  m_derivFac[j*m_dim].origin() + i*nPhys, 1,
243  &dtmp[0][0], 1, &tmp[j][0], 1);
244 
245  for(int k = 1; k < m_dim; ++k)
246  {
247  Vmath::Vvtvp (nPhys, m_derivFac[j*m_dim+k].origin()
248  + i*nPhys, 1, &dtmp[k][0], 1,
249  &tmp[j][0], 1, &tmp[j][0], 1);
250  }
251  }
252 
253  if(m_HasVarCoeffDiff)
254  {
255  // calculate dtmp[i] = dx/dxi sum_j diff[0][j] tmp[j]
256  // + dy/dxi sum_j diff[1][j] tmp[j]
257  // + dz/dxi sum_j diff[2][j] tmp[j]
258 
259  // First term
260  Vmath::Smul(nPhys, m_diff[0][0], &tmp[0][0], 1,
261  &tmpphys[0], 1);
262  for(int l = 1; l < m_coordim; ++l)
263  {
264  Vmath::Svtvp(nPhys, m_diff[0][l], &tmp[l][0], 1,
265  &tmpphys[0], 1, &tmpphys[0], 1);
266  }
267 
268  for(int j = 0; j < m_dim; ++j)
269  {
270  Vmath::Vmul(nPhys,
271  m_derivFac[j].origin() + i*nPhys, 1,
272  &tmpphys[0], 1, &dtmp[j][0], 1);
273  }
274 
275  // Second and third terms
276  for(int k = 1; k < m_coordim; ++k)
277  {
278  Vmath::Smul(nPhys,m_diff[k][0], &tmp[0][0], 1,
279  &tmpphys[0], 1);
280  for(int l = 1; l < m_coordim; ++l)
281  {
282  Vmath::Svtvp(nPhys, m_diff[k][l], &tmp[l][0], 1,
283  &tmpphys[0], 1, &tmpphys[0], 1);
284  }
285 
286  for(int j = 0; j < m_dim; ++j)
287  {
288  Vmath::Vvtvp (nPhys,
289  m_derivFac[j +k*m_dim].origin()
290  + i*nPhys, 1,
291  &tmpphys[0], 1,
292  &dtmp[j][0], 1, &dtmp[j][0], 1);
293  }
294  }
295  }
296  else
297  {
298  // calculate dx/dxi tmp[0] + dy/dxi tmp[1]
299  // + dz/dxi tmp[2]
300  for(int j = 0; j < m_dim; ++j)
301  {
302  Vmath::Vmul (nPhys,
303  m_derivFac[j].origin() + i*nPhys, 1,
304  &tmp[0][0], 1, &dtmp[j][0], 1);
305 
306  for(int k = 1; k < m_coordim; ++k)
307  {
308  Vmath::Vvtvp (nPhys,
309  m_derivFac[j +k*m_dim].origin()
310  + i*nPhys, 1, &tmp[k][0], 1,
311  &dtmp[j][0], 1, &dtmp[j][0], 1);
312  }
313  }
314  }
315 
316  // calculate Iproduct WRT Std Deriv
317  for(int j = 0; j < m_dim; ++j)
318  {
319 
320  // multiply by Jacobian
321  Vmath::Vmul(nPhys,m_jac+i*nPhys,1,dtmp[j],1,dtmp[j],1);
322 
323  m_stdExp->IProductWRTDerivBase(j,dtmp[j],tmp[0]);
324  Vmath::Vadd(nCoeffs,tmp[0],1,output+i*nCoeffs,1,
325  t1 = output+i*nCoeffs,1);
326  }
327  }
328  else
329  {
330  // calculate full derivative
331  for(int j = 0; j < m_coordim; ++j)
332  {
333  Vmath::Smul(nPhys, m_derivFac[j*m_dim][i],
334  &dtmp[0][0], 1, &tmp[j][0], 1);
335 
336  for(int k = 1; k < m_dim; ++k)
337  {
338  Vmath::Svtvp (nPhys, m_derivFac[j*m_dim+k][i],
339  &dtmp[k][0], 1,
340  &tmp[j][0], 1,
341  &tmp[j][0], 1);
342  }
343 
344  }
345 
346  if(m_HasVarCoeffDiff)
347  {
348  // calculate dtmp[i] = dx/dxi sum_j diff[0][j] tmp[j]
349  // + dy/dxi sum_j diff[1][j] tmp[j]
350  // + dz/dxi sum_j diff[2][j] tmp[j]
351 
352  // First term
353  Vmath::Smul(nPhys, m_diff[0][0], &tmp[0][0], 1,
354  &tmpphys[0], 1);
355  for(int l = 1; l < m_coordim; ++l)
356  {
357  Vmath::Svtvp(nPhys, m_diff[0][l], &tmp[l][0], 1,
358  &tmpphys[0], 1, &tmpphys[0], 1);
359  }
360 
361  for(int j = 0; j < m_dim; ++j)
362  {
363  Vmath::Smul (nPhys, m_derivFac[j][i],
364  &tmpphys[0], 1, &dtmp[j][0], 1);
365  }
366 
367  // Second and third terms
368  for(int k = 1; k < m_coordim; ++k)
369  {
370  Vmath::Smul(nPhys, m_diff[k][0], &tmp[0][0], 1,
371  &tmpphys[0], 1);
372  for(int l = 1; l < m_coordim; ++l)
373  {
374  Vmath::Svtvp(nPhys, m_diff[k][l], &tmp[l][0], 1,
375  &tmpphys[0], 1, &tmpphys[0], 1);
376  }
377 
378  for(int j = 0; j < m_dim; ++j)
379  {
380  Vmath::Svtvp (nPhys, m_derivFac[j +k*m_dim][i],
381  &tmpphys[0], 1, &dtmp[j][0], 1,
382  &dtmp[j][0], 1);
383  }
384  }
385  }
386  else
387  {
388  // calculate dx/dxi tmp[0] + dy/dxi tmp[2]
389  // + dz/dxi tmp[3]
390  for(int j = 0; j < m_dim; ++j)
391  {
392  Vmath::Smul (nPhys,m_derivFac[j][i],
393  &tmp[0][0], 1, &dtmp[j][0],1);
394 
395  for(int k = 1; k < m_coordim; ++k)
396  {
397  Vmath::Svtvp (nPhys, m_derivFac[j +k*m_dim][i],
398  &tmp[k][0], 1, &dtmp[j][0], 1,
399  &dtmp[j][0], 1);
400  }
401  }
402  }
403 
404  // calculate Iproduct WRT Std Deriv
405  for(int j = 0; j < m_dim; ++j)
406  {
407  // multiply by Jacobian
408  Vmath::Smul(nPhys,m_jac[i],dtmp[j],1,dtmp[j],1);
409 
410  m_stdExp->IProductWRTDerivBase(j,dtmp[j],tmp[0]);
411  Vmath::Vadd(nCoeffs,tmp[0],1,output+i*nCoeffs,1,
412  t1 = output+i*nCoeffs,1);
413  }
414  }
415  }
416  }
417 
418  void operator()(int dir,
419  const Array<OneD, const NekDouble> &input,
420  Array<OneD, NekDouble> &output,
421  Array<OneD, NekDouble> &wsp) final
422  {
423  boost::ignore_unused(dir, input, output, wsp);
424  NEKERROR(ErrorUtil::efatal, "Not valid for this operator.");
425  }
426 
427 
428  /**
429  * @brief Check the validity of supplied constant factors.
430  *
431  * @param factors Map of factors
432  * @param coll_phys_offset Unused
433  */
434  virtual void CheckFactors(StdRegions::FactorMap factors,
435  int coll_phys_offset)
436  {
437  boost::ignore_unused(coll_phys_offset);
438 
439  // If match previous factors, nothing to do.
440  if (m_factors == factors)
441  {
442  return;
443  }
444 
445  m_factors = factors;
446 
447  // Check Lambda constant of Helmholtz operator
448  auto x = factors.find(StdRegions::eFactorLambda);
449  ASSERTL1(x != factors.end(),
450  "Constant factor not defined: "
451  + std::string(StdRegions::ConstFactorTypeMap
453  m_lambda = x->second;
454 
455  // If varcoeffs not supplied, nothing else to do.
456  m_HasVarCoeffDiff = false;
457  auto d = factors.find(StdRegions::eFactorCoeffD00);
458  if (d == factors.end())
459  {
460  return;
461  }
462 
463  m_diff = Array<OneD, Array<OneD, NekDouble> >(m_coordim);
464  for(int i = 0; i < m_coordim; ++i)
465  {
466  m_diff[i] = Array<OneD, NekDouble>(m_coordim, 0.0);
467  }
468 
469  for(int i = 0; i < m_coordim; ++i)
470  {
471  d = factors.find(m_factorCoeffDef[i][i]);
472  if (d != factors.end())
473  {
474  m_diff[i][i] = d->second;
475  }
476  else
477  {
478  m_diff[i][i] = 1.0;
479  }
480 
481  for(int j = i+1; j < m_coordim; ++j)
482  {
483  d = factors.find(m_factorCoeffDef[i][j]);
484  if (d != factors.end())
485  {
486  m_diff[i][j] = m_diff[j][i] = d->second;
487  }
488  }
489  }
490  m_HasVarCoeffDiff = true;
491  }
492 
493 
494  protected:
497  int m_dim;
503  const StdRegions::ConstFactorType m_factorCoeffDef[3][3] =
510 
511  private:
513  vector<StdRegions::StdExpansionSharedPtr> pCollExp,
514  CoalescedGeomDataSharedPtr pGeomData,
515  StdRegions::FactorMap factors)
516  : Operator(pCollExp, pGeomData, factors)
517  {
518  LibUtilities::PointsKeyVector PtsKey = m_stdExp->GetPointsKeys();
519  m_dim = PtsKey.size();
520  m_coordim = pCollExp[0]->GetCoordim();
521  int nqtot = m_stdExp->GetTotPoints();
522 
523  m_derivFac = pGeomData->GetDerivFactors(pCollExp);
524  m_jac = pGeomData->GetJac(pCollExp);
525  m_wspSize = (2*m_coordim+1)*nqtot;
526 
527  m_lambda = 1.0;
528  m_HasVarCoeffDiff = false;
529  m_factors = StdRegions::NullFactorMap;
530  this->CheckFactors(factors, 0);
531  }
532 };
533 
534 /// Factory initialisation for the Helmholtz_IterPerExp operators
535 OperatorKey Helmholtz_IterPerExp::m_typeArr[] = {
538  Helmholtz_IterPerExp::create,
539  "Helmholtz_IterPerExp_Seg"),
542  Helmholtz_IterPerExp::create,
543  "Helmholtz_IterPerExp_Tri"),
546  Helmholtz_IterPerExp::create,
547  "Helmholtz_IterPerExp_NodalTri"),
550  Helmholtz_IterPerExp::create,
551  "Helmholtz_IterPerExp_Quad"),
554  Helmholtz_IterPerExp::create,
555  "Helmholtz_IterPerExp_Tet"),
558  Helmholtz_IterPerExp::create,
559  "Helmholtz_IterPerExp_NodalTet"),
562  Helmholtz_IterPerExp::create,
563  "Helmholtz_IterPerExp_Pyr"),
566  Helmholtz_IterPerExp::create,
567  "Helmholtz_IterPerExp_Prism"),
570  Helmholtz_IterPerExp::create,
571  "Helmholtz_IterPerExp_NodalPrism"),
574  Helmholtz_IterPerExp::create,
575  "Helmholtz_IterPerExp_Hex")
576 };
577 
578 
579 /**
580  * @brief Helmholtz operator using matrix free operators.
581  */
583 {
584 public:
586 
588  {
589  }
590 
592  const Array<OneD, const NekDouble> &input,
593  Array<OneD, NekDouble> &output0,
594  Array<OneD, NekDouble> &output1,
595  Array<OneD, NekDouble> &output2,
596  Array<OneD, NekDouble> &wsp) final
597  {
598  boost::ignore_unused(output1,output2,wsp);
599 
600  if (m_isPadded)
601  {
602  // copy into padded vector
603  Vmath::Vcopy(m_nmtot, input, 1, m_input, 1);
604  (*m_oper)(m_input, m_output);
605  Vmath::Vcopy(m_nmtot, m_output, 1, output0, 1);
606  }
607  else
608  {
609  (*m_oper)(input, output0);
610  }
611  }
612 
613  void operator()(int dir,
614  const Array<OneD, const NekDouble> &input,
615  Array<OneD, NekDouble> &output,
616  Array<OneD, NekDouble> &wsp) final
617  {
618  boost::ignore_unused(dir,input,output,wsp);
619  NEKERROR(ErrorUtil::efatal, "Not valid for this operator.");
620  }
621 
622 
623  /**
624  *
625  */
626  virtual void CheckFactors(StdRegions::FactorMap factors,
627  int coll_phys_offset)
628  {
629  boost::ignore_unused(coll_phys_offset);
630 
631  if (factors == m_factors)
632  {
633  return;
634  }
635 
636  m_factors = factors;
637 
638  // Set lambda for this call
639  auto x = factors.find(StdRegions::eFactorLambda);
640  ASSERTL1(x != factors.end(),
641  "Constant factor not defined: "
642  + std::string(StdRegions::ConstFactorTypeMap[
644  m_oper->SetLambda(x->second);
645 
646  // set constant diffusion coefficients
647  bool isConstVarDiff = false;
649  diff[0] = diff[2] = diff[5] = 1.0;
650 
651  auto xd00 = factors.find(StdRegions::eFactorCoeffD00);
652  if (xd00 != factors.end() && xd00->second != 1.0) {
653  isConstVarDiff = true;
654  diff[0] = xd00->second;
655  }
656 
657  auto xd01 = factors.find(StdRegions::eFactorCoeffD01);
658  if (xd01 != factors.end() && xd01->second != 0.0) {
659  isConstVarDiff = true;
660  diff[1] = xd01->second;
661  }
662 
663  auto xd11 = factors.find(StdRegions::eFactorCoeffD11);
664  if (xd11 != factors.end() && xd11->second != 1.0) {
665  isConstVarDiff = true;
666  diff[2] = xd11->second;
667  }
668 
669  auto xd02 = factors.find(StdRegions::eFactorCoeffD02);
670  if (xd02 != factors.end() && xd02->second != 0.0) {
671  isConstVarDiff = true;
672  diff[3] = xd02->second;
673  }
674 
675  auto xd12 = factors.find(StdRegions::eFactorCoeffD12);
676  if (xd12 != factors.end() && xd12->second != 0.0) {
677  isConstVarDiff = true;
678  diff[4] = xd12->second;
679  }
680 
681  auto xd22 = factors.find(StdRegions::eFactorCoeffD22);
682  if (xd22 != factors.end() && xd22->second != 1.0) {
683  isConstVarDiff = true;
684  diff[5] = xd22->second;
685  }
686 
687  if (isConstVarDiff) {
688  m_oper->SetConstVarDiffusion(diff);
689  }
690 
691  // set random here for fn variable diffusion
692  auto k = factors.find(StdRegions::eFactorTau);
693  if (k != factors.end() && k->second != 0.0) {
694  m_oper->SetVarDiffusion(diff);
695  }
696  }
697 
698 private:
699  std::shared_ptr<MatrixFree::Helmholtz> m_oper;
700  unsigned int m_nmtot;
702 
703  Helmholtz_MatrixFree(vector<StdRegions::StdExpansionSharedPtr> pCollExp,
704  CoalescedGeomDataSharedPtr pGeomData,
705  StdRegions::FactorMap factors)
706  : Operator(pCollExp, pGeomData, factors),
707  MatrixFreeOneInOneOut(pCollExp[0]->GetStdExp()->GetNcoeffs(),
708  pCollExp[0]->GetStdExp()->GetNcoeffs(),
709  pCollExp.size())
710  {
711 
712  m_nmtot = m_numElmt*pCollExp[0]->GetStdExp()->GetNcoeffs();
713 
714  const auto dim = pCollExp[0]->GetStdExp()->GetShapeDimension();
715 
716  // Basis vector.
717  std::vector<LibUtilities::BasisSharedPtr> basis(dim);
718  for (auto i = 0; i < dim; ++i)
719  {
720  basis[i] = pCollExp[0]->GetBasis(i);
721  }
722 
723  // Get shape type
724  auto shapeType = pCollExp[0]->GetStdExp()->DetShapeType();
725 
726  // Generate operator string and create operator.
727  std::string op_string = "Helmholtz";
728  op_string += MatrixFree::GetOpstring(shapeType, m_isDeformed);
729  auto oper = MatrixFree::GetOperatorFactory().
730  CreateInstance(op_string, basis, m_nElmtPad);
731 
732  // Set Jacobian
733  oper->SetJac(pGeomData->GetJacInterLeave(pCollExp,m_nElmtPad));
734 
735  // Store derivative factor
736  oper->SetDF(pGeomData->GetDerivFactorsInterLeave
737  (pCollExp,m_nElmtPad));
738 
739  m_oper = std::dynamic_pointer_cast<MatrixFree::Helmholtz>(oper);
740  ASSERTL0(m_oper, "Failed to cast pointer.");
741 
742  // Set factors
743  m_factors = StdRegions::NullFactorMap;
744  this->CheckFactors(factors, 0);
745  }
746 };
747 
748 /// Factory initialisation for the Helmholtz_MatrixFree operators
749 OperatorKey Helmholtz_MatrixFree::m_typeArr[] =
750 {
753  Helmholtz_MatrixFree::create, "Helmholtz_MatrixFree_Quad"),
756  Helmholtz_MatrixFree::create, "Helmholtz_MatrixFree_Tri"),
759  Helmholtz_MatrixFree::create, "Helmholtz_MatrixFree_Hex"),
762  Helmholtz_MatrixFree::create, "Helmholtz_MatrixFree_Prism"),
765  Helmholtz_MatrixFree::create, "Helmholtz_MatrixFree_Pyr"),
768  Helmholtz_MatrixFree::create, "Helmholtz_MatrixFree_Tet"),
769 };
770 
771 }
772 }
773 
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
Definition: ErrorUtil.hpp:209
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:250
#define OPERATOR_CREATE(cname)
Definition: Operator.h:45
Helmholtz operator using LocalRegions implementation.
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
virtual void CheckFactors(StdRegions::FactorMap factors, int coll_phys_offset)
Check the validity of supplied constant factors.
Helmholtz_IterPerExp(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
void operator()(const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &output1, Array< OneD, NekDouble > &output2, Array< OneD, NekDouble > &wsp) final
Perform operation.
Array< OneD, Array< OneD, NekDouble > > m_diff
Helmholtz operator using matrix free operators.
virtual void CheckFactors(StdRegions::FactorMap factors, int coll_phys_offset)
Check the validity of the supplied factor map.
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
std::shared_ptr< MatrixFree::Helmholtz > m_oper
void operator()(const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output0, Array< OneD, NekDouble > &output1, Array< OneD, NekDouble > &output2, Array< OneD, NekDouble > &wsp) final
Perform operation.
Helmholtz_MatrixFree(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
Helmholtz operator using LocalRegions implementation.
virtual void CheckFactors(StdRegions::FactorMap factors, int coll_phys_offset)
Check the validity of the supplied factor map.
Helmholtz_NoCollection(vector< StdRegions::StdExpansionSharedPtr > pCollExp, CoalescedGeomDataSharedPtr pGeomData, StdRegions::FactorMap factors)
void operator()(const Array< OneD, const NekDouble > &entry0, Array< OneD, NekDouble > &entry1, Array< OneD, NekDouble > &entry2, Array< OneD, NekDouble > &entry3, Array< OneD, NekDouble > &wsp) final
Perform operation.
void operator()(int dir, const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output, Array< OneD, NekDouble > &wsp) final
vector< StdRegions::StdExpansionSharedPtr > m_expList
Base class for operators on a collection of elements.
Definition: Operator.h:115
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
Definition: NekFactory.hpp:200
std::tuple< LibUtilities::ShapeType, OperatorType, ImplementationType, ExpansionIsNodal > OperatorKey
Key for describing an Operator.
Definition: Operator.h:181
std::shared_ptr< CoalescedGeomData > CoalescedGeomDataSharedPtr
OperatorFactory & GetOperatorFactory()
Returns the singleton Operator factory object.
Definition: Operator.cpp:121
std::vector< PointsKey > PointsKeyVector
Definition: Points.h:246
static FactorMap NullFactorMap
Definition: StdRegions.hpp:319
const char *const ConstFactorTypeMap[]
Definition: StdRegions.hpp:296
ConstFactorMap FactorMap
Definition: StdRegions.hpp:318
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:1
double NekDouble
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
Definition: Vmath.cpp:192
void Svtvp(int n, const T alpha, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
svtvp (scalar times vector plus vector): z = alpha*x + y
Definition: Vmath.cpp:565
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
Definition: Vmath.cpp:513
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
Definition: Vmath.cpp:322
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
Definition: Vmath.cpp:225
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1199