fei_Graph_Impl.hpp

00001 /*--------------------------------------------------------------------*/
00002 /*    Copyright 2005 Sandia Corporation.                              */
00003 /*    Under the terms of Contract DE-AC04-94AL85000, there is a       */
00004 /*    non-exclusive license for use of this work by or on behalf      */
00005 /*    of the U.S. Government.  Export of this program may require     */
00006 /*    a license from the United States Government.                    */
00007 /*--------------------------------------------------------------------*/
00008 
00009 #ifndef _fei_Graph_Impl_hpp_
00010 #define _fei_Graph_Impl_hpp_
00011 
00012 #include <fei_iosfwd.hpp>
00013 #include <fei_SharedPtr.hpp>
00014 #include <fei_Graph.hpp>
00015 #include <fei_mpi.h>
00016 #include <fei_EqnComm.hpp>
00017 
00018 namespace fei {
00019 
00021   class Graph_Impl : public fei::Graph {
00022   public:
00024     Graph_Impl(MPI_Comm comm, int firstLocalRow, int lastLocalRow);
00025 
00027     virtual ~Graph_Impl();
00028 
00030     int addIndices(int row,
00031        int len,
00032        const int* indices);
00033 
00037     int addSymmetricIndices(int numIndices,
00038           int* indices,
00039           bool diagonal=false);
00040 
00042     int gatherFromOverlap();
00043 
00046     table_type* getLocalGraph()
00047       {
00048   return( localGraphData_ );
00049       }
00050 
00052     std::vector<remote_table_type*>& getRemoteGraph()
00053       {
00054   return( remoteGraphData_);
00055       }
00056 
00058     int writeLocalGraph(FEI_OSTREAM& os,
00059       bool debug=false,
00060       bool prefixLinesWithPoundSign=true);
00061 
00063     int writeRemoteGraph(FEI_OSTREAM& os);
00064 
00066     int getNumLocalRows();
00067 
00070     int getNumLocalNonzeros() const;
00071 
00073     int getLocalRowLength(int row);
00074 
00075   private:
00076     void addDiagonals(int numIndices, int* indices);
00077 
00078     table_type* localGraphData_;
00079     std::vector<remote_table_type*> remoteGraphData_;
00080     fei::SharedPtr<fei::EqnComm> eqnComm_;
00081 
00082     int firstLocalRow_, lastLocalRow_;
00083     int localProc_, numProcs_;
00084     MPI_Comm comm_;
00085   };//class Graph_Impl
00086 
00087 } //namespace fei
00088 
00089 #endif // _fei_Graph_Impl_hpp_
00090 

Generated on Tue Jul 13 09:27:45 2010 for FEI by  doxygen 1.4.7