Re: [Yade-users] [Question #658699]: Deleting the desired interactions

2017-09-29 Thread Xavier Thurman
Question #658699 on Yade changed:
https://answers.launchpad.net/yade/+question/658699

Status: Answered => Solved

Xavier Thurman confirmed that the question is solved:
Thanks Jan Stránský, that solved my question.

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #658699]: Deleting the desired interactions

2017-09-28 Thread Jan Stránský
Question #658699 on Yade changed:
https://answers.launchpad.net/yade/+question/658699

Status: Open => Answered

Jan Stránský proposed the following answer:
Hello Xavier,
please try the following code. In the GUI on display tab, I checked intrAllWire 
and do not see any bonds between the two cubes. What version of Yade you use 
and what system? This works for me for Ubuntu 16.04 and yade-1.20.0.

###
from yade import pack

porosity = 0.3042744476
Young = 1.0e11 # 100Gpa
FrictAng = radians(18)
Density = 2640/(1-porosity)
Poisson = 1/3.0
Cohesion = 4.5e7 # pa
TensileStr = 4.5e6 # pa

rock = 
JCFpmMat(young=Young,frictionAngle=FrictAng,density=Density,poisson=Poisson,tensileStrength=TensileStr,cohesion=Cohesion)
steel = 
JCFpmMat(young=2.06e11,frictionAngle=radians(30),density=7800,poisson=0.3,tensileStrength=0,cohesion=0)

pred1 = pack.inAlignedBox((0,0,0),(0.01,0.01,0.01))
pred2 = pack.inAlignedBox((0,0,0.01),(0.01,0.01,0.02))

assembly1 = 
pack.randomDensePack(pred1,radius=0.0005,spheresInCell=1000,color=(1,1,1),material=rock)
O.bodies.append(assembly1)
assembly2 = 
pack.randomDensePack(pred2,radius=0.0005,spheresInCell=1000,color=(1,1,0),material=rock)
O.bodies.append(assembly2)

O.engines=[
   ForceResetter(),
   
InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=1.5,label='bo1'),Bo1_Facet_Aabb()]),
   InteractionLoop(
  
[Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=1.5,label='ig2'),Ig2_Facet_Sphere_ScGeom()],
  [Ip2_JCFpmMat_JCFpmMat_JCFpmPhys()],
  
[Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM(recordCracks=True,label='lawFunctor')]
   ),
   VTKRecorder(fileName='post/scp-',recorders=['all'],iterPeriod=50),
   
GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=5,timestepSafetyCoefficient=0.8,defaultDt=PWaveTimeStep()),
   NewtonIntegrator(damping=0.3,gravity=(0,0,-9.81)),

]
O.trackEnergy=True
O.step()
bo1.aabbEnlargeFactor = 1.
ig2.interactionDetectionFactor = 1.

print len(O.interactions), len([i for i in O.interactions])

for i in O.interactions:
   if O.bodies[i.id1].shape.color != O.bodies[i.id2].shape.color:
  O.interactions.erase(i.id1,i.id2)
O.step()

print len(O.interactions), len([i for i in O.interactions])
###

cheers
Jan

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #658699]: Deleting the desired interactions

2017-09-27 Thread Xavier Thurman
Question #658699 on Yade changed:
https://answers.launchpad.net/yade/+question/658699

Status: Answered => Open

Xavier Thurman is still having a problem:
Dear Jan,

I just tried your method, but it still can not delete the bonds between
two BPMs.

Xavier

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #658699]: Deleting the desired interactions

2017-09-27 Thread Jan Stránský
Question #658699 on Yade changed:
https://answers.launchpad.net/yade/+question/658699

Status: Open => Answered

Jan Stránský proposed the following answer:
Thanks for the code, it is much clearer now :-) you have to cancel the 
enlargements after the first O.step:
###
O.engines=[
ForceResetter(),

InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=1.5,label='bo1'),..
InteractionLoop(

[Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=1.5,label='ig2'),
   
]
O.trackEnergy=True
O.step()
bo1.aabbEnlargeFactor = 1. # !!
ig2.interactionDetectionFactor = 1. # !!
...
###

also note that len(O.interactions) and len([i for i in O.interactions]) may 
differ
len(O.interactions) ... includes also potential interactions
len([i for i in O.interactions]) ... only counts real interactions

cheers
Jan

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #658699]: Deleting the desired interactions

2017-09-27 Thread Xavier Thurman
Question #658699 on Yade changed:
https://answers.launchpad.net/yade/+question/658699

Status: Answered => Open

Xavier Thurman is still having a problem:
Here is my codes:
from yade import pack

porosity = 0.3042744476
Young = 1.0e11 # 100Gpa
FrictAng = radians(18)
Density = 2640/(1-porosity)
Poisson = 1/3.0
Cohesion = 4.5e7 # pa
TensileStr = 4.5e6 # pa

rock = 
JCFpmMat(young=Young,frictionAngle=FrictAng,density=Density,poisson=Poisson,tensileStrength=TensileStr,cohesion=Cohesion)
steel = 
JCFpmMat(young=2.06e11,frictionAngle=radians(30),density=7800,poisson=0.3,tensileStrength=0,cohesion=0)

pred1 = pack.inAlignedBox((0,0,0),(0.01,0.01,0.01))
pred2 = pack.inAlignedBox((0,0,0.01),(0.01,0.01,0.02))

assembly1 = 
pack.randomDensePack(pred1,radius=0.0005,spheresInCell=1000,color=(1,1,1),material=rock)
O.bodies.append(assembly1)
assembly2 = 
pack.randomDensePack(pred2,radius=0.0005,spheresInCell=1000,color=(1,1,0),material=rock)
O.bodies.append(assembly2)

O.engines=[
ForceResetter(),

InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=1.5),Bo1_Facet_Aabb()]),
InteractionLoop(

[Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=1.5),Ig2_Facet_Sphere_ScGeom()],
[Ip2_JCFpmMat_JCFpmMat_JCFpmPhys()],

[Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM(recordCracks=True,label='lawFunctor')]
),
VTKRecorder(fileName='post/scp-',recorders=['all'],iterPeriod=50),

GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=5,timestepSafetyCoefficient=0.8,defaultDt=PWaveTimeStep()),
NewtonIntegrator(damping=0.3,gravity=(0,0,-9.81)),

]
O.trackEnergy=True
O.step()

print len(O.interactions)

for i in O.interactions:
if O.bodies[i.id1].shape.color != O.bodies[i.id2].shape.color:
O.interactions.erase(i.id1,i.id2)

O.step()

print len(O.interactions)

from yade import qt
qt.View()
qt.Controller()


Thanks for your patience,
Xavier

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #658699]: Deleting the desired interactions

2017-09-27 Thread Jérôme Duriez
Question #658699 on Yade changed:
https://answers.launchpad.net/yade/+question/658699

Jérôme Duriez proposed the following answer:
Hello,

YADE is a very good computer program in the sense it always does what you're 
asking him to do (as every computer program..).
I'd thus advice

- to check your test (if it is properly written, it will run and the
interaction will be deleted)

- to check whether your interaction is not re-created just (one step..)
after it has been deleted

- to consider whether you could just zero the cohesive properties of
these interactions (instead of erasing the interaction altogether),
cancelling e.g. i.phys.FnMax and FsMax [*] assumping a interaction
physics of JCFpmPhys type.

Jérôme

[*] https://yade-
dem.org/doc/yade.wrapper.html?highlight=jcfpmphys#yade.wrapper.JCFpmPhys.FnMax
and just below

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #658699]: Deleting the desired interactions

2017-09-27 Thread Jan Stránský
Question #658699 on Yade changed:
https://answers.launchpad.net/yade/+question/658699

Status: Open => Answered

Jan Stránský proposed the following answer:
Have you run O.step() afterwards? If yes, please put here a MWE [1]
thanks
Jan

[1] https://yade-dem.org/wiki/Howtoask

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #658699]: Deleting the desired interactions

2017-09-27 Thread Xavier Thurman
Question #658699 on Yade changed:
https://answers.launchpad.net/yade/+question/658699

Status: Answered => Open

Xavier Thurman is still having a problem:
Thanks Jan,

I have tried this method.
I allocated two different colors for those two BPMs. I have the following codes:
O.step()
for i in O.interactions:
 if O.bodies[i.id1].shape.color != O.bodies[i.id2].shape.color:
O.interactions.erase(i.id1,i.id2)

But it does not work!
Xavier

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #658699]: Deleting the desired interactions

2017-09-27 Thread Jan Stránský
Question #658699 on Yade changed:
https://answers.launchpad.net/yade/+question/658699

Status: Open => Answered

Jan Stránský proposed the following answer:
Hello Xavier,
O.interactions.erase [1] is what you are looking for. The deletion will be 
applied after O.step()
cheers
Jan

[1] https://yade-
dem.org/doc/yade.wrapper.html#yade.wrapper.InteractionContainer.erase

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp