From 0c2db9fa7992231f7e0a959ad39ab1d819082494 Mon Sep 17 00:00:00 2001 From: Michael Krayer Date: Mon, 9 Aug 2021 18:03:17 +0200 Subject: [PATCH] some bugfixes. tested against spherical shell --- field.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/field.py b/field.py index 1a02636..7ad0200 100644 --- a/field.py +++ b/field.py @@ -787,24 +787,24 @@ class Features3d: return @property - def faces(self): return np.split(self._faces,self.offset) + def faces(self): return np.split(self._faces,self._offset) @property def points(self): return self._points @property - def cell_areas(self): return np.split(self._cellarea,self.offset) + def cell_areas(self): return np.split(self._cell_areas,self._offset) @property - def cell_volumes(self): return np.split(self._cellvol,self.offset) + def cell_volumes(self): return np.split(self._cell_volumes,self._offset) def area(self,feature): '''Returns the surface area of feature. If feature is None, total surface area of all features is returned.''' - if label is None: + if feature is None: return np.sum(self._cell_areas) else: - return np.sum(self.cell_areas[label-1]) + return np.sum(self.cell_areas[feature-1]) def areas(self): '''Returns a tuple with surface areas of all features.''' @@ -817,7 +817,7 @@ class Features3d: if self._faces is None: self.triangulate(contour_method=self.__TRI_CONTMETH, cellvol_normal_component=self.__TRI_NORMCOMP) - if label is None: + if feature is None: return np.sum(self._cell_volumes) else: return np.sum(self.cell_volumes[feature-1])