Skip to content

Commit

Permalink
vtk: removed dependence of saver on mesh classes; changed to mesh typ…
Browse files Browse the repository at this point in the history
…e string
  • Loading branch information
davidcortesortuno committed Feb 1, 2024
1 parent d72295e commit f5738e8
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions fidimag/common/vtk.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import os
import pyvtk
from fidimag.common import CuboidMesh
from fidimag.atomistic.hexagonal_mesh import HexagonalMesh
import sys

log = pyvtk.logging.getLogger(pyvtk.__name__)
log.setLevel(pyvtk.logging.ERROR)
Expand All @@ -14,10 +11,10 @@ def __init__(self, mesh, header="", directory=".", filename="unnamed"):
self.directory = directory
self.filename = filename

if isinstance(mesh, HexagonalMesh):
if mesh.mesh_type == 'hexagonal':
structure = pyvtk.PolyData(points=mesh.vertices,
polygons=mesh.hexagons)
elif isinstance(mesh, CuboidMesh):
elif mesh.mesh_type == 'cuboid':
# for keyword argument dimensions: if the mesh is made up of
# nx * ny * nz cells, it has (nx + 1) * (ny + 1) * (nz + 1)
# vertices.
Expand Down

0 comments on commit f5738e8

Please sign in to comment.