FEI Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
fei_NodeDescriptor.hpp
Go to the documentation of this file.
1 #ifndef _NodeDescriptor_hpp_
2 #define _NodeDescriptor_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 
14 #include <fei_ArrayUtils.hpp>
15 #include <iostream>
37  public:
39 
42  numNodalDOF_(0), fieldIDList_(NULL),
45  {}
46 
47  virtual ~NodeDescriptor();
48 
49  GlobalID getGlobalNodeID() const {return(nodeID_);}
50  void setGlobalNodeID(GlobalID node) {nodeID_ = node;}
51 
52  int getNodeNumber() const {return(nodeNumber_);}
53  void setNodeNumber(int nn) {nodeNumber_ = nn;};
54 
55  int getBlkEqnNumber() const {return(blkEqnNumber_);}
56  void setBlkEqnNumber(int blkEqn) {blkEqnNumber_ = blkEqn;}
57 
58  int getNumNodalDOF() const {return(numNodalDOF_);}
59  void setNumNodalDOF(int dof) {numNodalDOF_ = dof;}
60 
61  void addField(int fieldID);
62  void setFieldEqnNumber(int fieldID, int eqn);
63 
64  int getNumFields() const {return(numFields_);}
65  const int* getFieldIDList() const {return(fieldIDList_);}
66  const int* getFieldEqnNumbers() const {return(fieldEqnNumbers_);}
67 
74  bool getFieldEqnNumber(int fieldID, int& eqnNumber) const;
75 
79  void getFieldID(int eqnNumber, int& fieldID, int& offset_into_field) const;
80 
81  bool operator==(const NodeDescriptor& nd) const
82  { return( nodeID_ == nd.nodeID_ ); }
83 
84  bool operator!=(const NodeDescriptor& nd) const
85  { return( nodeID_ != nd.nodeID_ ); }
86 
87  bool operator<(const NodeDescriptor& nd) const
88  { return( nodeID_ < nd.nodeID_ ); }
89 
90  bool operator>(const NodeDescriptor& nd) const
91  { return( nodeID_ > nd.nodeID_ ); }
92 
93  int getOwnerProc() const {return(ownerProc_);}
94  void setOwnerProc(int proc) {ownerProc_ = proc;}
95 
96  void addBlockIndex(unsigned blk_idx)
97  { fei::sortedListInsert(blk_idx, blockList_); }
98 
99  size_t getNumBlocks() const {return blockList_.size();}
100  const std::vector<unsigned>& getBlockIndexList() const {return(blockList_);}
101  bool hasBlockIndex(unsigned blk_idx) const;
102 
103  private:
105 
106  void allocFieldLists();
107  void allocBlockList();
108 
110 
112 
113  int numNodalDOF_; //total number of nodal degrees-of-freedom
114 
115  int* fieldIDList_; //list of field identifiers
116  int* fieldEqnNumbers_; //list of starting (global) equation numbers.
117  //fields can consist of more than one scalar (and
118  //have more than one associated equation), this
119  //is the first equation number
121 
123 
124  int ownerProc_; //processor that owns the equations for this node
125 
126  std::vector<unsigned> blockList_; //indexes of blocks that contain this node
127 };
128 
129 #endif
130 
bool operator!=(const NodeDescriptor &nd) const
size_t getNumBlocks() const
int sortedListInsert(const T &item, std::vector< T > &list)
void setBlkEqnNumber(int blkEqn)
int getNumFields() const
bool hasBlockIndex(unsigned blk_idx) const
int getNumNodalDOF() const
std::vector< unsigned > blockList_
int GlobalID
Definition: fei_defs.h:60
const int * getFieldIDList() const
NodeDescriptor & operator=(const NodeDescriptor &src)
const int * getFieldEqnNumbers() const
void setFieldEqnNumber(int fieldID, int eqn)
bool getFieldEqnNumber(int fieldID, int &eqnNumber) const
bool operator<(const NodeDescriptor &nd) const
void addBlockIndex(unsigned blk_idx)
int getOwnerProc() const
void setGlobalNodeID(GlobalID node)
GlobalID getGlobalNodeID() const
void setNumNodalDOF(int dof)
void allocBlockList()
bool operator>(const NodeDescriptor &nd) const
int getBlkEqnNumber() const
void setNodeNumber(int nn)
bool operator==(const NodeDescriptor &nd) const
const std::vector< unsigned > & getBlockIndexList() const
void getFieldID(int eqnNumber, int &fieldID, int &offset_into_field) const
NodeDescriptor(const NodeDescriptor &src)
void setOwnerProc(int proc)
void addField(int fieldID)
int getNodeNumber() const
void allocFieldLists()