Ifpack Package Browser (Single Doxygen Collection)  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Ifpack_OverlapGraph.h
Go to the documentation of this file.
1 /*@HEADER
2 // ***********************************************************************
3 //
4 // Ifpack: Object-Oriented Algebraic Preconditioner Package
5 // Copyright (2002) Sandia Corporation
6 //
7 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8 // license for use of this work by or on behalf of the U.S. Government.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
38 //
39 // ***********************************************************************
40 //@HEADER
41 */
42 
43 #ifndef IFPACK_OVERLAPGRAPH_H
44 #define IFPACK_OVERLAPGRAPH_H
45 
46 #if defined(Ifpack_SHOW_DEPRECATED_WARNINGS)
47 #ifdef __GNUC__
48 #warning "The Ifpack package is deprecated"
49 #endif
50 #endif
51 
52 #include "Ifpack_ConfigDefs.h"
53 #include "Epetra_Object.h"
54 #include "Epetra_CrsGraph.h"
55 #include "Epetra_Import.h"
56 #include "Teuchos_RefCountPtr.hpp"
57 
58 class Epetra_Comm;
59 class Epetra_BlockMap;
60 class Epetra_RowMatrix;
61 
62 namespace Teuchos {
63  class ParameterList;
64 }
65 
67 
69 
70  public:
72 
77  Ifpack_OverlapGraph(const Teuchos::RefCountPtr<const Epetra_CrsGraph>& UserMatrixGraph_in, int OverlapLevel_in);
78 
80 
85  Ifpack_OverlapGraph(const Teuchos::RefCountPtr<const Epetra_RowMatrix>& UserMatrix_in, int OverlapLevel_in);
86 
89 
91  virtual ~Ifpack_OverlapGraph() {};
93 
95 
97  /* This method is only available if the configure argument
98  '--enable-ifpack-teuchos' was used.
99  This method recognizes the name: level_overlap, which is case insensitive.
100  The ParameterEntry must have type int.
101  */
102  int SetParameters(const Teuchos::ParameterList& parameterlist,
103  bool cerr_warning_if_unused=false);
104 
106  const Epetra_CrsGraph & OverlapGraph() const {return(*OverlapGraph_);}
107 
109  const Epetra_BlockMap & OverlapRowMap() const {return(*OverlapRowMap_);}
110 
112  const Epetra_Import & OverlapImporter() const {return(*OverlapImporter_);}
113 
115 
120  int OverlapLevel() const {return(OverlapLevel_);}
122 
124 
125  void Print(std::ostream& os) const {
126  using std::endl;
127 
128  os << endl;
130  os << "Overlap Graph created using the user's Epetra_RowMatrix object" << endl;
131  else
132  os << "Overlap Graph created using the user's Epetra_CrsGraph object" << endl;
133 
134  os << " Level of Overlap = " << OverlapLevel_ << endl;
135  OverlapGraph_->Print(os);
136  return;
137  }
139 
140  protected:
141 
142  int ConstructOverlapGraph(const Teuchos::RefCountPtr<const Epetra_CrsGraph>& UserMatrixGraph);
143  Teuchos::RefCountPtr<Epetra_CrsGraph> OverlapGraph_;
144  Teuchos::RefCountPtr<const Epetra_CrsGraph> UserMatrixGraph_;
145  Teuchos::RefCountPtr<const Epetra_RowMatrix> UserMatrix_;
146  Teuchos::RefCountPtr<Epetra_BlockMap> OverlapRowMap_;
147  Teuchos::RefCountPtr<Epetra_Import> OverlapImporter_;
150 };
151 #endif // IFPACK_OVERLAPGRAPH_H
Ifpack_OverlapGraph: Constructs a graph for use with Ifpack preconditioners.
Teuchos::RefCountPtr< Epetra_BlockMap > OverlapRowMap_
void Print(std::ostream &os) const
Ifpack_OverlapGraph(const Teuchos::RefCountPtr< const Epetra_CrsGraph > &UserMatrixGraph_in, int OverlapLevel_in)
Constructor using Epetra_CrsGraph.
virtual ~Ifpack_OverlapGraph()
Ifpack_CrsIlut Destructor.
int ConstructOverlapGraph(const Teuchos::RefCountPtr< const Epetra_CrsGraph > &UserMatrixGraph)
Teuchos::RefCountPtr< const Epetra_RowMatrix > UserMatrix_
const Epetra_BlockMap & OverlapRowMap() const
Returns the RowMap associated with the overlap graph.
Teuchos::RefCountPtr< Epetra_CrsGraph > OverlapGraph_
int SetParameters(const Teuchos::ParameterList &parameterlist, bool cerr_warning_if_unused=false)
Set parameters using a Teuchos::ParameterList object.
Teuchos::RefCountPtr< Epetra_Import > OverlapImporter_
const Epetra_CrsGraph & OverlapGraph() const
Returns the overlap graph object.
Teuchos::RefCountPtr< const Epetra_CrsGraph > UserMatrixGraph_
const Epetra_Import & OverlapImporter() const
Returns the overlap graph object.
int OverlapLevel() const
Returns the level of overlap used to create this graph.