← Back to team overview

yade-users team mailing list archive

Re: [Question #706218]: Microstrain for an assembly of clumps in direct shear test

 

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

    Status: Open => Answered

Jan Stránský proposed the following answer:
> And, do you imply that the strain analyses for clumps themselves is
not possible for clumps yet?

I have no idea (I do not use this stuff almost at all).
The approach below should work, you can experiment with other approaches.

> By mirroring do you mean releasing from clumps

No. By mirroring I mean just create separate simulation where for the
strain analysis purposes, clumps are replaced ("mirrored") by spheres
with same state.pos and state.ori as the original clumps.

Below is a MWE.
Be careful with the scene switching, always "return" back where you want to continue.

I am not sure if sphere sizes should be adjusted or not..

######
def mirror():
    # extract state from cumps
    states = [(b.state.pos,b.state.ori) for b in clumps]
    # switch to "spherical" simulation
    O.switchScene()
    # set states to the spheres
    for (pos,ori),b in zip(states,O.bodies):
        b.state.pos = pos
        b.state.ori = ori

# create dummy clump packing
for x in (0,1):
    for y in (0,1):
        for z in (0,1):
            clumpId,ids = O.bodies.appendClumped([
                sphere((x,y,z),0.1),
                sphere((x+0.2,y,z),0.1),
            ])


clumps = [b for b in O.bodies if b.isClump]

# create spheres in separate simulation (same amount as the clumps)
O.switchScene()
O.bodies.append([sphere((0,0,0),0.1) for _ in clumps])
O.switchScene()

mirror() # note: simulation is switched
TW=TesselationWrapper()
TW.triangulate()
TW.computeVolumes()
TW.setState(0)
O.switchScene() # switch back to "clump" simulation

# some artificial motion
O.bodies[clumpId].state.vel = (1,1,1)
O.step()

mirror() # note: simulation is switched
TW.setState(1)
TW.defToVtk("strain.vtk")

O.switchScene() # switch back to "clump" simulation
######

Cheers
Jan

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