yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #19267
Re: [Question #679314]: Reset Interactions
Question #679314 on Yade changed:
https://answers.launchpad.net/yade/+question/679314
Jan Stránský proposed the following answer:
Hello,
> I tried doing the compaction to a certain porosity in a different code
and export the compacted spheres as a txt file and then import it in
another code for uniaxial compression but didn't work because porosity
was reset to the original cloud porosity.
this is nonsense, how would the other script know how to "reset" the positions? Probably you accidentally saved the original packing and not the compacted one.
For example, it could be that you called the saving before O.run(...) or after O.run(...) without True parameter (see below).
For better answer, we would need your code.
I do not agree with Jerome's answer (sorry :-). Apart from i.phys.kn,
you also have to modify i.phys.E and other values (epsCrackOnset,
epsFracture....), so you should have a (very) good knowledge of CPM code
before doing these modifications. Furthermore, i,phys has some read-only
values (like damage variable) which you cannot set from python..
back to your problem, in general you can do:
###
...
O.switchScene() # the creation in independent scene
O.materials.append(...)
O.bodies.append(...)
O.engines = [...]
O.run()
O.wait() # (!) important, without this, the python evaluation directly continues and stores/saves original packing
sp = pack.SpherePack()
sp.fromSimulation()
O.switchScene() # back to the original simulation, starting from beginning
# define materials and engines again, since this is completely new simulation than the one before
# You can also use different parameters etc...
O.materials.append(...)
sp.toSimulation()
O.engines = [...]
###
A two script solution would look similarly, but instead of
sp.from/toSomulation, you would call some saving / loading.
cheers
Jan
--
You received this question notification because your team yade-users is
an answer contact for Yade.