Epetra_BlockMap.h

Go to the documentation of this file.
00001 
00002 //@HEADER
00003 /*
00004 ************************************************************************
00005 
00006               Epetra: Linear Algebra Services Package 
00007                 Copyright (2001) Sandia Corporation
00008 
00009 Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00010 license for use of this work by or on behalf of the U.S. Government.
00011 
00012 This library is free software; you can redistribute it and/or modify
00013 it under the terms of the GNU Lesser General Public License as
00014 published by the Free Software Foundation; either version 2.1 of the
00015 License, or (at your option) any later version.
00016  
00017 This library is distributed in the hope that it will be useful, but
00018 WITHOUT ANY WARRANTY; without even the implied warranty of
00019 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00020 Lesser General Public License for more details.
00021  
00022 You should have received a copy of the GNU Lesser General Public
00023 License along with this library; if not, write to the Free Software
00024 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00025 USA
00026 Questions? Contact Michael A. Heroux (maherou@sandia.gov) 
00027 
00028 ************************************************************************
00029 */
00030 //@HEADER
00031 
00032 #ifndef EPETRA_BLOCKMAP_H
00033 #define EPETRA_BLOCKMAP_H
00034 
00035 #include "Epetra_Object.h"
00036 #include "Epetra_BlockMapData.h"
00037 
00038 
00040 
00181 class Epetra_BlockMap: public Epetra_Object {
00182   friend class Epetra_Directory;
00183   friend class Epetra_LocalMap;
00184  public:
00186 
00187 
00188 
00211   Epetra_BlockMap(int NumGlobalElements, int ElementSize, int IndexBase, const Epetra_Comm& Comm);
00212 
00214 
00243   Epetra_BlockMap(int NumGlobalElements, int NumMyElements, 
00244     int ElementSize, int IndexBase, const Epetra_Comm& Comm);
00245 
00247 
00283   Epetra_BlockMap(int NumGlobalElements, int NumMyElements,
00284                   const int *MyGlobalElements,  
00285       int ElementSize, int IndexBase, const Epetra_Comm& Comm);
00286 
00288 
00325   Epetra_BlockMap(int NumGlobalElements, int NumMyElements,
00326                   const int *MyGlobalElements,
00327       const int *ElementSizeList, int IndexBase,
00328                   const Epetra_Comm& Comm);
00329   
00331   Epetra_BlockMap(const Epetra_BlockMap& map);
00332   
00334   virtual ~Epetra_BlockMap(void);
00336   
00338 
00339 
00340 
00344   int RemoteIDList(int NumIDs, const int * GIDList, int * PIDList, int * LIDList) const {
00345     return(RemoteIDList(NumIDs, GIDList, PIDList, LIDList, 0));
00346   };
00347 
00349 
00354   int RemoteIDList(int NumIDs, const int * GIDList, int * PIDList, int * LIDList, int * SizeList) const;
00355 
00357   int  LID(int GID) const;
00358   
00360   int  GID(int LID) const; 
00361   
00363   int FindLocalElementID(int PointID, int & ElementID, int & ElementOffset)  const;
00364 
00366   bool  MyGID(int GID_in) const {return(LID(GID_in)!=-1);};
00367    
00369   bool  MyLID(int LID_in) const {return(GID(LID_in)!=BlockMapData_->IndexBase_-1);};
00370   
00372   int  MinAllGID() const {return(BlockMapData_->MinAllGID_);};
00373   
00375   int  MaxAllGID() const {return(BlockMapData_->MaxAllGID_);};
00376   
00378   int  MinMyGID() const {return(BlockMapData_->MinMyGID_);};
00379   
00381   int  MaxMyGID() const {return(BlockMapData_->MaxMyGID_);};
00382   
00384   int  MinLID() const {return(BlockMapData_->MinLID_);};
00385   
00387   int  MaxLID() const {return(BlockMapData_->MaxLID_);};
00389 
00391 
00392 
00393   int  NumGlobalElements() const {return(BlockMapData_->NumGlobalElements_);};
00394   
00396   int  NumMyElements() const {return(BlockMapData_->NumMyElements_);};
00397   
00399   int MyGlobalElements(int * MyGlobalElementList) const;
00400   
00402   int  ElementSize() const {return(BlockMapData_->ElementSize_);};
00403     
00405   int  ElementSize(int LID) const;
00406     
00408 
00411   int  FirstPointInElement(int LID) const;
00412   
00414   int  IndexBase() const {return(BlockMapData_->IndexBase_);};
00415   
00417   int  NumGlobalPoints() const {return(BlockMapData_->NumGlobalPoints_);};
00418   
00420   int  NumMyPoints() const {return(BlockMapData_->NumMyPoints_);};
00421   
00423   int  MinMyElementSize() const {return(BlockMapData_->MinMyElementSize_);};
00424   
00426   int  MaxMyElementSize() const {return(BlockMapData_->MaxMyElementSize_);};
00427   
00429   int  MinElementSize() const {return(BlockMapData_->MinElementSize_);};
00430   
00432   int  MaxElementSize() const {return(BlockMapData_->MaxElementSize_);};
00434 
00436 
00437 
00438 
00443   bool  UniqueGIDs() const {return(IsOneToOne());};
00444 
00446   bool  ConstantElementSize() const {return(BlockMapData_->ConstantElementSize_);};
00447 
00449   bool SameAs(const Epetra_BlockMap & Map) const;
00450 
00452 
00455   bool PointSameAs(const Epetra_BlockMap & Map) const;
00456   
00458   bool  LinearMap() const {return(BlockMapData_->LinearMap_);};
00459 
00461   bool  DistributedGlobal() const {return(BlockMapData_->DistributedGlobal_);};
00463 
00465 
00466 
00468   int * MyGlobalElements() const;
00469 
00471 
00474   int * FirstPointInElementList() const;
00475 
00477   int * ElementSizeList() const;
00478 
00480   int * PointToElementList() const;
00481 
00483   int ElementSizeList(int * ElementSizeList)const;
00484   
00486   int FirstPointInElementList(int * FirstPointInElementList)const;
00487 
00489   int PointToElementList(int * PointToElementList) const;
00490 
00492 
00494 
00495 
00497   virtual void Print(ostream & os) const;
00498 
00500   const Epetra_Comm & Comm() const {return(*BlockMapData_->Comm_);}
00501 
00502   bool IsOneToOne() const {return(BlockMapData_->OneToOne_);}
00503 
00505   Epetra_BlockMap & operator=(const Epetra_BlockMap & map);
00506 
00508 
00510 
00511 
00513 
00514   int ReferenceCount() const {return(BlockMapData_->ReferenceCount());}
00515 
00517 
00518   const Epetra_BlockMapData * DataPtr() const {return(BlockMapData_);}
00519 
00521   
00522  private: // These need to be accessible to derived map classes.
00523   
00524   void GlobalToLocalSetup();
00525   bool DetermineIsOneToOne();
00526   bool IsDistributedGlobal(int NumGlobalElements, int NumMyElements) const;
00527   void CheckValidNGE(int NumGlobalElements);
00528   void EndOfConstructorOps();
00529   void CleanupData();
00530   
00531   Epetra_BlockMapData * BlockMapData_;
00532 
00533 };
00534 
00535 #endif /* EPETRA_BLOCKMAP_H */

Generated on Wed May 12 21:41:04 2010 for Epetra Package Browser (Single Doxygen Collection) by  doxygen 1.4.7