How to reset contact properties?

Asked by Lorin

What I am trying to do is to use a particular contact model with N properties, in which I have a deposition simulation that has 2 of the properties = 0, save as .xml and then have a new script to load the previous .xml and then reset the 2 properties from 0 to a random number that I want. After the reset, I am doing other things to the conglomerate (such as removing particles from particular locations or whatever).

## DEPOSITION SCRIPT

from yade import pack
from yade import plot
from yade import export

## create materials for spheres
O.materials.append(JCFpmMat(young=1e6,poisson=1.,frictionAngle=radians(26.56),density=2650,tensileStrength=.1e3,cohesion=1e3,label='spheres'))

## generate packing
(random packing, script not included)

## create materials for walls
O.materials.append(JCFpmMat(young=1e6,poisson=1.,frictionAngle=radians(0),density=0,tensileStrength=0,cohesion=0,label='wall'))

(other stuff not included, non contact model related, script not included)

O.engines=[
 ForceResetter(),
 InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
 InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=intRadius,label='bo1s'),Bo1_Facet_Aabb()]),
    InteractionLoop(
        [Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=intRadius,label='ig2ss'),Ig2_Facet_Sphere_ScGeom()],
        [Ip2_JCFpmMat_JCFpmMat_JCFpmPhys()],
       [Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM()],
    ),
 PyRunner(command='fabric()',iterPeriod=1000),
 NewtonIntegrator(damping=.7,gravity=(0.,-9.81,0.)),
 PyRunner(command='balls()',iterPeriod=1000),
 PyRunner(command='plotAddData()',iterPeriod=100),
 VTKRecorder(fileName='3d-vtk-',recorders=['all'],iterPeriod=1000),
 PyRunner(command='strains()',iterPeriod=1000)
]
O.dt=.5*utils.PWaveTimeStep()

RESET SCRIPT:

same thing, with O.load(deposition.xml)
(same stuff that is not included)
O.engines again
O.dt again

How to I reset my JCFpmMat() to have tensileStrength and cohesion any other number than zero?

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
Klaus Thoeni (klaus.thoeni) said :
#1

Hi,

have you tried looping over the interactions and changing the physics? That should do the job. Also, for new contacts you should change the properties in the material as well.

HTH
Klaus

Revision history for this message
James X (jaxie) said :
#2

I'm new to Yade as well, so my advice might be sub-optimal, but I also need to modify the interactions between materials to be something other than their default. I think [1] might be something useful for you, as this (and the link inside the first answer) is the advice I used. If not, just search for "change interactions" in the questions search, and it should lead you to something that may be useful.

One quick thing I noticed, though, is that JCFpmMat have slightly different object properties/methods than the materials in the answers. So instead of the loop they used to modify interactions, I used (as an example):

for i in O.interactions:
  mat1 = O.bodies[i.id1].mat
  mat2 = O.bodies[i.id2].mat
  if( (mat1==special_mat) or (mat2==special_mat) ):
        i.phys.kn = 0.3*i.phys.kn #make it weaker if special_mat is involved

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

Can you help with this problem?

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

To post a message you must log in.