XDMF write_checkpoint leads to segfault in paraview
To reproduce,
import dolfin
from dolfin import *
mesh = UnitSquareMesh(10,10)
DG1 = FunctionSpace(mesh,'DG', 1)
class Step(UserExpression):
def __init__(self, mesh, *args, **kwargs):
super().__init__(*args, **kwargs)
self.mesh = mesh
def eval_cell(self, values, x, cell):
c = Cell(self.mesh, cell.index)
p = c.midpoint()
if p[0] <= 0.5:
values[0] = 0.0
elif p[0] >= 0.5:
values[0] = 1.0
step = Step(mesh, domain=mesh, element=DG1.ufl_element())
f = Function(DG1)
f.interpolate(step)
file = XDMFFile("step_DG.xdmf")
file.write_checkpoint(f,"f")
Open xdmf file in paraview leads to segfault. Can @michalhabera look into this?
Comments (9)
-
reporter -
reporter - attached scalar_DG1_2D.h5
- attached scalar_DG1_2D.xdmf
Also the attached function generated with fenics using @michalhabera GSOC script loads in paraview but no datasets are present so that the fe-filter.py crashes. I think it's related to this issue.
-
Try
file.close()
at the end of file. -
reporter Thanks, that was easy. Now it's the fe-filter.py that's not working. The (cell) datasets are not being populated in paraview. Here's my
fe_fliter.py
script.Traceback (most recent call last): File "<string>", line 22, in <module> File "<string>", line 2, in RequestData File "<string>", line 277, in <module> File "<string>", line 221, in traverse AttributeError: 'NoneType' object has no attribute 'GetNumberOfComponents' ds_in = vtkUnstructuredGrid (0x560309ff9e50) Debug: Off Modified Time: 9346991 Reference Count: 2 Registered Events: (none) Information: 0x5603064da7d0 Data Released: False Global Release Data: Off UpdateTime: 9346993 Field Data: Debug: Off Modified Time: 9346969 Reference Count: 1 Registered Events: (none) Number Of Arrays: 0 Number Of Components: 0 Number Of Tuples: 0 Number Of Points: 600 Number Of Cells: 200 Cell Data: Debug: Off Modified Time: 9346987 Reference Count: 1 Registered Events: Registered Observers: vtkObserver (0x5603087ebee0) Event: 33 EventName: ModifiedEvent Command: 0x560306fc6f10 Priority: 0 Tag: 1 Number Of Arrays: 0 Number Of Components: 0 Number Of Tuples: 0 Copy Tuple Flags: ( 1 1 1 1 1 0 1 1 ) Interpolate Flags: ( 1 1 1 1 1 0 0 1 ) Pass Through Flags: ( 1 1 1 1 1 1 1 1 ) Scalars: (none) Vectors: (none) Normals: (none) TCoords: (none) Tensors: (none) GlobalIds: (none) PedigreeIds: (none) EdgeFlag: (none) Point Data: Debug: Off Modified Time: 9346991 Reference Count: 1 Registered Events: Registered Observers: vtkObserver (0x560308c1cce0) Event: 33 EventName: ModifiedEvent Command: 0x560306fc6f10 Priority: 0 Tag: 1 Number Of Arrays: 1 Array 0 name = f Number Of Components: 1 Number Of Tuples: 600 Copy Tuple Flags: ( 1 1 1 1 1 0 1 1 ) Interpolate Flags: ( 1 1 1 1 1 0 0 1 ) Pass Through Flags: ( 1 1 1 1 1 1 1 1 ) Scalars: Debug: Off Modified Time: 9345604 Reference Count: 3 Registered Events: (none) Name: f Data type: double Size: 1023 MaxId: 599 NumberOfComponents: 1 Information: 0x560307c67ee0 Debug: Off Modified Time: 9347038 Reference Count: 1 Registered Events: (none) PER_FINITE_COMPONENT: vtkInformationVector(0x560308cd8910) PER_COMPONENT: vtkInformationVector(0x56030cae74b0) Name: f Number Of Components: 1 Number Of Tuples: 600 Size: 1023 MaxId: 599 LookupTable: (none) Vectors: (none) Normals: (none) TCoords: (none) Tensors: (none) GlobalIds: (none) PedigreeIds: (none) EdgeFlag: (none) Bounds: Xmin,Xmax: (0, 1) Ymin,Ymax: (0, 1) Zmin,Zmax: (0, 0) Compute Time: 9460598 Number Of Points: 600 Point Coordinates: 0x560318265230 Locator: 0 Number Of Pieces: 1 Piece: 0 Ghost Level: 0
-
That filter is not meant to work. This functionality should work in latest Paraview out of box. Do not use any external filter. Use Paraview 5.5.0+.
-
- changed status to invalid
-
reporter OK I see. I am using paraview 5.5.2. In this case I am expecting to see a discontinuous step function but it looks like there is interpolation at the step edge. What am I doing wrong here? Paraview is still visualizing cells at the step-edge when you do a
WarpByScalar
. -
I see step as should be.
Sorry, I don't have time to give you support on this. Ask on allanswered. This is not issue.
-
reporter Thanks this is helpful already.
- Log in to comment
Error is