← Back to team overview

yade-users team mailing list archive

Re: [Question #698314]: how to use class yade.wrapper.StepDisplacer((object)arg1)

 

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

    Status: Open => Needs information

Jan Stránský requested more information:
TL;TR:
I do not understand what you want to achieve.
I do not understand why outputting position of all particles is a problem. You can filter it afterwards, much easier than polluting the simulation.

>> What does "moved (particles)" mean? Moved from the beginning of simulation? From last output? ... ? Changed position? Or also orientation? ... ?
> I mean changed position or orientation.

Moved from the beginning of simulation? From last output? ... ?

>> Why is the amount a problem? 3000 does not sound as too many..
> Maybe because of my computer.

Why is the amount a problem? What are the symptoms?
What you do with the output that it is problematic?

> I want write a code that says: if particles moved from ex-position so
give their id and new position of everyone.

sorry, it is still very unclear.. I really don't know how to read and
understand the sentence :-(

> Because I want to draw shape`s moving of every particle in plot or
diagram. And at the end, achieve to shape`s moving of hole body.

I don't understand the usecase (maybe that is the problem).
What is "plot or diagram"? How should it look? Picture of deformed shape? Some polar diagram of displacements? ... ?
What is "every particle"? individual particles? only clumps?
What is "whole body"?
Do you have some examples to share?

Are you aware of tools like Paraview?
Is regular exporting of the simulation into paraview and then visualizing it in Paraview what you want? Why not?

>> According to docs [1], it "applies displacement".
> Any example for this? please..

I do not have any experience with it, but a simple example could be:
### 
s1 = sphere((0,0,0),1)
s2 = sphere((5,0,0),1)
O.bodies.append((s1,s2))
displacer = StepDisplacer(mov=(1,1,1)) # can also be used inside O.engines
O.step()
print("0",s1.state.pos,s2.state.pos)

displacer.ids = [0] # only apply 1st body
displacer() # run displacer
O.step()
print("1",s1.state.pos,s2.state.pos)

O.step()
print("2",s1.state.pos,s2.state.pos)

displacer.ids = [0,1] # both bodies
displacer() # run displacer
O.step()
print("3",s1.state.pos,s2.state.pos)

O.step()
print("4",s1.state.pos,s2.state.pos)
###

with output:
0 Vector3(0,0,0) Vector3(5,0,0)
1 Vector3(1,1,1) Vector3(5,0,0)
2 Vector3(1,1,1) Vector3(5,0,0)
3 Vector3(2,2,2) Vector3(6,1,1)
4 Vector3(2,2,2) Vector3(6,1,1)

Cheers
Jan

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