pysdic.Connectivity.copy#
- Connectivity.copy(copy_properties=True)[source]#
Create a copy of the current
Connectivityinstance.- Parameters:
copy_properties (
bool, optional) – IfTrue, the properties of the connectivity will also be copied to the new instance. Default isTrue.- Returns:
A new
Connectivityobject containing the same elements as the current instance.- Return type:
Examples
Creating a
Connectivityfrom 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()