# Mannually Update Location of Components of Clumps

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.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:
Assignee:
No assignee Edit question
Solved by:
MikeZhao
Solved:
2015-12-01
Last query:
2015-12-01
2015-12-01
 Christian Jakob (jakob-ifgt) said on 2015-11-30: #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 on 2015-11-30: #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 on 2015-11-30: #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.

Cheers,
Alex

On Tue, Dec 1, 2015 at 4:07 AM, MikeZhao <

> Question #275973 on Yade changed:
>
> 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..
>
> --
>
> _______________________________________________
> Post to : <email address hidden>
>

 Christian Jakob (jakob-ifgt) said on 2015-12-01: #4

If you really need to modify your clumps, I think

O.bodies.releaseFromClump(0,3)