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 
00066     const fei::Pattern* getColPattern() const { return(colPattern_); }
00067 
00071     fei::Pattern* getColPattern() { return(colPattern_); }
00072 
00075     const std::map<int,int>& getConnectivityIDs() const { return( connIDsOffsetMap_ ); }
00076 
00079     std::map<int,int>& getConnectivityIDs() { return( connIDsOffsetMap_ ); }
00080 
00084     std::vector<int>& getConnectivityOffsets()
00085       { return(connectivityOffsets_); }
00086 
00088     std::vector<Record<int>*>& getRowConnectivities()
00089       { return(connectivities_); }
00090 
00092     std::vector<Record<int>*>& getColConnectivities()
00093       { return(colConnectivities_); }
00094 
00096     const Record<int>*const* getRowConnectivity(int ID) const;
00098     const Record<int>*const* getColConnectivity(int ID) const;
00100     Record<int>** getRowConnectivity(int ID);
00102     Record<int>** getColConnectivity(int ID);
00103 
00105     bool isSymmetric() const { return( isSymmetric_ ); }
00106 
00108     void setIsDiagonal(bool flag) { isDiagonal_ = flag; }
00110     bool isDiagonal() const { return( isDiagonal_ ); }
00111 
00113     bool haveFieldID()
00114       { return( haveFieldID_ ); }
00115 
00117     int fieldID()
00118       { return( fieldID_ ); }
00119 
00120   private:
00121     int blockID_;
00122     fei::Pattern* pattern_;
00123     fei::Pattern* colPattern_;
00124     bool isSymmetric_;
00125     bool isDiagonal_;
00126 
00127     std::map<int,int> connIDsOffsetMap_;
00128 
00129     std::vector<int> connectivityOffsets_;
00130 
00131     int numRecordsPerConnectivity_;
00132     std::vector<Record<int>*> connectivities_;
00133     int numRecordsPerColConnectivity_;
00134     std::vector<Record<int>*> colConnectivities_;
00135 
00136     int fieldID_;
00137     bool haveFieldID_;
00138 
00139   };//class ConnectivityBlock
00140 } //namespace fei
00141 
00142 #endif // _fei_ConnectivityBlock_hpp_
00143 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends
Generated on Wed Apr 13 10:08:23 2011 for FEI by  doxygen 1.6.3