pysdic.Connectivity.from_npz#
- classmethod Connectivity.from_npz(filepath, load_properties=True)[source]#
Create a
Connectivityobject from a NumPy NPZ file.The NPZ file should contain an array named ‘elements’ with shape \((N_e, N_{vpe})\) representing the elements of the connectivity. Additional properties can be stored as separate arrays in the NPZ file.
See also
to_npz()method for saving the connectivity to a NPZ file.
- Parameters:
- Returns:
A
Connectivityobject containing the elements and properties read from the NPZ file.- Return type:
Examples
Creating a
Connectivityobject from a NPZ file.1from pysdic import Connectivity 2# Create a connectivity from a NPZ file 3connectivity = Connectivity.from_npz('path/to/connectivity.npz')
Now,
connectivityis aConnectivityobject containing the elements and properties read from the specified NPZ file.