How to use TW.triangulate() for only part of particles

Asked by Leonard

Hi,

I'd like to ask that how to export micro-strain[1] for part of the whole packing.
There are two groups of particles in my packing, let's say, packing1 and packing2 for storing the ids respectively. I'd like to export micro-strain for particles in packing1.

I guess it could be done by using TW.triangulate (i.e., computing regular Delaunay triangulation) for only packing1. Refering to the example code[2], it well demonstrates how to export the micro-strain for the whole packing by using TW.triangulate(), as below:

TW.triangulate() #compute regular Delaunay triangulation, don’t construct tesselation
TW.computeVolumes() #will silently tesselate the packing, then compute volume of each Voronoi cell

I made some attemps such as using TW.triangulate(packing1) or TW.computeVolumes(packing1), but I got the feedback: did not match C++ signature.

My question is that can we pass only packing1 to TW.triangulate()?

Thanks
Leonard

[1]https://yade-dev.gitlab.io/trunk/user.html?highlight=paraview#micro-strain
[2]https://gitlab.com/yade-dev/trunk/-/blob/master/examples/tesselationwrapper/tesselationWrapper.py

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Karol Brzezinski
Solved:
Last query:
Last reply:
Revision history for this message
Karol Brzezinski (kbrzezinski) said :
#1

Hi Leonard,

I don't know whether you can triangulate for a set of particles. However, you can store the positions and radii of this set in external files. Next, you can compute strains from positions files using defToVtkFromPositions() method [1].

Cheers,
Karol

[1] https://yade-dem.org/doc/yade.wrapper.html?highlight=deftovtkfrompositions#yade.wrapper.TesselationWrapper.defToVtkFromPositions

Revision history for this message
Leonard (z2521899293) said :
#2

Hi Karol,
Firstly many thanks for your quick reply.

As this defToVtkFromPositions() is new info for me, if I understood correctly, what I need to do is:

step1: output a txt file (one sphere per line, with x,y,z,rad separated by spaces). This is clear for me, in this way I can specific the part of particles.

step2: pass this file to defToVtkFromPositions(), this function will write local deformations in vtk format from positions file as introduced in[1]. But what is not clear for me is that: there is only one state in the txt file, how can it calculate the microstrain from only one state? As the example code shows[2], it uses defToVtk() which write local deformations in vtk format from states 0 and 1.

Thanks
Leonard

[1] https://yade-dem.org/doc/yade.wrapper.html?highlight=deftovtkfrompositions#yade.wrapper.TesselationWrapper.defToVtkFromPositions
[2]https://yade-dev.gitlab.io/trunk/user.html?highlight=paraview#micro-strain

Revision history for this message
Best Karol Brzezinski (kbrzezinski) said :
#3

Hi Leonard,

the answer is simple. You need to output two txt files, before and after deformation :)

step 1: output the first txt file (one sphere per line, with x,y,z,rad separated by spaces).

step 2: run simulation.

step 3: output the second txt file.

step 4: pass the files to defToVtkFromPositions(first_file, second_file, output_vtk_file).

Cheers,
Karol

Revision history for this message
Leonard (z2521899293) said :
#4

Thanks Karol Brzezinski, that solved my question.