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

Method SerializeSubExtent

Parallel/Core/vtkFieldDataSerializer.cxx:166–198  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

164
165//------------------------------------------------------------------------------
166void vtkFieldDataSerializer::SerializeSubExtent(
167 int subext[6], int gridExtent[6], vtkFieldData* fieldData, vtkMultiProcessStream& bytestream)
168{
169 if (fieldData == nullptr)
170 {
171 vtkGenericWarningMacro("Field data is nullptr!");
172 return;
173 }
174
175 // STEP 0: Write the number of arrays
176 bytestream << fieldData->GetNumberOfArrays();
177
178 if (fieldData->GetNumberOfArrays() == 0)
179 {
180 return;
181 }
182
183 // STEP 1: Loop through each array, extract the data within the subext
184 // and serialize it
185 for (int array = 0; array < fieldData->GetNumberOfArrays(); ++array)
186 {
187 vtkDataArray* dataArray = fieldData->GetArray(array);
188
189 // STEP 2: Extract the data within the requested sub-extent
190 vtkDataArray* subSet =
191 vtkFieldDataSerializer::ExtractSubExtentData(subext, gridExtent, dataArray);
192 assert("pre: subset array is nullptr!" && (subSet != nullptr));
193
194 // STEP 3: Serialize only a subset of the data
195 bytestream.Push(subSet);
196 subSet->Delete();
197 } // END for all arrays
198}
199
200//------------------------------------------------------------------------------
201void vtkFieldDataSerializer::DeSerializeToSubExtent(

Callers

nothing calls this directly

Calls 5

DeleteMethod · 0.65
assertFunction · 0.50
GetNumberOfArraysMethod · 0.45
GetArrayMethod · 0.45
PushMethod · 0.45

Tested by

no test coverage detected