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