45 int *MyGlobalElements,
int IndexBase,
Epetra_Comm& Comm,
46 bool DistributedGlobal)
48 int i, ierr=0, forierr = 0;
56 int *MyElementSizeList =
new int[NumMyElements];
61 for (i=0; i<NumMyElements; i++) forierr += MyElementSizeList[i]!=1;
64 delete [] MyElementSizeList;
85 int MaxMyGID = (Comm.
MyPID()+1)*NumMyElements-1+IndexBase;
86 if (Comm.
MyPID()>2) MaxMyGID+=3;
87 if (!DistributedGlobal) MaxMyGID = NumMyElements-1+IndexBase;
96 int MinMyGID = Comm.
MyPID()*NumMyElements+IndexBase;
97 if (Comm.
MyPID()>2) MinMyGID+=3;
98 if (!DistributedGlobal) MinMyGID = 0;
101 int * MyGlobalElements1 =
new int[NumMyElements];
105 if (MyGlobalElements==0)
107 for (i=0; i<NumMyElements; i++)
108 forierr += MyGlobalElements1[i]!=MinMyGID+i;
112 for (i=0; i<NumMyElements; i++)
113 forierr += MyGlobalElements[i]!=MyGlobalElements1[i];
124 int MaxMyGID2 = Map.
GID(Map.
LID(MaxMyGID));
126 int MaxLID2 = Map.
LID(Map.
GID(MaxLID));
146 int TotalNumEle, NumElePerProc, NumProc = Comm.
NumProc();
149 Comm.
MinAll(&NumMyEle,&MinNumEleOnProc,1);
150 if (MinNumEleOnProc > 5) NumElePerProc = 6;
151 else NumElePerProc = MinNumEleOnProc;
152 if (NumElePerProc > 0) {
153 TotalNumEle = NumElePerProc*NumProc;
154 int * MyGIDlist =
new int[NumElePerProc];
155 int * GIDlist =
new int[TotalNumEle];
156 int * PIDlist =
new int[TotalNumEle];
157 int * LIDlist =
new int[TotalNumEle];
158 for (i=0; i<NumElePerProc; i++)
159 MyGIDlist[i] = MyGlobalElements1[i];
160 Comm.
GatherAll(MyGIDlist,GIDlist,NumElePerProc);
161 Map.
RemoteIDList(TotalNumEle, GIDlist, PIDlist, LIDlist);
162 int MyPID= Comm.
MyPID();
165 for (i=0; i<TotalNumEle; i++) {
166 if (Map.
MyGID(GIDlist[i])) {
167 forierr += PIDlist[i] != MyPID;
168 forierr += !Map.
MyLID(Map.
LID(GIDlist[i])) || Map.
LID(GIDlist[i]) != LIDlist[i] || Map.
GID(LIDlist[i]) != GIDlist[i];
171 forierr += PIDlist[i] == MyPID;
182 delete [] MyGlobalElements1;
188 int * GIDList =
new int[3];
189 int * PIDList =
new int[3];
190 int * LIDList =
new int[3];
int checkmap(Epetra_Map &Map, int NumGlobalElements, int NumMyElements, int *MyGlobalElements, int IndexBase, Epetra_Comm &Comm, bool DistributedGlobal)
int MinAllGID() const
Returns the minimum global ID across the entire map.
int RemoteIDList(int NumIDs, const int *GIDList, int *PIDList, int *LIDList) const
Returns the processor IDs and corresponding local index value for a given list of global indices.
int MaxElementSize() const
Maximum element size across all processors.
int MyGlobalElements(int *MyGlobalElementList) const
Puts list of global elements on this processor into the user-provided array.
int MinMyGID() const
Returns the minimum global ID owned by this processor.
int * ElementSizeList() const
List of the element sizes corresponding to the array MyGlobalElements().
bool DistributedGlobal() const
Returns true if map is defined across more than one processor.
int NumMyPoints() const
Number of local points for this map; equals the sum of all element sizes on the calling processor.
int LID(int GID) const
Returns local ID of global ID, return -1 if not found on this processor.
int GID(int LID) const
Returns global ID of local ID, return IndexBase-1 if not found on this processor.
bool LinearMap() const
Returns true if the global ID space is contiguously divided (but not necessarily uniformly) across al...
int IndexBase() const
Index base for this map.
int MaxAllGID() const
Returns the maximum global ID across the entire map.
int ElementSize() const
Returns the size of elements in the map; only valid if map has constant element size.
int MinLID() const
The minimum local index value on the calling processor.
int MinElementSize() const
Minimum element size across all processors.
int NumGlobalElements() const
Number of elements across all processors.
const Epetra_Comm & Comm() const
Access function for Epetra_Comm communicator.
bool ConstantElementSize() const
Returns true if map has constant element size.
int NumMyElements() const
Number of elements on the calling processor.
bool MyLID(int lid) const
Returns true if the LID passed in belongs to the calling processor in this map, otherwise returns fal...
int MaxLID() const
The maximum local index value on the calling processor.
int NumGlobalPoints() const
Number of global points for this map; equals the sum of all element sizes across all processors.
bool MyGID(int GID_in) const
Returns true if the GID passed in belongs to the calling processor in this map, otherwise returns fal...
int MaxMyGID() const
Returns the maximum global ID owned by this processor.
Epetra_Comm: The Epetra Communication Abstract Base Class.
virtual int NumProc() const =0
Returns total number of processes.
virtual int GatherAll(double *MyVals, double *AllVals, int Count) const =0
Epetra_Comm All Gather function.
virtual int MinAll(double *PartialMins, double *GlobalMins, int Count) const =0
Epetra_Comm Global Min function.
virtual int MyPID() const =0
Return my process ID.
Epetra_Map: A class for partitioning vectors and matrices.
#define EPETRA_TEST_ERR(a, b)