Epetra Development

Epetra_Map: A class for partitioning vectors and matrices. More...
#include <Epetra_Map.h>
Public Member Functions  
Epetra_Map (int NumGlobalElements, int IndexBase, const Epetra_Comm &Comm)  
Epetra_Map constructor for a Epetradefined uniform linear distribution of elements.  
Epetra_Map (long long NumGlobalElements, int IndexBase, const Epetra_Comm &Comm)  
Epetra_Map (long long NumGlobalElements, long long IndexBase, const Epetra_Comm &Comm)  
Epetra_Map (int NumGlobalElements, int NumMyElements, int IndexBase, const Epetra_Comm &Comm)  
Epetra_Map constructor for a userdefined linear distribution of elements.  
Epetra_Map (long long NumGlobalElements, int NumMyElements, int IndexBase, const Epetra_Comm &Comm)  
Epetra_Map (long long NumGlobalElements, int NumMyElements, long long IndexBase, const Epetra_Comm &Comm)  
Epetra_Map (int NumGlobalElements, int NumMyElements, const int *MyGlobalElements, int IndexBase, const Epetra_Comm &Comm)  
Epetra_Map constructor for a userdefined arbitrary distribution of elements.  
Epetra_Map (long long NumGlobalElements, int NumMyElements, const long long *MyGlobalElements, int IndexBase, const Epetra_Comm &Comm)  
Epetra_Map (long long NumGlobalElements, int NumMyElements, const long long *MyGlobalElements, long long IndexBase, const Epetra_Comm &Comm)  
Epetra_Map (long long NumGlobal_Elements, int NumMy_Elements, const long long *myGlobalElements, int indexBase, const Epetra_Comm &comm, bool UserIsDistributedGlobal, long long UserMinAllGID, long long UserMaxAllGID)  
Epetra_Map constructor for a userdefined arbitrary distribution of elements, where the user provides all the globals.  
Epetra_Map (int NumGlobal_Elements, int NumMy_Elements, const int *myGlobalElements, int indexBase, const Epetra_Comm &comm, bool UserIsDistributedGlobal, int UserMinAllGID, int UserMaxAllGID)  
Epetra_Map (const Epetra_Map &map)  
Epetra_Map copy constructor.  
virtual  ~Epetra_Map (void) 
Epetra_Map destructor.  
Epetra_Map &  operator= (const Epetra_Map &map) 
Assignment Operator.  
Epetra_Map *  RemoveEmptyProcesses () const 
Return a new BlockMap with processes with zero elements removed.  
Epetra_Map *  ReplaceCommWithSubset (const Epetra_Comm *Comm) const 
Replace this Map's communicator with a subset communicator. 
Epetra_Map: A class for partitioning vectors and matrices.
It is often the case that multiple matrix and vector objects have an identical distribution of elements on a parallel machine. The Epetra_Map class keep information that describes this distribution for matrices and vectors.
Epetra_Map allows the storage and retrieval of the following information. Depending on the constructor that is used, some of the information is defined by the user and some is determined by the constructor. Once a Epetra_Map is constructed any of the following attributes can be obtained by calling a query function that has the name as the attribute, e.g. to get the value of NumGlobalElements, you can call a function NumGlobalElements(). For attributes that are lists, the query functions return the list values in a user allocated array.
In addition to the information above that is passed in to or created by the Epetra_Map constructor, the following attributes are computed and available via query to the user using the same scheme as above, e.g., use NumGlobalPoints() to get the value of NumGlobalPoints.
The following functions allow boolean tests for certain properties.
Epetra_Map::Epetra_Map  (  int  NumGlobalElements, 
int  IndexBase,  
const Epetra_Comm &  Comm  
) 
Epetra_Map constructor for a Epetradefined uniform linear distribution of elements.
Creates a map that distributes NumGlobalElements elements evenly across all processors in the Epetra_Comm communicator. If NumGlobalElements does not divide exactly into the number of processors, the first processors in the communicator get one extra element until the remainder is gone.
In  NumGlobalElements  Number of elements to distribute. 
In  IndexBase  Minimum index value used for arrays that use this map. Typically 0 for C/C++ and 1 for Fortran. 
In  Comm  Epetra_Comm communicator containing information on the number of processors. 
Epetra_Map::Epetra_Map  (  int  NumGlobalElements, 
int  NumMyElements,  
int  IndexBase,  
const Epetra_Comm &  Comm  
) 
Epetra_Map constructor for a userdefined linear distribution of elements.
Creates a map that puts NumMyElements on the calling processor. If NumGlobalElements=1, the number of global elements will be the computed sum of NumMyElements across all processors in the Epetra_Comm communicator.
In  NumGlobalElements  Number of elements to distribute. Must be either 1 or equal to the computed sum of NumMyElements across all processors in the Epetra_Comm communicator. 
In  NumMyElements  Number of elements owned by the calling processor. 
In  IndexBase  Minimum index value used for arrays that use this map. Typically 0 for C/C++ and 1 for Fortran. 
In  Comm  Epetra_Comm communicator containing information on the number of processors. 
Epetra_Map::Epetra_Map  (  int  NumGlobalElements, 
int  NumMyElements,  
const int *  MyGlobalElements,  
int  IndexBase,  
const Epetra_Comm &  Comm  
) 
Epetra_Map constructor for a userdefined arbitrary distribution of elements.
Creates a map that puts NumMyElements on the calling processor. The indices of the elements are determined from the list MyGlobalElements. If NumGlobalElements=1, the number of global elements will be the computed sum of NumMyElements across all processors in the Epetra_Comm communicator.
In  NumGlobalElements  Number of elements to distribute. Must be either 1 or equal to the computed sum of NumMyElements across all processors in the Epetra_Comm communicator. 
In  NumMyElements  Number of elements owned by the calling processor. 
In  MyGlobalElements  Integer array of length NumMyElements. The ith entry contains the global index value of the ith element on this processor. Index values are not required to be contiguous on a processor, or to be within the range of 0 to NumGlobalElements. As long as the index values are consistently defined and used, any set of NumGlobalElements distinct integer values is acceptable. 
In  IndexBase  Minimum index value used for arrays that use this map. Typically 0 for C/C++ and 1 for Fortran. 
In  Comm  Epetra_Comm communicator containing information on the number of processors. 
Epetra_Map::Epetra_Map  (  long long  NumGlobal_Elements, 
int  NumMy_Elements,  
const long long *  myGlobalElements,  
int  indexBase,  
const Epetra_Comm &  comm,  
bool  UserIsDistributedGlobal,  
long long  UserMinAllGID,  
long long  UserMaxAllGID  
) 
Epetra_Map constructor for a userdefined arbitrary distribution of elements, where the user provides all the globals.
Epetra_Map* Epetra_Map::RemoveEmptyProcesses  (  )  const 
Return a new BlockMap with processes with zero elements removed.
This method first computes a new communicator, which contains only those processes in this Map's communicator (the "original communicator") that have a nonzero number of elements in this BlockMap (the "original BlockMap"). It then returns a new BlockMap distributed over the new communicator. The new BlockMap represents the same distribution as the original BlockMap, except that processes containing zero elements are not included in the new BlockMap or its communicator. On processes not included in the new BlockMap or communicator, this method returns NULL.
The returned BlockMap always has a distinct communicator from this BlockMap's original communicator. The new communicator contains a subset of processes from the original communicator. Even if the number of processes in the new communicator equals the number of processes in the original communicator, the new communicator is distinct. (In an MPI implementation, the new communicator is created using MPI_Comm_split.)
This method must be called collectively on the original communicator. It leaves the original Map and communicator unchanged.
This method was intended for applications such as algebraic multigrid or other multilevel preconditioners. Construction of each level of the multilevel preconditioner typically requires constructing sparse matrices, which in turn requires allreduces over all participating processes at that level. Matrix sizes at successively coarser levels shrink geometrically. At the coarsest levels, some processes might be left with zero rows of the matrix, or the multigrid implementation might "rebalance" (redistribute the matrix) and intentionally leave some processes with zero rows. Removing processes with zero rows makes the allreduces and other communication operations cheaper.
Reimplemented from Epetra_BlockMap.
Epetra_Map* Epetra_Map::ReplaceCommWithSubset  (  const Epetra_Comm *  Comm  )  const 
Replace this Map's communicator with a subset communicator.
This method must be called collectively on the original communicator. It leaves the original BlockMap and communicator unchanged.
Reimplemented from Epetra_BlockMap.