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

Method GetBlockOfDoubles

IO/Geometry/vtkMFIXReader.cxx:785–815  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

783
784//------------------------------------------------------------------------------
785void vtkMFIXReader::GetBlockOfDoubles(istream& in, vtkDoubleArray* v, int n)
786{
787 constexpr int numberOfDoublesInBlock = 512 / sizeof(double);
788 double tempArray[numberOfDoublesInBlock];
789 int numberOfRecords;
790
791 if (n % numberOfDoublesInBlock == 0)
792 {
793 numberOfRecords = n / numberOfDoublesInBlock;
794 }
795 else
796 {
797 numberOfRecords = 1 + n / numberOfDoublesInBlock;
798 }
799
800 int c = 0;
801 for (int i = 0; i < numberOfRecords; ++i)
802 {
803 in.read((char*)&tempArray, 512);
804 for (int j = 0; j < numberOfDoublesInBlock; ++j)
805 {
806 if (c < n)
807 {
808 double temp = tempArray[j];
809 this->SwapDouble(temp);
810 v->InsertValue(c, temp);
811 ++c;
812 }
813 }
814 }
815}
816
817//------------------------------------------------------------------------------
818void vtkMFIXReader::GetBlockOfInts(istream& in, vtkIntArray* v, int n)

Callers 1

ReadRestartFileMethod · 0.95

Calls 3

SwapDoubleMethod · 0.95
readMethod · 0.45
InsertValueMethod · 0.45

Tested by

no test coverage detected