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

Method MakeMetaDataAtTimeStep

IO/Geometry/vtkOpenFOAMReader.cxx:6031–6225  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Create field data lists and cell/point array selection lists

Source from the content-addressed store, hash-verified

6029//------------------------------------------------------------------------------
6030// Create field data lists and cell/point array selection lists
6031int vtkOpenFOAMReaderPrivate::MakeMetaDataAtTimeStep(vtkStringArray* cellSelectionNames,
6032 vtkStringArray* pointSelectionNames, vtkStringArray* lagrangianSelectionNames,
6033 const bool listNextTimeStep, const bool skipComputingMetaData)
6034{
6035 vtkFoamDebug(<< "MakeMetaDataAtTimeStep (" << this->RegionName << "/" << this->ProcessorName
6036 << ")\n");
6037
6038 if (!this->HasPolyMesh())
6039 {
6040 // Ignore a region without a mesh, but will normally be precluded earlier
6041 vtkWarningMacro("Called MakeMetaDataAtTimeStep without a mesh.");
6042 return 1;
6043 }
6044
6045 // Track topology change
6046 const bool topoChanged = (this->TopologyTimeIndex < -1 ||
6047 (this->TopologyTimeIndex != this->PolyMeshTimeIndexFaces[this->TimeStep]));
6048 this->TopologyTimeIndex = this->PolyMeshTimeIndexFaces[this->TimeStep];
6049
6050 // Change in topology or selection, may need to update boundaries
6051 {
6052 auto& patches = this->BoundaryDict;
6053
6054 // User selection changed
6055 const bool selectChanged = topoChanged ||
6056 (this->Parent->PatchDataArraySelection->GetMTime() !=
6057 this->Parent->GetPatchSelectionMTimeOld());
6058
6059 bool addInternalSelection = false;
6060
6061 // Read contents of polyMesh/boundary to update patch definitions
6062 if (topoChanged)
6063 {
6064 patches.clearAll();
6065 const bool isSubRegion = !this->RegionName.empty();
6066 auto boundaryEntriesPtr(this->GetPolyMeshFile("boundary", isSubRegion));
6067
6068 if (boundaryEntriesPtr)
6069 {
6070 if (!patches.update(*boundaryEntriesPtr))
6071 {
6072 vtkErrorMacro(<< patches.error());
6073 return 0;
6074 }
6075
6076 // On topology change, add the internal mesh by default
6077 addInternalSelection = true;
6078 }
6079 else if (isSubRegion)
6080 {
6081 // Could be missing polyMesh/boundary for sub-region
6082 return 0;
6083 }
6084 }
6085
6086 // The internal mesh - set/check status
6087 if (selectChanged)
6088 {

Callers 4

RequestInformationMethod · 0.80
RequestDataMethod · 0.80
RequestInformationMethod · 0.80
RequestDataMethod · 0.80

Calls 15

HasPolyMeshMethod · 0.95
GetPolyMeshFileMethod · 0.95
RegionPrefixMethod · 0.95
CurrentTimePathMethod · 0.95
GetFieldNamesMethod · 0.95
RegionPathMethod · 0.95
TimePathMethod · 0.95
SortFieldFilesMethod · 0.95
AddSelectionNamesMethod · 0.95
clearSelectionsMethod · 0.80
enableGroupMethod · 0.80

Tested by

no test coverage detected