preconditioner.C
Go to the documentation of this file.00001 // The libMesh Finite Element Library. 00002 // Copyright (C) 2002-2012 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 // C++ includes 00021 00022 // Local Includes 00023 #include "libmesh/auto_ptr.h" 00024 #include "libmesh/preconditioner.h" 00025 #include "libmesh/petsc_preconditioner.h" 00026 #include "libmesh/trilinos_preconditioner.h" 00027 00028 namespace libMesh 00029 { 00030 00031 //------------------------------------------------------------------ 00032 // Preconditioner members 00033 template <typename T> 00034 Preconditioner<T> * 00035 Preconditioner<T>::build(const SolverPackage solver_package) 00036 { 00037 // Build the appropriate solver 00038 switch (solver_package) 00039 { 00040 00041 /* 00042 #ifdef LIBMESH_HAVE_LASPACK 00043 case LASPACK_SOLVERS: 00044 { 00045 AutoPtr<Preconditioner<T> > ap(new LaspackPreconditioner<T>); 00046 return ap; 00047 } 00048 #endif 00049 */ 00050 00051 #ifdef LIBMESH_HAVE_PETSC 00052 case PETSC_SOLVERS: 00053 { 00054 return new PetscPreconditioner<T>(); 00055 } 00056 #endif 00057 00058 #ifdef LIBMESH_HAVE_TRILINOS 00059 case TRILINOS_SOLVERS: 00060 return new TrilinosPreconditioner<T>(); 00061 #endif 00062 00063 default: 00064 libMesh::err << "ERROR: Unrecognized solver package: " 00065 << solver_package 00066 << std::endl; 00067 libmesh_error(); 00068 } 00069 00070 return NULL; 00071 } 00072 00073 00074 00075 //------------------------------------------------------------------ 00076 // Explicit instantiations 00077 template class Preconditioner<Number>; 00078 00079 } // namespace libMesh 00080 00081 00082
Site Created By: libMesh Developers
Last modified: February 05 2013 19:54:48 UTC
Hosted By: