Nektar++
ContField.cpp
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File ContField.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: Field definition for a continuous domain with boundary conditions
32 //
33 ///////////////////////////////////////////////////////////////////////////////
34 
35 #include <MultiRegions/ContField.h>
37 #include <tuple>
38 
39 using namespace std;
40 
41 namespace Nektar
42 {
43  namespace MultiRegions
44  {
45  /**
46  * @class ContField
47  * The class #ContField is
48  * able to incorporate the boundary conditions imposed to the problem
49  * to be solved. Therefore, the class is equipped with three additional
50  * data members:
51  * - #m_bndCondExpansions
52  * - #m_bndTypes
53  * - #m_bndCondEquations
54  *
55  * The first data structure, #m_bndCondExpansions, contains the
56  * one-dimensional spectral/hp expansion on the boundary, #m_bndTypes
57  * stores information about the type of boundary condition on the
58  * different parts of the boundary while #m_bndCondEquations holds the
59  * equation of the imposed boundary conditions.
60  *
61  * Furthermore, in case of Dirichlet boundary conditions, this class is
62  * capable of lifting a known solution satisfying these boundary
63  * conditions. If we denote the unknown solution by
64  * \f$u^{\mathcal{H}}(\boldsymbol{x})\f$ and the known Dirichlet
65  * boundary conditions by \f$u^{\mathcal{D}}(\boldsymbol{x})\f$, the
66  * expansion then can be decomposed as
67  * \f[ u^{\delta}(\boldsymbol{x}_i)=u^{\mathcal{D}}(\boldsymbol{x}_i)+
68  * u^{\mathcal{H}}(\boldsymbol{x}_i)=\sum_{n=0}^{N^{\mathcal{D}}-1}
69  * \hat{u}_n^{\mathcal{D}}\Phi_n(\boldsymbol{x}_i)+
70  * \sum_{n={N^{\mathcal{D}}}}^{N_{\mathrm{dof}}-1}
71  * \hat{u}_n^{\mathcal{H}} \Phi_n(\boldsymbol{x}_i).\f]
72  * This lifting is accomplished by ordering the known global degrees of
73  * freedom, prescribed by the Dirichlet boundary conditions, first in
74  * the global array
75  * \f$\boldsymbol{\hat{u}}\f$, that is,
76  * \f[\boldsymbol{\hat{u}}=\left[ \begin{array}{c}
77  * \boldsymbol{\hat{u}}^{\mathcal{D}}\\
78  * \boldsymbol{\hat{u}}^{\mathcal{H}}
79  * \end{array} \right].\f]
80  * Such kind of expansions are also referred to as continuous fields.
81  * This class should be used when solving 2D problems using a standard
82  * Galerkin approach.
83  */
84 
85  /**
86  *
87  */
88  ContField::ContField():
89  DisContField(),
90  m_locToGloMap(),
91  m_globalMat(),
92  m_globalLinSysManager(
93  std::bind(&ContField::GenGlobalLinSys, this,
94  std::placeholders::_1),
95  std::string("GlobalLinSys"))
96  {
97  }
98 
99 
100  /**
101  * Given a mesh \a graph, containing information about the domain and
102  * the spectral/hp element expansion, this constructor fills the list
103  * of local expansions #m_exp with the proper expansions, calculates
104  * the total number of quadrature points \f$\boldsymbol{x}_i\f$ and
105  * local expansion coefficients \f$\hat{u}^e_n\f$ and allocates memory
106  * for the arrays #m_coeffs and #m_phys. Furthermore, it constructs the
107  * mapping array (contained in #m_locToGloMap) for the transformation
108  * between local elemental level and global level, it calculates the
109  * total number global expansion coefficients \f$\hat{u}_n\f$ and
110  * allocates memory for the array #m_contCoeffs. The constructor also
111  * discretises the boundary conditions, specified by the argument \a
112  * bcs, by expressing them in terms of the coefficient of the expansion
113  * on the boundary.
114  *
115  * @param graph A mesh, containing information about the domain
116  * and the spectral/hp element expansion.
117  * @param bcs The boundary conditions.
118  * @param variable An optional parameter to indicate for which
119  * variable the field should be constructed.
120  */
122  const LibUtilities::SessionReaderSharedPtr &pSession,
124  const std::string &variable,
125  const bool DeclareCoeffPhysArrays,
126  const bool CheckIfSingularSystem,
127  const Collections::ImplementationType ImpType):
128  DisContField(pSession,graph,variable,false,
129  DeclareCoeffPhysArrays,ImpType),
130  m_globalMat(MemoryManager<GlobalMatrixMap>::AllocateSharedPtr()),
131  m_globalLinSysManager(
132  std::bind(&ContField::GenGlobalLinSys, this,
133  std::placeholders::_1),
134  std::string("GlobalLinSys"))
135  {
140  CheckIfSingularSystem,
141  variable,
145 
146  if (m_session->DefinesCmdLineArgument("verbose"))
147  {
148  m_locToGloMap->PrintStats(std::cout, variable);
149  }
150  }
151 
152 
153  /**
154  * Given a mesh \a graph, containing information about the domain and
155  * the spectral/hp element expansion, this constructor fills the list
156  * of local expansions #m_exp with the proper expansions, calculates
157  * the total number of quadrature points \f$\boldsymbol{x}_i\f$ and
158  * local expansion coefficients \f$\hat{u}^e_n\f$ and allocates memory
159  * for the arrays #m_coeffs and #m_phys. Furthermore, it constructs the
160  * mapping array (contained in #m_locToGloMap) for the transformation
161  * between local elemental level and global level, it calculates the
162  * total number global expansion coefficients \f$\hat{u}_n\f$ and
163  * allocates memory for the array #m_coeffs. The constructor also
164  * discretises the boundary conditions, specified by the argument \a
165  * bcs, by expressing them in terms of the coefficient of the expansion
166  * on the boundary.
167  *
168  * @param In Existing ContField object used to provide the
169  * local to global mapping information and
170  * global solution type.
171  * @param graph A mesh, containing information about the domain
172  * and the spectral/hp element expansion.
173  * @param bcs The boundary conditions.
174  * @param bc_loc
175  */
178  const std::string &variable,
179  bool DeclareCoeffPhysArrays,
180  const bool CheckIfSingularSystem):
181  DisContField(In,graph,variable,false,DeclareCoeffPhysArrays),
182  m_globalMat (MemoryManager<GlobalMatrixMap>::AllocateSharedPtr()),
183  m_globalLinSysManager(
184  std::bind(&ContField::GenGlobalLinSys, this, std::placeholders::_1),
185  std::string("GlobalLinSys"))
186  {
187  if(!SameTypeOfBoundaryConditions(In) || CheckIfSingularSystem)
188  {
193  CheckIfSingularSystem,
194  variable,
198 
199  if (m_session->DefinesCmdLineArgument("verbose"))
200  {
201  m_locToGloMap->PrintStats(std::cout, variable);
202  }
203  }
204  else
205  {
207  }
208  }
209 
210 
211  /**
212  * Initialises the object as a copy of an existing ContField object.
213  * @param In Existing ContField object.
214  * @param DeclareCoeffPhysArrays bool to declare if \a m_phys
215  * and \a m_coeffs should be declared. Default is true
216  */
217  ContField::ContField(const ContField &In, bool DeclareCoeffPhysArrays):
218  DisContField(In,DeclareCoeffPhysArrays),
219  m_locToGloMap(In.m_locToGloMap),
220  m_globalMat(In.m_globalMat),
221  m_globalLinSysManager(In.m_globalLinSysManager)
222  {
223  }
224 
225  /**
226  * Constructs a continuous field as a copy of an existing
227  * explist field and adding all the boundary conditions.
228  *
229  * @param In Existing explist1D field .
230  */
232  (const LibUtilities::SessionReaderSharedPtr &pSession,
233  const ExpList & In):
234  DisContField(In),
235  m_locToGloMap(),
236  m_globalLinSysManager
237  (std::bind(&ContField::GenGlobalLinSys,
238  this, std::placeholders::_1),
239  std::string("GlobalLinSys"))
240  {
242  ::AllocateSharedPtr(pSession, m_ncoeffs, In);
243  }
244 
245  /**
246  *
247  */
249  {
250  }
251 
252 
253  /**
254  * Given a function \f$f(\boldsymbol{x})\f$ defined at the quadrature
255  * points, this function determines the unknown global coefficients
256  * \f$\boldsymbol{\hat{u}}^{\mathcal{H}}\f$ employing a discrete
257  * Galerkin projection from physical space to coefficient
258  * space. The operation is evaluated by the function #GlobalSolve using
259  * the global mass matrix.
260  *
261  * The values of the function \f$f(\boldsymbol{x})\f$ evaluated at the
262  * quadrature points \f$\boldsymbol{x}_i\f$ should be contained in the
263  * variable #m_phys of the ExpList object \a Sin. The resulting global
264  * coefficients \f$\hat{u}_g\f$ are stored in the array #m_coeffs.
265  *
266  * @param Sin An ExpList, containing the discrete evaluation
267  * of \f$f(\boldsymbol{x})\f$ at the quadrature
268  * points in its array #m_phys.
269  */
271  Array<OneD, NekDouble> &outarray)
272 
273  {
274  // Inner product of forcing
276  IProductWRTBase(inarray,wsp);
277 
278  // Solve the system
280 
281  GlobalSolve(key,wsp,outarray);
282  }
283 
284  /**
285  *
286  */
288  {
289  int Ncoeffs = m_locToGloMap->GetNumLocalCoeffs();
290  Array<OneD,NekDouble> tmp1(Ncoeffs);
291  Array<OneD,NekDouble> tmp2(Ncoeffs);
292 
293  IProductWRTBase(field,tmp1);
294  MultiplyByInvMassMatrix(tmp1,tmp2);
295  BwdTrans(tmp2,field);
296  }
297 
298 
299  /**
300  * Computes the matrix vector product
301  * @f$ \mathbf{y} = \mathbf{M}^{-1}\mathbf{x} @f$.
302  *
303  * @param inarray Input vector @f$\mathbf{x}@f$.
304  * @param outarray Output vector @f$\mathbf{y}@f$.
305  */
307  const Array<OneD, const NekDouble> &inarray,
308  Array<OneD, NekDouble> &outarray)
309 
310  {
311 
313  GlobalSolve(key,inarray,outarray);
314  }
315 
316 
317  /**
318  * Consider the two dimensional Laplace equation,
319  * \f[\nabla\cdot\left(\boldsymbol{\sigma}\nabla
320  * u(\boldsymbol{x})\right) = f(\boldsymbol{x}),\f] supplemented with
321  * appropriate boundary conditions (which are contained in the data
322  * member #m_bndCondExpansions). In the equation above
323  * \f$\boldsymbol{\sigma}\f$ is the (symmetric positive definite)
324  * diffusion tensor:
325  * \f[ \sigma = \left[ \begin{array}{cc}
326  * \sigma_{00}(\boldsymbol{x},t) & \sigma_{01}(\boldsymbol{x},t) \\
327  * \sigma_{01}(\boldsymbol{x},t) & \sigma_{11}(\boldsymbol{x},t)
328  * \end{array} \right]. \f]
329  * Applying a \f$C^0\f$ continuous Galerkin discretisation, this
330  * equation leads to the following linear system:
331  * \f[\boldsymbol{L}
332  * \boldsymbol{\hat{u}}_g=\boldsymbol{\hat{f}}\f]
333  * where \f$\boldsymbol{L}\f$ is the Laplacian matrix. This function
334  * solves the system above for the global coefficients
335  * \f$\boldsymbol{\hat{u}}\f$ by a call to the function #GlobalSolve.
336  *
337  * The values of the function \f$f(\boldsymbol{x})\f$ evaluated at the
338  * quadrature points \f$\boldsymbol{x}_i\f$ should be contained in the
339  * variable #m_phys of the ExpList object \a Sin. The resulting global
340  * coefficients \f$\boldsymbol{\hat{u}}_g\f$ are stored in the array
341  * #m_coeffs.
342  *
343  * @param Sin An ExpList, containing the discrete evaluation
344  * of the forcing function \f$f(\boldsymbol{x})\f$
345  * at the quadrature points in its array #m_phys.
346  * @param variablecoeffs The (optional) parameter containing the
347  * coefficients evaluated at the quadrature
348  * points. It is an Array of (three) arrays which
349  * stores the laplacian coefficients in the
350  * following way
351  * \f[\mathrm{variablecoeffs} = \left[ \begin{array}{c}
352  * \left[\sigma_{00}(\boldsymbol{x_i},t)\right]_i \\
353  * \left[\sigma_{01}(\boldsymbol{x_i},t)\right]_i \\
354  * \left[\sigma_{11}(\boldsymbol{x_i},t)\right]_i
355  * \end{array}\right]
356  * \f]
357  * If this argument is not passed to the function, the following
358  * equation will be solved:
359  * \f[\nabla^2u(\boldsymbol{x}) = f(\boldsymbol{x}),\f]
360  *
361  * @param time The time-level at which the coefficients are
362  * evaluated
363  */
365  const Array<OneD, const NekDouble> &inarray,
366  Array<OneD, NekDouble> &outarray,
367  const Array<OneD, const NekDouble> &dirForcing,
368  const Array<OneD, Array<OneD,NekDouble> >& variablecoeffs,
369  NekDouble time)
370  {
371  // Inner product of forcing
373  IProductWRTBase(inarray,wsp);
374 
375  // Note -1.0 term necessary to invert forcing function to
376  // be consistent with matrix definition
377  Vmath::Neg(m_ncoeffs, wsp, 1);
378 
379  // Forcing function with weak boundary conditions
380  int i,j;
381  int bndcnt = 0;
383  GetBndCondCoeffsToLocalCoeffsSign();
385  GetBndCondCoeffsToLocalCoeffsMap();
386 
387  // Add weak boundary conditions to forcing
388  for(i = 0; i < m_bndCondExpansions.size(); ++i)
389  {
390  if(m_bndConditions[i]->GetBoundaryConditionType() ==
392  m_bndConditions[i]->GetBoundaryConditionType() ==
394  {
395  const Array<OneD, NekDouble> bndcoeff =
397 
398  if(m_locToGloMap->GetSignChange())
399  {
400  for(j = 0; j < (m_bndCondExpansions[i])->GetNcoeffs(); j++)
401  {
402  wsp[map[bndcnt + j]] += sign[bndcnt + j] * bndcoeff[j];
403  }
404  }
405  else
406  {
407  for(j = 0; j < (m_bndCondExpansions[i])->GetNcoeffs(); j++)
408  {
409  wsp[map[bndcnt+j]] += bndcoeff[bndcnt + j];
410  }
411  }
412  }
413 
414  bndcnt += m_bndCondExpansions[i]->GetNcoeffs();
415  }
416 
417  StdRegions::VarCoeffMap varcoeffs;
418  varcoeffs[StdRegions::eVarCoeffD00] = variablecoeffs[0];
419  varcoeffs[StdRegions::eVarCoeffD01] = variablecoeffs[1];
420  varcoeffs[StdRegions::eVarCoeffD11] = variablecoeffs[3];
421  varcoeffs[StdRegions::eVarCoeffD22] = variablecoeffs[5];
423  factors[StdRegions::eFactorTime] = time;
424 
425  // Solve the system
427  varcoeffs);
428 
429  GlobalSolve(key,wsp,outarray,dirForcing);
430  }
431 
432 
433  /**
434  * Constructs the GlobalLinearSysKey for the linear advection operator
435  * with the supplied parameters, and computes the eigenvectors and
436  * eigenvalues of the associated matrix.
437  * @param ax Advection parameter, x.
438  * @param ay Advection parameter, y.
439  * @param Real Computed eigenvalues, real component.
440  * @param Imag Computed eigenvalues, imag component.
441  * @param Evecs Computed eigenvectors.
442  */
444  const NekDouble ay,
447  Array<OneD, NekDouble> &Evecs)
448  {
449  // Solve the system
453  vel[0] = vel_x;
454  vel[1] = vel_y;
455 
456  StdRegions::VarCoeffMap varcoeffs;
460  factors[StdRegions::eFactorTime] = 0.0;
462  factors,varcoeffs);
463 
465  Gmat->EigenSolve(Real,Imag,Evecs);
466  }
467 
468 
469 
470 
471  /**
472  * Given a linear system specified by the key \a key,
473  * \f[\boldsymbol{M}\boldsymbol{\hat{u}}_g=\boldsymbol{\hat{f}},\f]
474  * this function solves this linear system taking into account the
475  * boundary conditions specified in the data member
476  * #m_bndCondExpansions. Therefore, it adds an array
477  * \f$\boldsymbol{\hat{g}}\f$ which represents the non-zero surface
478  * integral resulting from the weak boundary conditions (e.g. Neumann
479  * boundary conditions) to the right hand side, that is,
480  * \f[\boldsymbol{M}\boldsymbol{\hat{u}}_g=\boldsymbol{\hat{f}}+
481  * \boldsymbol{\hat{g}}.\f]
482  * Furthermore, it lifts the known degrees of freedom which are
483  * prescribed by the Dirichlet boundary conditions. As these known
484  * coefficients \f$\boldsymbol{\hat{u}}^{\mathcal{D}}\f$ are numbered
485  * first in the global coefficient array \f$\boldsymbol{\hat{u}}_g\f$,
486  * the linear system can be decomposed as,
487  * \f[\left[\begin{array}{cc}
488  * \boldsymbol{M}^{\mathcal{DD}}&\boldsymbol{M}^{\mathcal{DH}}\\
489  * \boldsymbol{M}^{\mathcal{HD}}&\boldsymbol{M}^{\mathcal{HH}}
490  * \end{array}\right]
491  * \left[\begin{array}{c}
492  * \boldsymbol{\hat{u}}^{\mathcal{D}}\\
493  * \boldsymbol{\hat{u}}^{\mathcal{H}}
494  * \end{array}\right]=
495  * \left[\begin{array}{c}
496  * \boldsymbol{\hat{f}}^{\mathcal{D}}\\
497  * \boldsymbol{\hat{f}}^{\mathcal{H}}
498  * \end{array}\right]+
499  * \left[\begin{array}{c}
500  * \boldsymbol{\hat{g}}^{\mathcal{D}}\\
501  * \boldsymbol{\hat{g}}^{\mathcal{H}}
502  * \end{array}\right]
503  * \f]
504  * which will then be solved for the unknown coefficients
505  * \f$\boldsymbol{\hat{u}}^{\mathcal{H}}\f$ as,
506  * \f[
507  * \boldsymbol{M}^{\mathcal{HH}}\boldsymbol{\hat{u}}^{\mathcal{H}}=
508  * \boldsymbol{\hat{f}}^{\mathcal{H}}+
509  * \boldsymbol{\hat{g}}^{\mathcal{H}}-
510  * \boldsymbol{M}^{\mathcal{HD}}\boldsymbol{\hat{u}}^{\mathcal{D}}\f]
511  *
512  * @param mkey This key uniquely defines the linear system to
513  * be solved.
514  * @param locrhs contains the forcing term in local coefficient space
515  * @note inout contains initial guess and final output in local coeffs.
516  */
518  const GlobalLinSysKey &key,
519  const Array<OneD, const NekDouble>& locrhs,
520  Array<OneD, NekDouble>& inout,
521  const Array<OneD, const NekDouble>& dirForcing)
522  {
523  int NumDirBcs = m_locToGloMap->GetNumGlobalDirBndCoeffs();
524  int contNcoeffs = m_locToGloMap->GetNumGlobalCoeffs();
525 
526  // STEP 1: SET THE DIRICHLET DOFS TO THE RIGHT VALUE
527  // IN THE SOLUTION ARRAY
529 
530  // STEP 2: CALCULATE THE HOMOGENEOUS COEFFICIENTS
531  if(contNcoeffs - NumDirBcs > 0)
532  {
534  LinSys->Solve(locrhs,inout,m_locToGloMap,dirForcing);
535 
536  }
537  }
538 
539 
540  /**
541  * Returns the global matrix associated with the given GlobalMatrixKey.
542  * If the global matrix has not yet been constructed on this field,
543  * it is first constructed using GenGlobalMatrix().
544  * @param mkey Global matrix key.
545  * @returns Assocated global matrix.
546  */
548  const GlobalMatrixKey &mkey)
549  {
551  "To use method must have a AssemblyMap "
552  "attached to key");
553 
554  GlobalMatrixSharedPtr glo_matrix;
555  auto matrixIter = m_globalMat->find(mkey);
556 
557  if(matrixIter == m_globalMat->end())
558  {
559  glo_matrix = GenGlobalMatrix(mkey,m_locToGloMap);
560  (*m_globalMat)[mkey] = glo_matrix;
561  }
562  else
563  {
564  glo_matrix = matrixIter->second;
565  }
566 
567  return glo_matrix;
568  }
569 
570 
571  /**
572  * The function searches the map #m_globalLinSys to see if the
573  * global matrix has been created before. If not, it calls the function
574  * #GenGlobalLinSys to generate the requested global system.
575  *
576  * @param mkey This key uniquely defines the requested
577  * linear system.
578  */
580  const GlobalLinSysKey &mkey)
581  {
582  return m_globalLinSysManager[mkey];
583  }
584 
586  const GlobalLinSysKey &mkey)
587  {
589  "To use method must have a AssemblyMap "
590  "attached to key");
592  }
593 
594  // /**
595  // *
596  // */
597  // void ContField::v_BwdTrans(
598  // const Array<OneD, const NekDouble>
599  // &inarray,
600  // Array<OneD, NekDouble> &outarray)
601  // {
602  // BwdTrans(inarray,outarray);
603  // }
604 
605 
606  /**
607  *
608  */
611  &inarray,
612  Array<OneD, NekDouble> &outarray)
613  {
614  FwdTrans(inarray,outarray);
615  }
616 
618  {
619  int i,j;
620  int bndcnt=0;
621 
623  GetBndCondCoeffsToLocalCoeffsSign();
625  GetBndCondCoeffsToLocalCoeffsMap();
626 
627  for(i = 0; i < m_bndCondExpansions.size(); ++i)
628  {
629  if(m_bndConditions[i]->GetBoundaryConditionType() ==
631  {
632  const Array<OneD, NekDouble> bndcoeff =
634 
635  if(m_locToGloMap->GetSignChange())
636  {
637  for(j = 0; j < (m_bndCondExpansions[i])->GetNcoeffs(); j++)
638  {
639  outarray[map[bndcnt + j]] = sign[bndcnt + j] * bndcoeff[j];
640  }
641  }
642  else
643  {
644  for(j = 0; j < (m_bndCondExpansions[i])->GetNcoeffs(); j++)
645  {
646  outarray[map[bndcnt+j]] = bndcoeff[j];
647  }
648  }
649  }
650  bndcnt += m_bndCondExpansions[i]->GetNcoeffs();
651  }
652 
653  // communicate local Dirichlet coeffs that are just
654  // touching a dirichlet boundary on another partition
655  set<int> &ParallelDirBndSign = m_locToGloMap->GetParallelDirBndSign();
656 
657  for (auto &it : ParallelDirBndSign)
658  {
659  outarray[it] *= -1;
660  }
661 
662  m_locToGloMap->UniversalAbsMaxBnd(outarray);
663 
664  for (auto &it : ParallelDirBndSign)
665  {
666  outarray[it] *= -1;
667  }
668 
669  set<ExtraDirDof> &copyLocalDirDofs = m_locToGloMap->GetCopyLocalDirDofs();
670  for (auto &it : copyLocalDirDofs)
671  {
672  outarray[std::get<0>(it)] =
673  outarray[std::get<1>(it)]*std::get<2>(it);
674  }
675 
676  }
677 
679  {
680  int bndcnt = 0;
681 
683  GetBndCondCoeffsToLocalCoeffsSign();
684  const Array<OneD, const int> bndmap= m_locToGloMap->
685  GetBndCondCoeffsToLocalCoeffsMap();
686 
687  for(int i = 0; i < m_bndCondExpansions.size(); ++i)
688  {
689  Array<OneD, NekDouble>& coeffs = m_bndCondExpansions[i]->UpdateCoeffs();
690 
691  if(m_locToGloMap->GetSignChange())
692  {
693  for(int j = 0; j < (m_bndCondExpansions[i])->GetNcoeffs(); ++j)
694  {
695  coeffs[j] = sign[bndcnt+j] * m_coeffs[bndmap[bndcnt+j]];
696  }
697  }
698  else
699  {
700  for(int j = 0; j < (m_bndCondExpansions[i])->GetNcoeffs(); ++j)
701  {
702  coeffs[j] = m_coeffs[bndmap[bndcnt+j]];
703  }
704  }
705 
706  bndcnt += m_bndCondExpansions[i]->GetNcoeffs();
707  }
708  }
709 
710 
712  {
713  int bndcnt = 0;
714 
715  ASSERTL1(nreg < m_bndCondExpansions.size(),
716  "nreg is out or range since this many boundary "
717  "regions to not exist");
718 
720  GetBndCondCoeffsToLocalCoeffsSign();
721  const Array<OneD, const int> bndmap= m_locToGloMap->
722  GetBndCondCoeffsToLocalCoeffsMap();
723 
724  // Now fill in all other Dirichlet coefficients.
725  Array<OneD, NekDouble>& coeffs = m_bndCondExpansions[nreg]->UpdateCoeffs();
726 
727  for(int j = 0; j < nreg; ++j)
728  {
729  bndcnt += m_bndCondExpansions[j]->GetNcoeffs();
730  }
731 
732  if(m_locToGloMap->GetSignChange())
733  {
734  for(int j = 0; j < (m_bndCondExpansions[nreg])->GetNcoeffs(); ++j)
735  {
736  coeffs[j] = sign[bndcnt + j] * m_coeffs[bndmap[bndcnt + j]];
737  }
738  }
739  else
740  {
741  for(int j = 0; j < (m_bndCondExpansions[nreg])->GetNcoeffs(); ++j)
742  {
743  coeffs[j] = m_coeffs[bndmap[bndcnt + j]];
744  }
745  }
746  }
747 
748 
749  /**
750  * This operation is evaluated as:
751  * \f{tabbing}
752  * \hspace{1cm} \= Do \= $e=$ $1, N_{\mathrm{el}}$ \\
753  * > > Do \= $i=$ $0,N_m^e-1$ \\
754  * > > > $\boldsymbol{\hat{u}}^{e}[i] = \mbox{sign}[e][i] \cdot
755  * \boldsymbol{\hat{u}}_g[\mbox{map}[e][i]]$ \\
756  * > > continue \\
757  * > continue
758  * \f}
759  * where \a map\f$[e][i]\f$ is the mapping array and \a
760  * sign\f$[e][i]\f$ is an array of similar dimensions ensuring the
761  * correct modal connectivity between the different elements (both
762  * these arrays are contained in the data member #m_locToGloMap). This
763  * operation is equivalent to the scatter operation
764  * \f$\boldsymbol{\hat{u}}_l=\mathcal{A}\boldsymbol{\hat{u}}_g\f$,
765  * where \f$\mathcal{A}\f$ is the
766  * \f$N_{\mathrm{eof}}\times N_{\mathrm{dof}}\f$ permutation matrix.
767  *
768  * @note The array #m_coeffs should be filled with the global
769  * coefficients \f$\boldsymbol{\hat{u}}_g\f$ and that the resulting
770  * local coefficients \f$\boldsymbol{\hat{u}}_l\f$ will be stored in
771  * #m_coeffs.
772  */
774  const Array<OneD, const NekDouble> &inarray,
775  Array<OneD,NekDouble> &outarray)
776  {
777  m_locToGloMap->GlobalToLocal(inarray, outarray);
778  }
779 
780 
782  {
783  m_locToGloMap->GlobalToLocal(m_coeffs,m_coeffs);
784  }
785 
786 
787  /**
788  * This operation is evaluated as:
789  * \f{tabbing}
790  * \hspace{1cm} \= Do \= $e=$ $1, N_{\mathrm{el}}$ \\
791  * > > Do \= $i=$ $0,N_m^e-1$ \\
792  * > > > $\boldsymbol{\hat{u}}_g[\mbox{map}[e][i]] =
793  * \mbox{sign}[e][i] \cdot \boldsymbol{\hat{u}}^{e}[i]$\\
794  * > > continue\\
795  * > continue
796  * \f}
797  * where \a map\f$[e][i]\f$ is the mapping array and \a
798  * sign\f$[e][i]\f$ is an array of similar dimensions ensuring the
799  * correct modal connectivity between the different elements (both
800  * these arrays are contained in the data member #m_locToGloMap). This
801  * operation is equivalent to the gather operation
802  * \f$\boldsymbol{\hat{u}}_g=\mathcal{A}^{-1}\boldsymbol{\hat{u}}_l\f$,
803  * where \f$\mathcal{A}\f$ is the
804  * \f$N_{\mathrm{eof}}\times N_{\mathrm{dof}}\f$ permutation matrix.
805  *
806  * @note The array #m_coeffs should be filled with the local
807  * coefficients \f$\boldsymbol{\hat{u}}_l\f$ and that
808  * the resulting global coefficients
809  * \f$\boldsymbol{\hat{u}}_g\f$ will be stored in
810  * #m_coeffs. Also if useComm is set to false then no
811  * communication call will be made to check if all
812  * values are consistent over processors
813  */
814 
816  const Array<OneD, const NekDouble> &inarray,
817  Array<OneD,NekDouble> &outarray,
818  bool useComm)
819  {
820  m_locToGloMap->LocalToGlobal(inarray, outarray, useComm);
821  }
822 
823 
824  void ContField::v_LocalToGlobal(bool useComm)
825 
826  {
827  m_locToGloMap->LocalToGlobal(m_coeffs,m_coeffs, useComm);
828  }
829 
830  /**
831  *
832  */
834  const Array<OneD, const NekDouble> &inarray,
835  Array<OneD, NekDouble> &outarray)
836  {
837  MultiplyByInvMassMatrix(inarray,outarray);
838  }
839 
840 
841  /**
842  * Consider the two dimensional Helmholtz equation,
843  * \f[\nabla^2u(\boldsymbol{x})-\lambda u(\boldsymbol{x})
844  * = f(\boldsymbol{x}),\f] supplemented with appropriate boundary
845  * conditions (which are contained in the data member
846  * #m_bndCondExpansions). Applying a \f$C^0\f$ continuous Galerkin
847  * discretisation, this equation leads to the following linear system:
848  * \f[\left(\boldsymbol{L}+\lambda\boldsymbol{M}\right)
849  * \boldsymbol{\hat{u}}_g=\boldsymbol{\hat{f}}\f] where
850  * \f$\boldsymbol{L}\f$ and \f$\boldsymbol{M}\f$ are the Laplacian and
851  * mass matrix respectively. This function solves the system above for
852  * the global coefficients \f$\boldsymbol{\hat{u}}\f$ by a call to the
853  * function #GlobalSolve. It is assumed #m_coeff contains an
854  * initial estimate for the solution.
855  *
856  * The values of the function \f$f(\boldsymbol{x})\f$
857  * evaluated at the quadrature points \f$\boldsymbol{x}_i\f$
858  * should be contained in the variable #m_phys of the ExpList
859  * object \a inarray.
860  *
861  * @param inarray An ExpList, containing the discrete evaluation
862  * of the forcing function \f$f(\boldsymbol{x})\f$
863  * at the quadrature points in its array #m_phys.
864  * @param factors The parameter \f$\lambda\f$ of the Helmholtz
865  * equation is specified through the factors map
866  */
868  const Array<OneD, const NekDouble> &inarray,
869  Array<OneD, NekDouble> &outarray,
870  const StdRegions::ConstFactorMap &factors,
871  const StdRegions::VarCoeffMap &varcoeff,
872  const MultiRegions::VarFactorsMap &varfactors,
873  const Array<OneD, const NekDouble> &dirForcing,
874  const bool PhysSpaceForcing)
875 
876  {
877  int i,j;
878 
879  //----------------------------------
880  // Setup RHS Inner product
881  //----------------------------------
882  // Inner product of forcing
884  if(PhysSpaceForcing)
885  {
886  IProductWRTBase(inarray,wsp);
887  // Note -1.0 term necessary to invert forcing function to
888  // be consistent with matrix definition
889  Vmath::Neg(m_ncoeffs, wsp, 1);
890  }
891  else
892  {
893  Vmath::Smul(m_ncoeffs,-1.0,inarray,1,wsp,1);
894  }
895 
896  int bndcnt = 0;
898  GetBndCondCoeffsToLocalCoeffsSign();
900  GetBndCondCoeffsToLocalCoeffsMap();
901  // Add weak boundary conditions to forcing
902  for(i = 0; i < m_bndCondExpansions.size(); ++i)
903  {
904  if(m_bndConditions[i]->GetBoundaryConditionType() ==
906  m_bndConditions[i]->GetBoundaryConditionType() ==
908  {
909  const Array<OneD, NekDouble> bndcoeff =
911 
912  if(m_locToGloMap->GetSignChange())
913  {
914  for(j = 0; j < (m_bndCondExpansions[i])->GetNcoeffs(); j++)
915  {
916  wsp[map[bndcnt + j]] += sign[bndcnt + j] * bndcoeff[j];
917  }
918  }
919  else
920  {
921  for(j = 0; j < (m_bndCondExpansions[i])->GetNcoeffs(); j++)
922  {
923  wsp[map[bndcnt+j]] += bndcoeff[j];
924  }
925  }
926  }
927  bndcnt += m_bndCondExpansions[i]->GetNcoeffs();
928  }
929 
931  varcoeff,varfactors);
932 
933  GlobalSolve(key,wsp,outarray,dirForcing);
934  }
935 
936 
937  /**
938  * This is equivalent to the operation:
939  * \f[\boldsymbol{M\hat{u}}_g\f]
940  * where \f$\boldsymbol{M}\f$ is the global matrix of type specified by
941  * \a mkey. After scattering the global array \a inarray to local
942  * level, this operation is evaluated locally by the function
943  * ExpList#GeneralMatrixOp. The global result is then obtained by a
944  * global assembly procedure.
945  *
946  * @param mkey This key uniquely defines the type matrix
947  * required for the operation.
948  * @param inarray The vector \f$\boldsymbol{\hat{u}}_g\f$ of size
949  * \f$N_{\mathrm{dof}}\f$.
950  * @param outarray The resulting vector of size
951  * \f$N_{\mathrm{dof}}\f$.
952  */
954  const GlobalMatrixKey &gkey,
955  const Array<OneD,const NekDouble> &inarray,
956  Array<OneD, NekDouble> &outarray)
957  {
958  GeneralMatrixOp_IterPerExp(gkey,inarray,outarray);
959  }
960 
961  /**
962  * First compute the inner product of forcing function with respect to
963  * base, and then solve the system with the linear advection operator.
964  * @param velocity Array of advection velocities in physical space
965  * @param inarray Forcing function.
966  * @param outarray Result.
967  * @param lambda reaction coefficient
968  * @param dirForcing Dirichlet Forcing.
969  */
970 
971  // could combine this with HelmholtzCG.
973  (const Array<OneD, Array<OneD, NekDouble> > &velocity,
974  const Array<OneD, const NekDouble> &inarray,
975  Array<OneD, NekDouble> &outarray,
976  const NekDouble lambda,
977  const Array<OneD, const NekDouble>& dirForcing)
978  {
979  // Inner product of forcing
981  IProductWRTBase(inarray,wsp);
982 
983  // Note -1.0 term necessary to invert forcing function to
984  // be consistent with matrix definition
985  Vmath::Neg(m_ncoeffs, wsp, 1);
986 
987  // Forcing function with weak boundary conditions
988  int i,j;
989  int bndcnt=0;
991  GetBndCondCoeffsToLocalCoeffsSign();
993  GetBndCondCoeffsToLocalCoeffsMap();
994  // Add weak boundary conditions to forcing
995  for(i = 0; i < m_bndCondExpansions.size(); ++i)
996  {
997  if(m_bndConditions[i]->GetBoundaryConditionType() ==
999  m_bndConditions[i]->GetBoundaryConditionType() ==
1001  {
1002  const Array<OneD, NekDouble> bndcoeff =
1004 
1005  if(m_locToGloMap->GetSignChange())
1006  {
1007  for(j = 0; j < (m_bndCondExpansions[i])->GetNcoeffs(); j++)
1008  {
1009  wsp[map[bndcnt + j]] += sign[bndcnt + j] * bndcoeff[j];
1010  }
1011  }
1012  else
1013  {
1014  for(j = 0; j < (m_bndCondExpansions[i])->GetNcoeffs(); j++)
1015  {
1016  wsp[map[bndcnt+j]] += bndcoeff[bndcnt + j];
1017  }
1018  }
1019  }
1020 
1021  bndcnt += m_bndCondExpansions[i]->GetNcoeffs();
1022  }
1023 
1024  // Solve the system
1026  factors[StdRegions::eFactorLambda] = lambda;
1027  StdRegions::VarCoeffMap varcoeffs;
1028  varcoeffs[StdRegions::eVarCoeffVelX] = velocity[0];
1029  varcoeffs[StdRegions::eVarCoeffVelY] = velocity[1];
1030  if(m_expType == e3D)
1031  {
1032  varcoeffs[StdRegions::eVarCoeffVelZ] = velocity[2];
1033  }
1034 
1036 
1037  GlobalSolve(key,wsp,outarray,dirForcing);
1038  }
1039 
1040  /**
1041  * First compute the inner product of forcing function with respect to
1042  * base, and then solve the system with the linear advection operator.
1043  * @param velocity Array of advection velocities in physical space
1044  * @param inarray Forcing function.
1045  * @param outarray Result.
1046  * @param lambda reaction coefficient
1047  * @param dirForcing Dirichlet Forcing.
1048  */
1050  const Array<OneD, Array<OneD, NekDouble> > &velocity,
1051  const Array<OneD, const NekDouble> &inarray,
1052  Array<OneD, NekDouble> &outarray,
1053  const NekDouble lambda,
1054  const Array<OneD, const NekDouble>& dirForcing)
1055  {
1056  // Inner product of forcing
1058  IProductWRTBase(inarray,wsp);
1059 
1060  // Solve the system
1062  factors[StdRegions::eFactorLambda] = lambda;
1063  StdRegions::VarCoeffMap varcoeffs;
1064  varcoeffs[StdRegions::eVarCoeffVelX] = velocity[0];
1065  varcoeffs[StdRegions::eVarCoeffVelY] = velocity[1];
1067 
1068  GlobalSolve(key,wsp,outarray,dirForcing);
1069  }
1070 
1071 
1072  /**
1073  *
1074  */
1077  {
1078  return GetBndConditions();
1079  }
1080 
1081 
1082  /**
1083  * Reset the GlobalLinSys Manager
1084  */
1086  {
1087  m_globalLinSysManager.ClearManager("GlobalLinSys");
1088  }
1089 
1090  } // end of namespace
1091 } //end of namespace
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:250
#define sign(a, b)
return the sign(b)*a
Definition: Polylib.cpp:15
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
This class is the abstraction of a global continuous two- dimensional spectral/hp element expansion w...
Definition: ContField.h:56
virtual void v_MultiplyByInvMassMatrix(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Template method virtual forwarder for MultiplyByInvMassMatrix().
Definition: ContField.cpp:833
virtual ~ContField()
The default destructor.
Definition: ContField.cpp:248
LibUtilities::NekManager< GlobalLinSysKey, GlobalLinSys > m_globalLinSysManager
A manager which collects all the global linear systems being assembled, such that they should be cons...
Definition: ContField.h:177
void LaplaceSolve(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray, const Array< OneD, Array< OneD, NekDouble > > &variablecoeffs=NullNekDoubleArrayOfArray, NekDouble time=0.0)
Solves the two-dimensional Laplace equation, subject to the boundary conditions specified.
Definition: ContField.cpp:364
GlobalLinSysSharedPtr GenGlobalLinSys(const GlobalLinSysKey &mkey)
Definition: ContField.cpp:585
AssemblyMapCGSharedPtr m_locToGloMap
(A shared pointer to) the object which contains all the required information for the transformation f...
Definition: ContField.h:167
virtual void v_SmoothField(Array< OneD, NekDouble > &field)
Template method virtual forwarded for SmoothField().
Definition: ContField.cpp:287
virtual void v_LocalToGlobal(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool useComm)
Gathers the global coefficients from the local coefficients .
Definition: ContField.cpp:815
const Array< OneD, const SpatialDomains::BoundaryConditionShPtr > & GetBndConditions()
Returns the boundary conditions.
Definition: ContField.h:417
virtual void v_FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Template method virtual forwarder for FwdTrans().
Definition: ContField.cpp:609
void MultiplyByInvMassMatrix(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Multiply a solution by the inverse mass matrix.
Definition: ContField.cpp:306
virtual void v_GeneralMatrixOp(const GlobalMatrixKey &gkey, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Calculates the result of the multiplication of a global matrix of type specified by mkey with a vecto...
Definition: ContField.cpp:953
virtual void v_GlobalToLocal(void)
Definition: ContField.cpp:781
void IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Calculates the inner product of a function with respect to all global expansion modes .
Definition: ContField.h:381
GlobalMatrixMapShPtr m_globalMat
(A shared pointer to) a list which collects all the global matrices being assembled,...
Definition: ContField.h:172
void BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Performs the backward transformation of the spectral/hp element expansion.
Definition: ContField.h:403
virtual void v_LinearAdvectionDiffusionReactionSolve(const Array< OneD, Array< OneD, NekDouble > > &velocity, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const NekDouble lambda, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray)
Definition: ContField.cpp:973
virtual void v_HelmSolve(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::ConstFactorMap &factors, const StdRegions::VarCoeffMap &varcoeff, const MultiRegions::VarFactorsMap &varfactors, const Array< OneD, const NekDouble > &dirForcing, const bool PhysSpaceForcing)
Solves the two-dimensional Helmholtz equation, subject to the boundary conditions specified.
Definition: ContField.cpp:867
virtual void v_ImposeDirichletConditions(Array< OneD, NekDouble > &outarray)
Impose the Dirichlet Boundary Conditions on outarray.
Definition: ContField.cpp:617
virtual void v_ClearGlobalLinSysManager(void)
Definition: ContField.cpp:1085
GlobalLinSysSharedPtr GetGlobalLinSys(const GlobalLinSysKey &mkey)
Returns the linear system specified by the key mkey.
Definition: ContField.cpp:579
void FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Performs the global forward transformation of a function , subject to the boundary conditions specifi...
Definition: ContField.cpp:270
GlobalMatrixSharedPtr GetGlobalMatrix(const GlobalMatrixKey &mkey)
Returns the global matrix specified by mkey.
Definition: ContField.cpp:547
virtual void v_FillBndCondFromField()
Definition: ContField.cpp:678
ContField()
The default constructor.
Definition: ContField.cpp:88
virtual const Array< OneD, const SpatialDomains ::BoundaryConditionShPtr > & v_GetBndConditions()
Template method virtual forwarder for GetBndConditions().
Definition: ContField.cpp:1076
void LinearAdvectionEigs(const NekDouble ax, const NekDouble ay, Array< OneD, NekDouble > &Real, Array< OneD, NekDouble > &Imag, Array< OneD, NekDouble > &Evecs=NullNekDouble1DArray)
Compute the eigenvalues of the linear advection operator.
Definition: ContField.cpp:443
void GlobalSolve(const GlobalLinSysKey &key, const Array< OneD, const NekDouble > &rhs, Array< OneD, NekDouble > &inout, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray)
Solves the linear system specified by the key key.
Definition: ContField.cpp:517
void v_LinearAdvectionReactionSolve(const Array< OneD, Array< OneD, NekDouble > > &velocity, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const NekDouble lambda, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray)
Definition: ContField.cpp:1049
This class is the abstractio n of a global discontinuous two- dimensional spectral/hp element expansi...
Definition: DisContField.h:56
PeriodicMap m_periodicEdges
A map which identifies pairs of periodic edges.
Definition: DisContField.h:172
PeriodicMap m_periodicFaces
A map which identifies pairs of periodic faces.
Definition: DisContField.h:177
Array< OneD, SpatialDomains::BoundaryConditionShPtr > m_bndConditions
An array which contains the information about the boundary condition on the different boundary region...
Definition: DisContField.h:148
bool SameTypeOfBoundaryConditions(const DisContField &In)
Check to see if expansion has the same BCs as In.
Array< OneD, MultiRegions::ExpListSharedPtr > m_bndCondExpansions
An object which contains the discretised boundary conditions.
Definition: DisContField.h:142
PeriodicMap m_periodicVerts
A map which identifies groups of periodic vertices.
Definition: DisContField.h:167
Base class for all multi-elemental spectral/hp expansions.
Definition: ExpList.h:107
Array< OneD, NekDouble > m_coeffs
Concatenation of all local expansion coefficients.
Definition: ExpList.h:1252
int GetNcoeffs(void) const
Returns the total number of local degrees of freedom .
Definition: ExpList.h:1800
std::shared_ptr< GlobalMatrix > GenGlobalMatrix(const GlobalMatrixKey &mkey, const std::shared_ptr< AssemblyMapCG > &locToGloMap)
Generates a global matrix from the given key and map.
Definition: ExpList.cpp:2034
const Array< OneD, const NekDouble > & GetCoeffs() const
This function returns (a reference to) the array (implemented as m_coeffs) containing all local expa...
Definition: ExpList.h:2293
std::shared_ptr< GlobalLinSys > GenGlobalLinSys(const GlobalLinSysKey &mkey, const std::shared_ptr< AssemblyMapCG > &locToGloMap)
This operation constructs the global linear system of type mkey.
Definition: ExpList.cpp:2310
int m_ncoeffs
The total number of local degrees of freedom. m_ncoeffs .
Definition: ExpList.h:1230
std::shared_ptr< DNekMat > GenGlobalMatrixFull(const GlobalLinSysKey &mkey, const std::shared_ptr< AssemblyMapCG > &locToGloMap)
Definition: ExpList.cpp:2170
void GeneralMatrixOp_IterPerExp(const GlobalMatrixKey &gkey, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:1961
LibUtilities::SessionReaderSharedPtr m_session
Session.
Definition: ExpList.h:1223
ExpansionType m_expType
Exapnsion type.
Definition: ExpList.h:1212
Describes a matrix with ordering defined by a local to global map.
bool LocToGloMapIsDefined() const
Returns true if a local to global map is defined.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< GlobalLinSys > GlobalLinSysSharedPtr
Pointer to a GlobalLinSys object.
Definition: GlobalLinSys.h:50
std::shared_ptr< GlobalMatrix > GlobalMatrixSharedPtr
Shared pointer to a GlobalMatrix object.
Definition: GlobalMatrix.h:88
std::map< StdRegions::ConstFactorType, Array< OneD, NekDouble > > VarFactorsMap
std::map< GlobalMatrixKey, GlobalMatrixSharedPtr > GlobalMatrixMap
Mapping from global matrix keys to global matrices.
Definition: GlobalMatrix.h:90
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition: MeshGraph.h:174
std::map< StdRegions::VarCoeffType, Array< OneD, NekDouble > > VarCoeffMap
Definition: StdRegions.hpp:272
std::map< ConstFactorType, NekDouble > ConstFactorMap
Definition: StdRegions.hpp:314
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:1
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:69
double NekDouble
void Neg(int n, T *x, const int incx)
Negate x = -x.
Definition: Vmath.cpp:461
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