------------------------------------------------------------------------------
| 783 | |
| 784 | //------------------------------------------------------------------------------ |
| 785 | void 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 | //------------------------------------------------------------------------------ |
| 818 | void vtkMFIXReader::GetBlockOfInts(istream& in, vtkIntArray* v, int n) |
no test coverage detected