[Paraview] Difference between two Exodus II files

kenichiro yoshimi rccm.kyoshimi at gmail.com
Fri Mar 24 06:46:32 EDT 2017


Hi,

One solution is to call programmable filter from your python program.
I haven't tried Exodus II format, but the below is working:

readers = []
readers.append(OpenDataFile(PATH + 'aaa.vtp'))
readers.append(OpenDataFile(PATH + 'bbb.vtp'))

programmable = ProgrammableFilter(Input=readers)
programmable.Script="\nelev0 = inputs[0].PointData['Elevation']
\nelev1 = inputs[1].PointData['Elevation']\noutput.PointData.append(elev1
- elev0, 'difference')"
programmable.UpdatePipeline()

writer = CreateWriter(PATH + 'ccc.vtp', programmable)
writer.UpdatePipeline()

Regards,
yoshimi

2017-03-24 4:02 GMT+09:00 John Haase <jhaase1 at nd.edu>:
> Hello Paraviewers,
>
> I want to get the difference of all the cell data, similar to what was done
> here
>
> http://paraview.markmail.org/search/?q=difference#query:difference+page:1+mid:lc6a4ss2j5hi37ps+state:results
>
> However, how do I make a writer that can accept the appended data? I tried
> to create the writer
>
> writer = CreateWriter(path+'Difference.e', reader[0])
> writer.CellData.append( reader[0].CellData['x'] - reader[1].CellData['x'] ,
> 'x')
>
>
> and got the error
>
> Traceback (most recent call last):
>   File "<console>", line 1, in <module>
>   File "C:\Program Files\ParaView
> 5.2.0-Qt4-OpenGL2-Windows-64bit\bin\lib\site-packages\paraview\servermanager.py",
> line 1595, in __getattr__
>     array = self.GetArray(name)
>   File "C:\Program Files\ParaView
> 5.2.0-Qt4-OpenGL2-Windows-64bit\bin\lib\site-packages\paraview\servermanager.py",
> line 1531, in GetArray
>     if not self.GetFieldData().GetArrayInformation(idx):
>   File "C:\Program Files\ParaView
> 5.2.0-Qt4-OpenGL2-Windows-64bit\bin\lib\site-packages\paraview\servermanager.py",
> line 1520, in GetFieldData
>     return getattr(self.Proxy.GetDataInformation(self.OutputPort),
> "Get%sInformation" % self.FieldData)()
> AttributeError: 'NoneType' object has no attribute 'GetCellDataInformation'
>
>
> Then, I also tried to just copy the reader
>
> writer = reader[0]
> writer.CellData.append( reader[0].CellData['x'] - reader[1].CellData['x'] ,
> 'x')
>
>
> and got the error
>
> Traceback (most recent call last):
>   File "<console>", line 1, in <module>
>   File "C:\Program Files\ParaView
> 5.2.0-Qt4-OpenGL2-Windows-64bit\bin\lib\site-packages\paraview\servermanager.py",
> line 1597, in __getattr__
>     raise AttributeError("class has no attribute %s" % name)
> AttributeError: class has no attribute append
>
>
> Any advice?
>
> Regards,
>
> John R. Haase
> jhaase1 at nd.edu
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Search the list archives at: http://markmail.org/search/?q=ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/paraview
>


More information about the ParaView mailing list