Commit 50850217 authored by Xavier Roynard's avatar Xavier Roynard Committed by Felipe Bordeu
Browse files

Update src/BasicTools/Bridges/CGNSBridge.py

parent fe0c1293
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -340,6 +340,11 @@ def MeshToCGNS( mesh: UnstructuredMesh, outputPyTree = None, baseNumberOrName=
            if pointData.dtype.char == "U":
                print(f"skipping nodeFields '{name}' because if of type: {pointData.dtype}"  )
                continue
            if name=='Normals':
                assert(pointData.shape[1] == mesh.GetPointsDimensionality())
                for i,coord in enumerate(coordNames):
                    NewDataArray(flowSolution, "Normals"+coord, np.copy(pointData[:,i]) )
            else:
                NewDataArray(flowSolution, name, pointData)

    ## elem fields
@@ -350,6 +355,11 @@ def MeshToCGNS( mesh: UnstructuredMesh, outputPyTree = None, baseNumberOrName=
            if cellData.dtype.char == "U":
                print(f"skipping elemFields '{name}' because if of type: {cellData.dtype}"  )
                continue
            if name=='Normals':
                assert(cellData.shape[1] == mesh.GetPointsDimensionality())
                for i,coord in enumerate(coordNames):
                    NewDataArray(flowSolutionCell, "Normals"+coord, np.copy(cellData[:,i]) )
            else:
                NewDataArray(flowSolutionCell, name, np.copy(cellData))