Commit cbaa45e0 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit Committed by Kitware Robot

Merge topic 'vtkAMRInformation_SetGridDescription'

70cb8dde ENH: Move test that discovers inconsistent structured grids in an AMR grid.
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Reviewed-by: Berk Geveci's avatarBerk Geveci <berk.geveci@kitware.com>
Merge-request: !365
parents d575a70b 70cb8dde
......@@ -570,9 +570,10 @@ bool vtkAMRInformation::HasValidBounds()
void vtkAMRInformation::SetGridDescription(int description)
{
if(this->GridDescription>=0 && description!=this->GridDescription)
if (description < VTK_SINGLE_POINT || description > VTK_EMPTY)
{
vtkErrorMacro("Inconsistent types of vtkUniformGrid");
vtkErrorMacro("Invalid grid description for a vtkUniformGrid.");
return;
}
this->GridDescription = description;
}
......
......@@ -153,7 +153,15 @@ void vtkUniformGridAMR::SetDataSet(
return;
}
this->AMRInfo->SetGridDescription(grid->GetGridDescription());
if(this->AMRInfo->GetGridDescription() < 0)
{
this->AMRInfo->SetGridDescription(grid->GetGridDescription());
}
else if (grid->GetGridDescription() != this->AMRInfo->GetGridDescription())
{
vtkErrorMacro("Inconsistent types of vtkUniformGrid");
return;
}
int index = this->AMRInfo->GetIndex(level,idx);
this->AMRData->Insert(index, grid);
......
......@@ -154,7 +154,15 @@ void vtkUniformGridAMR2::SetDataSet(
return;
}
this->AMRInfo->SetGridDescription(grid->GetGridDescription());
if(this->AMRInfo->GetGridDescription() < 0)
{
this->AMRInfo->SetGridDescription(grid->GetGridDescription());
}
else if (grid->GetGridDescription() != this->AMRInfo->GetGridDescription())
{
vtkErrorMacro("Inconsistent types of vtkUniformGrid");
return;
}
int index = this->AMRInfo->GetIndex(level,idx);
this->AMRData->Insert(index, grid);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment