FEI Version of the Day
fei_Factory_Aztec.hpp
00001 /*
00002 // @HEADER
00003 // ************************************************************************
00004 //             FEI: Finite Element Interface to Linear Solvers
00005 //                  Copyright (2005) Sandia Corporation.
00006 //
00007 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the
00008 // U.S. Government retains certain rights in this software.
00009 //
00010 // Redistribution and use in source and binary forms, with or without
00011 // modification, are permitted provided that the following conditions are
00012 // met:
00013 //
00014 // 1. Redistributions of source code must retain the above copyright
00015 // notice, this list of conditions and the following disclaimer.
00016 //
00017 // 2. Redistributions in binary form must reproduce the above copyright
00018 // notice, this list of conditions and the following disclaimer in the
00019 // documentation and/or other materials provided with the distribution.
00020 //
00021 // 3. Neither the name of the Corporation nor the names of the
00022 // contributors may be used to endorse or promote products derived from
00023 // this software without specific prior written permission.
00024 //
00025 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
00026 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00027 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00028 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
00029 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00030 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00031 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00032 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00033 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00034 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00035 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00036 //
00037 // Questions? Contact Alan Williams (william@sandia.gov) 
00038 //
00039 // ************************************************************************
00040 // @HEADER
00041 */
00042 
00043 
00044 #ifndef _fei_Factory_Aztec_hpp_
00045 #define _fei_Factory_Aztec_hpp_
00046 
00047 #include "fei_trilinos_macros.hpp"
00048 
00049 #include <fei_mpi.h>
00050 
00051 #include <fei_Aztec_LSVector.hpp>
00052 #include <fei_AztecDMSR_Matrix.hpp>
00053 
00054 #include <fei_Factory.hpp>
00055 #include <fei_ParameterSet.hpp>
00056 #include <fei_Reducer.hpp>
00057 #include <fei_Vector_Impl.hpp>
00058 #include <fei_Matrix_Impl.hpp>
00059 #include <fei_MatrixGraph_Impl2.hpp>
00060 #include <fei_SparseRowGraph.hpp>
00061 #include <fei_utils.hpp>
00062 
00063 #undef fei_file
00064 #define fei_file "fei_Factory_Aztec.hpp"
00065 #include <fei_ErrMacros.hpp>
00066 
00067 /*** Implementation of an fei::Factory which creates instances that use fei-Aztec
00068      objects as the underlying matrix and vector objects.
00069 */
00070 class Factory_Aztec : public fei::Factory {
00071  public:
00072   Factory_Aztec(MPI_Comm comm);
00073 
00074   virtual ~Factory_Aztec();
00075 
00077   fei::SharedPtr<fei::Factory> clone() const
00078     {
00079       fei::SharedPtr<fei::Factory> factory(new Factory_Aztec(comm_));
00080       return(factory);
00081     }
00082 
00084   int parameters(int numParams, const char* const* paramStrings);
00085 
00087   void parameters(const fei::ParameterSet& parameterset);
00088 
00089   fei::SharedPtr<fei::MatrixGraph>
00090     createMatrixGraph(fei::SharedPtr<fei::VectorSpace> rowSpace,
00091                       fei::SharedPtr<fei::VectorSpace> colSpace,
00092                       const char* name = NULL);
00093 
00095   fei::SharedPtr<fei::Vector>
00096     createVector(fei::SharedPtr<fei::VectorSpace> vecSpace, int numVectors=1);
00097 
00099   fei::SharedPtr<fei::Vector>
00100     createVector(fei::SharedPtr<fei::VectorSpace> vecSpace,
00101       bool isSolutionVector,
00102       int numVectors=1);
00103 
00105   fei::SharedPtr<fei::Vector>
00106     createVector(fei::SharedPtr<fei::MatrixGraph> matrixGraph,
00107       int numVectors=1);
00108 
00110   fei::SharedPtr<fei::Vector>
00111     createVector(fei::SharedPtr<fei::MatrixGraph> matrixGraph,
00112       bool isSolutionVector,
00113       int numVectors=1);
00114 
00115   fei::SharedPtr<fei::Matrix>
00116     createMatrix(fei::SharedPtr<fei::MatrixGraph> matrixGraph);
00117 
00118   fei::SharedPtr<fei::Solver> createSolver(const char* name=0);
00119 
00120   int getOutputLevel() const { return(outputLevel_); }
00121 
00122  private:
00123   MPI_Comm comm_;
00124 
00125   fei::SharedPtr<fei::Reducer> reducer_;
00126   bool blockEntryMatrix_;
00127 
00128   int outputLevel_;
00129 };
00130 
00131 #endif // _Factory_Aztec_hpp_
00132 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends