← Back to team overview

yade-users team mailing list archive

Re: [Question #706506]: How to output volumetric strain (micro strain field) in vtk file

 

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

    Status: Open => Answered

Karol Brzezinski proposed the following answer:
Hi,

MWE would be appreciated [1].

Using the' calculator filter', you can always compute anything in
ParaView from matrix components.

Load the VTK file, and then use the calculator filter. You can type the
formula:

"Strain_matrix_0"+"Strain_matrix_4"+"Strain_matrix_8"

or select other components using the "Scalar" button. Next, you can
visualize the 'Result'.

The MWE that I used to generate the file is as follows:
####
centers = []
for x in range(2):
 for y in range(2):
  for z in range(2):
   centers.append((x,y,z))

O.bodies.append([
 sphere(center=center,radius=1,) for center in centers
])

sp = SpherePack()
sp.fromSimulation()

TW=TesselationWrapper()
TW.triangulate()
TW.computeVolumes()


TW.setState(0)

shiftBodies([4,5,6,7],(1,0,0)) # move spheres without engines (I am just being lazy)
shiftBodies([2,3,6,7],(0,1,0)) 
shiftBodies([1,3,5,7],(0,0,1)) 

TW.setState(1)
TW.defToVtk("strain.vtk")

###


Cheers, 
Karol 

[1]https://www.yade-dem.org/wiki/Howtoask

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