FEI Version of the Day
snl_fei_PointBlockMap.hpp
00001 /*--------------------------------------------------------------------*/
00002 /*    Copyright 2005 Sandia Corporation.                              */
00003 /*    Under the terms of Contract DE-AC04-94AL85000, there is a       */
00004 /*    non-exclusive license for use of this work by or on behalf      */
00005 /*    of the U.S. Government.  Export of this program may require     */
00006 /*    a license from the United States Government.                    */
00007 /*--------------------------------------------------------------------*/
00008 
00009 #ifndef _snl_fei_PointBlockMap_hpp_
00010 #define _snl_fei_PointBlockMap_hpp_
00011 
00012 #include <fei_macros.hpp>
00013 
00014 #include <map>
00015 
00016 namespace snl_fei {
00023   class PointBlockMap {
00024   public:
00026     PointBlockMap();
00027 
00029     virtual ~PointBlockMap();
00030 
00036    void setPtEqualBlk();
00037 
00040    bool ptEqualBlk() { return( ptEqualBlk_ ); }
00041 
00047    int setEqn(int ptEqn, int blkEqn);
00048 
00055    int setEqn(int ptEqn, int blkEqn, int blkSize);
00056 
00061    int setBlkEqnSize(int blkEqn, int size);
00062 
00064    int getBlkEqnSize(int blkEqn);
00065 
00068    int getMaxBlkEqnSize() { return( maxSize_ ); }
00069 
00072    void setMaxBlkEqnSize(int sz) { maxSize_ = sz; }
00073 
00079    int eqnToBlkEqn(int eqn) const;
00080 
00086    int blkEqnToPtEqn(int blkEqn) const;
00087 
00093    int getBlkEqnInfo(int blkEqn, int& ptEqn, int& blkSize);
00094 
00099    int getPtEqnInfo(int ptEqn, int& blkEqn, int& blkOffset);
00100 
00106    int getBlkEqnOffset(int blkEqn, int ptEqn);
00107 
00111    bool isExactlyBlkEqn(int ptEqn);
00112 
00115    std::map<int,int>* getPtEqns()
00116      {
00117        return( ptEqns_ );
00118      }
00119 
00122    std::map<int,std::pair<int,int> >* getBlkEqns()
00123      {
00124        return( blkEqns_ );
00125      }
00126 
00127   private:
00129    PointBlockMap(const PointBlockMap& src);
00130 
00131    PointBlockMap& operator=(const PointBlockMap& src);
00132 
00133    std::map<int,int>* ptEqns_; //ptEqns_ maps point-equations to block-equations
00134 
00135    std::map<int,std::pair<int,int> >* blkEqns_;
00136    //blkEqns_ maps block-equations to point-equations and block-sizes
00137    //(the point-equation stored is the first or smallest point-equation that is
00138    //associated with the block-equation)
00139 
00140    int maxSize_;
00141 
00142    bool ptEqualBlk_; //if this is true, then all blkSizes are 1
00143   };//class PointBlockMap
00144 }//namespace snl_fei
00145 #endif // _snl_fei_PointBlockMap_hpp_
00146 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends