← Back to team overview

yade-users team mailing list archive

Re: [Question #680662]: Small density sphere in micron size makes segment fault (core dumped)

 

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

    Status: Needs information => Answered

Jan Stránský proposed the following answer:
Hello, just running your code and waiting for the result. However, the
changeValues() function should not be used in this form (!)

You are adding new TranslationEngine every 100 iterations. Now I have
O.iter=288300 and if I print len(O.engines), I got 2893.. Furthermore,
what is the meaning of the TranslationEngine with velocity=0.0?

A proper way could be something like:
###
O.engines = [
   ...
   TranslationEngine(...,dead=False,label='transEngine'), # just one engine
   HarmonicMotionEngine(...,dead=True,label='harmEngine'), # just one engine
   NewtonIntegrator(...), # consider pacing it after kinematic engines [1]
   PyRunner(iterPeriod=100,command='changeValues()'),
]

def changeValues():
   if O.time < 0.2:
      pass # probably initialized above
   elif O.time < 0.4: # no need of 0.2 <= O.time, because if so, it would have finished in above branch
      transEngine.dead = True
      harmEngine.dead = False
      harmEngine.A = ...
      harmEngine.f = ...
   elif ...
###

could you modify your code and test if it works?

cheers
Jan

[1] https://yade-dev.gitlab.io/trunk/user.html#base-engines

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