FEI  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
fei_BlockDescriptor.hpp
1 #ifndef _fei_BlockDescriptor_hpp_
2 #define _fei_BlockDescriptor_hpp_
3 
4 /*--------------------------------------------------------------------*/
5 /* Copyright 2005 Sandia Corporation. */
6 /* Under the terms of Contract DE-AC04-94AL85000, there is a */
7 /* non-exclusive license for use of this work by or on behalf */
8 /* of the U.S. Government. Export of this program may require */
9 /* a license from the United States Government. */
10 /*--------------------------------------------------------------------*/
11 
12 #include "fei_macros.hpp"
13 #include "fei_defs.h"
14 #include <vector>
15 
67 class BlockDescriptor {
68  public:
70  virtual ~BlockDescriptor();
71 
72  GlobalID getGlobalBlockID() {return(blockID_);}
73  void setGlobalBlockID(GlobalID blockID) {blockID_ = blockID;}
74 
77  int setNumNodesPerElement(int numNodes);
78  int getNumNodesPerElement() const { return numNodesPerElement_; }
79 
80  int* fieldsPerNodePtr(); //length of this list = getNumNodesPerElement()
81 
82  int allocateFieldIDsTable();
83 
88  int** fieldIDsTablePtr() { return(nodalFieldIDs_); }
89 
90  bool containsField(int fieldID);
91 
92  int getNumDistinctFields() { return( numDistinctFields_ ); }
93  void setNumDistinctFields(int nFields) { numDistinctFields_ = nFields; }
94 
95  int getInterleaveStrategy() const {return(interleaveStrategy_);}
96  void setInterleaveStrategy(int strat) {interleaveStrategy_ = strat;}
97 
98  int getLumpingStrategy() const {return(lumpingStrategy_);}
99  void setLumpingStrategy(int strat) {lumpingStrategy_ = strat;}
100 
101  int getNumElements() {return(numElements_);}
102  void setNumElements(int numElems) {numElements_ = numElems;}
103 
104  size_t getNumElemDofFieldsPerElement() {return(elemDofFieldIDs_.size());}
105  int setElemDofFieldIDs(int numFields, const int* fieldIDs);
106  std::vector<int>& getElemDofFieldIDs() { return(elemDofFieldIDs_); }
107 
108  void setNumElemDOFPerElement(int ndof) { numElemDOFPerElement_ = ndof; }
109  int getNumElemDOFPerElement() { return(numElemDOFPerElement_); }
110 
111  //elemDOFEqnNumbers is of length numElements.
112  std::vector<int>& elemDOFEqnNumbers() {return(elemDOFEqnNumbers_);}
113 
114  int getNumEqnsPerElement() {return(numEqnsPerElement_);};
115  void setNumEqnsPerElement(int numEqns) {numEqnsPerElement_ = numEqns;}
116 
117  int getNumBlkEqnsPerElement() {return(numBlkEqnsPerElement_);}
118  void setNumBlkEqnsPerElement(int numBlkEqns) {numBlkEqnsPerElement_ = numBlkEqns;};
119 
120  int getNumActiveNodes() {return(numActiveNodes_);}
121  void setNumActiveNodes(int num) {numActiveNodes_ = num;}
122 
123  int getTotalNumEqns() {return(totalNumEqns_);}
124  void setTotalNumEqns(int numEqns) {totalNumEqns_ = numEqns;}
125 
126  private:
127  BlockDescriptor(const BlockDescriptor& /*src*/)
128  : blockID_(0), numNodesPerElement_(0), numFieldsPerNode_(NULL),
129  nodalFieldIDs_(NULL), fieldIDsAllocated_(false),
130  numDistinctFields_(0), elemDofFieldIDs_(), interleaveStrategy_(0),
131  lumpingStrategy_(0), numElements_(0), numElemDOFPerElement_(0),
132  elemDOFEqnNumbers_(), numEqnsPerElement_(0), numBlkEqnsPerElement_(0),
133  numActiveNodes_(0), totalNumEqns_(0) {}
134 
135  BlockDescriptor& operator=(const BlockDescriptor& /*src*/)
136  {
137  return(*this);
138  }
139 
140  void destroyFieldArrays();
141 
142  GlobalID blockID_;
143 
144  int numNodesPerElement_;
145 
146  int* numFieldsPerNode_; //list: length = numNodesPerElement_
147 
148  int** nodalFieldIDs_; //table: number-of-rows = numNodesPerElement_
149  // length-of-row[i] = numFieldsPerNode_[i]
150  bool fieldIDsAllocated_;
151 
152  int numDistinctFields_;
153 
154  std::vector<int> elemDofFieldIDs_;
155 
156  int interleaveStrategy_;
157  int lumpingStrategy_;
158 
159  int numElements_;
160  int numElemDOFPerElement_; //number of elem-dof in each element (all
161  //elems in block have the same number)
162 
163  std::vector<int> elemDOFEqnNumbers_; //list -- length = numElements_
164  //holds eqn number of each element's first elemDOF
165 
166  int numEqnsPerElement_;
167  int numBlkEqnsPerElement_;
168 
169  int numActiveNodes_;
170  int totalNumEqns_;
171 };
172 
173 #endif
174 
int ** fieldIDsTablePtr()
int setNumNodesPerElement(int numNodes)