Commit e178db19 authored by David E. DeMarle's avatar David E. DeMarle

change 2D Rectgrid from ZY to XY

parent e4be1fb8
...@@ -729,7 +729,6 @@ vtkRectilinearGrid* vtkXdmfHeavyData::RequestRectilinearGrid(XdmfGrid* xmfGrid) ...@@ -729,7 +729,6 @@ vtkRectilinearGrid* vtkXdmfHeavyData::RequestRectilinearGrid(XdmfGrid* xmfGrid)
// convert to stridden update extents. // convert to stridden update extents.
int scaled_extents[6]; int scaled_extents[6];
vtkScaleExtents(update_extents, scaled_extents, this->Stride); vtkScaleExtents(update_extents, scaled_extents, this->Stride);
int scaled_dims[3]; int scaled_dims[3];
vtkGetDims(scaled_extents, scaled_dims); vtkGetDims(scaled_extents, scaled_dims);
...@@ -782,11 +781,23 @@ vtkRectilinearGrid* vtkXdmfHeavyData::RequestRectilinearGrid(XdmfGrid* xmfGrid) ...@@ -782,11 +781,23 @@ vtkRectilinearGrid* vtkXdmfHeavyData::RequestRectilinearGrid(XdmfGrid* xmfGrid)
case XDMF_GEOMETRY_VXVY: case XDMF_GEOMETRY_VXVY:
{ {
xarray->FillComponent(0, 0); // Note:
xmfGeometry->GetVectorY()->GetValues(update_extents[2], // XDMF and VTK structured extents are reversed
yarray->GetPointer(0), scaled_dims[1], this->Stride[1]); // Where I varies fastest, VTK's convention is IJK, but XDMF's is KJI
xmfGeometry->GetVectorX()->GetValues(update_extents[4], // However, users naturally don't want VXVY to mean VZVY.
zarray->GetPointer(0), scaled_dims[2], this->Stride[2]); // 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; break;
......
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