← Back to team overview

yade-users team mailing list archive

Re: [Question #693455]: addForce didnt work for facet

 

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

    Status: Open => Answered

Jan Stránský proposed the following answer:
1) facets are fixed (state.blockedDOFs='xyzXYZ') by default.
You have to "unblock" some DOFs. In your last code, uncomment the line
f.state.blockedDOFs = 'XYZz'
and the position is different. Specifically it is (NaN,NaN,0) :-)

2) Further, you have to set non-zero mass to get non-NaN position

3)
addF add force only for one time step (="only a little")
setPermF set permanent force (you can change its value - also to 0 - during the simulation)


Your code is a bit complex for testing (e.g. interactions may play some role), use a real MWE for testing:
###
f = facet(((1,0,0),(0,1,0),(0,0,1)))
print("blockedDOFs",f.state.blockedDOFs)
f.state.blockedDOFs = "XYZ" # (!)
f.state.mass = 1 # (!)

O.bodies.append(f)
a,n = f.shape.area,f.shape.normal
p = -1
print("f",p*a*n)

print()
print("trying addF ... ")
O.forces.addF(0,p*a*n)
print("displ step",O.iter,f.state.displ())
O.step()
print("displ step",O.iter,f.state.displ())
O.step()
print("displ step",O.iter,f.state.displ())
O.step()
print("displ step",O.iter,f.state.displ())
print("addF applies 'constant velocity'")

print()
print("trying setPermF ... ")
O.forces.setPermF(0,p*a*n)
O.step()
print("displ step",O.iter,f.state.displ())
O.step()
print("displ step",O.iter,f.state.displ())
O.step()
print("displ step",O.iter,f.state.displ())
O.step()
print("displ step",O.iter,f.state.displ())
print("setPermF applies 'constant acceleration'")
###

cheers
Jan

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