$extrastylesheet
condensed_eigen_system.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 #ifndef LIBMESH_CONDENSED_EIGEN_SYSTEM_H
00020 #define LIBMESH_CONDENSED_EIGEN_SYSTEM_H
00021 
00022 #include "libmesh/libmesh_config.h"
00023 
00024 // Currently, the EigenSystem should only be available
00025 // if SLEPc support is enabled.
00026 #if defined(LIBMESH_HAVE_SLEPC)
00027 
00028 // Local Includes
00029 #include "libmesh/eigen_system.h"
00030 #include "libmesh/sparse_matrix.h"
00031 
00032 // C++ includes
00033 
00034 namespace libMesh
00035 {
00036 
00045 // ------------------------------------------------------------
00046 // CondensedEigenSystem class definition
00047 
00048 class CondensedEigenSystem : public EigenSystem
00049 {
00050 public:
00051 
00056   CondensedEigenSystem (EquationSystems& es,
00057                         const std::string& name_in,
00058                         const unsigned int number_in);
00059 
00063   typedef CondensedEigenSystem sys_type;
00064 
00068   typedef EigenSystem Parent;
00069 
00073   sys_type & system () { return *this; }
00074 
00080   void initialize_condensed_dofs(std::set<unsigned int>& global_dirichlet_dofs_set);
00081 
00085   unsigned int n_global_non_condensed_dofs() const;
00086 
00092   virtual void solve();
00093 
00100   virtual std::pair<Real, Real> get_eigenpair(unsigned int i);
00101 
00105   UniquePtr< SparseMatrix<Number> > condensed_matrix_A;
00106 
00110   UniquePtr< SparseMatrix<Number> > condensed_matrix_B;
00111 
00117   std::vector<dof_id_type> local_non_condensed_dofs_vector;
00118 
00119 private:
00120 
00125   bool condensed_dofs_initialized;
00126 
00127 };
00128 
00129 
00130 } // namespace libMesh
00131 
00132 
00133 #endif // LIBMESH_HAVE_SLEPC
00134 
00135 #endif // LIBMESH_CONDENSED_EIGEN_SYSTEM_H