← Back to team overview

yade-users team mailing list archive

Re: [Question #277022]: How to get facet data with VTKRecorder or vtkExporter for visualization by paraview

 

Question #277022 on Yade changed:
https://answers.launchpad.net/yade/+question/277022

    Status: Open => Answered

Jan Stránský proposed the following answer:
Hello,

However when I added VTKRecoder, I got error message "SyntaxError: invalid
> syntax" at line of VTKRecoder.


O.engines = [

   ...

   PyRunner(command='checkUnbalancedI()',realPeriod=5,label='checker')
>    VTKRecorder(iterPeriod=100,recorders=['facets'],fileName=
> '/home/username/myYade/trunk/

]


As the error says, it is syntax problem. O.engines is a list and elements
are comma separated. Just add comma after PyRunner:

####################
   PyRunner(command='checkUnbalancedI()',realPeriod=5,label='checker') , #
comma here !!
   VTKRecorder(iterPeriod=100,recorders=['facets'],fileName=
'/home/username/myYade/trunk/
####################


Also, When I added vtkExpoter, I got only one data in which facet data was
> initial position.


>  vtkExporter.exportPolyhedra(what=[('n','b.id')])


this exports polyhedra to a vtk file at current time step, so in your case
exactly saving just initial position. To save files regularly during
simulation, one option is to put this command into PyRunner in O.engines:

##########################
O.engines = [
   ...
   PyRunner(command='checkUnbalancedI()',realPeriod=5,label='checker'), #
comma :-)
   PyRunner(command="vtkExporter.exportPolyhedra(what=[('n','b.id')])
",iterPeriod=1000)
]
##########################

cheers
Jan

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.