force and identify

Asked by fan yang on 2021-06-03

Hi guys!
For a spherical packing, what is the most effective way to identify the outermost particles? and how to apply forces to those identified particles?
Thanking you in advance,
Owen

Question information

Language:
English Edit question
Status:
Answered
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Jan Stránský (honzik) said :
#1

Hello,

please read [1] and provide more information.

> For a spherical packing ...

what is "a spherical packing"?
A MWE [1] would answer this question.

> what is the most effective way to identify the outermost particles?

How you define "most effective"? w.r.t. code writing? w.r.t. execution performance?

how you define "outermost particles"? along axes? from center? important is particle center? particle surface? ... ?
How many "outermost particles"? 1? a few? 10? 100?

> how to apply forces to those identified particles?

O.forces.addF [2] of O.forces.setPermF [3]

Please, consider providing the packing in the form of a MWE. E.g. simple text file with a few predefined particles, also illustrating what particles are the "outermost" and why.

Cheers
Jan

[1] https://www.yade-dem.org/wiki/Howtoask
[2] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.ForceContainer.addF
[3] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.ForceContainer.setPermF

Revision history for this message
fan yang (yff) said :
#2

Dear Jan:
Thank you for your reply.
1.The spherical sample is 'trimmed' from the cubic sample that contains generated particles.I just want to apply forces to the exterior of the spherical sample.2.So I want to know the most effective way to identify the outermost particles for both code writing and execution performance.3.The outermost particles means from the central of the spherical sample.

Revision history for this message
Jan Stránský (honzik) said :
#3

Hello,

> 1 + 3

still, please be more specific. What is "the exterior"? Particles forming a convex hull? Particles close enough to the trimming sphere surface? ... ? Is more important center of particles? Or their surface? ... ?

The solution is as easy as:
###
exterior = [b for b in O.bodies if isExterior(b)]
for b in exterior:
    O.forces.setPermF(b.id,someForce) # or addF
###
isExterior is a function depending on your needs. E.g. the most primitive could be:
###
limitDistance = 1.23
center = Vector3(1,2,3)
def distance(v1,v2):
    return (v1-v2).norm()
def isExterior(b):
    return distance(b.state.pos,center) < limitDistance
###

> 2...

efficiency w.r.t. code writing and efficiency w.r.t. performance are often contradicting requirements...

Cheers
Jan

Can you help with this problem?

Provide an answer of your own, or ask fan yang for more information if necessary.

To post a message you must log in.