cfdm.CellConnectivity.get_connectivity

CellConnectivity.get_connectivity(default=ValueError())[source]

Return the connectivity type.

The connectivity type describes a characteristic of inter-cell connectivity defined by the domain topology construct. It may take any value, but the following values are standardised:

  • 'node': Edge or face cells connected by one or more

    shared nodes.

  • 'edge': Face cells connected by one or more shared

    edges.

See set_connectivity for the connectivity type definitions.

New in version (cfdm): 1.11.0.0

Parameters
default: optional

Return the value of the default parameter if the connectivity has not been set.

If set to an Exception instance then it will be raised instead.

Returns

The value of the connectivity.

Examples

>>>
>>> d = cfdm.CellConnectivity()
>>> d.has_connectivity()
False
>>> d.set_connectivity('face')
>>> d.has_connectivity()
True
>>> d.get_connectivity()
'face'
>>> d.del_connectivity()
'face'
>>> d.get_connectivity()
Traceback (most recent call last):
    ...
ValueError: CellConnectivity has no 'connectivity' component
>>> print(d.get_connectivity(None))
None