FEI  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
fei_ConnectivityBlock.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_ConnectivityBlock_hpp_
10 #define _fei_ConnectivityBlock_hpp_
11 
12 #include <fei_macros.hpp>
13 
14 #include <map>
15 #include <vector>
16 
17 namespace fei {
18  class Pattern;
19 
27  public:
29  ConnectivityBlock(int blockID,
30  fei::Pattern* pattern,
31  int numConnectivities);
33  ConnectivityBlock(int blockID,
34  fei::Pattern* rowpattern, fei::Pattern* colpattern,
35  int numConnectivities);
37  ConnectivityBlock(int numRowIDs,
38  const int* rowIDs,
39  const int* rowOffsets,
40  bool offsets_are_lengths = false);
41 
44  int numRowIDs,
45  const int* rowIDs,
46  const int* rowOffsets,
47  bool offsets_are_lengths = false);
48 
50  virtual ~ConnectivityBlock();
51 
53  int getBlockID() const { return(blockID_); }
54 
57  const fei::Pattern* getRowPattern() const { return(pattern_); }
58 
61  fei::Pattern* getRowPattern() { return(pattern_); }
62 
63  void setRowPattern(fei::Pattern* pattern) { pattern_ = pattern; }
64 
68  const fei::Pattern* getColPattern() const { return(colPattern_); }
69 
73  fei::Pattern* getColPattern() { return(colPattern_); }
74 
75  void setColPattern(fei::Pattern* pattern) { colPattern_ = pattern; }
76 
79  const std::map<int,int>& getConnectivityIDs() const { return( connIDsOffsetMap_ ); }
80 
83  std::map<int,int>& getConnectivityIDs() { return( connIDsOffsetMap_ ); }
84 
88  std::vector<int>& getConnectivityOffsets()
89  { return(connectivityOffsets_); }
90 
92  std::vector<int>& getRowConnectivities()
93  { return(connectivities_); }
94 
96  std::vector<int>& getColConnectivities()
97  { return(colConnectivities_); }
98 
100  const int* getRowConnectivity(int ID) const;
102  const int* getColConnectivity(int ID) const;
104  int* getRowConnectivity(int ID);
106  int* getColConnectivity(int ID);
107 
109  bool isSymmetric() const { return( isSymmetric_ ); }
110 
112  void setIsDiagonal(bool flag) { isDiagonal_ = flag; }
114  bool isDiagonal() const { return( isDiagonal_ ); }
115 
117  bool haveFieldID()
118  { return( haveFieldID_ ); }
119 
121  int fieldID()
122  { return( fieldID_ ); }
123 
124  private:
125  int blockID_;
126  fei::Pattern* pattern_;
127  fei::Pattern* colPattern_;
128  bool isSymmetric_;
129  bool isDiagonal_;
130 
131  std::map<int,int> connIDsOffsetMap_;
132 
133  std::vector<int> connectivityOffsets_;
134 
135  int numRecordsPerConnectivity_;
136  std::vector<int> connectivities_;
137  int numRecordsPerColConnectivity_;
138  std::vector<int> colConnectivities_;
139 
140  int fieldID_;
141  bool haveFieldID_;
142 
143  };//class ConnectivityBlock
144 } //namespace fei
145 
146 #endif // _fei_ConnectivityBlock_hpp_
147 
const int * getRowConnectivity(int ID) const
const std::map< int, int > & getConnectivityIDs() const
std::vector< int > & getColConnectivities()
std::vector< int > & getRowConnectivities()
const fei::Pattern * getColPattern() const
ConnectivityBlock(int blockID, fei::Pattern *pattern, int numConnectivities)
std::vector< int > & getConnectivityOffsets()
const int * getColConnectivity(int ID) const
std::map< int, int > & getConnectivityIDs()
const fei::Pattern * getRowPattern() const