fixed leftover .add --> .set

This commit is contained in:
Philip Eisenlohr 2022-05-11 18:54:03 -04:00
parent 648d17d381
commit d18e36ecf0
2 changed files with 5 additions and 5 deletions

View File

@ -694,9 +694,9 @@ class Grid:
""" """
v = VTK.from_image_data(self.cells,self.size,self.origin)\ v = VTK.from_image_data(self.cells,self.size,self.origin)\
.add('material',self.material.flatten(order='F')) .set('material',self.material.flatten(order='F'))
for label,data in self.initial_conditions.items(): for label,data in self.initial_conditions.items():
v = v.add(label,data.flatten(order='F')) v = v.set(label,data.flatten(order='F'))
v.comments = self.comments v.comments = self.comments
v.save(fname,parallel=False,compress=compress) v.save(fname,parallel=False,compress=compress)
@ -745,7 +745,7 @@ class Grid:
""" """
VTK.from_image_data(self.cells,self.size,self.origin) \ VTK.from_image_data(self.cells,self.size,self.origin) \
.add('material',self.material.flatten('F'),) \ .set('material',self.material.flatten('F'),) \
.show('material',colormap) .show('material',colormap)

View File

@ -1627,7 +1627,7 @@ class Result:
for inc in util.show_progress(self.visible['increments']): for inc in util.show_progress(self.visible['increments']):
u = _read(f['/'.join([inc,'geometry','u_n' if mode.lower() == 'cell' else 'u_p'])]) u = _read(f['/'.join([inc,'geometry','u_n' if mode.lower() == 'cell' else 'u_p'])])
v = v.add('u',u) v = v.set('u',u)
for ty in ['phase','homogenization']: for ty in ['phase','homogenization']:
for field in self.visible['fields']: for field in self.visible['fields']:
@ -1654,7 +1654,7 @@ class Result:
outs[out][at_cell_ho[label]] = data[in_data_ho[label]] outs[out][at_cell_ho[label]] = data[in_data_ho[label]]
for label,dataset in outs.items(): for label,dataset in outs.items():
v = v.add(' / '.join(['/'.join([ty,field,label]),dataset.dtype.metadata['unit']]),dataset) v = v.set(' / '.join(['/'.join([ty,field,label]),dataset.dtype.metadata['unit']]),dataset)
v.save(f'{self.fname.stem}_inc{inc[10:].zfill(N_digits)}',parallel=parallel) v.save(f'{self.fname.stem}_inc{inc[10:].zfill(N_digits)}',parallel=parallel)