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

Method GetPointFieldAtTimeStep

IO/Geometry/vtkOpenFOAMReader.cxx:9608–9854  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Read point field at a timestep

Source from the content-addressed store, hash-verified

9606//------------------------------------------------------------------------------
9607// Read point field at a timestep
9608void vtkOpenFOAMReaderPrivate::GetPointFieldAtTimeStep(const std::string& varName)
9609{
9610 // Where to map data
9611 vtkUnstructuredGrid* internalMesh = this->InternalMesh;
9612 vtkMultiBlockDataSet* boundaryMesh = this->BoundaryMesh;
9613
9614 // Boundary information
9615 const auto& patches = this->BoundaryDict;
9616
9617 vtkFoamIOobject io(this->CasePath, this->Parent);
9618 vtkFoamDict dict;
9619 if (!this->ReadFieldFile(io, dict, varName, this->Parent->PointDataArraySelection))
9620 {
9621#if VTK_OPENFOAM_TIME_PROFILING
9622 this->RequestDataTimeInMicroseconds += io.TimeInMicroseconds;
9623 this->RequestDataBytes += io.Bytes;
9624#endif
9625 return;
9626 }
9627
9628 if (io.GetClassName().compare(0, 5, "point") != 0)
9629 {
9630 vtkErrorMacro(<< io.GetFileName() << " is not a pointField");
9631#if VTK_OPENFOAM_TIME_PROFILING
9632 this->RequestDataTimeInMicroseconds += io.TimeInMicroseconds;
9633 this->RequestDataBytes += io.Bytes;
9634#endif
9635 return;
9636 }
9637
9638 // Eg, from "pointScalarField" -> SCALAR_TYPE
9639 const auto fieldDataType(vtkFoamTypes::FieldToEnum(io.GetClassName(), 5));
9640
9641 // -------------------------
9642 // Handle dictionary lookups first
9643
9644 // The "dimensions" entry - stringify
9645 const std::string dimString(this->ConstructDimensions(dict));
9646
9647 // The "internalField" entry
9648 vtkFoamEntry* ifieldEntry = nullptr;
9649 {
9650 ifieldEntry = dict.Lookup("internalField");
9651 if (ifieldEntry == nullptr)
9652 {
9653 vtkErrorMacro(<< "internalField not found in " << io.GetFileName());
9654#if VTK_OPENFOAM_TIME_PROFILING
9655 this->RequestDataTimeInMicroseconds += io.TimeInMicroseconds;
9656 this->RequestDataBytes += io.Bytes;
9657#endif
9658 return;
9659 }
9660 else if (ifieldEntry->FirstValue().GetType() == vtkFoamToken::EMPTYLIST)
9661 {
9662 if (this->NumPoints)
9663 {
9664 vtkErrorMacro(<< "internalField of " << io.GetFileName() << " is empty");
9665#if VTK_OPENFOAM_TIME_PROFILING

Callers 1

RequestDataMethod · 0.95

Calls 15

ReadFieldFileMethod · 0.95
ConstructDimensionsMethod · 0.95
FillFieldMethod · 0.95
Is64BitArrayFunction · 0.85
GetLabelValueFunction · 0.85
AddArrayToFieldDataFunction · 0.85
LookupMethod · 0.80
GetDataSizeMethod · 0.80
isActiveMethod · 0.80
GetBlockMethod · 0.80
NewFunction · 0.50
compareMethod · 0.45

Tested by

no test coverage detected