Re: [Yade-users] [Question #698498]: How to use cellRepeat

2021-08-25 Thread Leonard
Question #698498 on Yade changed:
https://answers.launchpad.net/yade/+question/698498

Status: Open => Solved

Leonard confirmed that the question is solved:
Hi,

I made some attempts and seems got how to use cellRepeat.

Below is a MWE.

from yade import pack; from math import *
O.periodic=True
sp=pack.SpherePack()
sp.makeCloud((0,0,0),(5,5,5),rMean=.5,rRelFuzz=.5,periodic=True,num=20)
sp.cellRepeat((1,1,3))
## don't forget to put them into simulation by using sp.toSimulation()
sp.toSimulation()

Thanks!
Leonard

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


[Yade-users] [Question #698498]: How to use cellRepeat

2021-08-24 Thread Leonard
New question #698498 on Yade:
https://answers.launchpad.net/yade/+question/698498

Hi,
I'd like to ask how to use cellRepeat[1] function to stack several copies of a 
cell along one direction. One illustration can be found in Fig. 3 in [2].

I use the following MWE (from[3]) to make a sample in a cell, the MWE pauses 
after the sample reaches the target isotropic state. I'd like to reproduce 
several of the cell at that state, and stack them together along one direction, 
but I didn't make it after some attempts. Here is the MWE, it may take around 
50 seconds for running.
 MWE begins ###
from __future__ import print_function
sigmaIso = -100e3

from yade import pack, qt, plot
mn,mx=Vector3(0,0,0),Vector3(0.07,0.14,0.07)
O.periodic = True
O.cell.setBox(.07,.14,.07)
sp = pack.SpherePack()
sp.makeCloud(mn,mx,-1,0.,num=7000, periodic=True)
sp.toSimulation()

O.engines = [
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb()]),
InteractionLoop([Ig2_Sphere_Sphere_ScGeom()], 
[Ip2_FrictMat_FrictMat_FrictPhys()], [Law2_ScGeom_FrictPhys_CundallStrack()]),
PeriTriaxController(
label='triax',
goal=(sigmaIso, sigmaIso, sigmaIso),
stressMask=7,
dynCell=True,
maxStrainRate=(10, 10, 10),
maxUnbalanced=.1,
relStressTol=1e-3,
doneHook='compactionFinished()'
),
NewtonIntegrator(damping=.2),
]
O.dt = .5 * PWaveTimeStep()
O.trackEnergy = True

def compactionFinished():
print('stage1 
finished','sxx',triax.stress[0],'syy',triax.stress[1],'szz',triax.stress[2])
O.cell.trsf=Matrix3.Identity
triax.goal = (sigmaIso, -0.1, sigmaIso)
triax.stressMask = 5
triax.maxStrainRate = (1., 0.5, 1.)
triax.maxUnbalanced = 10
O.pause()
# here I want to repeat the current cell

def triaxFinished():
print('Finished')
O.pause()

 MWE finish ###
Thanks very much!
Leonard

[1]https://yade-dev.gitlab.io/trunk/yade.pack.html?highlight=cell#yade._packSpheres.SpherePack.cellRepeat
[2]Cheng, Hongyang, Stefan Luding, Kuniyasu Saitoh, and Vanessa Magnanimo. 
"Elastic wave propagation in dry granular media: effects of probing 
characteristics and stress history." International journal of solids and 
structures 187 (2020): 85-99.
[3]https://gitlab.com/yade-dev/trunk/blob/master/doc/sphinx/tutorial/06-periodic-triaxial-test.py


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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp