FEI Version of the Day
fei_BlockDescriptor.hpp
00001 #ifndef _fei_BlockDescriptor_hpp_
00002 #define _fei_BlockDescriptor_hpp_
00003 
00004 /*--------------------------------------------------------------------*/
00005 /*    Copyright 2005 Sandia Corporation.                              */
00006 /*    Under the terms of Contract DE-AC04-94AL85000, there is a       */
00007 /*    non-exclusive license for use of this work by or on behalf      */
00008 /*    of the U.S. Government.  Export of this program may require     */
00009 /*    a license from the United States Government.                    */
00010 /*--------------------------------------------------------------------*/
00011 
00012 #include "fei_macros.hpp"
00013 #include "fei_defs.h"
00014 #include <vector>
00015 
00067 class BlockDescriptor {
00068  public:
00069    BlockDescriptor();
00070    virtual ~BlockDescriptor();
00071 
00072    GlobalID getGlobalBlockID() {return(blockID_);}
00073    void setGlobalBlockID(GlobalID blockID) {blockID_ = blockID;}
00074 
00077    int setNumNodesPerElement(int numNodes);
00078    int getNumNodesPerElement() const { return numNodesPerElement_; }
00079 
00080    int* fieldsPerNodePtr();  //length of this list = getNumNodesPerElement()
00081 
00082    int allocateFieldIDsTable();
00083 
00088    int** fieldIDsTablePtr() { return(nodalFieldIDs_); }
00089 
00090    bool containsField(int fieldID);
00091 
00092    int getNumDistinctFields() { return( numDistinctFields_ ); }
00093    void setNumDistinctFields(int nFields) { numDistinctFields_ = nFields; }
00094 
00095    int getInterleaveStrategy() const {return(interleaveStrategy_);}
00096    void setInterleaveStrategy(int strat) {interleaveStrategy_ = strat;}
00097    
00098    int getLumpingStrategy() const {return(lumpingStrategy_);}
00099    void setLumpingStrategy(int strat) {lumpingStrategy_ = strat;}
00100 
00101    int getNumElements() {return(numElements_);}
00102    void setNumElements(int numElems) {numElements_ = numElems;}
00103    
00104    size_t getNumElemDofFieldsPerElement() {return(elemDofFieldIDs_.size());}
00105    int setElemDofFieldIDs(int numFields, const int* fieldIDs);
00106    std::vector<int>& getElemDofFieldIDs() { return(elemDofFieldIDs_); }
00107 
00108    void setNumElemDOFPerElement(int ndof) { numElemDOFPerElement_ = ndof; }
00109    int getNumElemDOFPerElement() { return(numElemDOFPerElement_); }
00110 
00111    //elemDOFEqnNumbers is of length numElements.
00112    std::vector<int>& elemDOFEqnNumbers() {return(elemDOFEqnNumbers_);}
00113 
00114    int getNumEqnsPerElement() {return(numEqnsPerElement_);};
00115    void setNumEqnsPerElement(int numEqns) {numEqnsPerElement_ = numEqns;}
00116 
00117    int getNumBlkEqnsPerElement() {return(numBlkEqnsPerElement_);}
00118    void setNumBlkEqnsPerElement(int numBlkEqns) {numBlkEqnsPerElement_ = numBlkEqns;};
00119 
00120    int getNumActiveNodes() {return(numActiveNodes_);}
00121    void setNumActiveNodes(int num) {numActiveNodes_ = num;}
00122 
00123    int getTotalNumEqns() {return(totalNumEqns_);}
00124    void setTotalNumEqns(int numEqns) {totalNumEqns_ = numEqns;}
00125 
00126  private:
00127    BlockDescriptor(const BlockDescriptor& /*src*/)
00128      : blockID_(0), numNodesPerElement_(0), numFieldsPerNode_(NULL),
00129      nodalFieldIDs_(NULL), fieldIDsAllocated_(false),
00130      numDistinctFields_(0), elemDofFieldIDs_(), interleaveStrategy_(0),
00131      lumpingStrategy_(0), numElements_(0), numElemDOFPerElement_(0),
00132      elemDOFEqnNumbers_(), numEqnsPerElement_(0), numBlkEqnsPerElement_(0),
00133      numActiveNodes_(0), totalNumEqns_(0) {}
00134 
00135    BlockDescriptor& operator=(const BlockDescriptor& /*src*/)
00136      {
00137        return(*this);
00138      }
00139 
00140    void destroyFieldArrays();
00141 
00142    GlobalID blockID_;
00143 
00144    int numNodesPerElement_;
00145 
00146    int* numFieldsPerNode_; //list: length = numNodesPerElement_
00147 
00148    int** nodalFieldIDs_;   //table: number-of-rows = numNodesPerElement_
00149                            //       length-of-row[i] = numFieldsPerNode_[i]
00150    bool fieldIDsAllocated_;
00151 
00152    int numDistinctFields_;
00153 
00154    std::vector<int> elemDofFieldIDs_;
00155 
00156    int interleaveStrategy_;
00157    int lumpingStrategy_;
00158 
00159    int numElements_;
00160    int numElemDOFPerElement_; //number of elem-dof in each element (all
00161                               //elems in block have the same number)
00162 
00163    std::vector<int> elemDOFEqnNumbers_; //list -- length = numElements_
00164                             //holds eqn number of each element's first elemDOF
00165 
00166    int numEqnsPerElement_;
00167    int numBlkEqnsPerElement_;
00168 
00169    int numActiveNodes_;
00170    int totalNumEqns_;
00171 };
00172 
00173 #endif
00174 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends