← Back to team overview

yade-users team mailing list archive

Re: [Question #238797]: Update interaction physics after changing material of spheres

 

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

Bruno Chareyre posted a new comment:
I support Klaus suggestion to increase stiffness more progressively,
this is the best way to preserve the history. Deleting interactions make
you loose shear forces, then the resulting packing is not equilibrated.

Since everything is proportional, you can update contact properties
yourself:

mat1.Young *= stiffer
for i in O.interactions:
   i.phys.kn*= stiffer

We could do that in the Ip2 functor automatically as you suggest, but it
doesn't need to add references (besides, your test would not work.
interaction->phys->mat1 is still equal to mat1 even after changing a
value in mat1).

We could overload the "write" operator on materials parameters so that a flag isChanged is turned on in the material object.
Then in Ip2 we would have something like:
if(interaction->phys && !mat1.isChanged && !mat2.isChanged) return;

A difficulty is to do that automatically for all variables of all
material types. I don't see how we could do that. We should have in mind
that resetting the interaction each time a variable is modified is not
an option, in most case we want to change a parameter without deleting
the existing contacts.

Last thing, in your case you can prevent explosions by increasing
gravity with the same factor. It can be turned back to its initial value
at the end (but again: progressively).

Bruno

-- 
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.