------------------------------------------------------------------------------
| 849 | |
| 850 | //------------------------------------------------------------------------------ |
| 851 | void 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 | //------------------------------------------------------------------------------ |
| 896 | void vtkMFIXReader::ReadRestartFile() |
no test coverage detected