plaid.utils.cgns_vtk¶
plaid.utils.cgns_vtk
¶
Direct CGNS -> VTK conversion functions.
This fuction do not require any class of plaid. Please keep this module free of plaid dependencies to make it usable in the ParaView plugin without forcing users to install plaid.
plaid.utils.cgns_vtk.CGNSBaseExtractGlobals
¶
Extract global fields from a CGNSBase_t node as a dictionary of name -> numpy array.
Parameters:
-
baseNode(list) –CGNS
CGNSBase_tnode.
Returns:
-
dict(dict) –A dictionary mapping field names to numpy arrays.
Source code in plaid/utils/cgns_vtk.py
plaid.utils.cgns_vtk.CGNSTreeToVtk
¶
Convert a full CGNS tree to VTK objects, one per base, and return either the single base or a multi-block of bases.
Parameters:
-
treeNode(list) –CGNS tree as read by cgns_tree_from_json_payload.
Returns:
-
Any–vtkStructuredGrid, vtkUnstructuredGrid, or vtkMultiBlockDataSet: the VTK
-
Any–representation of the tree. A single-zone base returns the zone object;
-
Any–a multi-zone base returns one block per zone; a multi-base tree returns
-
Any–one block per base.
Source code in plaid/utils/cgns_vtk.py
plaid.utils.cgns_vtk.CGNSBaseToVtk
¶
Convert a CGNSBase_t node directly to a VTK object.
This function intentionally bypasses Muscat mesh/conversion functions. It reads the CGNS/Python tree node lists directly and creates native VTK data objects using only VTK and NumPy.
Parameters:
-
baseNode(list) –CGNS
CGNSBase_tnode.
Returns:
-
Any–vtkStructuredGrid, vtkUnstructuredGrid, or vtkMultiBlockDataSet: the VTK
-
Any–representation of the base. A single-zone base returns the zone object;
-
Any–a multi-zone base returns one block per zone.