Hi,<div><br></div><div>Are there any examples on how to create the data structures needed write a time series of vtkMultiBlockDataSets to a single exodus file ? </div><div><br></div><div>I've tried storing one vtkMultiBlockDataSet per time step as a vtkTemporalDataSet.</div>
<div>Another strategy, from the documentation seems to imply that the ModelMetaData needs to be setup ? <br></div><div><br></div><div><br></div><div><div> vtkTemporalDataSet = vtk.vtkTemporalDataSet()</div><div> multiBlockData = {}</div>
<div> for timeID in range(ntime):</div><div> if exodusObject.IsA("vtkMultiBlockDataSet"):</div><div> iter = exodusObject.NewIterator()</div><div> iter.UnRegister(None)</div><div> iter.InitTraversal()</div>
<div> # loop over blocks...</div><div> while not iter.IsDoneWithTraversal():</div><div> curInput = iter.GetCurrentDataObject()</div><div> curNumberPoints = curInput.GetNumberOfPoints()</div>
<div> fem_point_data= curInput.GetPointData()</div><div> DeepCopy = 1</div><div> #print timeID,listSliceInit,curNumberPoints </div><div> vtkOnes= vtkNumPy.numpy_to_vtk( numpy.ones(curNumberPoints ) , DeepCopy)</div>
<div> fem_point_data.AddArray( vtkOnes )</div><div> fem_point_data.Update()</div><div> curInput.Update()</div><div> iter.GoToNextItem();</div><div> multiBlockData['%d' % timeID] = vtk.vtkMultiBlockDataSet()</div>
<div> multiBlockData['%d' % timeID].DeepCopy(exodusObject)</div><div> vtkTemporalDataSet.SetTimeStep( timeID, multiBlockData['%d' % timeID] )</div><div> vtkTemporalDataSet.Update()</div><div>
# write time steps</div><div> vtkExodusIIWriter = vtk.vtkExodusIIWriter()</div><div> vtkExodusIIWriter.SetFileName( '%s/fem_stats.e' % data_dir )</div><div> vtkExodusIIWriter.WriteOutBlockIdArrayOn ();</div><div>
vtkExodusIIWriter.WriteOutGlobalNodeIdArrayOn ();</div><div> vtkExodusIIWriter.WriteOutGlobalElementIdArrayOn ();</div><div> vtkExodusIIWriter.WriteAllTimeStepsOn ();</div><div> print "#time", vtkTemporalDataSet.GetNumberOfTimeSteps()</div>
<div> vtkExodusIIWriter.SetInput( vtkTemporalDataSet )</div><div> vtkExodusIIWriter.Update()</div></div><div><br></div><div><br></div><div><br></div><div>Thank you,</div><div>David</div><div><br></div>