|
Ifpack2 Templated Preconditioning Package
Version 1.0
|
00001 /*@HEADER 00002 // *********************************************************************** 00003 // 00004 // Ifpack2: Tempated Object-Oriented Algebraic Preconditioner Package 00005 // Copyright (2009) 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 // 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 Michael A. Heroux (maherou@sandia.gov) 00038 // 00039 // *********************************************************************** 00040 //@HEADER 00041 */ 00042 00043 #ifndef IFPACK2_DETAILS_OVERLAPPINGROWGRAPH_DECL_HPP 00044 #define IFPACK2_DETAILS_OVERLAPPINGROWGRAPH_DECL_HPP 00045 00046 #include <Ifpack2_ConfigDefs.hpp> 00047 #include <Tpetra_RowGraph.hpp> 00048 #include <Tpetra_Import_decl.hpp> 00049 #include <Tpetra_Export_decl.hpp> 00050 00051 namespace Ifpack2 { 00052 namespace Details { 00053 00064 template<class GraphType> 00065 class OverlappingRowGraph : 00066 virtual public Tpetra::RowGraph<typename GraphType::local_ordinal_type, 00067 typename GraphType::global_ordinal_type, 00068 typename GraphType::node_type> { 00069 public: 00071 00072 typedef typename GraphType::local_ordinal_type local_ordinal_type; 00073 typedef typename GraphType::global_ordinal_type global_ordinal_type; 00074 typedef typename GraphType::node_type node_type; 00075 00076 typedef Tpetra::Export<local_ordinal_type, global_ordinal_type, node_type> export_type; 00077 typedef Tpetra::Import<local_ordinal_type, global_ordinal_type, node_type> import_type; 00078 typedef Tpetra::Map<local_ordinal_type, global_ordinal_type, node_type> map_type; 00079 typedef Tpetra::RowGraph<local_ordinal_type, global_ordinal_type, node_type> row_graph_type; 00081 00082 00083 00103 OverlappingRowGraph (const Teuchos::RCP<const row_graph_type>& nonoverlappingGraph, 00104 const Teuchos::RCP<const row_graph_type>& overlappingGraph, 00105 const Teuchos::RCP<const map_type>& rowMap, 00106 const Teuchos::RCP<const map_type>& colMap, 00107 const Tpetra::global_size_t numGlobalRows, 00108 const Tpetra::global_size_t numGlobalCols, 00109 const Tpetra::global_size_t numGlobalNonzeros, 00110 const size_t maxNumEntries, 00111 const Teuchos::RCP<const import_type>& nonoverlappingImporter, 00112 const Teuchos::RCP<const import_type>& overlappingImporter); 00114 virtual ~OverlappingRowGraph (); 00115 00117 00118 00119 00121 virtual Teuchos::RCP<const Teuchos::Comm<int> > getComm () const; 00122 00124 virtual Teuchos::RCP<node_type> getNode () const; 00125 00127 virtual Teuchos::RCP<const map_type> getRowMap () const; 00128 00130 virtual Teuchos::RCP<const map_type> getColMap () const; 00131 00136 virtual Teuchos::RCP<const map_type> getDomainMap () const; 00137 00142 virtual Teuchos::RCP<const map_type> getRangeMap () const; 00143 00145 virtual Teuchos::RCP<const import_type> getImporter () const; 00146 00148 virtual Teuchos::RCP<const export_type> getExporter () const; 00149 00151 virtual global_size_t getGlobalNumRows () const; 00152 00154 virtual global_size_t getGlobalNumCols () const; 00155 00157 virtual size_t getNodeNumRows () const; 00158 00164 virtual size_t getNodeNumCols () const; 00165 00167 virtual global_ordinal_type getIndexBase () const; 00168 00170 virtual global_size_t getGlobalNumEntries () const; 00171 00173 virtual size_t getNodeNumEntries () const; 00174 00184 virtual size_t getNumEntriesInGlobalRow (global_ordinal_type globalRow) const; 00185 00195 virtual size_t getNumEntriesInLocalRow (local_ordinal_type localRow) const; 00196 00198 virtual global_size_t getGlobalNumDiags () const; 00199 00201 virtual size_t getNodeNumDiags () const; 00202 00204 virtual size_t getGlobalMaxNumRowEntries () const; 00205 00207 virtual size_t getNodeMaxNumRowEntries() const; 00208 00210 virtual bool hasColMap() const; 00211 00213 virtual bool isLowerTriangular() const; 00214 00216 virtual bool isUpperTriangular() const; 00217 00219 virtual bool isLocallyIndexed () const; 00220 00222 virtual bool isGloballyIndexed () const; 00223 00225 virtual bool isFillComplete() const; 00226 00228 00229 00230 00244 virtual void 00245 getGlobalRowCopy (global_ordinal_type globalRow, 00246 const Teuchos::ArrayView<global_ordinal_type>& indices, 00247 size_t& numIndices) const; 00248 00266 virtual void 00267 getLocalRowCopy (local_ordinal_type localRow, 00268 const Teuchos::ArrayView<local_ordinal_type>& indices, 00269 size_t& numIndices) const; 00271 private: 00273 00274 Teuchos::RCP<const row_graph_type> nonoverlappingGraph_; 00275 Teuchos::RCP<const row_graph_type> overlappingGraph_; 00276 Teuchos::RCP<const map_type> rowMap_; 00277 Teuchos::RCP<const map_type> colMap_; 00278 const Tpetra::global_size_t numGlobalRows_; 00279 const Tpetra::global_size_t numGlobalCols_; 00280 const Tpetra::global_size_t numGlobalNonzeros_; 00281 const size_t maxNumEntries_; 00282 Teuchos::RCP<const import_type> nonoverlappingImporter_; 00283 Teuchos::RCP<const import_type> overlappingImporter_; 00285 }; 00286 00287 } // namespace Details 00288 } // namespace Ifpack2 00289 00290 #endif // IFPACK2_DETAILS_OVERLAPPINGROWGRAPH_DECL_HPP
1.7.6.1