CGNSReader#
- class CGNSReader(*args, **kwargs)[source]#
CGNS Reader for .cgns files.
Creates a multi-block dataset and reads unstructured grids and structured meshes from binary files stored in CGNS file format, with data stored at the nodes, cells, or faces.
By default, all point and cell arrays are loaded as well as the boundary patch. This varies from VTK’s defaults. For more details, see vtkCGNSReader.
Examples#
Download Python source code | Download Jupyter notebook
Load a CGNS file. All arrays are loaded by default.
>>> import pyvista as pv
>>> from pyvista import examples
>>> filename = examples.download_cgns_multi(load=False)
>>> reader = pv.CGNSReader(filename)
>>> reader.load_boundary_patch = False
>>> ds = reader.read()
>>> ds[0][0].cell_data
pyvista DataSetAttributes
Association : CELL
Active Scalars : None
Active Vectors : Momentum
Active Texture : None
Active Normals : None
Contains arrays :
Density float64 (2928,)
Momentum float64 (2928, 3) VECTORS
EnergyStagnationDensity float64 (2928,)
ViscosityEddy float64 (2928,)
TurbulentDistance float64 (2928,)
TurbulentSANuTilde float64 (2928,)
Used In#
Docstring Examples
CGNSReader.disable_all_bases(1 use)CGNSReader.disable_all_families(1 use)CGNSReader.distribute_blocks(1 use)CGNSReader.enable_all_bases(1 use)CGNSReader.enable_all_families(1 use)CGNSReader.load_boundary_patch(1 use)CGNSReader.unsteady_pattern(1 use)CGNSReader.vector_3d(1 use)
Inheritance#
Inherited members are documented on BaseReader, _FileIOBase, PointCellDataSelection.
See them all under Inherited Attributes and Inherited Methods.
Attributes#
Return the list of all base array names. |
|
Distribute each block in each zone across ranks. |
|
Return the list of all family array names. |
|
Return or set loading boundary patches. |
|
Return the number of base arrays. |
|
Return the number of family arrays. |
|
Return or set using an unsteady pattern. |
|
Return or set adding an empty dimension to vectors in case of 2D solutions. |
Inherited Attributes#
Return the status of all cell arrays. |
|
Return the status of all point arrays. |
|
Return the list of all cell array names. |
|
Return mapping from regex pattern matching associated with this class. |
|
Return the file extensions associated with this class. |
|
Return the number of cell arrays. |
|
Return the number of point arrays. |
|
Return or set the filename or directory of the reader. |
|
Return the list of all point array names. |
|
Return the vtk Reader object. |
Methods#
Get status of base array with name. |
|
Disable reading all bases. |
|
Disable reading all families. |
|
Enable reading all bases. |
|
Enable reading all families. |
|
Get status of family array with name. |
Inherited Methods#
Get status of cell array with name. |
|
Disable all cell arrays. |
|
Disable all point arrays. |
|
Disable cell array with name. |
|
Disable point array with name. |
|
Enable all cell arrays. |
|
Enable all point arrays. |
|
Enable cell array with name. |
|
Enable point array with name. |
|
Hide the progress bar when loading the file. |
|
Get status of point array with name. |
|
Read data in file. |
|
Show a progress bar when loading the file. |