MCPcopy Create free account
hub / github.com/Kitware/VTK / AddTimeStep

Method AddTimeStep

Filters/General/vtkGroupTimeStepsFilter.cxx:142–161  ·  view source on GitHub ↗

----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

140
141//----------------------------------------------------------------------------
142bool vtkGroupTimeStepsFilter::AddTimeStep(
143 double vtkNotUsed(time), int timeStep, vtkDataObject* data)
144{
145 auto pdc = vtkPartitionedDataSetCollection::SafeDownCast(this->AccumulatedData);
146 if (!pdc)
147 {
148 vtkErrorMacro("Mismatched output type was created. Did data type change between timesteps?");
149 return false;
150 }
151
152 const auto idx = pdc->GetNumberOfPartitionedDataSets();
153 pdc->SetPartition(idx, 0, data);
154
155 const auto name = "timestep" + vtk::to_string(timeStep);
156 auto assembly = pdc->GetDataAssembly();
157 auto node = assembly->AddNode(name.c_str());
158 assembly->AddDataSetIndex(node, idx);
159 pdc->GetMetaData(idx)->Set(vtkCompositeDataSet::NAME(), name.c_str());
160 return true;
161}
162
163//----------------------------------------------------------------------------
164bool vtkGroupTimeStepsFilter::AddTimeStep(

Callers 1

RequestDataMethod · 0.95

Calls 15

GetDataAssemblyMethod · 0.80
AddDataSetIndexMethod · 0.80
SetPartitionedDataSetMethod · 0.80
GetPartitionedDataSetMethod · 0.80
AddDataSetIndexRangeMethod · 0.80
AddSubtreeMethod · 0.80
SetBlockMethod · 0.80
to_stringFunction · 0.50
SetPartitionMethod · 0.45
AddNodeMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected