# Cylinder Geometry Problem

I have tried constructing a cylinder using cylinder facet but get an error everytime. The code is below

O.bodies.append(utils.facetCylinder(center, radius, height, orientation=Quaternion((1, 0, 0), 0), segmentsNumber=10, wallMask=7, angleRange=None, closeGap=False, **kw)

Can anyone help me with this?

Regards

## Question information

Language:
English Edit question
Status:
Solved
For:
Assignee:
No assignee Edit question
Solved by:
Jan Stránský
Solved:
2013-01-30
Last query:
2013-01-30
2013-01-28
 Jan Stránský (honzik) said on 2013-01-25: #1

Hello,

next time please always write what error you got, it is much easier for

In this specific case:
utils has no function facetCylinder, try

geom.facetCylinder

instead. Furthermore, there is ")" missing at the end of your command.

cheers
Jan

> New question #220152 on Yade:
>
> I have tried constructing a cylinder using cylinder facet but get an error
> everytime. The code is below
>
> orientation=Quaternion((1, 0, 0), 0), segmentsNumber=10, wallMask=7,
> angleRange=None, closeGap=False, **kw)
>
> Can anyone help me with this?
>
> Regards
>
> --
> You received this question notification because you are a member of
>
> _______________________________________________
> Post to : <email address hidden>
>

 MOHAMMAD MOHSENI (mma25) said on 2013-01-25: #2

many thanks for your help Jan . can I just ask another simple question ?

How you can make a finite wall ? I just write this line which makes an infinite wall but I want to fit this moving wall in another box.

O.bodies.append(utils.wall(position=(5,0,4), axis=0, sense=-1))

 Jan Stránský (honzik) said on 2013-01-25: #3

for creating finite wall, you can use facets [1]. Either build your wall
manually wit as many facets as you want (e.g. two triangles could be
enough), or you can try to use geom.facetPolygon [2] (I peronally have
never used it).
In case of another questions, don't hesitate to ask :-)
good luck
Jan

> Question #220152 on Yade changed:
>
> MOHAMMAD MOHSENI posted a new comment:
> many thanks for your help Jan . can I just ask another simple question ?
>
> How you can make a finite wall ? I just write this line which makes an
> infinite wall but I want to fit this moving wall in another box.
>
> O.bodies.append(utils.wall(position=(5,0,4), axis=0, sense=-1))
>
>
> --
> You received this question notification because you are a member of
>
> _______________________________________________
> Post to : <email address hidden>
>

 MOHAMMAD MOHSENI (mma25) said on 2013-01-26: #4

Hi ,thanks for this

the thing is I want this wall to move , imagine a box full of spheres and one of the walls will move to inside and push the spheres to another side .I want to create this moving wall . is it possible with facets ?

 Jan Stránský (honzik) said on 2013-01-26: #5

it is possible. You can directly prescribe position of certain facets (or
prescribe velocity, which is preferable), or you can use TranslationEngine.

movingFacets = [facet1,facet2,...,facetN]
for f in movingFacets:
f.state.vel = Vector3(velx,vely,velz)

I have not used it myself, but isn't the same behavior possible also with
infinite walls?

Jan

> Question #220152 on Yade changed:
>
>
> MOHAMMAD MOHSENI is still having a problem:
> Hi ,thanks for this
>
> the thing is I want this wall to move , imagine a box full of spheres
> and one of the walls will move to inside and push the spheres to another
> side .I want to create this moving wall . is it possible with facets ?
>
>
> --
> You received this question notification because you are a member of
>
> _______________________________________________
> Post to : <email address hidden>
>

 MOHAMMAD MOHSENI (mma25) said on 2013-01-26: #6

Hi Jan

I will try this method you have mentioned .
by using infinite wall ,I can move the wall easily but as I am using it to model a die fill process ,I need to make the wall finite .

 Bruno Chareyre (bruno-chareyre) said on 2013-01-28: #7

If I don't miss something, you don't have to make the wall finite. You can use infinite planes or boxes larger than the cylinder.
I strongly recommend this as it will avoid the contact-on-edge problems of coplanar facets.

Consider having a look at the triax-tutorial examples, where boundary conditions are applied by large boxes (or, even simpler, go to the "generate" tab in the GUI and generate a triaxial test).

 MOHAMMAD MOHSENI (mma25) said on 2013-01-30: #8

Thanks Jan Stránský, that solved my question.

 MOHAMMAD MOHSENI (mma25) said on 2013-01-30: #9

Thanks Bruno , it helps a lot.

 403175147 (yanfb-1019) said on 2013-05-13: #10

Hello, teacher
I want to simulate triaxial experiments of standard cylinder specimens which radius is 0.025 meters and lenght is 0.1 meters, could you tell me how boundary conditions should be set ?
Regards

 Jan Stránský (honzik) said on 2013-05-13: #11

Hello,

I must say I haven't understood your question really well.. Do you want to
simulate a cylindrical shaped assembly of many particles? If so, what kind
of boundary conditions would you like to prescribe and where? :-)

If you want to presribe zero displacement of certain particles, you can set
blockedDOFs parameter [1], for instance like this:

boundary [] # list of particles, whise radius is grater than certain limit
for b in O.bodies:
pos = b.state.pos
r = Vector3(pos[0],pos[1],0).norm() # distance from z axis
for b in boundary:
b. state.blockedDOFs = 'xy' # blocked x and y displacement, z
displacement is still allowed

Appliyng axial displacement / force, you can use facets or walls, or use
the same trick as above to block some DOFs of bottom and top layer of
particles and prescribe some z velocity to them

If you want to aplly some transverse prestress, this might be a bit more
tricky, but definitely solvable :-)

If I understood your question wrong, sorry for spamming. In case of any
further questions, do not hesitate to ask.
Jan

> Question #220152 on Yade changed:
>
> pingyang.1019@163.com posted a new comment:
> Hello, teacher
> I want to simulate triaxial experiments of standard cylinder specimens
> which radius is 0.025 meters and lenght is 0.1 meters, could you tell me
> how boundary conditions should be set ?
> Regards
>
> --
> You received this question notification because you are a member of
>
> _______________________________________________
> Post to : <email address hidden>
>

 Luc Scholtès (luc) said on 2013-05-13: #12

Hello PingYang,

I guess your question is: Is it possible to simulate triaxial compressions on cylindrical specimens?

If yes, first, you should open a new thread/question, or maybe look at previous messages in relation to this topic (have a look there: https://answers.launchpad.net/yade). Second, if I may answer, it is not possible to simulate triaxial tests on cylindrical specimens at the moment. To my knowledge, there is no predefined engine capable of doing that in the source code and you will need to implement a new one by yourself or maybe code it through python scripting (is that even possible?...). However, triaxial compressions can be simulated on cubical specimens quite easily (either using external walls/boxes or periodic boundary conditions). Have a look at the examples directory in the source code, you may find useful things.

If no, sorry for misunderstanding your question.

Luc

 Jan Stránský (honzik) said on 2013-05-27: #13

Hello,
just for your information, in latest git version, I created a very simple
(perhaps naive :-) script to simulate triaxial test on cylinder
(examples/concrete/triax.py), so you can try it.
Best regards
Jan

> Question #220152 on Yade changed:
>
> pingyang.1019@163.com posted a new comment:
> Hello, teacher
> I want to simulate triaxial experiments of standard cylinder specimens
> which radius is 0.025 meters and lenght is 0.1 meters, could you tell me
> how boundary conditions should be set ?
> Regards
>
> --
> You received this question notification because you are a member of
>
> _______________________________________________
> Post to : <email address hidden>
>

 Bruno Chareyre (bruno-chareyre) said on 2013-05-27: #14

Very nice Jan, I'll try eventually.
I suggest to always put author references in the example scripts as for
any other file. It is sometimes useful to know where to ask details
(especially when it comes to repository cleaning).

Best.

Bruno

 403175147 (yanfb-1019) said on 2013-05-29: #15

thank you very much

>
>Jan Stránský posted a new comment:
>Hello,
>just for your information, in latest git version, I created a very simple
>(perhaps naive :-) script to simulate triaxial test on cylinder
>(examples/concrete/triax.py), so you can try it.
>Best regards
>Jan
>
>
>
>> Question #220152 on Yade changed:
>>
>> pingyang.1019@163.com posted a new comment:
>> Hello, teacher
>> I want to simulate triaxial experiments of standard cylinder specimens
>> which radius is 0.025 meters and lenght is 0.1 meters, could you tell me
>> how boundary conditions should be set ?
>> Regards
>>
>> --
>> You received this question notification because you are a member of
>>
>> _______________________________________________
>> Post to : <email address hidden>
>>
>
>--