Skip to content

Commit 6628dd6

Browse files
committed
Add dvolumetric strain to Particle init
1 parent c6291cc commit 6628dd6

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

diffmpm/particle.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ def __init__(
6464
self.dstrain = jnp.zeros((self.loc.shape[0], 6, 1))
6565
self.f_ext = jnp.zeros_like(self.loc)
6666
self.reference_loc = jnp.zeros_like(self.loc)
67+
self.dvolumetric_strain = jnp.zeros((self.loc.shape[0], 1))
6768
self.volumetric_strain_centroid = jnp.zeros((self.loc.shape[0], 1))
6869
else:
6970
(
@@ -79,6 +80,7 @@ def __init__(
7980
self.dstrain,
8081
self.f_ext,
8182
self.reference_loc,
83+
self.dvolumetric_strain,
8284
self.volumetric_strain_centroid,
8385
) = data
8486
self.initialized = True
@@ -100,6 +102,7 @@ def tree_flatten(self):
100102
self.dstrain,
101103
self.f_ext,
102104
self.reference_loc,
105+
self.dvolumetric_strain,
103106
self.volumetric_strain_centroid,
104107
)
105108
aux_data = (self.material,)

0 commit comments

Comments
 (0)