Commit a25141b8 authored by Andreas Dedner's avatar Andreas Dedner

fix a bug with a None function passed to vtk writer

parent 7148e801
Pipeline #14466 passed with stage
in 10 minutes and 18 seconds
......@@ -53,11 +53,14 @@ def writeVTK(grid, name, celldata=None, pointdata=None, cellvector=None, pointve
vtk = grid.vtkWriter() if subsampling is None else grid.vtkWriter(subsampling)
def addDataToVTKWriter(dataFunctions, dataName, dataTag):
if dataFunctions is None: return
if isinstance(dataFunctions, dict):
for n, f in dataFunctions.items():
if f is None: continue
_writeVTK(vtk,grid,f,n,dataTag)
elif isinstance(dataFunctions, list):
for f in dataFunctions:
if f is None: continue
try:
_writeVTK(vtk,grid,f,f.name,dataTag)
except AttributeError:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment