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

Method GetBlockOfFloats

IO/Geometry/vtkMFIXReader.cxx:851–893  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

849
850//------------------------------------------------------------------------------
851void vtkMFIXReader::GetBlockOfFloats(istream& in, vtkFloatArray* v, int n)
852{
853 constexpr int numberOfFloatsInBlock = 512 / sizeof(float);
854 float tempArray[numberOfFloatsInBlock];
855 int numberOfRecords;
856
857 if (n % numberOfFloatsInBlock == 0)
858 {
859 numberOfRecords = n / numberOfFloatsInBlock;
860 }
861 else
862 {
863 numberOfRecords = 1 + n / numberOfFloatsInBlock;
864 }
865
866 bool modified = false;
867 int c = 0;
868 int cnt = 0;
869 for (int i = 0; i < numberOfRecords; ++i)
870 {
871 in.read((char*)&tempArray, 512);
872 for (int j = 0; j < numberOfFloatsInBlock; ++j)
873 {
874 if (c < n)
875 {
876 float temp = tempArray[j];
877 this->SwapFloat(temp);
878 if (this->Flag->GetValue(c) < 10)
879 {
880 v->InsertValue(cnt, temp);
881 cnt++;
882 modified = true;
883 }
884 ++c;
885 }
886 }
887 }
888
889 if (modified)
890 {
891 v->Modified();
892 }
893}
894
895//------------------------------------------------------------------------------
896void vtkMFIXReader::ReadRestartFile()

Callers 1

GetVariableAtTimestepMethod · 0.95

Calls 5

SwapFloatMethod · 0.95
readMethod · 0.45
GetValueMethod · 0.45
InsertValueMethod · 0.45
ModifiedMethod · 0.45

Tested by

no test coverage detected