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

Method GetBlockOfInts

IO/Geometry/vtkMFIXReader.cxx:818–848  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

816
817//------------------------------------------------------------------------------
818void vtkMFIXReader::GetBlockOfInts(istream& in, vtkIntArray* v, int n)
819{
820 constexpr int numberOfIntsInBlock = 512 / sizeof(int);
821 int tempArray[numberOfIntsInBlock];
822 int numberOfRecords;
823
824 if (n % numberOfIntsInBlock == 0)
825 {
826 numberOfRecords = n / numberOfIntsInBlock;
827 }
828 else
829 {
830 numberOfRecords = 1 + n / numberOfIntsInBlock;
831 }
832
833 int c = 0;
834 for (int i = 0; i < numberOfRecords; ++i)
835 {
836 in.read((char*)&tempArray, 512);
837 for (int j = 0; j < numberOfIntsInBlock; ++j)
838 {
839 if (c < n)
840 {
841 int temp = tempArray[j];
842 this->SwapInt(temp);
843 v->InsertValue(c, temp);
844 ++c;
845 }
846 }
847 }
848}
849
850//------------------------------------------------------------------------------
851void vtkMFIXReader::GetBlockOfFloats(istream& in, vtkFloatArray* v, int n)

Callers 1

ReadRestartFileMethod · 0.95

Calls 3

SwapIntMethod · 0.95
readMethod · 0.45
InsertValueMethod · 0.45

Tested by

no test coverage detected