Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ContField3D.cpp
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File ContField3D.cpp
4 //
5 // For more information, please see: http://www.nektar.info
6 //
7 // The MIT License
8 //
9 // Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10 // Department of Aeronautics, Imperial College London (UK), and Scientific
11 // Computing and Imaging Institute, University of Utah (USA).
12 //
13 // License for the specific language governing rights and limitations under
14 // Permission is hereby granted, free of charge, to any person obtaining a
15 // copy of this software and associated documentation files (the "Software"),
16 // to deal in the Software without restriction, including without limitation
17 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
18 // and/or sell copies of the Software, and to permit persons to whom the
19 // Software is furnished to do so, subject to the following conditions:
20 //
21 // The above copyright notice and this permission notice shall be included
22 // in all copies or substantial portions of the Software.
23 //
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
30 // DEALINGS IN THE SOFTWARE.
31 //
32 // Description: Field definition for 3D domain with boundary conditions
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
38 
40 
41 using namespace std;
42 
43 namespace Nektar
44 {
45  namespace MultiRegions
46  {
47 
48  ContField3D::ContField3D():
50  m_locToGloMap(),
51  m_globalMat(),
52  m_globalLinSysManager(
53  boost::bind(&ContField3D::GenGlobalLinSys, this, _1),
54  std::string("GlobalLinSys"))
55  {
56  }
57 
58 
59  /**
60  * Given a mesh \a graph2D, containing information about the domain and
61  * the spectral/hp element expansion, this constructor fills the list
62  * of local expansions #m_exp with the proper expansions, calculates
63  * the total number of quadrature points \f$\boldsymbol{x}_i\f$ and
64  * local expansion coefficients \f$\hat{u}^e_n\f$ and allocates memory
65  * for the arrays #m_coeffs and #m_phys. Furthermore, it constructs the
66  * mapping array (contained in #m_locToGloMap) for the transformation
67  * between local elemental level and global level, it calculates the
68  * total number global expansion coefficients \f$\hat{u}_n\f$ and
69  * allocates memory for the array #m_coeffs. The constructor also
70  * discretises the boundary conditions, specified by the argument \a
71  * bcs, by expressing them in terms of the coefficient of the expansion
72  * on the boundary.
73  *
74  * @param pSession Session information.
75  * @param graph3D A mesh, containing information about the domain
76  * and the spectral/hp element expansion.
77  * @param variable The variable associated with this field.
78  */
81  const std::string &variable,
82  const bool CheckIfSingularSystem):
83  DisContField3D(pSession,graph3D,variable,false),
84  m_globalMat(MemoryManager<GlobalMatrixMap>::AllocateSharedPtr()),
85  m_globalLinSysManager(
86  boost::bind(&ContField3D::GenGlobalLinSys, this, _1),
87  std::string("GlobalLinSys"))
88  {
91  CheckIfSingularSystem, variable,
93 
94  if (m_session->DefinesCmdLineArgument("verbose"))
95  {
96  m_locToGloMap->PrintStats(std::cout, variable);
97  }
98  }
99 
100 
101  /**
102  * Given a mesh \a graph3D, containing information about the domain and
103  * the spectral/hp element expansion, this constructor fills the list
104  * of local expansions #m_exp with the proper expansions, calculates
105  * the total number of quadrature points \f$\boldsymbol{x}_i\f$ and
106  * local expansion coefficients \f$\hat{u}^e_n\f$ and allocates memory
107  * for the arrays #m_coeffs and #m_phys. Furthermore, it constructs the
108  * mapping array (contained in #m_locToGloMap) for the transformation
109  * between local elemental level and global level, it calculates the
110  * total number global expansion coefficients \f$\hat{u}_n\f$ and
111  * allocates memory for the array #m_coeffs. The constructor also
112  * discretises the boundary conditions, specified by the argument \a
113  * bcs, by expressing them in terms of the coefficient of the expansion
114  * on the boundary.
115  *
116  * @param In Existing ContField2D object used to provide the
117  * local to global mapping information and
118  * global solution type.
119  * @param graph3D A mesh, containing information about the domain
120  * and the spectral/hp element expansion.
121  * @param bcs The boundary conditions.
122  * @param bc_loc
123  */
125  const SpatialDomains::MeshGraphSharedPtr &graph3D,
126  const std::string &variable,
127  const bool CheckIfSingularSystem):
128  DisContField3D(In,graph3D,variable,false),
129  m_globalMat (MemoryManager<GlobalMatrixMap>::AllocateSharedPtr()),
130  m_globalLinSysManager(boost::bind(&ContField3D::GenGlobalLinSys, this, _1),
131  std::string("GlobalLinSys"))
132 
133  {
134  if(!SameTypeOfBoundaryConditions(In) || CheckIfSingularSystem)
135  {
139  CheckIfSingularSystem, variable,
141 
142  if (m_session->DefinesCmdLineArgument("verbose"))
143  {
144  m_locToGloMap->PrintStats(std::cout, variable);
145  }
146  }
147  else
148  {
150  }
151  }
152 
153 
155  DisContField3D(In),
156  m_locToGloMap(In.m_locToGloMap),
157  m_globalMat(In.m_globalMat),
158  m_globalLinSysManager(In.m_globalLinSysManager)
159  {
160  }
161 
162 
164  {
165  }
166 
167 
168  /**
169  * Given the coefficients of an expansion, this function evaluates the
170  * spectral/hp expansion \f$u^{\delta}(\boldsymbol{x})\f$ at the
171  * quadrature points \f$\boldsymbol{x}_i\f$. This operation is
172  * evaluated locally by the function ExpList#BwdTrans.
173  *
174  * The coefficients of the expansion should be contained in the variable
175  * #inarray of the ExpList object \a In. The resulting physical values
176  * at the quadrature points \f$u^{\delta}(\boldsymbol{x}_i)\f$ are
177  * stored in the array #outarray.
178  *
179  * @param In An ExpList, containing the local coefficients
180  * \f$\hat{u}_n^e\f$ in its array #m_coeffs.
181  */
183  const Array<OneD, const NekDouble> &inarray,
184  Array<OneD, NekDouble> &outarray,
185  CoeffState coeffstate)
186  {
187  if(coeffstate == eGlobal)
188  {
189  bool doGlobalOp = m_globalOptParam->DoGlobalMatOp(
191 
192  if(doGlobalOp)
193  {
196  mat->Multiply(inarray,outarray);
197  }
198  else
199  {
201  GlobalToLocal(inarray,wsp);
202  BwdTrans_IterPerExp(wsp,outarray);
203  }
204  }
205  else
206  {
207  BwdTrans_IterPerExp(inarray,outarray);
208  }
209  }
210 
211 
212  /**
213  * The operation is evaluated locally (i.e. with respect to all local
214  * expansion modes) by the function ExpList#IProductWRTBase. The inner
215  * product with respect to the global expansion modes is than obtained
216  * by a global assembly operation.
217  *
218  * The values of the function \f$f(\boldsymbol{x})\f$ evaluated at the
219  * quadrature points \f$\boldsymbol{x}_i\f$ should be contained in the
220  * variable #m_phys of the ExpList object \a in. The result is stored
221  * in the array #m_coeffs.
222  *
223  * @param In An ExpList, containing the discrete evaluation
224  * of \f$f(\boldsymbol{x})\f$ at the quadrature
225  * points in its array #m_phys.
226  */
228  Array<OneD, NekDouble> &outarray,
229  CoeffState coeffstate)
230  {
231  if(coeffstate == eGlobal)
232  {
233  bool doGlobalOp = m_globalOptParam->DoGlobalMatOp(
235 
236  if(doGlobalOp)
237  {
239  m_locToGloMap);
241  mat->Multiply(inarray,outarray);
242  m_locToGloMap->UniversalAssemble(outarray);
243  }
244  else
245  {
247  IProductWRTBase_IterPerExp(inarray,wsp);
248  Assemble(wsp,outarray);
249  }
250  }
251  else
252  {
253  IProductWRTBase_IterPerExp(inarray,outarray);
254  }
255  }
256 
257 
259  Array<OneD, NekDouble> &outarray,
260  CoeffState coeffstate)
261  {
262  // Inner product of forcing
263  int contNcoeffs = m_locToGloMap->GetNumGlobalCoeffs();
264  Array<OneD,NekDouble> wsp(contNcoeffs);
265  IProductWRTBase(inarray,wsp,eGlobal);
266 
267  // Solve the system
269 
270  if(coeffstate == eGlobal)
271  {
272  GlobalSolve(key,wsp,outarray);
273  }
274  else
275  {
276  Array<OneD,NekDouble> tmp(contNcoeffs,0.0);
277  GlobalSolve(key,wsp,tmp);
278  GlobalToLocal(tmp,outarray);
279  }
280  }
281 
282 
284  const Array<OneD, const NekDouble> &inarray,
285  Array<OneD, NekDouble> &outarray,
286  CoeffState coeffstate)
287 
288  {
289  int contNcoeffs = m_locToGloMap->GetNumGlobalCoeffs();
291 
292  if(coeffstate == eGlobal)
293  {
294  if(inarray.data() == outarray.data())
295  {
296  Array<OneD, NekDouble> tmp(contNcoeffs,0.0);
297  Vmath::Vcopy(contNcoeffs,inarray,1,tmp,1);
298  GlobalSolve(key,tmp,outarray);
299  }
300  else
301  {
302  GlobalSolve(key,inarray,outarray);
303  }
304  }
305  else
306  {
307  Array<OneD, NekDouble> globaltmp(contNcoeffs,0.0);
308 
309  if(inarray.data() == outarray.data())
310  {
311  Array<OneD,NekDouble> tmp(inarray.num_elements());
312  Vmath::Vcopy(inarray.num_elements(),inarray,1,tmp,1);
313  Assemble(tmp,outarray);
314  }
315  else
316  {
317  Assemble(inarray,outarray);
318  }
319 
320  GlobalSolve(key,outarray,globaltmp);
321  GlobalToLocal(globaltmp,outarray);
322  }
323  }
324 
325 
327  Array<OneD, NekDouble> &inout,
328  Array<OneD, NekDouble> &outarray)
329  {
330  int bndcnt=0;
331  const Array<OneD,const int>& map = m_locToGloMap->GetBndCondCoeffsToGlobalCoeffsMap();
332  NekDouble sign;
333 
334  for(int i = 0; i < m_bndCondExpansions.num_elements(); ++i)
335  {
336  if(m_bndConditions[i]->GetBoundaryConditionType() == SpatialDomains::eDirichlet)
337  {
338  const Array<OneD,const NekDouble>& coeffs = m_bndCondExpansions[i]->GetCoeffs();
339  for(int j = 0; j < (m_bndCondExpansions[i])->GetNcoeffs(); ++j)
340  {
341  sign = m_locToGloMap->GetBndCondCoeffsToGlobalCoeffsSign(bndcnt);
342  inout[map[bndcnt++]] = sign * coeffs[j];
343  }
344  }
345  else
346  {
347  bndcnt += m_bndCondExpansions[i]->GetNcoeffs();
348  }
349  }
350  GeneralMatrixOp(key,inout,outarray,eGlobal);
351  }
352 
353 
354 
355  // Note inout contains initial guess and final output.
357  const GlobalLinSysKey &key,
358  const Array<OneD, const NekDouble> &rhs,
359  Array<OneD, NekDouble> &inout,
360  const Array<OneD, const NekDouble> &dirForcing)
361  {
362  int NumDirBcs = m_locToGloMap->GetNumGlobalDirBndCoeffs();
363  int contNcoeffs = m_locToGloMap->GetNumGlobalCoeffs();
364 
365  // STEP 1: SET THE DIRICHLET DOFS TO THE RIGHT VALUE
366  // IN THE SOLUTION ARRAY
368 
369 
370  // STEP 2: CALCULATE THE HOMOGENEOUS COEFFICIENTS
371  if(contNcoeffs - NumDirBcs > 0)
372  {
374  LinSys->Solve(rhs,inout,m_locToGloMap,dirForcing);
375  }
376  }
377 
379  {
380  return m_globalLinSysManager[mkey];
381  }
382 
383 
385  {
387  "To use method must have a AssemblyMap "
388  "attached to key");
390  }
391 
392 
393  /**
394  * Returns the global matrix associated with the given GlobalMatrixKey.
395  * If the global matrix has not yet been constructed on this field,
396  * it is first constructed using GenGlobalMatrix().
397  * @param mkey Global matrix key.
398  * @returns Assocated global matrix.
399  */
401  {
403  "To use method must have a AssemblyMap "
404  "attached to key");
405 
406  GlobalMatrixSharedPtr glo_matrix;
407  GlobalMatrixMap::iterator matrixIter = m_globalMat->find(mkey);
408 
409  if(matrixIter == m_globalMat->end())
410  {
411  glo_matrix = GenGlobalMatrix(mkey,m_locToGloMap);
412  (*m_globalMat)[mkey] = glo_matrix;
413  }
414  else
415  {
416  glo_matrix = matrixIter->second;
417  }
418 
419  return glo_matrix;
420  }
421 
422 
424  {
425  int i,j;
426  int bndcnt = 0;
427  int nDir = m_locToGloMap->GetNumGlobalDirBndCoeffs();
428 
429  NekDouble sign;
430  const Array<OneD,const int> &bndMap =
431  m_locToGloMap->GetBndCondCoeffsToGlobalCoeffsMap();
432 
434  m_locToGloMap->GetNumGlobalBndCoeffs(), 0.0);
435 
436  // Fill in Dirichlet coefficients that are to be sent to other
437  // processors. This code block uses a tuple<int,int.NekDouble> which
438  // stores the local id of coefficent the global id of the data
439  // location and the inverse of the values of the data (arising from
440  // periodic boundary conditiosn)
441  map<int, vector<ExtraDirDof> > &extraDirDofs =
442  m_locToGloMap->GetExtraDirDofs();
443  map<int, vector<ExtraDirDof> >::iterator it;
444  for (it = extraDirDofs.begin(); it != extraDirDofs.end(); ++it)
445  {
446  for (i = 0; i < it->second.size(); ++i)
447  {
448  tmp[it->second.at(i).get<1>()] =
449  m_bndCondExpansions[it->first]->GetCoeffs()[
450  it->second.at(i).get<0>()]*it->second.at(i).get<2>();
451  }
452  }
453 
454  m_locToGloMap->UniversalAssembleBnd(tmp);
455 
456  // Now fill in all other Dirichlet coefficients.
457  for(i = 0; i < m_bndCondExpansions.num_elements(); ++i)
458  {
459  if(m_bndConditions[i]->GetBoundaryConditionType() ==
461  {
462  const Array<OneD,const NekDouble>& coeffs =
463  m_bndCondExpansions[i]->GetCoeffs();
464  for(j = 0; j < (m_bndCondExpansions[i])->GetNcoeffs(); ++j)
465  {
466  sign = m_locToGloMap->GetBndCondCoeffsToGlobalCoeffsSign(
467  bndcnt);
468  tmp[bndMap[bndcnt++]] = sign * coeffs[j];
469  }
470  }
471  else
472  {
473  bndcnt += m_bndCondExpansions[i]->GetNcoeffs();
474  }
475  }
476 
477  Vmath::Vcopy(nDir, tmp, 1, outarray, 1);
478  }
479 
481  {
482  NekDouble sign;
483  int bndcnt = 0;
484  const Array<OneD,const int> &bndMap =
485  m_locToGloMap->GetBndCondCoeffsToGlobalCoeffsMap();
486 
487  Array<OneD, NekDouble> tmp(m_locToGloMap->GetNumGlobalCoeffs());
488  LocalToGlobal(m_coeffs,tmp);
489 
490  // Now fill in all other Dirichlet coefficients.
491  for(int i = 0; i < m_bndCondExpansions.num_elements(); ++i)
492  {
493  Array<OneD, NekDouble>& coeffs = m_bndCondExpansions[i]->UpdateCoeffs();
494 
495  for(int j = 0; j < (m_bndCondExpansions[i])->GetNcoeffs(); ++j)
496  {
497  sign = m_locToGloMap->GetBndCondCoeffsToGlobalCoeffsSign(bndcnt);
498  coeffs[j] = sign * tmp[bndMap[bndcnt++]];
499  }
500  }
501  }
502 
504  {
505  m_locToGloMap->LocalToGlobal(m_coeffs, m_coeffs);
506  }
507 
509  {
510  m_locToGloMap->GlobalToLocal(m_coeffs, m_coeffs);
511  }
512 
513 
514 
516  const Array<OneD, const NekDouble> &inarray,
517  Array<OneD, NekDouble> &outarray,
518  const FlagList &flags,
519  const StdRegions::ConstFactorMap &factors,
520  const StdRegions::VarCoeffMap &varcoeff,
521  const Array<OneD, const NekDouble> &dirForcing)
522  {
523  // Inner product of forcing
524  int contNcoeffs = m_locToGloMap->GetNumGlobalCoeffs();
525  Array<OneD,NekDouble> wsp(contNcoeffs);
526  IProductWRTBase(inarray,wsp,eGlobal);
527 
528  // Note -1.0 term necessary to invert forcing function to
529  // be consistent with matrix definition
530  Vmath::Neg(contNcoeffs, wsp, 1);
531 
532  // Forcing function with weak boundary conditions
533  int i,j;
534  int bndcnt = 0;
535  NekDouble sign;
536  Array<OneD, NekDouble> gamma(contNcoeffs, 0.0);
537  for(i = 0; i < m_bndCondExpansions.num_elements(); ++i)
538  {
539  if(m_bndConditions[i]->GetBoundaryConditionType() != SpatialDomains::eDirichlet)
540  {
541  for(j = 0; j < (m_bndCondExpansions[i])->GetNcoeffs(); j++)
542  {
543  sign = m_locToGloMap->GetBndCondCoeffsToGlobalCoeffsSign(bndcnt);
544  gamma[m_locToGloMap->GetBndCondCoeffsToGlobalCoeffsMap(bndcnt++)] +=
545  sign * (m_bndCondExpansions[i]->GetCoeffs())[j];
546  }
547  }
548  else
549  {
550  bndcnt += m_bndCondExpansions[i]->GetNcoeffs();
551  }
552  }
553  m_locToGloMap->UniversalAssemble(gamma);
554 
555  // Add weak boundary conditions to forcing
556  Vmath::Vadd(contNcoeffs, wsp, 1, gamma, 1, wsp, 1);
557 
558  // Solve the system
559  GlobalLinSysKey key(StdRegions::eHelmholtz, m_locToGloMap, factors,varcoeff);
560 
561  if(flags.isSet(eUseGlobal))
562  {
563  GlobalSolve(key,wsp,outarray,dirForcing);
564  }
565  else
566  {
567  Array<OneD,NekDouble> tmp(contNcoeffs);
568  LocalToGlobal(outarray,tmp);
569  GlobalSolve(key,wsp,tmp,dirForcing);
570  GlobalToLocal(tmp,outarray);
571  }
572  }
573 
575  const GlobalMatrixKey &gkey,
576  const Array<OneD,const NekDouble> &inarray,
577  Array<OneD, NekDouble> &outarray,
578  CoeffState coeffstate)
579  {
580  if(coeffstate == eGlobal)
581  {
582  bool doGlobalOp = m_globalOptParam->DoGlobalMatOp(gkey.GetMatrixType());
583 
584  if(doGlobalOp)
585  {
587  mat->Multiply(inarray,outarray);
588  m_locToGloMap->UniversalAssemble(outarray);
589  }
590  else
591  {
593  Array<OneD,NekDouble> tmp2(tmp1+m_ncoeffs);
594  GlobalToLocal(inarray,tmp1);
595  GeneralMatrixOp_IterPerExp(gkey,tmp1,tmp2);
596  Assemble(tmp2,outarray);
597  }
598  }
599  else
600  {
601  GeneralMatrixOp_IterPerExp(gkey,inarray,outarray);
602  }
603  }
604 
606  {
608  "To use method must have a AssemblyMap "
609  "attached to key");
610 
611  GlobalMatrixMap::iterator matrixIter = m_globalMat->find(gkey);
612 
613  if(matrixIter == m_globalMat->end())
614  {
615  return 0;
616  }
617  else
618  {
619  return matrixIter->second->GetNumNonZeroEntries();
620  }
621 
622  return 0;
623  }
624 
625 
626  /**
627  *
628  */
630  {
631  m_globalLinSysManager.ClearManager("GlobalLinSys");
632  }
633 
634  } //end of namespace
635 } //end of namespace
boost::shared_ptr< GlobalMatrix > GenGlobalMatrix(const GlobalMatrixKey &mkey, const boost::shared_ptr< AssemblyMapCG > &locToGloMap)
Generates a global matrix from the given key and map.
Definition: ExpList.cpp:897
void GeneralMatrixOp_IterPerExp(const GlobalMatrixKey &gkey, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList.cpp:829
GlobalMatrixSharedPtr GetGlobalMatrix(const GlobalMatrixKey &mkey)
Returns the global matrix specified by mkey.
Array< OneD, MultiRegions::ExpListSharedPtr > m_bndCondExpansions
An object which contains the discretised boundary conditions.
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
#define sign(a, b)
return the sign(b)*a
Definition: Polylib.cpp:22
NekOptimize::GlobalOptParamSharedPtr m_globalOptParam
Definition: ExpList.h:1001
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
std::map< GlobalMatrixKey, GlobalMatrixSharedPtr > GlobalMatrixMap
Mapping from global matrix keys to global matrices.
Definition: GlobalMatrix.h:91
int GetGlobalMatrixNnz(const GlobalMatrixKey &gkey)
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate=eLocal)
Calculates the inner product of a function with respect to all global expansion modes ...
STL namespace.
PeriodicMap m_periodicFaces
A map which identifies pairs of periodic faces.
std::map< ConstFactorType, NekDouble > ConstFactorMap
Definition: StdRegions.hpp:251
virtual void v_GlobalToLocal(void)
Array< OneD, NekDouble > m_coeffs
Concatenation of all local expansion coefficients.
Definition: ExpList.h:939
boost::shared_ptr< GlobalMatrix > GlobalMatrixSharedPtr
Shared pointer to a GlobalMatrix object.
Definition: GlobalMatrix.h:89
virtual void v_ImposeDirichletConditions(Array< OneD, NekDouble > &outarray)
Impose the Dirichlet Boundary Conditions on outarray.
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
Definition: MeshPartition.h:51
Global coefficients.
void GeneralMatrixOp(const GlobalMatrixKey &gkey, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate=eLocal)
This function calculates the result of the multiplication of a matrix of type specified by mkey with ...
Definition: ExpList.h:2129
bool isSet(const FlagType &key) const
void BwdTrans_IterPerExp(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:1620
GlobalLinSysSharedPtr GenGlobalLinSys(const GlobalLinSysKey &mkey)
std::map< StdRegions::VarCoeffType, Array< OneD, NekDouble > > VarCoeffMap
Definition: StdRegions.hpp:226
boost::shared_ptr< GlobalLinSys > GenGlobalLinSys(const GlobalLinSysKey &mkey, const boost::shared_ptr< AssemblyMapCG > &locToGloMap)
This operation constructs the global linear system of type mkey.
Definition: ExpList.cpp:1175
void IProductWRTBase_IterPerExp(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:1570
int m_ncoeffs
The total number of local degrees of freedom. m_ncoeffs .
Definition: ExpList.h:917
LibUtilities::SessionReaderSharedPtr m_session
Session.
Definition: ExpList.h:910
void Neg(int n, T *x, const int incx)
Negate x = -x.
Definition: Vmath.cpp:382
double NekDouble
bool SameTypeOfBoundaryConditions(const DisContField3D &In)
Defines a list of flags.
virtual void v_GeneralMatrixOp(const GlobalMatrixKey &gkey, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate)
Calculates the result of the multiplication of a global matrix of type specified by mkey with a vecto...
Describe a linear system.
StdRegions::MatrixType GetMatrixType() const
Return the matrix type.
Describes a matrix with ordering defined by a local to global map.
AssemblyMapCGSharedPtr m_locToGloMap
Definition: ContField3D.h:110
void LocalToGlobal(void)
Put the coefficients into global ordering using m_coeffs.
Definition: ExpList.h:1850
GlobalLinSysSharedPtr GetGlobalLinSys(const GlobalLinSysKey &mkey)
void GenerateDirBndCondForcing(const GlobalLinSysKey &key, Array< OneD, NekDouble > &inout, Array< OneD, NekDouble > &outarray)
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
virtual void v_MultiplyByInvMassMatrix(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate)
virtual void v_HelmSolve(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const FlagList &flags, const StdRegions::ConstFactorMap &factors, const StdRegions::VarCoeffMap &varcoeff, const Array< OneD, const NekDouble > &dirForcing)
void GlobalSolve(const GlobalLinSysKey &key, const Array< OneD, const NekDouble > &rhs, Array< OneD, NekDouble > &inout, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray)
PeriodicMap m_periodicVerts
A map which identifies groups of periodic vertices.
bool LocToGloMapIsDefined() const
Returns true if a local to global map is defined.
GlobalMatrixMapShPtr m_globalMat
(A shared pointer to) a list which collects all the global matrices being assembled, such that they should be constructed only once.
Definition: ContField3D.h:115
void IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate=eLocal)
Definition: ExpList.h:1559
Array< OneD, SpatialDomains::BoundaryConditionShPtr > m_bndConditions
An array which contains the information about the boundary condition on the different boundary region...
int GetNcoeffs(void) const
Returns the total number of local degrees of freedom .
Definition: ExpList.h:1403
LibUtilities::NekManager< GlobalLinSysKey, GlobalLinSys > m_globalLinSysManager
(A shared pointer to) a list which collects all the global linear system being assembled, such that they should be constructed only once.
Definition: ContField3D.h:120
boost::shared_ptr< GlobalLinSys > GlobalLinSysSharedPtr
Pointer to a GlobalLinSys object.
Definition: GlobalLinSys.h:52
virtual void v_FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate)
virtual void v_BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate=eLocal)
Performs the backward transformation of the spectral/hp element expansion.
virtual void v_ClearGlobalLinSysManager(void)
virtual void v_LocalToGlobal(void)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
boost::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition: MeshGraph.h:442
void GlobalToLocal(void)
Put the coefficients into local ordering and place in m_coeffs.
Definition: ExpList.h:1855
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1047
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:285
PeriodicMap m_periodicEdges
A map which identifies groups of periodic edges.