File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
pyiron_atomistics/atomistics/structure Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -3088,6 +3088,13 @@ def ase_to_pyiron(ase_obj):
3088
3088
)
3089
3089
else :
3090
3090
warnings .warn ("Unsupported ASE constraint: " + constraint_dict ["name" ])
3091
+ if not np .all (
3092
+ np .isclose (
3093
+ ase_obj .get_velocities (),
3094
+ np .array ([[0.0 , 0.0 , 0.0 ]] * len (ase_obj )),
3095
+ )
3096
+ ):
3097
+ pyiron_atoms .set_velocities (ase_obj .get_velocities ())
3091
3098
return pyiron_atoms
3092
3099
3093
3100
@@ -3156,6 +3163,8 @@ def pyiron_to_ase(pyiron_obj):
3156
3163
"Selective Dynamics Error: " + str (k ) + ": " + str (v )
3157
3164
)
3158
3165
atoms .set_constraint (constraints_lst )
3166
+ if pyiron_obj .velocities is not None :
3167
+ atoms .set_velocities (pyiron_obj .velocities )
3159
3168
return atoms
3160
3169
3161
3170
You can’t perform that action at this time.
0 commit comments