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

Method ReadFacesFile

IO/Geometry/vtkOpenFOAMReader.cxx:6760–6823  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6758// Return meshFaces
6759
6760vtkSmartPointer<vtkCellArray> vtkOpenFOAMReaderPrivate::ReadFacesFile(
6761 const std::string& timeRegionDir)
6762{
6763 // Assume failure
6764 this->NumFaces = 0;
6765 this->NumInternalFaces = 0;
6766
6767 vtkFoamIOobject io(this->CasePath, this->Parent);
6768
6769 // Read polyMesh/faces
6770 if (!io.OpenOrGzip(timeRegionDir + "/polyMesh/faces"))
6771 {
6772 vtkErrorMacro(<< "Error opening " << io.GetFileName() << ": " << io.GetError()
6773 << ". If you are trying to read a parallel decomposed case, "
6774 "set Case Type to Decomposed Case.");
6775#if VTK_OPENFOAM_TIME_PROFILING
6776 this->RequestDataTimeInMicroseconds += io.TimeInMicroseconds;
6777 this->RequestDataBytes += io.Bytes;
6778#endif
6779 return nullptr;
6780 }
6781
6782 vtkSmartPointer<vtkCellArray> meshFaces;
6783
6784 try
6785 {
6786 vtkFoamEntryValue dict(nullptr);
6787 dict.SetStreamOption(io);
6788
6789 if (io.GetClassName() == "faceCompactList")
6790 {
6791 dict.ReadCompactLabelListList(io);
6792 }
6793 else
6794 {
6795 dict.ReadLabelListList(io);
6796 }
6797#if VTK_OPENFOAM_TIME_PROFILING
6798 this->RequestDataTimeInMicroseconds += io.TimeInMicroseconds;
6799 this->RequestDataBytes += io.Bytes;
6800#endif
6801
6802 // Capture content
6803 meshFaces.TakeReference(dict.ReleasePtr<vtkCellArray>());
6804 }
6805 catch (const vtkFoamError& err)
6806 {
6807 vtkErrorMacro(<< "Error reading line " << io.GetLineNumber() << " of " << io.GetFileName()
6808 << ": " << err);
6809#if VTK_OPENFOAM_TIME_PROFILING
6810 this->RequestDataTimeInMicroseconds += io.TimeInMicroseconds;
6811 this->RequestDataBytes += io.Bytes;
6812#endif
6813
6814 return nullptr;
6815 }
6816
6817 if (meshFaces)

Callers 1

RequestDataMethod · 0.95

Calls 10

OpenOrGzipMethod · 0.80
ReadLabelListListMethod · 0.80
GetFileNameMethod · 0.45
GetErrorMethod · 0.45
SetStreamOptionMethod · 0.45
GetClassNameMethod · 0.45
TakeReferenceMethod · 0.45
GetLineNumberMethod · 0.45
GetNumberOfCellsMethod · 0.45

Tested by

no test coverage detected