mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 05:35:49 -04:00
Avoid high memory use when writing unstructured mesh VTK files (#2806)
This commit is contained in:
parent
3efd24289d
commit
fb65dfd53c
1 changed files with 2 additions and 5 deletions
|
|
@ -2181,7 +2181,6 @@ class UnstructuredMesh(MeshBase):
|
|||
grid.SetPoints(vtk_pnts)
|
||||
|
||||
n_skipped = 0
|
||||
elems = []
|
||||
for elem_type, conn in zip(self.element_types, self.connectivity):
|
||||
if elem_type == self._LINEAR_TET:
|
||||
elem = vtk.vtkTetra()
|
||||
|
|
@ -2195,15 +2194,13 @@ class UnstructuredMesh(MeshBase):
|
|||
if c == -1:
|
||||
break
|
||||
elem.GetPointIds().SetId(i, c)
|
||||
elems.append(elem)
|
||||
|
||||
grid.InsertNextCell(elem.GetCellType(), elem.GetPointIds())
|
||||
|
||||
if n_skipped > 0:
|
||||
warnings.warn(f'{n_skipped} elements were not written because '
|
||||
'they are not of type linear tet/hex')
|
||||
|
||||
for elem in elems:
|
||||
grid.InsertNextCell(elem.GetCellType(), elem.GetPointIds())
|
||||
|
||||
# check that datasets are the correct size
|
||||
datasets_out = []
|
||||
if datasets is not None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue