pysdic.Connectivity.copy#

Connectivity.copy(copy_properties=True)[source]#

Create a copy of the current Connectivity instance.

Parameters:

copy_properties (bool, optional) – If True, the properties of the connectivity will also be copied to the new instance. Default is True.

Returns:

A new Connectivity object containing the same elements as the current instance.

Return type:

Connectivity

Examples

Creating a Connectivity from a random NumPy array and making a copy.

1import numpy as np
2from pysdic import Connectivity
3
4# Create a random connectivity with 100 elements
5random_elements = np.random.randint(0, 100, size=(100, 3))  # shape (100, 3)
6connectivity1 = Connectivity.from_array(random_elements)
7
8# Create a copy of the existing Connectivity object
9connectivity2 = connectivity1.copy()