Commit 9c7135b9 authored by Dan Lipsa's avatar Dan Lipsa
Browse files

Add data_index to Exodus driver

data_index[0] represents the time step (t_index) if HasModeShapes=0
or ModeShape otherwise. This commit also removes an unused variable.

Change-Id: I08716d6c904aa18eb5b6163a6d394e3c47bcb138
parent 6dee6fde
......@@ -388,7 +388,6 @@ vtkExodusIIReaderPrivate::vtkExodusIIReaderPrivate()
this->Cache = vtkExodusIICache::New();
this->CacheSize = 0;
this->TimeStep = 0;
this->HasModeShapes = 0;
this->ModeShapeTime = -1.;
this->AnimateModeShapes = 1;
......@@ -946,7 +945,7 @@ int vtkExodusIIReaderPrivate::AssembleOutputProceduralArrays(
//-----------------------------------------------------------------------------
int vtkExodusIIReaderPrivate::AssembleOutputGlobalArrays(
vtkIdType vtkNotUsed(timeStep), int otyp, int obj, BlockSetInfoType* bsinfop,
vtkIdType timeStep, int otyp, int obj, BlockSetInfoType* bsinfop,
vtkUnstructuredGrid* output )
{
(void)obj;
......@@ -1010,6 +1009,16 @@ int vtkExodusIIReaderPrivate::AssembleOutputGlobalArrays(
sarr->Delete();
}
// Add mode_shape/time_step
{
vtkNew<vtkIntArray> arr;
arr->SetName("data_index");
arr->SetNumberOfComponents(1);
arr->SetNumberOfTuples(1);
arr->SetValue(0, timeStep);
ofieldData->AddArray(arr.GetPointer());
}
vtkExodusIICacheKey infokey( -1, vtkExodusIIReader::INFO_RECORDS, 0, 0 );
arr = this->GetCacheOrRead( infokey );
if ( arr )
......@@ -3573,7 +3582,6 @@ void vtkExodusIIReaderPrivate::PrintData( ostream& os, vtkIndent indent )
os << " " << this->Times[i];
}
os << "\n";
os << indent << "TimeStep: " << this->TimeStep << "\n";
os << indent << "HasModeShapes: " << this->HasModeShapes << "\n";
os << indent << "ModeShapeTime: " << this->ModeShapeTime << "\n";
os << indent << "AnimateModeShapes: " << this->AnimateModeShapes << "\n";
......@@ -4496,7 +4504,6 @@ void vtkExodusIIReaderPrivate::Reset()
this->ArrayInfo.clear();
this->ExodusVersion = -1.;
this->Times.clear();
this->TimeStep = 0;
memset( (void*)&this->ModelParameters, 0, sizeof(this->ModelParameters) );
// Don't clear file id since it's not part of meta-data that's read from the
......
......@@ -83,11 +83,6 @@ public:
*/
int GetNumberOfTimeSteps() { return (int) this->Times.size(); }
/// Return the current time step
vtkGetMacro(TimeStep,int);
/// Set the current time step for subsequent calls to RequestData().
vtkSetMacro(TimeStep,int);
/// Return whether subsequent RequestData() calls will produce the minimal
/// point set required to represent the output.
......@@ -770,8 +765,6 @@ protected:
/// A list of time steps for which results variables are stored.
std::vector<double> Times;
/// The current time step
int TimeStep;
/** The time value. This is used internally when HasModeShapes is true and
* ignored otherwise.
......
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