Skip to content

Commit 86b987a

Browse files
authored
Merge pull request #17 from chahak13/dvol_strain
Add dvolumetric strain to Particle init
2 parents 2c170d5 + 6628dd6 commit 86b987a

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
@@ -66,6 +66,7 @@ def __init__(
6666
self.f_ext = jnp.zeros_like(self.loc)
6767
self.traction = jnp.zeros_like(self.loc)
6868
self.reference_loc = jnp.zeros_like(self.loc)
69+
self.dvolumetric_strain = jnp.zeros((self.loc.shape[0], 1))
6970
self.volumetric_strain_centroid = jnp.zeros((self.loc.shape[0], 1))
7071
else:
7172
(
@@ -83,6 +84,7 @@ def __init__(
8384
self.f_ext,
8485
self.traction,
8586
self.reference_loc,
87+
self.dvolumetric_strain,
8688
self.volumetric_strain_centroid,
8789
) = data
8890
self.initialized = True
@@ -106,6 +108,7 @@ def tree_flatten(self):
106108
self.f_ext,
107109
self.traction,
108110
self.reference_loc,
111+
self.dvolumetric_strain,
109112
self.volumetric_strain_centroid,
110113
)
111114
aux_data = (self.material,)

0 commit comments

Comments
 (0)