# aabb walls don't move after apply a force

Asked by Anqi H on 2019-09-18

Hi everyone,

I recently installed yade-2019-08-28.git-430b5a3 and found the script that worked with the old yade (apt install yade) is not working with the updated version. Specifically, a force is applied on an aabb wall, but the wall position does not change and the velocity shows to be zero. I have attached my script below, would anyone be able to help me have a look? Thank you.

# !/usr/bin/python
# -*- coding: utf-8 -*-

# input parameter
Young = 57e8 # 100Gpa
FrictAng = atan(0.5)
Density = 2650
Poisson = 0.28
Cohesion = 38e6 # pa
TensileStr = 38e6 # pa

#define rock and wall
rock = JCFpmMat(young=Young,frictionAngle=FrictAng,density=Density,poisson=Poisson,tensileStrength=TensileStr,cohesion=Cohesion)

for Mat in (rock,wall):
O.materials.append(Mat)

# regularOrth packing of the rock
rock_pred = pack.inAlignedBox((0,0,0),(.02,.03,.02))
r_assembly=O.bodies.append(assembly)

# aabbWalls
wall = O.bodies.append(utils.aabbWalls(material=wall,thickness=0.000,color=(1,1,1)))

# set velocity for bottom/upper wall
bottom_wall = O.bodies[wall[2]]
#bottom_wall.state.blockedDOFs = 'zXY'
bottom_wall.state.mass = 1

upper_wall = O.bodies[wall[3]]
#upper_wall.state.blockedDOFs = 'zXY'
upper_wall.state.mass = 1

O.forces.setPermF(upper_wall.id, (0,-10000,0))
O.forces.setPermF(bottom_wall.id, (0,10000,0))

print (str(upper_wall.state.pos[1]))
print ('wall velocity'+str(upper_wall.state.vel))
O.forces.setPermF(upper_wall.id, (0,-10000,0))

###########################
# ENGINES
###########################

O.engines=[
ForceResetter(),
# enlarge interaction radius between spheres
InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=1.25,label='bo1s'),Bo1_Box_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=1.25,label='ig2s'),Ig2_Box_Sphere_ScGeom()],
[Ip2_JCFpmMat_JCFpmMat_JCFpmPhys(cohesiveTresholdIteration=1)],
[Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM(recordCracks=True,label='lawFunctor')]
),
# VTKRecorder(fileName='post/uniCom-',recorders=['all'],iterPeriod=50),
GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=5,timestepSafetyCoefficient=0.8,defaultDt=PWaveTimeStep()),
NewtonIntegrator(damping=0.3,gravity=(0,0,0)),
]
O.trackEnergy=True
O.step()

bo1s.aabbEnlargeFactor=1
ig2s.interactionDetectionFactor=1

#set an optimal timestep
O.dt = utils.PWaveTimeStep()
O.usesTimeStepper = True

## Question information

Language:
English Edit question
Status:
For:
Assignee:
No assignee Edit question
Last query:
2019-09-18
2019-09-22
 Jan Stránský (honzik) said on 2019-09-18: #1

Hello,

the same as in [1]:
"please provide a script which is ... minimal = if the problem is moving the wall, a script with one wall should be enough"

hint: print(upper_wall.state.blockedDOFs)

cheers
Jan

 Anqi H (analoq) said on 2019-09-18: #2

Hi Jan,

Thank you for the catch. I've uncommented the code that defined blockedDOFs, but now I've got very different error messages when I run the simulations. It seems like it does not recognize a character in the line 'upper_wall.state.blockedDOFs = 'zXY'', but this line of code doesn't have any issues in the old yade install.

ValueError: cannot convert float NaN to integer
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/IPython/core/ultratb.py", line 1267, in __call__
self.handler((etype, evalue, etb))
File "/usr/lib/python3/dist-packages/IPython/core/ultratb.py", line 1256, in handler
ostream.write(self.text(etype, evalue, etb))
UnicodeEncodeError: 'latin-1' codec can't encode character '\u03bc' in position 2659: ordinal not in range(256)

Original exception was:
Traceback (most recent call last):
self.refreshValues()
s=int(t); ms=int(t*1000)%1000; us=int(t*1000000)%1000; ns=int(t*1000000000)%1000

 Robert Caulk (rcaulk) said on 2019-09-22: #3

Whether you meant to or not, python is reading a $\mu$ character in that line. Try retyping it to make sure you aren't inadvertently adding any special characters.