Added a routine to get the boxes and the proc ids corresponding to

the boxes.
This commit is contained in:
barrylee 2006-12-08 18:45:19 +00:00
parent eefa67a52a
commit 965bf28186

View File

@ -803,6 +803,52 @@ int hypre_BoxManGetAllEntriesBoxes( hypre_BoxManager *manager,
}
/*--------------------------------------------------------------------------
* Get the boxes and the proc ids. The input procs array should be NULL.
*--------------------------------------------------------------------------*/
int hypre_BoxManGetAllEntriesBoxesProc( hypre_BoxManager *manager,
hypre_BoxArray *boxes,
int *procs)
{
hypre_BoxManEntry entry;
int i, nentries;
hypre_Index ilower, iupper;
hypre_BoxManEntry *boxman_entries = hypre_BoxManEntries(manager);
/* can only use after assembling */
if (!hypre_BoxManIsAssembled(manager))
{
hypre_error_in_arg(1);
return hypre_error_flag;
}
/* set array size */
nentries = hypre_BoxManNEntries(manager);
hypre_BoxArraySetSize(boxes, nentries);
procs= hypre_TAlloc(int, nentries);
for (i= 0; i< nentries; i++)
{
entry = boxman_entries[i];
hypre_BoxManEntryGetExtents(&entry, ilower, iupper);
hypre_BoxSetExtents(hypre_BoxArrayBox(boxes,i), ilower, iupper);
procs[i]= hypre_BoxManEntryProc(&entry);
}
/* return */
return hypre_error_flag;
}
/*--------------------------------------------------------------------------
hypre_BoxManGatherEntries: