45 long long *MyGlobalElements,
int ElementSize,
int * ElementSizeList,
46 long long NumGlobalPoints,
int NumMyPoints,
48 bool DistributedGlobal,
52 int i, ierr=0, forierr=0;
56 if (ElementSizeList==0)
67 int *MyElementSizeList;
69 if (ElementSizeList==0)
73 MyElementSizeList =
new int[NumMyElements];
77 for (i=0; i<NumMyElements; i++)
78 forierr += MyElementSizeList[i]!=ElementSize;
86 MyElementSizeList =
new int[NumMyElements];
88 int MaxSize = MyElementSizeList[0];
89 int MinSize = MyElementSizeList[0];
91 for (i=0; i<NumMyElements; i++) {
92 forierr += MyElementSizeList[i]!=ElementSizeList[i];
93 if (MyElementSizeList[i] > MaxSize)
94 MaxSize = MyElementSizeList[i];
95 if (MyElementSizeList[i] < MinSize)
96 MinSize = MyElementSizeList[i];
100 forierr += Map.
ElementSize(Map.
LID(MyGlobalElements[i])) != ElementSizeList[i];
124 int MaxLID = Map.
MaxLID();
127 long long MaxMyGID = (Comm.
MyPID()+1)*NumMyElements-1+IndexBase;
128 if (Comm.
MyPID()>2) MaxMyGID+=3;
129 if (!DistributedGlobal) MaxMyGID = NumMyElements-1+IndexBase;
134 if (ElementSizeList==0)
140 int MinLID = Map.
MinLID();
143 long long MinMyGID = Comm.
MyPID()*NumMyElements+IndexBase;
144 if (Comm.
MyPID()>2) MinMyGID+=3;
145 if (!DistributedGlobal) MinMyGID = IndexBase;
148 long long * MyGlobalElements1 =
new long long[NumMyElements];
152 if (MyGlobalElements==0) {
153 for (i=0; i<NumMyElements; i++)
154 forierr += MyGlobalElements1[i]!=MinMyGID+i;
158 for (i=0; i<NumMyElements; i++)
159 forierr += MyGlobalElements[i]!=MyGlobalElements1[i];
170 long long MaxMyGID2 = Map.
GID64(Map.
LID(MaxMyGID));
172 int MaxLID2 = Map.
LID(Map.
GID64(MaxLID));
191 int * FirstPointInElementList =
new int[NumMyElements+1];
195 for (i=0; i<=NumMyElements; i++)
196 forierr += FirstPointInElementList[i]!=FirstPointInElementList1[i];
201 for (i=0; i<=NumMyElements; i++)
202 forierr += FirstPointInElementList1[i]!=(i*ElementSize);
207 for (i=0; i<NumMyElements; i++) {
208 forierr += FirstPointInElementList1[i]!=FirstPoint;
209 FirstPoint += ElementSizeList[i];
212 EPETRA_TEST_ERR(FirstPointInElementList[NumMyElements] != NumMyPoints,ierr);
214 delete [] FirstPointInElementList;
217 int ElementID, Offset;
219 int * PointToElementList =
new int[NumMyPoints];
223 for (i=0; i<NumMyPoints; i++)
224 forierr += PointToElementList1[i] != PointToElementList[i];
229 for (i=0; i<NumMyElements; i++)
230 for (
int j=0; j<ElementSize; j++) {
231 forierr += PointToElementList[i*ElementSize+j] != i;
234 forierr += ElementID != i || Offset != j;
240 for (i=0; i<NumMyElements; i++) {
241 for (
int j=0; j<ElementSizeList[i]; j++) {
242 forierr += PointToElementList[MyPointTot+j] != i;
245 forierr += ElementID != i || Offset != j;
247 MyPointTot += ElementSizeList[i];
251 delete [] PointToElementList;
255 int TotalNumEle, NumElePerProc, NumProc = Comm.
NumProc();
258 Comm.
MinAll(&NumMyEle,&MinNumEleOnProc,1);
259 if (MinNumEleOnProc > 5) NumElePerProc = 6;
260 else NumElePerProc = MinNumEleOnProc;
261 if (NumElePerProc > 0) {
262 TotalNumEle = NumElePerProc*NumProc;
263 long long * MyGIDlist =
new long long[NumElePerProc];
264 long long * GIDlist =
new long long[TotalNumEle];
265 int * PIDlist =
new int[TotalNumEle];
266 int * LIDlist =
new int[TotalNumEle];
267 int * SizeList =
new int[TotalNumEle];
268 for (i=0; i<NumElePerProc; i++)
269 MyGIDlist[i] = MyGlobalElements1[i];
270 Comm.
GatherAll(MyGIDlist,GIDlist,NumElePerProc);
271 Map.
RemoteIDList(TotalNumEle, GIDlist, PIDlist, LIDlist, SizeList);
272 int MyPID= Comm.
MyPID();
274 for (i=0; i<TotalNumEle; i++) {
275 if (Map.
MyGID(GIDlist[i])) {
276 forierr += PIDlist[i] != MyPID;
277 forierr += !Map.
MyLID(Map.
LID(GIDlist[i])) || Map.
LID(GIDlist[i]) != LIDlist[i] || Map.
GID64(LIDlist[i]) != GIDlist[i];
278 forierr += SizeList[i] != Map.
ElementSize(LIDlist[i]);
281 forierr += PIDlist[i] == MyPID;
293 delete [] MyGlobalElements1;
294 delete [] MyElementSizeList;
300 long long * GIDList =
new long long[3];
301 int * PIDList =
new int[3];
302 int * LIDList =
new int[3];
int checkmap(Epetra_BlockMap &Map, long long NumGlobalElements, int NumMyElements, long long *MyGlobalElements, int ElementSize, int *ElementSizeList, long long NumGlobalPoints, int NumMyPoints, long long IndexBase, Epetra_Comm &Comm, bool DistributedGlobal, bool IsOneToOne)