snl_fei_RecordCollection.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_RecordCollection_hpp_
00010 #define _snl_fei_RecordCollection_hpp_
00011 
00012 #include <fei_iosfwd.hpp>
00013 #include <fei_Pool_alloc.hpp>
00014 #include <fei_FieldMask.hpp>
00015 #include <fei_Record.hpp>
00016 
00017 #include <map>
00018 
00019 #undef fei_file
00020 #define fei_file "snl_fei_RecordCollection.hpp"
00021 
00022 #include <fei_ErrMacros.hpp>
00023 
00024 namespace fei {
00025   class SharedIDs;
00026 }
00027 
00028 namespace snl_fei {
00029 
00031   class RecordCollection {
00032   public:
00034     RecordCollection(int localProc);
00035 
00037     RecordCollection(const RecordCollection& src);
00038 
00040     virtual ~RecordCollection();
00041 
00043     typedef std::map<int,fei::Record*> map_type;
00044 
00046     void initRecords(int numIDs,
00047          const int* IDs,
00048          std::vector<fei::FieldMask*>& fieldMasks,
00049          fei::Record** records=NULL);
00050 
00052     void initRecords(int fieldID,
00053         int fieldSize,
00054         int numInstances,
00055         int numIDs,
00056         const int* IDs,
00057         std::vector<fei::FieldMask*>& fieldMasks,
00058         bool skipIDsWithThisField=true);
00059 
00061     void initRecords(int fieldID,
00062         int fieldSize,
00063         int numInstances,
00064         int numIDs,
00065         const int* IDs,
00066         std::vector<fei::FieldMask*>& fieldMasks,
00067         fei::Record** records,
00068         bool skipIDsWithThisField=true);
00069 
00072     void setOwners_lowestSharing(fei::SharedIDs* sharedIDs);
00073 
00075     size_t getNumRecords()
00076       {
00077   return( records_.size() );
00078       }
00079 
00081     map_type& getRecords()
00082       {
00083   return( records_ );
00084       }
00085 
00087     const map_type& getRecords() const
00088       {
00089   return( records_ );
00090       }
00091 
00093     fei::Record* getRecordWithID(int ID);
00094 
00096     int getGlobalIndex(int ID,
00097            int fieldID,
00098            int fieldSize,
00099            int fieldOffset,
00100            int whichComponentOfField,
00101            const int* eqnNumbers);
00102 
00104     int getGlobalBlkIndex(int ID, int& globalBlkIndex);
00105 
00107     void setDebugOutput(FEI_OSTREAM* dbgOut)
00108       {
00109   dbgOut_ = dbgOut;
00110   debugOutput_ = true;
00111       }
00112 
00113   private:
00114 
00115     map_type records_;
00116 
00117     int localProc_;
00118 
00119     fei_Pool_alloc<fei::Record > recordPool_;
00120 
00121     bool debugOutput_;
00122     FEI_OSTREAM* dbgOut_;
00123   };
00124 
00125 } //namespace snl_fei
00126 
00127 #undef fei_file
00128 
00129 #endif // _snl_fei_RecordCollection_hpp_

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