Mannually Update Location of Components of Clumps

Asked by MikeZhao on 2015-11-29

I did a test about mannually updating location of one clump's components:

## here is the example:
a = utils.sphere([0,0,0],1)
b = utils.sphere([0,0,1],1)
c = utils.sphere([0,0,2],1)
O.bodies.appendClumped([a,b,c]);

##Now, I want to mannually change the position of 'a':
a.state.pos = Vector3(0,0,100)

##However I don't know what information of the clump that contains 'a' should be changed.
##If I use O.step(), then the clump will set the location of 'a' back.

O.step()
a.state.pos
##Output:Vector3(-8.529034726309396e-18,4.7316020007752715e-17,-1.1102230246251565e-16)
##According to those examples about Clump, I figured out one solution: That is to remove a from the clump and then add it back:

O.bodies.releaseFromClump(0,3)
O.bodies.addToClump([0],3)
O.step()
a.state.pos
##Output:Vector3(9.525366606588648e-15,1.6515434853037192e-14,100)
##This is doable, but it will make the calculation really slow when there are many components. So I want to know if you can figure out some better solution?

Thanks for your precious time, and I'm looking forward to hearing from you!

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
MikeZhao
Solved:
2015-12-01
Last query:
2015-12-01
Last reply:
2015-12-01
Christian Jakob (jakob-ifgt) said : #1

Hi,

I do not understand the reason this:

> ## here is the example:
> a = utils.sphere([0,0,0],1)
> b = utils.sphere([0,0,1],1)
> c = utils.sphere([0,0,2],1)
> O.bodies.appendClumped([a,b,c]);
>
> ##Now, I want to mannually change the position of 'a':
> a.state.pos = Vector3(0,0,100)

Why dont you do the following?

a = utils.sphere([0,0,100],1)
b = utils.sphere([0,0,1],1)
c = utils.sphere([0,0,2],1)
O.bodies.appendClumped([a,b,c])

MikeZhao (zhaoyang12) said : #2

Actually I just tried to use the simplest example to describe the problem I've encountered:

I am working on FEM-DEM coupling now, and I want to use DEM to build a contact detector for different FE meshes. So I first transferred elements of FEM into utils.tetraPoly in DEM. To make calculation more efficient, I made tetraPoly that belongs to the same FE mesh a clump. And I need to update the positions of those tetraPoly in DEM using the positions of FEM's elements, so I need to change the positions of those tetraPoly mannually..

Hongyang Cheng (alex-cheng) said : #3

HI,

It looks you are doing FEM/DEM modeling pioneered by Munjiza‘s (FEs within
DEM). I am guessing the so-called PFacet element in Yade [1] would work in
this case, but It seems you have to wait until it is ready in trunk.

[1]
https://www.researchgate.net/publication/281203746_Geotextiles_and_Geomembranes

Cheers,
Alex

On Tue, Dec 1, 2015 at 4:07 AM, MikeZhao <
<email address hidden>> wrote:

> Question #275973 on Yade changed:
> https://answers.launchpad.net/yade/+question/275973
>
> MikeZhao gave more information on the question:
> Actually I just tried to use the simplest example to describe the
> problem I've encountered:
>
> I am working on FEM-DEM coupling now, and I want to use DEM to build a
> contact detector for different FE meshes. So I first transferred
> elements of FEM into utils.tetraPoly in DEM. To make calculation more
> efficient, I made tetraPoly that belongs to the same FE mesh a clump.
> And I need to update the positions of those tetraPoly in DEM using the
> positions of FEM's elements, so I need to change the positions of those
> tetraPoly mannually..
>
> --
> You received this question notification because your team yade-users is
> an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>

Christian Jakob (jakob-ifgt) said : #4

If you really need to modify your clumps, I think

O.bodies.releaseFromClump(0,3)
O.bodies.addToClump([0],3)

is the only way I know.

MikeZhao (zhaoyang12) said : #5

Thank you for your work~