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
43{
44// Forward declarations
45class ExpList;
46class GlobalLinSysPETScStaticCond;
47
48typedef std::shared_ptr<GlobalLinSysPETScStaticCond>
50
51/// A global linear system.
53 virtual public GlobalLinSysStaticCond
54{
55public:
56 /// Creates an instance of this class
58 const GlobalLinSysKey &pLinSysKey,
59 const std::weak_ptr<ExpList> &pExpList,
60 const std::shared_ptr<AssemblyMap> &pLocToGloMap)
61 {
64 pLinSysKey, pExpList, pLocToGloMap);
65 p->InitObject();
66 return p;
67 }
68
69 /// Name of class
70 MULTI_REGIONS_EXPORT static std::string className;
71 static std::string className2;
72
73 /// Constructor for full direct matrix solve.
75 const GlobalLinSysKey &mkey, const std::weak_ptr<ExpList> &pExpList,
76 const std::shared_ptr<AssemblyMap> &locToGloMap);
77
78 /// Constructor for full direct matrix solve.
80 const GlobalLinSysKey &mkey, const std::weak_ptr<ExpList> &pExpList,
81 const DNekScalBlkMatSharedPtr pSchurCompl,
83 const DNekScalBlkMatSharedPtr pInvD,
84 const std::shared_ptr<AssemblyMap> &locToGloMap,
86
88
89protected:
90 void v_InitObject() override;
91
92 /// Assemble the Schur complement matrix.
94 std::shared_ptr<AssemblyMap> locToGloMap) override;
96 Array<OneD, NekDouble> &output) override;
97 DNekScalBlkMatSharedPtr v_GetStaticCondBlock(unsigned int n) override;
98 void v_PreSolve(int scLevel, Array<OneD, NekDouble> &F_bBnd) override;
99 void v_SolveLinearSystem(const int pNumRows,
100 const Array<OneD, const NekDouble> &pInput,
101 Array<OneD, NekDouble> &pOutput,
102 const AssemblyMapSharedPtr &locToGloMap,
103 const int pNumDir) override;
104
105 void v_BasisFwdTransform(Array<OneD, NekDouble> &pInOut) override;
106 void v_CoeffsBwdTransform(Array<OneD, NekDouble> &pInOut) override;
108 Array<OneD, NekDouble> &pOutput) override;
109
111 const GlobalLinSysKey &mkey, const std::weak_ptr<ExpList> &pExpList,
112 const DNekScalBlkMatSharedPtr pSchurCompl,
114 const DNekScalBlkMatSharedPtr pInvD,
115 const std::shared_ptr<AssemblyMap> &locToGloMap) override;
116};
117} // namespace Nektar::MultiRegions
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.
void v_CoeffsFwdTransform(const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput) override
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.
void v_SolveLinearSystem(const int pNumRows, const Array< OneD, const NekDouble > &pInput, Array< OneD, NekDouble > &pOutput, const AssemblyMapSharedPtr &locToGloMap, const int pNumDir) override
Solve linear system using PETSc.
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
void v_CoeffsBwdTransform(Array< OneD, NekDouble > &pInOut) override
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.
DNekScalBlkMatSharedPtr v_GetStaticCondBlock(unsigned int n) override
Retrieves a the static condensation block matrices from n-th expansion using the matrix key provided ...
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.
void v_BasisFwdTransform(Array< OneD, NekDouble > &pInOut) override
std::shared_ptr< GlobalLinSys > GlobalLinSysSharedPtr
Pointer to a GlobalLinSys object.
Definition: GlobalLinSys.h:51
std::shared_ptr< GlobalLinSysStaticCond > GlobalLinSysStaticCondSharedPtr
std::shared_ptr< Preconditioner > PreconditionerSharedPtr
Definition: GlobalLinSys.h:58
std::shared_ptr< AssemblyMap > AssemblyMapSharedPtr
Definition: AssemblyMap.h:50
std::shared_ptr< GlobalLinSysPETScStaticCond > GlobalLinSysPETScStaticCondSharedPtr
std::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
Definition: NekTypeDefs.hpp:79