yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #21992
Re: [Question #688489]: applying force boundary condition
Question #688489 on Yade changed:
https://answers.launchpad.net/yade/+question/688489
Status: Answered => Open
mrhappy is still having a problem:
Hi,
Thank you for your message. I tried to do what you mentioned in your reply, but I got the following error: O.forces.setPermForce(1,(0,1,0))
AttributeError: 'ForceContainer' object has no attribute 'setPermForce'.
Can you help me out? I want to apply a force 1 N/s in the y-direction on
body 1.
Thank you soo much for your help.
MYCODE:
# MATERIAL PROPERTIES
intR=20 # allows near neighbour interaction (can be adjusted for every packing)
DENS=2500 # Density
YOUNG=1800
FRICT=7
ALPHA=0.1
TENS=10000000
COH=1000000
iterMax = 1
O.materials.append(JCFpmMat(type=1,density=DENS,young=YOUNG,poisson=ALPHA,frictionAngle=radians(FRICT),tensileStrength=TENS,cohesion=COH,label='mat1'))
# PARTICLES
O.bodies.append([
# 0
sphere(center=(0,0,0),radius=0.5,fixed=True,material='mat1'),
# 1
sphere((0,1,0),radius=0.5,material='mat1')
])
nbSpheres = 2;
# BOUNDARY CONDITION
O.forces.setPermForce(1,(0,1,0))
# FUNCTIONAL COMPONENTS
# 1
def addPlotData1():
plot.addData(t=O.time,DX1 = O.bodies[1].state.pos[0],DY1 = O.bodies[1].state.pos[1],DZ1 = O.bodies[1].state.pos[2], FX1 = O.forces.f(1)[0], FY1 = O.forces.f(1)[1], FZ1 = O.forces.f(1)[2])
# 2
def addPlotData2():
plot.saveDataTxt('/home/nabid/Desktop/SCRIPTS/dataFile.txt',vars=('t','DX1','DY1','DZ1','FX1','FY1','FZ1'))
#PRINTING
from yade import plot
from pprint import pprint
# SIMULATION LOOP
O.engines=[
PyRunner(command='addPlotData1()',iterPeriod=1),
PyRunner(command='addPlotData2()',iterPeriod=1),
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=intR)],
[Ip2_JCFpmMat_JCFpmMat_JCFpmPhys(cohesiveTresholdIteration=1)],
[Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM()]
),
GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=10,timestepSafetyCoefficient=0.5, defaultDt=utils.PWaveTimeStep()),
NewtonIntegrator(damping=0.1),
]
numSSlinks=0
numCohesivelinks=0
for i in O.interactions:
numSSlinks+=1
print numSSlinks
#TIME STEP
O.dt=0.5e-4*PWaveTimeStep()
#PLOTTING
plot.plots={'DY1':('FX1','FY1')}
plot.plot()
O.run(iterMax)
# SAVE SIMULATION
--
You received this question notification because your team yade-users is
an answer contact for Yade.