Skip to content

Commit 53d0ded

Browse files
author
davidcorteso
committed
Fixed VTK saving. The save_vtk option needs to be simplified further
1 parent 74cbb14 commit 53d0ded

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

fidimag/common/neb_spherical.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,8 +548,22 @@ def save_vtks(self):
548548

549549
self.coords.shape = (self.total_image_num, -1)
550550

551+
# We use Ms from the simulation assuming that all the
552+
# images are the same
551553
for i in range(self.total_image_num):
552-
self.vtk.save_vtk(spherical2cartesian(self.coords[i]), step=i, vtkname='m')
554+
# We will try to save for the micromagnetic simulation (Ms)
555+
# or an atomistic simulation (mu_s)
556+
# TODO: maybe this can be done with an: isinstance
557+
try:
558+
self.vtk.save_vtk(spherical2cartesian(self.coords[i]).reshape(-1, 3),
559+
self.sim.Ms,
560+
step=i,
561+
vtkname='m')
562+
except:
563+
self.vtk.save_vtk(spherical2cartesian(self.coords[i]).reshape(-1, 3),
564+
self.sim._mu_s,
565+
step=i,
566+
vtkname='m')
553567

554568
self.coords.shape = (-1, )
555569

0 commit comments

Comments
 (0)