User’s manual¶
Scene construction¶
Adding particles¶
The BodyContainer holds Body objects in the simulation; it is accessible as O.bodies
.
Creating Body objects¶
Body objects are only rarely constructed by hand by their components (Shape, Bound, State, Material); instead, convenience functions sphere, facet and wall are used to create them. Using these functions also ensures better future compatibility, if internals of Body change in some way. These functions receive geometry of the particle and several other characteristics. See their documentation for details. If the same Material is used for several (or many) bodies, it can be shared by adding it in O.materials
, as explained below.
Defining materials¶
The O.materials
object (instance of Omega.materials) holds defined shared materials for bodies. It only supports addition, and will typically hold only a few instances (though there is no limit).
label
given to each material is optional, but can be passed to sphere and other functions for constructing body. The value returned by O.materials.append
is an id
of the material, which can be also passed to sphere – it is a little bit faster than using label, though not noticeable for small number of particles and perhaps less convenient.
If no Material is specified when calling sphere, the last defined material is used; that is a convenient default. If no material is defined yet (hence there is no last material), a default material will be created: FrictMat(density=1e3,young=1e7,poisson=.3,frictionAngle=.5). This should not happen for serious simulations, but is handy in simple scripts, where exact material properties are more or less irrelevant.
Yade [1]: len(O.materials)
Out[1]: 0
Yade [2]: idConcrete=O.materials.append(FrictMat(young=30e9,poisson=.2,frictionAngle=.6,label="concrete"))
Yade [3]: O.materials[idConcrete]
Out[3]: <FrictMat instance at 0x2c6c130>
# uses the last defined material
Yade [4]: O.bodies.append(sphere(center=(0,0,0),radius=1))