diff --git a/IO/CGNS/vtkCONVERGECFDCGNSReader.cxx b/IO/CGNS/vtkCONVERGECFDCGNSReader.cxx index 1251ed3b3c0c3664350f6628776195754aa17905..4a87762f8561f4125950be463a077f5889f44bb3 100644 --- a/IO/CGNS/vtkCONVERGECFDCGNSReader.cxx +++ b/IO/CGNS/vtkCONVERGECFDCGNSReader.cxx @@ -307,6 +307,10 @@ int vtkCONVERGECFDCGNSReader::RequestData(vtkInformation* vtkNotUsed(request), // Retrieve collection assembly so parcels can be added vtkDataAssembly* hierarchy = cgnsOutput->GetDataAssembly(); + // change root node name to "assembly" + hierarchy->SetRootNodeName("assembly"); + hierarchy->SetAttribute(vtkDataAssembly::GetRootNode(), "label", "assembly"); + // Use CGIO routine to find the zones int cgioId = 0; if (cgio_open_file(this->FileName.c_str(), CGIO_MODE_READ, CG_FILE_NONE, &cgioId) != CG_OK) @@ -396,6 +400,31 @@ int vtkCONVERGECFDCGNSReader::RequestData(vtkInformation* vtkNotUsed(request), continue; } + const auto zoneChildren = hierarchy->GetChildNodes(zoneAssemblyId); + for (const auto zoneChild : zoneChildren) + { + const auto childName = hierarchy->GetNodeName(zoneChild); + // 1) change the name of the "Internal" node to "Mesh" + if (strcmp(childName, "Internal") == 0) + { + hierarchy->SetNodeName(zoneChild, "Mesh"); + hierarchy->SetAttribute(zoneChild, "label", "Mesh"); + // also change the vtkCompositeDataSet::NAME() metadata + unsigned int partitionedDataSetId = hierarchy->GetDataSetIndices(zoneChild).front(); + if (cgnsOutput->HasMetaData(partitionedDataSetId) && + cgnsOutput->GetMetaData(partitionedDataSetId)->Has(vtkCompositeDataSet::NAME())) + { + cgnsOutput->GetMetaData(partitionedDataSetId)->Set(vtkCompositeDataSet::NAME(), "Mesh"); + } + } + // 2) change the name of the "Patches" node to "Surfaces" + else if (strcmp(childName, "Patches") == 0) + { + hierarchy->SetNodeName(zoneChild, "Surfaces"); + hierarchy->SetAttribute(zoneChild, "label", "Surfaces"); + } + } + // Search for UserDefinedData_t child nodes named "PARCEL_DATA" in current zone std::vector<double> zoneChildIds; CGNSRead::getNodeChildrenId(cgioId, baseChildId, zoneChildIds);