Skip to content

Commit

Permalink
Merge pull request #25 from visit-dav/bug/miller86/28Jan19_ghost_fix_…
Browse files Browse the repository at this point in the history
…revert

reverting "fix" to GenericExecute method
  • Loading branch information
markcmiller86 committed Jan 28, 2019
2 parents 6c6f47e + 6ea1372 commit e0adc8a
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions src/visit_vtk/full/vtkDataSetRemoveGhostCells.C
Original file line number Diff line number Diff line change
Expand Up @@ -163,33 +163,25 @@ vtkDataSetRemoveGhostCells::RequestData(
// Eric Brugger, Wed Jan 9 14:56:57 PST 2013
// Modified to inherit from vtkDataSetAlgorithm.
//
// Mark C. Miller, Sun Jan 13 23:43:14 CST 2019
// Fix to filter on GhostZoneTypesToRemove. Also add optimizations for
// when GhostZoneTypesToRemove is 0xFF (255), meaning all types.
//
// ****************************************************************************

void
vtkDataSetRemoveGhostCells::GenericExecute()
{
int i;


vtkDataSet *ds = input;
vtkDataArray *arr = ds->GetCellData()->GetArray("avtGhostZones");
if (GhostZoneTypesToRemove == 255 || arr == NULL)
if (arr == NULL)
{
output->ShallowCopy(ds);
return;
}
int nOut = 0;
int nCells = ds->GetNumberOfCells();
for (i = 0 ; i < nCells ; i++)
{
unsigned char effectiveVal = (unsigned char) arr->GetTuple1(i) & GhostZoneTypesToRemove;
if (!avtGhostData::IsGhostZone(effectiveVal))
if (arr->GetTuple1(i) == 0)
nOut++;
}

// If *all* the cells are selected, exit early, returning the input
if (nOut == nCells)
Expand All @@ -212,8 +204,7 @@ vtkDataSetRemoveGhostCells::GenericExecute()
vtkIdList *ptList = vtkIdList::New();
for (i = 0 ; i < nCells ; i++)
{
unsigned char effectiveVal = (unsigned char) arr->GetTuple1(i) & GhostZoneTypesToRemove;
if (avtGhostData::IsGhostZone(effectiveVal))
if (arr->GetTuple1(i) != 0)
continue;

ds->GetCellPoints(i, ptList);
Expand All @@ -224,10 +215,6 @@ vtkDataSetRemoveGhostCells::GenericExecute()
ptList->Delete();

ugrid->Squeeze();
if (GhostZoneTypesToRemove == 255)
{
ugrid->GetCellData()->RemoveArray("avtGhostZones");
}
this->GetExecutive()->SetOutputData(0, ugrid);
ugrid->Delete();
}
Expand Down

0 comments on commit e0adc8a

Please sign in to comment.