← Back to team overview

yade-users team mailing list archive

Re: [Question #397825]: change the material properties during simulation

 

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

Klaus Thoeni proposed the following answer:
Hi,

as Jerome mentioned, changing materials/laws is not straight forward.
However, you can change material parameters and parameters of the
contact physics and contact law during the simulation. So what you need
is to start from a material and contact law that has all functionalities
and then you change the specific parameter during the simulation. You
need to change the parameter in the material for new contacts and the
one in the physics for already existing contacts. Use label to easily
access the parameters. In terms of python code this could look something
like this:

mat = O.materials.append(ViscElMat(frictionAngle=0.5, density=1000,tc=0.0001, en=1,label='myMaterial'))
O.engines = [
   ...
    [Ip2_ViscElMat_ViscElMat_ViscElPhys(label='myPhysics')],
   ...
]
O.run() # do something
# for example, change en
myMaterial.en=0.5
myPhysics.en=0.5
O.run() # do something

HTH
Klaus

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