Logo  0.95.0-final
Finite Element Embedded Library and Language in C++
Feel++ Feel++ on Github Feel++ community
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
preconditionerpetsc.hpp
Go to the documentation of this file.
1 /* -*- mode: c++; coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; show-trailing-whitespace: t -*-
2 
3  This file is part of the Feel library
4 
5  Author(s): Christophe Prud'homme <christophe.prudhomme@feelpp.org>
6  Date: 2012-01-16
7 
8  Copyright (C) 2012 Université Joseph Fourier (Grenoble I)
9 
10  This library is free software; you can redistribute it and/or
11  modify it under the terms of the GNU Lesser General Public
12  License as published by the Free Software Foundation; either
13  version 2.1 of the License, or (at your option) any later version.
14 
15  This library is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public
21  License along with this library; if not, write to the Free Software
22  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 */
29 #ifndef __PreconditionerPetsc_H
30 #define __PreconditionerPetsc_H 1
31 
34 
35 namespace Feel
36 {
44 template<typename T>
46  : public Preconditioner<T>
47 {
48 public:
49 
50 
54 
55 
57 
61 
62 
64 
68 
70  PreconditionerPetsc( std::string const& name, WorldComm const& worldComm=Environment::worldComm() );
74  virtual ~PreconditionerPetsc();
75 
79  virtual void clear ();
80 
84  virtual void init ();
85 
87 
91 
94  {
95  if ( this != &o )
96  {
97  M_pc = o.M_pc;
98  M_mat = o.M_mat;
99  }
100 
101  return *this;
102  }
104 
112  PC pc()
113  {
114  return M_pc;
115  }
116 
117 
118 
120 
124 
125 
130  const MatSolverPackageType & matSolverPackage_type,
131  PC & pc,
132  WorldComm const& worldComm=Environment::worldComm(),
133  std::string const& prefix="");
134 
135 
137 
141 
146  virtual void apply( const Vector<T> & x, Vector<T> & y );
147 
148 
150 
154  PC M_pc;
155 
160  Mat M_mat;
161 
162  static void setPetscSubpreconditionerType( PC& pc, WorldComm const& worldComm=Environment::worldComm(), std::string const& prefix="" );
163 
164  static void setPetscFieldSplitPreconditionerType( PC& pc,
165  WorldComm const& worldComm=Environment::worldComm(),
166  std::string const& prefix="" );
167 
168  static void setPetscMGCoarsePreconditionerType( PC& pc,
169  WorldComm const& worldComm=Environment::worldComm(),
170  std::string const& prefix="" );
171  static void setPetscMGLevelsPreconditionerType( PC& pc,
172  WorldComm const& worldComm=Environment::worldComm(),
173  std::string const& prefix="" );
174 
175 private:
183  //#if PETSC_VERSION_LESS_THAN(3,0,0)
185  //static void setPetscSubpreconditionerType(PCType type, PC& pc);
186  //#else
187  // In later versions, PCType is #define'd as char*, so we need the const
188 
189  //#endif
190 };
191 
192 
193 
194 
195 
196 } // Feel
197 #endif /* __PreconditionerPetsc_H */

Generated on Fri Oct 25 2013 14:24:22 for Feel++ by doxygen 1.8.4