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

Method ReadFieldFile

IO/Geometry/vtkOpenFOAMReader.cxx:8788–8821  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

8786
8787//------------------------------------------------------------------------------
8788bool vtkOpenFOAMReaderPrivate::ReadFieldFile(vtkFoamIOobject& io, vtkFoamDict& dict,
8789 const std::string& varName, const vtkDataArraySelection* selection)
8790{
8791 const std::string varPath(this->CurrentTimeRegionPath() + "/" + varName);
8792
8793 // Open the file
8794 if (!io.Open(varPath))
8795 {
8796 vtkErrorMacro(<< "Error opening " << io.GetFileName() << ": " << io.GetError());
8797 return false;
8798 }
8799
8800 // if the variable is disabled on selection panel then skip it
8801 if (selection->ArrayExists(io.GetObjectName().c_str()) &&
8802 !selection->ArrayIsEnabled(io.GetObjectName().c_str()))
8803 {
8804 return false;
8805 }
8806
8807 // Read the field file into dictionary
8808 if (!dict.Read(io))
8809 {
8810 vtkErrorMacro(<< "Error reading line " << io.GetLineNumber() << " of " << io.GetFileName()
8811 << ": " << io.GetError());
8812 return false;
8813 }
8814
8815 if (dict.GetType() != vtkFoamToken::DICTIONARY)
8816 {
8817 vtkErrorMacro(<< "File " << io.GetFileName() << "is not valid as a field file");
8818 return false;
8819 }
8820 return true;
8821}
8822
8823//------------------------------------------------------------------------------
8824vtkSmartPointer<vtkFloatArray> vtkOpenFOAMReaderPrivate::FillField(vtkFoamEntry& entry,

Callers 3

GetVolFieldAtTimeStepMethod · 0.95

Calls 11

CurrentTimeRegionPathMethod · 0.95
OpenMethod · 0.45
GetFileNameMethod · 0.45
GetErrorMethod · 0.45
ArrayExistsMethod · 0.45
c_strMethod · 0.45
GetObjectNameMethod · 0.45
ArrayIsEnabledMethod · 0.45
ReadMethod · 0.45
GetLineNumberMethod · 0.45
GetTypeMethod · 0.45

Tested by

no test coverage detected