Nektar++
GlobalLinSysPETScStaticCond.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File: GlobalLinSysPETScStaticCond.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  {
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, const std::weak_ptr<ExpList> &pExpList,
78  const std::shared_ptr<AssemblyMap> &locToGloMap);
79 
80  /// Constructor for full direct matrix solve.
82  const GlobalLinSysKey &mkey, const std::weak_ptr<ExpList> &pExpList,
83  const DNekScalBlkMatSharedPtr pSchurCompl,
84  const DNekScalBlkMatSharedPtr pBinvD, const DNekScalBlkMatSharedPtr pC,
85  const DNekScalBlkMatSharedPtr pInvD,
86  const std::shared_ptr<AssemblyMap> &locToGloMap,
88 
90 
91 protected:
92  virtual void v_InitObject() override;
93 
94  /// Assemble the Schur complement matrix.
95  virtual void v_AssembleSchurComplement(
96  std::shared_ptr<AssemblyMap> locToGloMap) override;
97  virtual void v_DoMatrixMultiply(const Array<OneD, const NekDouble> &input,
98  Array<OneD, NekDouble> &output) override;
100  unsigned int n) override;
101  virtual void v_PreSolve(int scLevel,
102  Array<OneD, NekDouble> &F_bBnd) override;
103 
104  virtual void v_BasisFwdTransform(Array<OneD, NekDouble> &pInOut) override;
105  virtual void v_CoeffsBwdTransform(Array<OneD, NekDouble> &pInOut) override;
106  virtual void v_CoeffsFwdTransform(const Array<OneD, NekDouble> &pInput,
107  Array<OneD, NekDouble> &pOutput) override;
108 
110  const GlobalLinSysKey &mkey, const std::weak_ptr<ExpList> &pExpList,
111  const DNekScalBlkMatSharedPtr pSchurCompl,
112  const DNekScalBlkMatSharedPtr pBinvD, const DNekScalBlkMatSharedPtr pC,
113  const DNekScalBlkMatSharedPtr pInvD,
114  const std::shared_ptr<AssemblyMap> &locToGloMap) override;
115 };
116 } // namespace MultiRegions
117 } // namespace Nektar
118 
119 #endif
#define MULTI_REGIONS_EXPORT
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
A PETSc global linear system.
virtual void v_CoeffsFwdTransform(const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput) override
virtual void v_AssembleSchurComplement(std::shared_ptr< AssemblyMap > locToGloMap) override
Assemble the Schur complement matrix.
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 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) override
virtual void v_CoeffsBwdTransform(Array< OneD, NekDouble > &pInOut) override
virtual void v_DoMatrixMultiply(const Array< OneD, const NekDouble > &input, Array< OneD, NekDouble > &output) override
Apply matrix-vector multiplication using local approach and the assembly map.
virtual DNekScalBlkMatSharedPtr v_GetStaticCondBlock(unsigned int n) override
Retrieves a the static condensation block matrices from n-th expansion using the matrix key provided ...
virtual void v_PreSolve(int scLevel, Array< OneD, NekDouble > &F_bBnd) override
GlobalLinSysPETScStaticCond(const GlobalLinSysKey &mkey, const std::weak_ptr< ExpList > &pExpList, const std::shared_ptr< AssemblyMap > &locToGloMap)
Constructor for full direct matrix solve.
virtual void v_BasisFwdTransform(Array< OneD, NekDouble > &pInOut) override
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:2
std::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
Definition: NekTypeDefs.hpp:79