← Back to team overview

yade-users team mailing list archive

Re: How to make an inclined wall? or cylindrical wall


Feng, Chen said:     (by the date of Wed, 9 Nov 2005 00:57:57 -0500)

>     I am now trying to make a cylidrical tube which contain hundreds of 
> particles, one way of doing that I think is to make small pieces of 
> rectangular walls to form a shape of the wall, but I read through the codes 
> and did not find such kind of example to make the wall inclined?

position and orientation of Body is its Se3. in .xml file it's following:

<body _className_="Body"  id="0" groupMask="1" isDynamic="0">
  <physicalParameters _className_="BodyMacroParameters"  se3="{0 0 0 1 0 0 0}"  (...)
those 7 numbers are:

se3="position_x position_y position_z vector_x vector_y vector_z rotation_around_that_vector_in_radians"

inside any FileGenerator you can find for example those lines of code:

void SDECSpheresPlane::createBox(shared_ptr<Body>& body, Vector3r position, Vector3r extents)
// ....
	Quaternionr q;
	q.fromAxisAngle( Vector3r(0,0,1),0); // this function creates an orientation quaterion
                                             // from rotating around vector (0,0,1) by 0 radians.
// ....
	physics->se3			= Se3r(position,q);
// ....

with that information you should be able to modify a filegenerator so
that it creates lots of box-walls, that together form a tube.

Another solution is to create a GeometricalModel that represents a
cylinder. Benefit would be that you will have a perfect representation
of a cylinder, and you can write a function that calculates
SpheresContactGeometry from contact between a Sphere and that cylinder.

I wanted to do that at some point in the past, but have never finished
it. I called that class HollowCylinder, because it's not a real cylinder
- it's a hollow cylinder :)

Classes that should be written are:

1. stores data about cylinder (insideRadius,outsideRadius,height): [done]
-  DataClass/GeometricalModel/HollowCylinder

2. draws it using OpenGL:       [I'm not OpenGL expert, so I have problems here, not done]
-  RenderingEngine/GLDrawGeometricalModel/GLDrawHollowCylinder

3. there are many ways for a hollow cylinder to interact.
We can pick the simplest one, just by duplicating the HollowCylinder
class:                                                   [not done]

-  DataClass/InteractingGeometry/InteractingHollowCylinder

3a.Another way, would be for example to fill the walls of hollow cylinder
with spheres (or vertical boxes) inside:

-  DataClass/InteractingGeometry/InteractingSphereTree

4.A way to build SpheresContactGeometry when a collision between
Sphere and HollowCylinder occurs:                        [not done]

- Engine/EngineUnit/InteractingSphere2InteractingHollowCylinder4SpheresContactGeometry

4a.A way to build SpheresContactGeometry when a collision between Sphere and HollowCylinder occurs:
- Engine/EngineUnit/InteractingSphere2InteractingSphereTree4SpheresContactGeometry

5. a FileGenerator that uses it. (I really look forward to the future
when writing source C++ code for filegenerators will not be necessary to
build a model for simulation)                            [well, it's started]

when we have all that it should be possible to run a simulation with
perfect mathematical hollow cylinder. (well maybe I forgot something but
it's about everything important we need ;)

When ElasticContactLaw has a class SpheresContactGeometry it doesn't
care that the interaction is between sphere and a cylinder. it only
needs SpheresContactGeometry class with data inside. If you can create a
class SpheresContactGeometry from collision of sqashed ellipsoid with a
green blob, then you can calculate forces between them and simulate
their collision with ElastiContactLaw. Unfortunately for such complex
examples that involve ellipsoids it is not methematically easy to
calculate SpheresContactGeometry ;)

But for a cylinder it should be quite trival, except for the border
cases, when a Sphere collides with cylinder's ending edge.

If you want to try to code a HollowCylinder, let me know. I can send
you what I already have. But as you see above - I've stopped on the
problem of drawing it on the display :> I think that other things
shouldn't be too difficult to code.

>     I don't know if it is appropriate to attach a jpg file here, but the 
> picture attached should be helpful to illustrate my problem.

I had let it go trough. maximum size of attachments that go without
asking moderator is 40kb.

Janek Kozicki                                                         |
Yade-users mailing list