yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #29299
Re: [Question #706306]: How can interact spheres with the moving facet when using MPI?
Question #706306 on Yade changed:
https://answers.launchpad.net/yade/+question/706306
JINSUN LEE posted a new comment:
Dear Stránský,
Thanks to your comment.
In this case, the non-zero mass facets still disappear. The followings are MWE.
Regards,
=====
from yade import pack, plot
from yade import mpy as mp
O.materials.append(FrictMat(young=20e6, poisson=0.17, density=2700, frictionAngle=0.523, label='frictmat'))
O.materials.append(FrictMat(young=20e6, poisson = 0.5, frictionAngle = 0.523, density =2600, label='wallMat'))
O.bodies.append(geom.facetBox((0.0, 0.0, 0.0), (.03, .03, .06), wallMask=31, material='wallMat'))
#radius_mean = .002
# create topcap
width = 0.06
height = 0.17
dx = width/10.0
dy = width/10.0
p5t = (-width/2-dx,-width/2-dy,0.06)
p6t = (-width/2-dx,width/2+dy,0.06)
p7t = (width/2+dx,width/2+dy,0.06)
p8t = (width/2+dx,-width/2-dy,0.06)
topcap1 = utils.facet(vertices=[p5t,p6t,p7t], wire=True, highlight=False, material='wallMat')
topcap2 = utils.facet(vertices=[p5t,p8t,p7t], wire=True, highlight=False, material='wallMat')
topcap1.dynamic = True
topcap2.dynamic = True
O.bodies.append(topcap1)
O.bodies.append(topcap2)
#topcap1.state.vel=(0.0,0.0,-0.5)
#topcap2.state.vel=(0.0,0.0,-0.5)
mn,mx=Vector3(-.03,-.03,-.06),Vector3(.03,.03,.05)
pred = pack.inAlignedBox(mn,mx)
O.bodies.append(pack.regularHexa(pred,radius=0.002,gap=0, material='frictmat'))
O.engines = [
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(), Bo1_Facet_Aabb()], label='collider'), # always add label
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom(), Ig2_Facet_Sphere_ScGeom()], # collision geometry
[Ip2_FrictMat_FrictMat_FrictPhys()], # collision "physics"
[Law2_ScGeom_FrictPhys_CundallStrack()] # contact law -- apply forces
),
NewtonIntegrator(gravity=(0, 0, -9.81), damping=0.08),
# VTKRecorder(fileName='mpi/3d-vtk-', recorders=['spheres', 'intr', 'facets', 'colors'], parallelMode=True, iterPeriod=100), #use .pvtu to open spheres, .pvtp for ints, and .vtu for boxes.
PyRunner(command='addData()', iterPeriod=1000),
PyRunner(command='control_run()', iterPeriod=100),
DomainLimiter(lo=(-.1,-.1,-.20), hi=(.1,.1,.20), iterPeriod = 100, label = 'Domain') # destroy balls outside domain in every 100 steps
]
def addData():
for b in O.bodies:
b.shape.color=scalarOnColorScale(b.state.vel.norm())
def control_run():
print ("Current step is ", O.iter, end='\r')
collider.verletDist = -.5
O.dt=0.5*PWaveTimeStep()
O.resetTime()
print("Number of bodies = ", len(O.bodies))
# w/o MPI
#O.run(nSteps= 10000, wait=False)
# MPI
mp.VERBOSE_OUTPUT = False
mp.REALLOCATE_FREQUENCY = 5
mp.ACCUMULATE_FORCES = False
mp.MAX_RANK_OUTPUT = 4
mp.DOMAIN_DECOMPOSITION = True
mp.MERGE_W_INTERACTIONS = False
mp.mpirun(nSteps=1000, np = 5, withMerge=True) # interactive run, numThreads is the number of workers to be initialized, see below for withMerge explanation.
mp.mergeScene()
--
You received this question notification because your team yade-users is
an answer contact for Yade.