TSFPartitionedMatrixFactory.hpp
Go to the documentation of this file.
00001 /* @HEADER@ */
00002 /* ***********************************************************************
00003 // 
00004 //           TSFExtended: Trilinos Solver Framework Extended
00005 //                 Copyright (2004) Sandia Corporation
00006 // 
00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00008 // license for use of this work by or on behalf of the U.S. Government.
00009 // 
00010 // This library is free software; you can redistribute it and/or modify
00011 // it under the terms of the GNU Lesser General Public License as
00012 // published by the Free Software Foundation; either version 2.1 of the
00013 // License, or (at your option) any later version.
00014 //  
00015 // This library is distributed in the hope that it will be useful, but
00016 // WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018 // Lesser General Public License for more details.
00019 //  
00020 // You should have received a copy of the GNU Lesser General Public
00021 // License along with this library; if not, write to the Free Software
00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00023 // USA
00024 // Questions? Contact Michael A. Heroux (maherou@sandia.gov) 
00025 // 
00026 // **********************************************************************/
00027 /* @HEADER@ */
00028 
00029 #ifndef TSFPARTITIONEDMATRIXFACTORYDECL_HPP
00030 #define TSFPARTITIONEDMATRIXFACTORYDECL_HPP
00031 
00032 #include "TSFIncrementallyConfigurableMatrixFactory.hpp"
00033 #include "TSFCollectivelyConfigurableMatrixFactory.hpp"
00034 #include "TSFMatrixFactory.hpp"
00035 #include "TSFVectorSpaceDecl.hpp"
00036 #include "TSFVectorType.hpp"
00037 #include "SundanceHandleable.hpp"
00038 #include "SundancePrintable.hpp"
00039 #include "Epetra_CrsGraph.h"
00040 #include <set>
00041 
00042 namespace TSFExtended
00043 {
00044   using namespace Teuchos;
00045   using namespace Thyra;
00046 
00047   /** */
00048   class PartitionedMatrixFactory 
00049     : public MatrixFactory<double>,
00050       public IncrementallyConfigurableMatrixFactory
00051   {
00052   public:
00053 
00054     /** Construct an uninitialized PartitionedMatrixFactory */
00055     PartitionedMatrixFactory(
00056       const VectorSpace<double>& domain,
00057       int lowestLocalCol,
00058       const RCP<Array<int> >& isBCCol,
00059       const RCP<std::set<int> >& remoteBCCols,
00060       const VectorType<double>& domainVecType,
00061       const VectorSpace<double>& range,
00062       int lowestLocalRow,
00063       const RCP<Array<int> >& isBCRow,
00064       const VectorType<double>& rangeType
00065       );
00066 
00067     /** */
00068     virtual ~PartitionedMatrixFactory(){;}
00069 
00070     /** Initialize a set of nonzero elements in the matrix's graph.
00071      * @param globalRowIndex the global index of the row to which these
00072      * elements belong.
00073      * @param nElemsToInsert the number of elements being inserted in this
00074      * step
00075      * @param globalColumnIndices array of column indices. Must 
00076      * be nElemsToInsert in length. 
00077      */
00078     virtual void initializeNonzerosInRow(int globalRowIndex,
00079                                          int nElemsToInsert,
00080                                          const int* globalColumnIndices) ;
00081 
00082     /** */
00083     void finalize();
00084 
00085     /** */
00086     virtual LinearOperator<double> createMatrix() const ;
00087 
00088   protected:
00089 
00090   private:
00091     VectorSpace<double> domain_;
00092     VectorSpace<double> internalDomain_;
00093     VectorSpace<double> bcDomain_;
00094     RCP<Array<int> > isBCCol_;
00095     RCP<std::set<int> > remoteBCCols_;
00096     VectorType<double> domainVecType_;
00097     int lowestLocalCol_;
00098     int highestLocalCol_;
00099     VectorSpace<double> range_;
00100     VectorSpace<double> internalRange_;
00101     VectorSpace<double> bcRange_;
00102     RCP<Array<int> > isBCRow_;
00103     VectorType<double> rangeVecType_;
00104     int lowestLocalRow_;
00105     int highestLocalRow_;
00106 
00107 
00108     Array<Array<RCP<MatrixFactory<double> > > > blockFactory_;
00109     Array<Array<IncrementallyConfigurableMatrixFactory*> > blockICMF_;
00110   };
00111 }
00112 
00113 
00114 #endif

Site Contact