Commit b7b5166d authored by David E. DeMarle's avatar David E. DeMarle Committed by Kitware Robot

Merge topic 'xdmf2-2D-rgrid-is-XY-not-ZY'

74a504f4 Fix assignment of coordinates for XdmfRectilnearGrid
e178db19 change 2D Rectgrid from ZY to XY
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Joachim Pouderoux's avatarJoachim Pouderoux <joachim.pouderoux@kitware.com>
Merge-request: !5954
parents 296ca5b6 74a504f4
......@@ -729,7 +729,6 @@ vtkRectilinearGrid* vtkXdmfHeavyData::RequestRectilinearGrid(XdmfGrid* xmfGrid)
// convert to stridden update extents.
int scaled_extents[6];
vtkScaleExtents(update_extents, scaled_extents, this->Stride);
int scaled_dims[3];
vtkGetDims(scaled_extents, scaled_dims);
......@@ -782,11 +781,23 @@ vtkRectilinearGrid* vtkXdmfHeavyData::RequestRectilinearGrid(XdmfGrid* xmfGrid)
case XDMF_GEOMETRY_VXVY:
{
xarray->FillComponent(0, 0);
xmfGeometry->GetVectorY()->GetValues(update_extents[2],
yarray->GetPointer(0), scaled_dims[1], this->Stride[1]);
xmfGeometry->GetVectorX()->GetValues(update_extents[4],
zarray->GetPointer(0), scaled_dims[2], this->Stride[2]);
// Note:
// XDMF and VTK structured extents are reversed
// Where I varies fastest, VTK's convention is IJK, but XDMF's is KJI
// However, users naturally don't want VXVY to mean VZVY.
// Let's accept VisIt's interpretation of this 2D case
// (KJI is ZXY where Z=0).
xarray->SetNumberOfTuples(scaled_dims[1]);
yarray->SetNumberOfTuples(scaled_dims[2]);
zarray->SetNumberOfTuples(scaled_dims[0]);
rg->SetExtent(scaled_extents[2],scaled_extents[3],
scaled_extents[4],scaled_extents[5],
scaled_extents[0],scaled_extents[1]);
xmfGeometry->GetVectorX()->GetValues(update_extents[2],
xarray->GetPointer(0), scaled_dims[1], this->Stride[1]);
xmfGeometry->GetVectorY()->GetValues(update_extents[4],
yarray->GetPointer(0), scaled_dims[2], this->Stride[2]);
zarray->FillComponent(0, 0);
}
break;
......
......@@ -1341,7 +1341,7 @@ void vtkXdmf3DataSet::VTKToXdmf(
bool OK = true;
vtkDataArray *vCoords = dataSet->GetXCoordinates();
OK &= vtkXdmf3DataSet::VTKToXdmfArray(vCoords, xZCoords.get());
OK &= vtkXdmf3DataSet::VTKToXdmfArray(vCoords, xXCoords.get());
if (OK)
{
vCoords = dataSet->GetYCoordinates();
......@@ -1349,7 +1349,7 @@ void vtkXdmf3DataSet::VTKToXdmf(
if (OK)
{
vCoords = dataSet->GetZCoordinates();
OK &= vtkXdmf3DataSet::VTKToXdmfArray(vCoords, xXCoords.get());
OK &= vtkXdmf3DataSet::VTKToXdmfArray(vCoords, xZCoords.get());
}
}
......
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