correct names
This commit is contained in:
parent
4e9e55f3ac
commit
bc020a9580
|
@ -649,8 +649,8 @@ class Grid:
|
|||
"""
|
||||
v = VTK.from_image_data(self.cells,self.size,self.origin)\
|
||||
.add(self.material.flatten(order='F'),'material')
|
||||
for label,field in self.fields.items():
|
||||
v = v.add(field.flatten(order='F'),label)
|
||||
for label,data in self.ic.items():
|
||||
v = v.add(data.flatten(order='F'),label)
|
||||
v.comments = self.comments
|
||||
|
||||
v.save(fname,parallel=False,compress=compress)
|
||||
|
|
|
@ -88,10 +88,10 @@ class VTK:
|
|||
@property
|
||||
def comments(self) -> List[str]:
|
||||
"""Return the comments."""
|
||||
fielddata = self.vtk_data.GetFieldData()
|
||||
for a in range(fielddata.GetNumberOfArrays()):
|
||||
if fielddata.GetArrayName(a) == 'comments':
|
||||
comments = fielddata.GetAbstractArray(a)
|
||||
field_data = self.vtk_data.GetFieldData()
|
||||
for a in range(field_data.GetNumberOfArrays()):
|
||||
if field_data.GetArrayName(a) == 'comments':
|
||||
comments = field_data.GetAbstractArray(a)
|
||||
return [comments.GetValue(i) for i in range(comments.GetNumberOfValues())]
|
||||
return []
|
||||
|
||||
|
|
Loading…
Reference in New Issue