Nektar++
GlobalLinSysPETScStaticCond.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File GlobalLinSys.h
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: GlobalLinSysStaticCond header
32 //
33 ///////////////////////////////////////////////////////////////////////////////
34 
35 #ifndef NEKTAR_LIB_MULTIREGIONS_GLOBALLINSYSPETSCSTATICCOND_H
36 #define NEKTAR_LIB_MULTIREGIONS_GLOBALLINSYSPETSCSTATICCOND_H
37 
41 
42 namespace Nektar
43 {
44  namespace MultiRegions
45  {
46  // Forward declarations
47  class ExpList;
48  class GlobalLinSysPETScStaticCond;
49 
50  typedef std::shared_ptr<GlobalLinSysPETScStaticCond>
52 
53  /// A global linear system.
55  virtual public GlobalLinSysStaticCond
56  {
57  public:
58  /// Creates an instance of this class
60  const GlobalLinSysKey &pLinSysKey,
61  const std::weak_ptr<ExpList> &pExpList,
62  const std::shared_ptr<AssemblyMap> &pLocToGloMap)
63  {
65  GlobalLinSysPETScStaticCond>::AllocateSharedPtr(
66  pLinSysKey, pExpList, pLocToGloMap);
67  p->InitObject();
68  return p;
69  }
70 
71  /// Name of class
72  MULTI_REGIONS_EXPORT static std::string className;
73  static std::string className2;
74 
75  /// Constructor for full direct matrix solve.
77  const GlobalLinSysKey &mkey,
78  const std::weak_ptr<ExpList> &pExpList,
79  const std::shared_ptr<AssemblyMap> &locToGloMap);
80 
81  /// Constructor for full direct matrix solve.
83  const GlobalLinSysKey &mkey,
84  const std::weak_ptr<ExpList> &pExpList,
85  const DNekScalBlkMatSharedPtr pSchurCompl,
86  const DNekScalBlkMatSharedPtr pBinvD,
87  const DNekScalBlkMatSharedPtr pC,
88  const DNekScalBlkMatSharedPtr pInvD,
89  const std::shared_ptr<AssemblyMap> &locToGloMap,
90  const PreconditionerSharedPtr pPrecon =
92 
94 
95  protected:
96  virtual void v_InitObject();
97 
98  /// Assemble the Schur complement matrix.
99  virtual void v_AssembleSchurComplement(
100  std::shared_ptr<AssemblyMap> locToGloMap);
101  virtual void v_DoMatrixMultiply(
102  const Array<OneD, const NekDouble> &input,
103  Array<OneD, NekDouble> &output);
104  virtual DNekScalBlkMatSharedPtr v_GetStaticCondBlock(unsigned int n);
105  virtual void v_PreSolve(int scLevel,
106  Array<OneD, NekDouble> &F_bBnd);
107 
108  virtual void v_BasisFwdTransform(
109  Array<OneD, NekDouble>& pInOut);
110  virtual void v_CoeffsBwdTransform(
111  Array<OneD, NekDouble>& pInOut);
112  virtual void v_CoeffsFwdTransform(
113  const Array<OneD, NekDouble>& pInput,
114  Array<OneD, NekDouble>& pOutput);
115 
117  const GlobalLinSysKey &mkey,
118  const std::weak_ptr<ExpList> &pExpList,
119  const DNekScalBlkMatSharedPtr pSchurCompl,
120  const DNekScalBlkMatSharedPtr pBinvD,
121  const DNekScalBlkMatSharedPtr pC,
122  const DNekScalBlkMatSharedPtr pInvD,
123  const std::shared_ptr<AssemblyMap> &locToGloMap);
124 
125  };
126  }
127 }
128 
129 #endif
#define MULTI_REGIONS_EXPORT
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
A PETSc global linear system.
virtual void v_CoeffsBwdTransform(Array< OneD, NekDouble > &pInOut)
virtual void v_CoeffsFwdTransform(const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput)
static GlobalLinSysSharedPtr create(const GlobalLinSysKey &pLinSysKey, const std::weak_ptr< ExpList > &pExpList, const std::shared_ptr< AssemblyMap > &pLocToGloMap)
Creates an instance of this class.
virtual DNekScalBlkMatSharedPtr v_GetStaticCondBlock(unsigned int n)
Retrieves a the static condensation block matrices from n-th expansion using the matrix key provided ...
virtual GlobalLinSysStaticCondSharedPtr v_Recurse(const GlobalLinSysKey &mkey, const std::weak_ptr< ExpList > &pExpList, const DNekScalBlkMatSharedPtr pSchurCompl, const DNekScalBlkMatSharedPtr pBinvD, const DNekScalBlkMatSharedPtr pC, const DNekScalBlkMatSharedPtr pInvD, const std::shared_ptr< AssemblyMap > &locToGloMap)
virtual void v_DoMatrixMultiply(const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output)
Apply matrix-vector multiplication using local approach and the assembly map.
virtual void v_PreSolve(int scLevel, Array< OneD, NekDouble > &F_bBnd)
virtual void v_AssembleSchurComplement(std::shared_ptr< AssemblyMap > locToGloMap)
Assemble the Schur complement matrix.
virtual void v_BasisFwdTransform(Array< OneD, NekDouble > &pInOut)
GlobalLinSysPETScStaticCond(const GlobalLinSysKey &mkey, const std::weak_ptr< ExpList > &pExpList, const std::shared_ptr< AssemblyMap > &locToGloMap)
Constructor for full direct matrix solve.
std::shared_ptr< GlobalLinSys > GlobalLinSysSharedPtr
Pointer to a GlobalLinSys object.
Definition: GlobalLinSys.h:50
std::shared_ptr< GlobalLinSysStaticCond > GlobalLinSysStaticCondSharedPtr
std::shared_ptr< Preconditioner > PreconditionerSharedPtr
Definition: GlobalLinSys.h:60
std::shared_ptr< GlobalLinSysPETScStaticCond > GlobalLinSysPETScStaticCondSharedPtr
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:1
std::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
Definition: NekTypeDefs.hpp:73