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

Method GetAMRGridData

IO/AMR/vtkAMREnzoReader.cxx:399–424  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

397
398//------------------------------------------------------------------------------
399void 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//------------------------------------------------------------------------------
427void vtkAMREnzoReader::SetUpDataArraySelections()

Callers 1

GetAMRDataMethod · 0.45

Calls 9

GetConversionFactorMethod · 0.95
assertFunction · 0.50
GetBlockAttributeMethod · 0.45
GetArrayMethod · 0.45
GetCellDataMethod · 0.45
GetNumberOfTuplesMethod · 0.45
GetNumberOfComponentsMethod · 0.45
GetComponentMethod · 0.45
SetComponentMethod · 0.45

Tested by

no test coverage detected