Using O.forces without Ip2 and Law2

Asked by Rioual

Hello,

This sounds like an unusual question but is very valuable for me.
I would like to do a script without using th collision physics Ip2 and
 the contact law Law2 in the engines. I do not need it.
I would like only to treat interactions between my particles through
 O.forces called by a pyrunner at every iteration.

How is this possible??

Best

Vincent

Question information

Language:
English Edit question
Status:
Expired
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Robert Caulk (rcaulk) said :
#1

What happens when you define your engines list without Ip2 and Law2?

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#2

Or without InteractionLoop (same effect)?
B

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

Hi,

@Robert
###
O.bodies.append((sphere((0,0,0),1),sphere((1,0,0),1)))
O.engines = [
   ForceResetter(),
   InsertionSortCollider([Bo1_Sphere_Aabb()]),
   InteractionLoop(
      [Ig2_Sphere_Sphere_ScGeom()],
      [],
      [],
   ),
   NewtonIntegrator(),
]
O.step()
###
terminate called after throwing an instance of 'std::runtime_error'
  what(): Undefined or ambiguous IPhys dispatch for types FrictMat and FrictMat.
Aborted (core dumped)

@Vincent
in general it would be possible, but I don't think easily with current implementation (haven't tried, thought). E.g. Interactions without IPhys are normally treated as non-real, I am not sure with consequences for your use case..
Would setting zero stiffness to materials be ok for you? Then the force computed would be zero and forces would be applied exclusively from what is set to O.forces..

cheers
Jan

Revision history for this message
Rioual (francois-rioual-v) said :
#4

Hello,

I tried to delete the InteractionLoop() as suggested by Bruno and let my pyrunner call the function with O.forces.
In this case, apparently there is no error but the function called by pyrunner is not running.
I use indeed in my function a loop on O.interactions (to define the force between particles to add with O.forces)
 and O.interactions depends apparenty on Geom and Phys so this seems to be a dead end....

I thought also as suggested by Jan about taking an arbitrary contact law and put the parameters to 0 but
this does not seem to be very optimized...????

Best regards,

V.

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

> but this does not seem to be very optimized...????

yes, it is sub-optimal, but I **guess** that setting interaction forces through O.forces is even worse (from performance point of view) :-).
I like this approach for testing and playing.
But, as discussed in [1], dedicated Law2 is the optimal way (not only from performance, but also from maintenance etc. point of view)

cheers
Jan

[1] https://answers.launchpad.net/yade/+question/690066

Revision history for this message
Launchpad Janitor (janitor) said :
#6

This question was expired because it remained in the 'Open' state without activity for the last 15 days.