------------------------------------------------------------------------------
| 397 | |
| 398 | //------------------------------------------------------------------------------ |
| 399 | void vtkAMREnzoReader::GetAMRGridData(int blockIdx, vtkUniformGrid* block, const char* field) |
| 400 | { |
| 401 | assert("pre: AMR block is nullptr" && (block != nullptr)); |
| 402 | |
| 403 | this->Internal->GetBlockAttribute(field, blockIdx, block); |
| 404 | if (this->ConvertToCGS == 1) |
| 405 | { |
| 406 | double conversionFactor = this->GetConversionFactor(field); |
| 407 | if (conversionFactor != 1.0) |
| 408 | { |
| 409 | vtkDataArray* data = block->GetCellData()->GetArray(field); |
| 410 | assert("pre: data array is nullptr!" && (data != nullptr)); |
| 411 | |
| 412 | vtkIdType numTuples = data->GetNumberOfTuples(); |
| 413 | for (vtkIdType t = 0; t < numTuples; ++t) |
| 414 | { |
| 415 | int numComp = data->GetNumberOfComponents(); |
| 416 | for (int c = 0; c < numComp; ++c) |
| 417 | { |
| 418 | double f = data->GetComponent(t, c); |
| 419 | data->SetComponent(t, c, f * conversionFactor); |
| 420 | } // END for all components |
| 421 | } // END for all tuples |
| 422 | } // END if the conversion factor is not 1.0 |
| 423 | } // END if conversion to CGS units is requested |
| 424 | } |
| 425 | |
| 426 | //------------------------------------------------------------------------------ |
| 427 | void vtkAMREnzoReader::SetUpDataArraySelections() |
no test coverage detected