$extrastylesheet
eigen_preconditioner.h
Go to the documentation of this file.
00001 // The libMesh Finite Element Library.
00002 // Copyright (C) 2002-2014 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
00003 
00004 // This library is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU Lesser General Public
00006 // License as published by the Free Software Foundation; either
00007 // version 2.1 of the License, or (at your option) any later version.
00008 
00009 // This library is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 // Lesser General Public License for more details.
00013 
00014 // You should have received a copy of the GNU Lesser General Public
00015 // License along with this library; if not, write to the Free Software
00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 
00018 
00019 
00020 #ifndef LIBMESH_EIGEN_PRECONDITIONER_H
00021 #define LIBMESH_EIGEN_PRECONDITIONER_H
00022 
00023 #include "libmesh/libmesh_config.h"
00024 
00025 #ifdef LIBMESH_HAVE_EIGEN
00026 
00027 // Local includes
00028 #include "libmesh/eigen_core_support.h"
00029 #include "libmesh/preconditioner.h"
00030 #include "libmesh/libmesh_common.h"
00031 #include "libmesh/enum_solver_package.h"
00032 #include "libmesh/enum_preconditioner_type.h"
00033 #include "libmesh/reference_counted_object.h"
00034 #include "libmesh/libmesh.h"
00035 
00036 // Eigen includes
00037 
00038 // C++ includes
00039 
00040 namespace libMesh
00041 {
00042 
00043 // forward declarations
00044 template <typename T> class SparseMatrix;
00045 template <typename T> class NumericVector;
00046 template <typename T> class ShellMatrix;
00047 
00055 template <typename T>
00056 class EigenPreconditioner : public Preconditioner<T>
00057 {
00058 public:
00059 
00063   EigenPreconditioner (const libMesh::Parallel::Communicator &comm_in
00064                        LIBMESH_CAN_DEFAULT_TO_COMMWORLD);
00065 
00069   virtual ~EigenPreconditioner ();
00070 
00075   virtual void apply(const NumericVector<T> & x, NumericVector<T> & y);
00076 
00080   virtual void clear () {}
00081 
00085   virtual void init ();
00086 
00087 protected:
00088 };
00089 
00090 
00091 
00092 
00093 /*----------------------- inline functions ----------------------------------*/
00094 template <typename T>
00095 inline
00096 EigenPreconditioner<T>::EigenPreconditioner(const libMesh::Parallel::Communicator &comm_in) :
00097   Preconditioner<T>(comm_in)
00098 {
00099 }
00100 
00101 
00102 
00103 template <typename T>
00104 inline
00105 EigenPreconditioner<T>::~EigenPreconditioner ()
00106 {
00107   this->clear ();
00108 }
00109 
00110 } // namespace libMesh
00111 
00112 #endif // #ifdef LIBMESH_HAVE_EIGEN
00113 #endif // LIBMESH_EIGEN_PRECONDITIONER_H