FEI Version of the Day
fei_ConnectivityBlock.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_ConnectivityBlock_hpp_
00010 #define _fei_ConnectivityBlock_hpp_
00011 
00012 #include <fei_macros.hpp>
00013 
00014 #include <map>
00015 #include <vector>
00016 
00017 namespace fei {
00018   class Pattern;
00019 
00026   class ConnectivityBlock {
00027   public:
00029     ConnectivityBlock(int blockID,
00030                       fei::Pattern* pattern,
00031                       int numConnectivities);
00033     ConnectivityBlock(int blockID,
00034                       fei::Pattern* rowpattern, fei::Pattern* colpattern,
00035                       int numConnectivities);
00037     ConnectivityBlock(int numRowIDs,
00038                       const int* rowIDs,
00039                       const int* rowOffsets,
00040                       bool offsets_are_lengths = false);
00041 
00043     ConnectivityBlock(int fieldID,
00044                       int numRowIDs,
00045                       const int* rowIDs,
00046                       const int* rowOffsets,
00047                       bool offsets_are_lengths = false);
00048 
00050     virtual ~ConnectivityBlock();
00051 
00053     int getBlockID() const { return(blockID_); }
00054 
00057     const fei::Pattern* getRowPattern() const { return(pattern_); }
00058 
00061     fei::Pattern* getRowPattern() { return(pattern_); }
00062 
00063     void setRowPattern(fei::Pattern* pattern) { pattern_ = pattern; }
00064 
00068     const fei::Pattern* getColPattern() const { return(colPattern_); }
00069 
00073     fei::Pattern* getColPattern() { return(colPattern_); }
00074 
00075     void setColPattern(fei::Pattern* pattern) { colPattern_ = pattern; }
00076 
00079     const std::map<int,int>& getConnectivityIDs() const { return( connIDsOffsetMap_ ); }
00080 
00083     std::map<int,int>& getConnectivityIDs() { return( connIDsOffsetMap_ ); }
00084 
00088     std::vector<int>& getConnectivityOffsets()
00089       { return(connectivityOffsets_); }
00090 
00092     std::vector<int>& getRowConnectivities()
00093       { return(connectivities_); }
00094 
00096     std::vector<int>& getColConnectivities()
00097       { return(colConnectivities_); }
00098 
00100     const int* getRowConnectivity(int ID) const;
00102     const int* getColConnectivity(int ID) const;
00104     int* getRowConnectivity(int ID);
00106     int* getColConnectivity(int ID);
00107 
00109     bool isSymmetric() const { return( isSymmetric_ ); }
00110 
00112     void setIsDiagonal(bool flag) { isDiagonal_ = flag; }
00114     bool isDiagonal() const { return( isDiagonal_ ); }
00115 
00117     bool haveFieldID()
00118       { return( haveFieldID_ ); }
00119 
00121     int fieldID()
00122       { return( fieldID_ ); }
00123 
00124   private:
00125     int blockID_;
00126     fei::Pattern* pattern_;
00127     fei::Pattern* colPattern_;
00128     bool isSymmetric_;
00129     bool isDiagonal_;
00130 
00131     std::map<int,int> connIDsOffsetMap_;
00132 
00133     std::vector<int> connectivityOffsets_;
00134 
00135     int numRecordsPerConnectivity_;
00136     std::vector<int> connectivities_;
00137     int numRecordsPerColConnectivity_;
00138     std::vector<int> colConnectivities_;
00139 
00140     int fieldID_;
00141     bool haveFieldID_;
00142 
00143   };//class ConnectivityBlock
00144 } //namespace fei
00145 
00146 #endif // _fei_ConnectivityBlock_hpp_
00147 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends