Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PreconditionerDiagonal.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File Preconditioner.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 // 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: Preconditioner header
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 #ifndef NEKTAR_LIB_MULTIREGIONS_PRECONDITIONERDIAGONAL_H
36 #define NEKTAR_LIB_MULTIREGIONS_PRECONDITIONERDIAGONAL_H
41 
42 
43 namespace Nektar
44 {
45  namespace MultiRegions
46  {
48  typedef boost::shared_ptr<PreconditionerDiagonal> PreconditionerDiagonalSharedPtr;
49 
51  {
52  public:
53  /// Creates an instance of this class
55  const boost::shared_ptr<GlobalLinSys> &plinsys,
56  const boost::shared_ptr<AssemblyMap>
57  &pLocToGloMap)
58  {
60  p->InitObject();
61  return p;
62  }
63 
64  /// Name of class
65  static std::string className;
66  //static std::string className1;
67 
69  const boost::shared_ptr<GlobalLinSys> &plinsys,
70  const AssemblyMapSharedPtr &pLocToGloMap);
71 
74 
75  protected:
76 
77  Array<OneD, NekDouble> m_diagonals;
78 
80 
81  private:
82 
83  void DiagonalPreconditionerSum(void);
84 
86 
87  virtual void v_InitObject();
88 
89  virtual void v_DoPreconditioner(
90  const Array<OneD, NekDouble>& pInput,
91  Array<OneD, NekDouble>& pOutput);
92 
93  virtual void v_BuildPreconditioner();
94 
95  static std::string lookupIds[];
96  static std::string def;
97  };
98 
100  typedef boost::shared_ptr<PreconditionerNull> PreconditionerNullSharedPtr;
101 
103  {
104  public:
105  /// Creates an instance of this class
107  const boost::shared_ptr<GlobalLinSys> &plinsys,
108  const boost::shared_ptr<AssemblyMap>
109  &pLocToGloMap)
110  {
112  p->InitObject();
113  return p;
114  }
115 
116  /// Name of class
117  static std::string className;
118 
120  const boost::shared_ptr<GlobalLinSys> &plinsys,
121  const AssemblyMapSharedPtr &pLocToGloMap);
122 
124  virtual ~PreconditionerNull() {}
125 
126  protected:
127 
129 
130  private:
131 
132  virtual void v_InitObject();
133 
134  virtual void v_DoPreconditioner(
135  const Array<OneD, NekDouble>& pInput,
136  Array<OneD, NekDouble>& pOutput);
137 
138  virtual void v_BuildPreconditioner();
139 
140  static std::string lookupIds[];
141  static std::string def;
142  };
143 
144  }
145 }
146 
147 #endif