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

Method GetPolyMeshFile

IO/Geometry/vtkOpenFOAMReader.cxx:10139–10184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10137// Read specified file (typeName) from polyMesh directory as dictionary
10138
10139std::unique_ptr<vtkFoamDict> vtkOpenFOAMReaderPrivate::GetPolyMeshFile(
10140 const std::string& typeName, bool mandatory)
10141{
10142 const std::string timeRegionDir(this->CurrentTimeRegionPath(this->PolyMeshTimeIndexFaces));
10143
10144 vtkFoamIOobject io(this->CasePath, this->Parent);
10145 if (!io.OpenOrGzip(timeRegionDir + "/polyMesh/" + typeName))
10146 {
10147 if (mandatory)
10148 {
10149 vtkErrorMacro(<< "Error opening " << io.GetFileName() << ": " << io.GetError());
10150 }
10151#if VTK_OPENFOAM_TIME_PROFILING
10152 this->RequestDataTimeInMicroseconds += io.TimeInMicroseconds;
10153 this->RequestDataBytes += io.Bytes;
10154#endif
10155 return nullptr;
10156 }
10157
10158 std::unique_ptr<vtkFoamDict> dictPtr(new vtkFoamDict);
10159 vtkFoamDict& dict = *dictPtr;
10160 if (!dict.Read(io))
10161 {
10162 vtkErrorMacro(<< "Error reading line " << io.GetLineNumber() << " of " << io.GetFileName()
10163 << ": " << io.GetError());
10164#if VTK_OPENFOAM_TIME_PROFILING
10165 this->RequestDataTimeInMicroseconds += io.TimeInMicroseconds;
10166 this->RequestDataBytes += io.Bytes;
10167#endif
10168 return nullptr;
10169 }
10170 if (dict.GetType() != vtkFoamToken::DICTIONARY)
10171 {
10172 vtkErrorMacro(<< "The file type of " << io.GetFileName() << " is not a dictionary");
10173#if VTK_OPENFOAM_TIME_PROFILING
10174 this->RequestDataTimeInMicroseconds += io.TimeInMicroseconds;
10175 this->RequestDataBytes += io.Bytes;
10176#endif
10177 return nullptr;
10178 }
10179#if VTK_OPENFOAM_TIME_PROFILING
10180 this->RequestDataTimeInMicroseconds += io.TimeInMicroseconds;
10181 this->RequestDataBytes += io.Bytes;
10182#endif
10183 return dictPtr;
10184}
10185
10186//------------------------------------------------------------------------------
10187// Populate cell zone(s) mesh

Callers 4

GetCellZoneMeshMethod · 0.95
GetFaceZoneMeshMethod · 0.95
GetPointZoneMeshMethod · 0.95

Calls 7

CurrentTimeRegionPathMethod · 0.95
OpenOrGzipMethod · 0.80
GetFileNameMethod · 0.45
GetErrorMethod · 0.45
ReadMethod · 0.45
GetLineNumberMethod · 0.45
GetTypeMethod · 0.45

Tested by

no test coverage detected