← Back to team overview

yade-users team mailing list archive

Re: [Question #685223]: what are the input variables to get the micro-stress firled

 

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

Jan Stránský proposed the following answer:
> right now I can export the position, radius, and the nine components per particle stress. I named these variables as
(x,y,z,r,s11,s22,s33,s44,s55,s66,s77,s88,s99)
> since I already output the particle information. how can I relate this information to this command (vtk.exportSpheres)

since you already output the particle information, use this output and
do not make it more difficult than necessary :-)

VTKExporter is meant to save data in .vtk format (for Paraview). I would
not use it for this case (although it is possible). But anyway you would
have to read the 9 components and then somehow process them. No benefit
compared to using already saved 9 components..

Just to make the answer complete, here is a MWE how to save the stresses with VTKExporter (have a look at the output file).
###
from yade import export
O.bodies.append((
   sphere((0,0,0),1),
   sphere((1,0,0),1),
))
O.step()
stresses = bodyStressTensors()
vtk = export.VTKExporter("stress-test")
for b in O.bodies:
   b.mystress = stresses[b.id]
vtk.exportSpheres(what=[("stress","b.mystress")])
###
here, the name 'stress' is used, but it can be any name (e.g. just 'stress', which does not conflict (a few) names already occupied by C++ (like state, shape, material, isClump etc.)

cheers
Jan

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