fei_NodeDescriptor.hpp

00001 #ifndef _NodeDescriptor_hpp_
00002 #define _NodeDescriptor_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 
00014 #include <snl_fei_ArrayUtils.hpp>
00015 
00036 class NodeDescriptor {
00037  public:
00038    NodeDescriptor();
00039 
00040    NodeDescriptor(const NodeDescriptor& src)
00041     : nodeID_(src.nodeID_), nodeNumber_(src.nodeNumber_),
00042       numNodalDOF_(0), fieldIDList_(NULL),
00043       fieldEqnNumbers_(NULL), numFields_(0), blkEqnNumber_(0),
00044       ownerProc_(src.ownerProc_), blockList_(NULL), numBlocks_(0)
00045    {}
00046 
00047    virtual ~NodeDescriptor();
00048 
00049    GlobalID getGlobalNodeID() const {return(nodeID_);};
00050    void setGlobalNodeID(GlobalID node) {nodeID_ = node;};
00051 
00052    int getNodeNumber() const {return(nodeNumber_);};
00053    void setNodeNumber(int nn) {nodeNumber_ = nn;};
00054 
00055    int getBlkEqnNumber() const {return(blkEqnNumber_);}
00056    void setBlkEqnNumber(int blkEqn) {blkEqnNumber_ = blkEqn;}
00057 
00058    int getNumNodalDOF() const {return(numNodalDOF_);};
00059    void setNumNodalDOF(int dof) {numNodalDOF_ = dof;};
00060 
00061    void addField(int fieldID);
00062    void setFieldEqnNumber(int fieldID, int eqn);
00063 
00064    int getNumFields() const {return(numFields_);};
00065    const int* getFieldIDList() const {return(fieldIDList_);};
00066    const int* getFieldEqnNumbers() const {return(fieldEqnNumbers_);};
00067 
00074    bool getFieldEqnNumber(int fieldID, int& eqnNumber) const;
00075 
00076    bool operator==(const NodeDescriptor& nd) const
00077      { return( nodeID_ == nd.nodeID_ ); }
00078 
00079    bool operator!=(const NodeDescriptor& nd) const
00080      { return( nodeID_ != nd.nodeID_ ); }
00081 
00082    bool operator<(const NodeDescriptor& nd) const
00083      { return( nodeID_ < nd.nodeID_ ); }
00084 
00085    bool operator>(const NodeDescriptor& nd) const
00086      { return( nodeID_ > nd.nodeID_ ); }
00087 
00088    int getOwnerProc() const {return(ownerProc_);};
00089    void setOwnerProc(int proc) {ownerProc_ = proc;};
00090 
00091    void addBlock(GlobalID blk)
00092      {
00093        int allocLen = numBlocks_;
00094        snl_fei::sortedListInsert(blk, blockList_, numBlocks_, allocLen);
00095      }
00096 
00097    int getNumBlocks() const {return(numBlocks_);};
00098    const GlobalID* getBlockList() const {return(blockList_);};
00099    bool containedInBlock(GlobalID blk) const;
00100 
00101  private:
00102    NodeDescriptor& operator=(const NodeDescriptor& src);
00103 
00104    void allocFieldLists();
00105    void allocBlockList();
00106 
00107    GlobalID nodeID_;
00108 
00109    int nodeNumber_;
00110 
00111    int numNodalDOF_;      //total number of nodal degrees-of-freedom
00112 
00113    int* fieldIDList_;     //list of field identifiers
00114    int* fieldEqnNumbers_; //list of starting (global) equation numbers.
00115                           //fields can consist of more than one scalar (and
00116                           //have more than one associated equation), this
00117                           //is the first equation number
00118    int numFields_;
00119 
00120    int blkEqnNumber_;
00121 
00122    int ownerProc_;        //processor that owns the equations for this node
00123 
00124    GlobalID* blockList_;       //blocks that contain this node
00125    int numBlocks_;
00126 };
00127 
00128 #endif
00129 

Generated on Wed May 12 21:30:41 2010 for FEI by  doxygen 1.4.7