FEI  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
fei_Graph_Impl.hpp
1 /*--------------------------------------------------------------------*/
2 /* Copyright 2005 Sandia Corporation. */
3 /* Under the terms of Contract DE-AC04-94AL85000, there is a */
4 /* non-exclusive license for use of this work by or on behalf */
5 /* of the U.S. Government. Export of this program may require */
6 /* a license from the United States Government. */
7 /*--------------------------------------------------------------------*/
8 
9 #ifndef _fei_Graph_Impl_hpp_
10 #define _fei_Graph_Impl_hpp_
11 
12 #include <fei_iosfwd.hpp>
13 #include <fei_SharedPtr.hpp>
14 #include <fei_Graph.hpp>
15 #include <fei_mpi.h>
16 #include <fei_EqnComm.hpp>
17 
18 namespace fei {
19 
21  class Graph_Impl : public fei::Graph {
22  public:
24  Graph_Impl(MPI_Comm comm, int firstLocalRow, int lastLocalRow);
25 
27  virtual ~Graph_Impl();
28 
30  int addIndices(int row,
31  int len,
32  const int* indices);
33 
37  int addSymmetricIndices(int numIndices,
38  int* indices,
39  bool diagonal=false);
40 
42  int gatherFromOverlap();
43 
47  {
48  return( localGraphData_ );
49  }
50 
52  std::vector<remote_table_type*>& getRemoteGraph()
53  {
54  return( remoteGraphData_);
55  }
56 
58  int writeLocalGraph(FEI_OSTREAM& os,
59  bool debug=false,
60  bool prefixLinesWithPoundSign=true);
61 
63  int writeRemoteGraph(FEI_OSTREAM& os);
64 
66  int getNumLocalRows();
67 
70  int getNumLocalNonzeros() const;
71 
73  int getLocalRowLength(int row);
74 
75  private:
76  void addDiagonals(int numIndices, int* indices);
77 
78  table_type* localGraphData_;
79  std::vector<remote_table_type*> remoteGraphData_;
81 
82  int firstLocalRow_, lastLocalRow_;
83  int localProc_, numProcs_;
84  MPI_Comm comm_;
85  };//class Graph_Impl
86 
87 } //namespace fei
88 
89 #endif // _fei_Graph_Impl_hpp_
90 
int writeRemoteGraph(FEI_OSTREAM &os)
snl_fei::RaggedTable< snl_fei::MapContig< fei::ctg_set< int > * >, fei::ctg_set< int > > table_type
Definition: fei_Graph.hpp:28
int addIndices(int row, int len, const int *indices)
Graph_Impl(MPI_Comm comm, int firstLocalRow, int lastLocalRow)
int writeLocalGraph(FEI_OSTREAM &os, bool debug=false, bool prefixLinesWithPoundSign=true)
int getLocalRowLength(int row)
std::vector< remote_table_type * > & getRemoteGraph()
int addSymmetricIndices(int numIndices, int *indices, bool diagonal=false)
int getNumLocalNonzeros() const
virtual ~Graph_Impl()
table_type * getLocalGraph()