# When reading the CGNS file, an incorrect topology result was obtained, but there was no problem using Paraview to read it. What could be the reason for this?

**URL:** https://discourse.vtk.org/t/when-reading-the-cgns-file-an-incorrect-topology-result-was-obtained-but-there-was-no-problem-using-paraview-to-read-it-what-could-be-the-reason-for-this/14424
**Category:** Support
**Tags:** code
**Created:** [August 16, 2024, 11:40am UTC](https://discourse.vtk.org/t/when-reading-the-cgns-file-an-incorrect-topology-result-was-obtained-but-there-was-no-problem-using-paraview-to-read-it-what-could-be-the-reason-for-this/14424 "2024-08-16T11:40:11Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![realwhzc](https://discourse.vtk.org/user_avatar/discourse.vtk.org/realwhzc/32/9186_2.png) [@realwhzc](https://discourse.vtk.org/u/realwhzc)
#### Post date: [August 16, 2024, 11:40am UTC](https://discourse.vtk.org/t/when-reading-the-cgns-file-an-incorrect-topology-result-was-obtained-but-there-was-no-problem-using-paraview-to-read-it-what-could-be-the-reason-for-this/14424/1 "2024-08-16T11:40:11Z")

</div>

I use the following code to read CGNS files：

```auto
    vtkNew<vtkCGNSReader> reader;
    reader->SetFileName(toUTF8(filename).c_str());
    reader->UpdateInformation();
    reader->EnableAllBases();
    reader->EnableAllFamilies();
    reader->EnableAllCellArrays();
    reader->EnableAllPointArrays();
    reader->EnableAllFaceArrays();
    reader->Update();

    vtkDataObject* obj = vtkMultiBlockDataSet::SafeDownCast(reader->GetOutput()->GetBlock(0))->GetBlock(0);
    vtkUnstructuredGrid* grid = vtkUnstructuredGrid::New();
    grid->DeepCopy(obj);

```

Then use vtkDataSetMapper to render the vtkUnstructuredGrid object.  
**I got the following result：**

 ![vtk_result](https://discourse.vtk.org/uploads/default/original/2X/3/314183d40c1bd4a44010d0f169aaac3d562fc853.jpeg)

**As shown in the figure below, it is clear that the result obtained in ParaView is the correct one.**

 ![pv_result](https://discourse.vtk.org/uploads/default/original/2X/6/67d088488af01d5c5080617f5ff3273efd127c17.jpeg)

**I want to know what causes this discrepancy? How can I fix this error?**
