$extrastylesheet
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_TIME_SOLVER_H 00021 #define LIBMESH_EIGEN_TIME_SOLVER_H 00022 00023 #include "libmesh/libmesh_config.h" 00024 #ifdef LIBMESH_HAVE_SLEPC 00025 00026 // Local includes 00027 #include "libmesh/time_solver.h" 00028 00029 // C++ includes 00030 00031 namespace libMesh 00032 { 00033 00034 // Forward declarations 00035 template <typename T> class EigenSolver; 00036 00037 00067 class EigenTimeSolver : public TimeSolver 00068 { 00069 public: 00073 typedef DifferentiableSystem sys_type; 00074 00078 typedef TimeSolver Parent; 00079 00084 explicit 00085 EigenTimeSolver (sys_type& s); 00086 00090 virtual ~EigenTimeSolver (); 00091 00096 virtual void init (); 00097 00102 virtual void reinit (); 00103 00108 virtual void solve (); 00109 00113 virtual void advance_timestep () { } 00114 00119 virtual Real error_order() const { return 0.; } 00120 00125 virtual bool element_residual (bool get_jacobian, 00126 DiffContext&); 00127 00131 virtual bool side_residual (bool get_jacobian, 00132 DiffContext&); 00133 00137 virtual bool nonlocal_residual (bool get_jacobian, 00138 DiffContext&); 00139 00145 virtual Real du (const SystemNorm&) const { return 0.; } 00146 00150 virtual bool is_steady() const { return true; } 00151 00156 UniquePtr<EigenSolver<Number> > eigen_solver; 00157 00162 Real tol; 00163 00167 unsigned int maxits; 00168 00172 unsigned int n_eigenpairs_to_compute; 00173 00183 unsigned int n_basis_vectors_to_use; 00184 00189 unsigned int n_converged_eigenpairs; 00190 00195 unsigned int n_iterations_reqd; 00196 00197 private: 00198 00199 enum NowAssembling { 00203 Matrix_A, 00204 00208 Matrix_B, 00209 00213 Invalid_Matrix 00214 }; 00215 00219 NowAssembling now_assembling; 00220 00221 }; 00222 00223 } // namespace libMesh 00224 00225 00226 #endif // LIBMESH_HAVE_SLEPC 00227 #endif // LIBMESH_EIGEN_TIME_SOLVER_H