Skip to content
This repository has been archived by the owner on Apr 23, 2021. It is now read-only.

Commit

Permalink
update_cell call corrected
Browse files Browse the repository at this point in the history
  • Loading branch information
khiltunen committed Oct 29, 2015
1 parent 9509367 commit 7bc6c1b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions foam_internalwrapper/foam_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def __init__(self, name, BC, mesh=None, path=None):
foamface.createDefaultFields(name, 'pimpleFoam')

# write possible cell data to time directory
self.update_cells(list(mesh.iter_cells()))
self.update_cells(mesh.iter_cells())

def get_point(self, uuid):
""" Returns a point with a given uuid.
Expand Down Expand Up @@ -421,7 +421,8 @@ def update_cells(self, cells):
# if cell data does not exists in the mesh at all, initialize it
newDataNames = []
dataNameKeyMap = {}
for cell in cells:
cellList = list(cells)
for cell in cellList:
for data in cell.data:
if data not in dataNameMap:
error_str = "Data named "+data+" not supported"
Expand All @@ -434,7 +435,7 @@ def update_cells(self, cells):
for dataName in newDataNames:
create_dummy_celldata(self.name, dataName)

for cell in cells:
for cell in cellList:
if cell.uid not in self._uuidToFoamLabel:
error_str = "Trying to update a non-existing cell with uuid: "\
+ str(cell.uid)
Expand All @@ -448,7 +449,7 @@ def update_cells(self, cells):
if set(puids) != set(cell.points):
raise Warning("Cell points can't be updated")

set_cells_data(self.name, cells, self._uuidToFoamLabel,
set_cells_data(self.name, cellList, self._uuidToFoamLabel,
dataNameKeyMap)

def iter_points(self, point_uuids=None):
Expand Down

0 comments on commit 7bc6c1b

Please sign in to comment.