woo.dem
¶
Packings¶
TODO
ShapePack¶

class
woo.dem.
ShapePack
¶ Representation of geometry of many particles, with the ability of text I/O. It is meant as a replacement for
woo.pack.SpherePack
, which only handles spherical particles.[ pkg/dem/ShapePack.hpp , pkg/dem/ShapePack.cpp ]

cellSize
(= Vector3(0, 0, 0))¶ Positive components signify periodic boundary along the respective axis.
[type:
Vector3
]

movable
(= False)¶ Whether the packing is movable, i.e. should be automatically recentered after filtered with a predicate.
[type: bool]

div
(= 5)¶ Default value for recomputing properties of clumps (relative to the smallest equivalent radius)
[type: int]

raws
(= [])¶ Raw shapes of particles/clumps.
[type: vector<shared_ptr<ShapeClump>>]

userData
(= '')¶ String of arbitrary user data to be loaded/saved with the ShapePack.
[type: string]

loadFrom
(= '')¶ If given when constructing the instance, the file is loaded immediately and the attribute is reset.
[type: string]

add
((ShapePack)arg1, (object)shapes[, (bool)clumped=True]) → None¶

canonicalize
((ShapePack)arg1) → None¶

cellRepeat
((ShapePack)arg1, (Vector3i)arg2) → None¶

filter
((ShapePack)arg1, (Predicate)predicate[, (int)recenter=1]) → None¶

filtered
((ShapePack)arg1, (Predicate)predicate[, (int)recenter=1]) → ShapePack¶

fromDem
((ShapePack)arg1, (Scene)scene, (DemField)dem[, (int)mask=0[, (bool)skipUnsupported=True]]) → None¶

load
((ShapePack)arg1, (str)arg2) → None¶

loadTxt
((ShapePack)arg1, (str)arg2) → None¶

save
((ShapePack)arg1, (str)arg2) → None¶

saveTxt
((ShapePack)arg1, (str)arg2) → None¶

solidVolume
((ShapePack)arg1) → float¶

toDem
((ShapePack)arg1, (Scene)scene, (DemField)dem, (Material)mat[, (int)mask=5[, (float)color=nan]]) → None¶

translate
((ShapePack)arg1, (Vector3)arg2) → None¶

RawShape¶

class
woo.dem.
RawShape
¶ Object holding raw geometry data for one
Shape
in a uniform manner: center and radius of bounding sphere, plus an array of raw data. It is used as an intermediary shapeneutral storage format.[ pkg/dem/ShapePack.hpp , pkg/dem/ShapePack.cpp ]

className
(= '')¶ Name of the Shape subclass.
[type: string]

radius
(= 0.0)¶ Radius of the bounding sphere.
[type: Real]

raw
(= [])¶ Raw data for shape reconstruction; the size of the array is shapespecific.
[type: vector<Real>]

ShapeClump¶

class
woo.dem.
ShapeClump
¶ Defines pure geometry of clumps. This is a base class, not to be used asis.

scaleProb
(= [])¶ Used by particle generators: piecewiselinear function probability(equivRad) given as a sequence of x,y coordinates. If not given, constant function \(p(d)=1\) is assumed. See the documentation of
woo.dem.PsdClumpGenerator
for details.[type: vector<Vector2r>]

pos
(= Vector3(0, 0, 0))¶ Centroid position (computed automatically)
[type:
Vector3
, not dumped, readonly in python]

ori
(= Quaternion((1, 0, 0), 0))¶ Principal axes orientation (computed automatically)
[type:
Quaternion
, not dumped, readonly in python]

volume
(= nan)¶ Volume (computed automatically)
[type: Real, unit: m³, not dumped, readonly in python]

equivRad
(= nan)¶ Equivalent radius of the clump (computed automatically) – mean of radii of gyration, i.e. \(\frac{1}{3}\sum \sqrt{I_{ii}/V}\).
[type: Real, unit: m, not dumped, readonly in python]

inertia
(= Vector3(nan, nan, nan))¶ Geometrical inertia (computed with unit density)
[type:
Vector3
, not dumped, readonly in python]

div
(= 5)¶ Sampling grid fineness, when computing volume and other properties, relative to the smallest sphere’s radius. When zero or negative, assume spheres don’t intersect and use a different algorithm (Steiner’s theorem).
[type: int, not dumped]

clumped
(= True)¶ Whether nodes of this shape are clumped together when the particle is created (so far, clumped shapes only are produced).
[type: bool, readonly in python]

makeParticles
((ShapeClump)arg1, (Material)mat, (Vector3)pos[, (Quaternion)ori=Quaternion((1, 0, 0), 0)[, (float)scale=1.0[, (int)mask=5]]]) → tuple :¶ Create particle(s) as described by this geometry, positioned in pos and rotated with ori. Geometry will be scaled by scale. Returns tuple ([Node,…],[Particle,..]).

recompute
((ShapeClump)arg1[, (int)div=5[, (bool)failOk=False[, (bool)fastOnly=False]]]) → None :¶ Recompute principal axes of the clump, using div for subdivision (see
div
for the semantics). failOk (silently return in case of invalid data) and fastOnly (return if there is lots of cells in subdivision) are only to be used internally.

SphereClumpGeom¶
Object
→ ShapeClump
→ SphereClumpGeom

class
woo.dem.
SphereClumpGeom
¶ Defines geometry of spherical clumps. Each clump is described by spheres it is made of (position and radius).
[ pkg/dem/Clump.hpp , pkg/dem/Clump.cpp ]

centers
(= [])¶ Centers of constituent spheres, in clumplocal coordinates.
[type: vector<Vector3r>]

radii
(= [])¶ Radii of constituent spheres
[type: vector<Real>]

static
fromSpherePack
((SpherePack)pack[, (int)div=5]) → object :¶ Return [
SphereClumpGeom
] which contain all clumps and spheres from givenSpherePack
.

RawShapeClump¶
Object
→ ShapeClump
→ RawShapeClump

class
woo.dem.
RawShapeClump
¶ Clump consisting of generic shapes (
RawShape
).[ pkg/dem/ShapePack.hpp , pkg/dem/ShapePack.cpp ]

rawShapes
(= [])¶ Data for creating primitive shapes
[type: vector<shared_ptr<RawShape>>]

ForcesToHdf5¶
Object
→ Engine
→ PeriodicEngine
→ ForcesToHdf5

class
woo.dem.
ForcesToHdf5
¶ Periodically export nodal/contact forces to HDF5 file. Nodal forces are only exported for tagged nodes (having
DemDataTagged
attached, instead of plainDemData
) and include both force and torque. Contact forces only export force (not torque, which is zero for most models, but the adaptation would be easy).[ pkg/dem/Hdf5Export.hpp , pkg/dem/Hdf5Export.cpp ]

what
(= 0)¶ Select whether to export nodal forces (default) or contact forces.
[type: int, named enum, possible values are: ‘node’ (‘nodes’, ‘nodal’; 0), ‘contact’ (‘contacts’; 1)]

contMask
(= 2)¶ Only export contacts where at least one particle matches this mask. If zero, match all contacts. If this
Contact.pA
has matching mask, inverts force sense; this has as result that (unless both particles match) the force is exported as it acts on the matching particle.[type: int]

out
(= '')¶ Name of the output file.
[type: string]

deflate
(= 9)¶ Compression level for HDF5 chunked storage; valid values are 0 to 9 (will be clamped if outside).
[type: int]

NodalForcesToHdf5¶
Object
→ Engine
→ PeriodicEngine
→ ForcesToHdf5
→ NodalForcesToHdf5

class
woo.dem.
NodalForcesToHdf5
¶ Legacy class which only serves for backwards compatibility.
Collision detection¶
TODO
Collider¶

class
woo.dem.
Collider
¶ Abstract class for finding spatial collisions between bodies.
[ pkg/dem/Collision.hpp , pkg/dem/Collision.cpp ]

static
mayCollide
((DemField)dem, (Particle)pA, (Particle)pB) → bool :¶ Predicate whether two particles in question may collide or not

probeAabb
((Collider)arg1, (Vector3)mn, (Vector3)mx) → object :¶ Return list of particles intersected by axisaligned box with given corners

static
InsertionSortCollider¶
Object
→ Engine
→ Collider
→ InsertionSortCollider

class
woo.dem.
InsertionSortCollider
¶ Collider with O(n log(n)) complexity, using
Aabb
for bounds.At the initial step, Bodies’ bounds (along sortAxis) are first std::sort’ed along one axis (sortAxis), then collided. The initial sort has \(O(n^2)\) complexity, see Colliders’ performance for some information (There are scripts in examples/colliderperf for measurements).
Insertion sort is used for sorting the bound list that is already presorted from last iteration, where each inversion calls checkOverlap which then handles either overlap (by creating interaction if necessary) or its absence (by deleting interaction if it is only potential).
Bodies without bounding volume (such as clumps) are handled gracefully and never collide. Deleted bodies are handled gracefully as well.
This collider handles periodic boundary conditions. There are some limitations, notably:
 No body can have Aabb larger than cell’s half size in that respective dimension. You get exception it it does and gets in interaction.
 No body can travel more than cell’s distance in one step; this would mean that the simulation is numerically exploding, and it is only detected in some cases.
Stride can be used to avoid running collider at every step by enlarging the particle’s bounds, tracking their velocities and only rerun if they might have gone out of that bounds (see Verlet list for brief description and background) . This requires cooperation from
Leapfrog
as well asBoundDispatcher
, which will be found among engines automatically (exception is thrown if they are not found).If you wish to use strides, set
verletDist
(length by which bounds will be enlarged in all directions) to some value, e.g. 0.05 × typical particle radius. This parameter expresses the tradeoff between many potential interactions (running collider rarely, but with longer exact interaction resolution phase) and few potential interactions (running collider more frequently, but with less exact resolutions of interactions); it depends mainly on packing density and particle radius distribution.[ pkg/dem/InsertionSortCollider.hpp , pkg/dem/InsertionSortCollider.cpp ]

forceInitSort
(= False)¶ When set to true, full sort will be run regardless of other conditions. This flag is then reset automatically to false
[type: bool]

noBoundOk
(= False)¶ Allow particles without bounding box. This is currently only useful for testing
woo.fem.Tetra
which don’t undergo any collisions.[type: bool]

sortAxis
(= 0)¶ Axis for the initial contact detection.
[type: int]

sortThenCollide
(= False)¶ Separate sorting and colliding phase; it is MUCH slower, but all interactions are processed at every step; this effectively makes the collider nonpersistent, not remembering last state. (The default behavior relies on the fact that inversions during insertion sort are overlaps of bounding boxes that just started/ceased to exist, and only processes those; this makes the collider much more efficient.)
[type: bool]

verletDist
(= 0.05)¶ Length by which to enlarge particle bounds, to avoid running collider at every step. Stride disabled if zero, and bounding boxes are updated at every step. Negative value will trigger automatic computation, so that the real value will be
verletDist
× minimum spherical particle radius and minimumInlet
radius (for particles which don’t exist yet); if there is no minimum radius found, it will be set to 0.0 (with a warning) and disabled.[type: Real]

maxVel2
(= 0.0)¶ Maximum encountered velocity of a particle, to compute bounding box shift.
[type: Real, readonly in python]

nFullRuns
(= 0)¶ Number of full runs, when collision detection is needed; only informative.
[type: int]

numReinit
(= 0)¶ Cumulative number of bound array reinitialization.
[type: int, readonly in python]

stepInvs
(= Vector3i(0, 0, 0))¶ Number of inversions in insertion sort in the last step; always zero in the nondebug builds
[type:
Vector3i
]

numInvs
(= Vector3i(0, 0, 0))¶ Cumulative number of inversions in insertion sort; always zero in the nondebug builds
[type:
Vector3i
]

boundDispatcher
(= <BoundDispatcher @ 0x2af1ea0>)¶ BoundDispatcher
object that is used for creatingbounds
on collider’s request as necessary.[type: shared_ptr<
BoundDispatcher
>, readonly in python]

ompTuneSort
(= Vector3i(1, 1000, 0))¶ Finetuning for the OpenMPparallellized partial insertion sort. The first number is the number of chunks per CPU (2 means each core will process 2 chunks sequentially, on average). The second number (if positive) is the lower bound on number of particles per chunk; the third number (if positive) is the limit of bounds per one chunk (15000 means that if there are e.g. 300k particles, bounds will be processed in 20 chunks, even if the number of chunks from the first number is smaller).
[type:
Vector3i
]

sortChunks
(= 1)¶ Number of threads that were actually used during the last parallelized insertion sort.
[type: int, readonly in python]

paraPeri
(= False)¶ (debugging only): enable/disable(default) parallel sort with periodic boundaries.
[type: bool]

periDbgNew
(= False)¶ Compute periodic overlaps and periods twice (with the original and the new algorithm) compare the results and report discrepancies.
[type: bool]

maxSortPass
(= 20)¶ If partial sort is not done after this many passes, give up. Usually more than 2 passes already means a particle went crazy or the whole simulation is exploding.
[type: int]

dbgInfo
((InsertionSortCollider)arg1) → object :¶ Return python distionary with information on some internal structures (debugging only)

dumpBounds
((InsertionSortCollider)arg1) → tuple :¶ Return representation of the internal sort data. The format is
([...],[...],[...])
for 3 axes, where each...
is a list of entries (bounds). The entry is a tuple with the fllowing items: coordinate (float)
 body id (int), but negated for negative bounds
 period numer (int), if the collider is in the periodic regime.

maxima
¶ Array of maximum bbox coords; every 3 contiguous values are x, y, z for one particle

minima
¶ Array of minimum bbox coords; every 3 contiguous values are x, y,z for one particle

periodic
¶ Whether the collider is in periodic mode (readonly; for debugging)

spatialOverlap
((InsertionSortCollider)arg1, (Scene)scene, (int)id1, (int)id2) → object :¶ Debug access to the spatial overlap function.

strideActive
¶ Whether striding is active (readonly; for debugging).
GridCollider¶
Object
→ Engine
→ Collider
→ GridCollider

class
woo.dem.
GridCollider
¶ Gridbased collider.
[ pkg/dem/GridCollider.hpp , pkg/dem/GridCollider.cpp ]
► Grid geometry

domain
(= AlignedBox3((0, 0, 0), (1, 1, 1)))¶ Domain spanned by the grid.
[type:
AlignedBox3
]
► Data

gridOld
(= None)¶ Grid containing entries in
gridPrev
but not ingridCurr
.[type: shared_ptr<
GridStore
>, not saved]

gridNew
(= None)¶ Grid containing entries in
gridCurr
but not ingridPrev
.[type: shared_ptr<
GridStore
>, not saved]
► Rendering

renderCells
(= False)¶ Render cells.
[type: bool]

minOccup
(= 0)¶ Minimum occupancy for cell to be rendered (zero cells are never rendered).
[type: int]

occupancyRange
(= None)¶ Range for coloring grids based on occupancy (automatically created)
[type: shared_ptr<
ScalarRange
>]
► Tunables

exIniSize
(= 6)¶ GridStore.exIniSize
for new grids.[type: int]

exNumMaps
(= 100)¶ GridStore.exNumMaps
for new grids.[type: int]

verletDist
(= 0.0)¶ Length by which particle size is enalrged, to avoid running the collider at every timestep.
[type: Real, unit: m]

verletSteps
(= 0)¶ If positive, enlarge boxes of some particle nodes (currently only spheres are supported) so that they will still be inside the box after verletSteps with their current velocity;
verletDist
is still used when velocity is too small.[type: int]

nFullRuns
(= 0)¶ Cumulative number of full runs, when collision detection is needed.
[type: int]

complSetMinSize
(= 1)¶ The value of setMinSize when calling
GridStore.computeRelativeComplements
.[type: int]

useDiff
(= True)¶ Create new contacts based on set complement of
gridPrev
with respect togridCurr
if both contain meaningful data and are compatible; if false, always traverse gridCurr and try adding all possible contacts (this should be much slower)[type: bool]

around
(= False)¶ If frue, particle in every cell is checked with particles in all cells around; this makes the grid storage substantially less loaded, as all particles can be shrunk by one half of the cell size.
Warning
this feature is broken and will raise exception if enabled; the tradeoff is not good, since many more cells need to be checked around every cell, and many more potential contacts are created.
[type: bool]

shrink
(= 0.0)¶ The amount of shrinking for each particle (half of the minimum cell size if around is true, zero otherwise.
[type: Real, not shown in the UI, readonly in python]

boundDispatcher
(= <GridBoundDispatcher @ 0x2acf240>)¶ Dispatches
GridBound
creation toGridBoundFuctor
based onShape
type.[type: shared_ptr<
GridBoundDispatcher
>]

GridStore¶

class
woo.dem.
GridStore
¶ 3d grid storing scalar (particles ids) in partially dense array; the grid is actually 4d (gridSize×cellLen), and each cell may contain additional items in separate mapped storage, if the cellLen is not big enough to accomodate required number of items. Appending to cells is guarded via mutexes (with
denseLock
) optionally, appending to extra storage is mutexprotected always. Write acces from python should be used for testing exclusively.[ pkg/dem/GridStore.hpp , pkg/dem/GridStore.cpp ]

cellLen
(= 4)¶ Size of the dense storage in each cell
[type: int, readonly in python]

denseLock
(= True)¶ Whether this grid supports percell dense storage locking for appending (must use protected_append)
[type: bool, readonly in python]

exIniSize
(= 4)¶ Initial size of extension vectors, and step of their growth if needed.
[type: int, readonly in python]

exNumMaps
(= 10)¶ Number of maps for extra items not fitting the dense storage (it affects how finegrained is locking for those extra elements)
[type: int, readonly in python]

__delitem__
((GridStore)arg1, (Vector3i)arg2) → None¶

__getitem__
((GridStore)arg1, (Vector3i)arg2) → list¶

__setitem__
((GridStore)arg1, (Vector3i)arg2, (object)arg3) → None¶

append
((GridStore)arg1, (Vector3i)ijk, (int)id) → None :¶ Append new element; uses mutexes with
denseLock

complements
((GridStore)arg1, (GridStore)B[, (int)setMinSize=1]) → tuple¶

countEx
((GridStore)arg1) → dict :¶ Return dictionary mapping ijk to number of items in the extra storage.

counts
((GridStore)arg1) → object :¶ Return array with number of cells with given number of elements: [number of cells with 0 elements, number of cells with 1 elements, …]

ijk2box
((GridStore)arg1, (Vector3i)ijk) → AlignedBox3 :¶ Box for given cell

ijk2lin
((GridStore)arg1, (Vector3i)arg2) → int¶

lin2ijk
((GridStore)arg1, (int)arg2) → Vector3i¶

size
((GridStore)arg1, (Vector3i)arg2) → int¶

xyz2ijk
((GridStore)arg1, (Vector3)arg2) → Vector3i :¶ Convert spatial coordinates to cell coordinate (no bound checking is done)

xyzNearIjk
((GridStore)arg1, (Vector3i)from, (Vector3i)ijk) → Vector3 :¶ Return point nearest to from (given in cell coords) in cell ijk

xyzNearXyz
((GridStore)arg1, (Vector3)from, (Vector3i)ijk) → Vector3 :¶ Return point nearest to from*(given in spatial coords) in cell *ijk (corner, at a face, on an edge, inside)

Bound¶

class
woo.dem.
Bound
¶ Object bounding the associated body.

box
(= AlignedBox3((1.7976931348623157e308, 1.7976931348623157e308, 1.7976931348623157e308), (1.7976931348623157e308, 1.7976931348623157e308, 1.7976931348623157e308)))¶ Axisaligned bounding box.
[type:
AlignedBox3
, unit: m, not saved, readonly in python]

dispHierarchy
((Bound)arg1[, (bool)names=True]) → list :¶ Return list of dispatch classes (from down upwards), starting with the class instance itself, toplevel indexable at last. If names is true (default), return class names rather than numerical indices.

dispIndex
¶ Return class index of this instance.

GridBound¶

class
woo.dem.
GridBound
¶ Bound defined via grid cell indices (used with
GridCollider
)[ pkg/dem/GridBound.hpp , pkg/dem/GridBound.cpp ]

nodePlay
(= [])¶ Space in which respective nodes of the shapes may be without triggering new contact detection
[type: vector<AlignedBox3r>, readonly in python]

Aabb¶

class
woo.dem.
Aabb
¶ Axisaligned bounding box, for use with InsertionSortCollider.

nodeLastPos
(= [])¶ Node positions when bbox was last updated.
[type: vector<Vector3r>, unit: m, readonly in python]

maxD2
(= 0.0)¶ Maximum allowed squared distance for nodal displacements (i.e. how much was the bbox enlarged last time)
[type: Real, unit: m², not shown in the UI, readonly in python]

maxRot
(= nan)¶ Maximum allowed rotation (in radians, without discriminating different angles) that does not yet invalidate the bbox. Functor sets to 1 (or other negative value) for particles where node rotation does not influence the box (such as spheres or facets); in that case, orientation difference is not computed at all. If it is left at NaN, it is an indication that the functor does not implemnt this behavior and an error will be raised in the collider.
[type: Real, readonly in python]

nodeLastOri
(= [])¶ Node orientations when bbox was last updated.
[type: vector<Quaternionr>, readonly in python]

BoundFunctor¶
Object
→ Functor
→ BoundFunctor

class
woo.dem.
BoundFunctor
¶ Functor for creating/updating
woo.dem.Bound
.
Bo1_Capsule_Aabb¶
Bo1_Wall_Aabb¶
Bo1_Facet_Aabb¶
Bo1_Sphere_Aabb¶
Object
→ Functor
→ BoundFunctor
→ Bo1_Sphere_Aabb

class
woo.dem.
Bo1_Sphere_Aabb
¶ Functor creating
Aabb
fromSphere
. HonorsDemField.distFactor
.[ pkg/dem/Sphere.hpp , pkg/dem/Sphere.cpp ]

distFactor
(= 1.0)¶ removed in API 10103, set
DemField.distFactor
instead.[type: Real, not shown in the UI, not dumped, DEPRECATED, raises
ValueError
when accessed]

Bo1_Ellipsoid_Aabb¶
Object
→ Functor
→ BoundFunctor
→ Bo1_Sphere_Aabb
→ Bo1_Ellipsoid_Aabb

class
woo.dem.
Bo1_Ellipsoid_Aabb
¶ Functor creating
Aabb
fromEllipsoid
.Todo
Handle rotation which is not detected by verlet distance!
Warning
woo.dem.DemField.distFactor
is ignored.
Bo1_Rod_Aabb¶
Object
→ Functor
→ BoundFunctor
→ Bo1_Rod_Aabb

class
woo.dem.
Bo1_Rod_Aabb
¶ Compute
woo.dem.Aabb
of aRod
particle
Bo1_InfCylinder_Aabb¶
Object
→ Functor
→ BoundFunctor
→ Bo1_InfCylinder_Aabb

class
woo.dem.
Bo1_InfCylinder_Aabb
¶ Creates/updates an
Aabb
of aInfCylinder
GridBoundFunctor¶
Object
→ Functor
→ GridBoundFunctor

class
woo.dem.
GridBoundFunctor
¶ Functor for creating/updating
woo.dem.GridBound
.
Grid1_Sphere¶
Object
→ Functor
→ GridBoundFunctor
→ Grid1_Sphere

class
woo.dem.
Grid1_Sphere
¶ Functor filling
GridStore
fromSphere
, used withGridCollider
.[ pkg/dem/GridBound.hpp , pkg/dem/GridBound.cpp ]

distFactor
(= 1.0)¶ removed in API 10103, set
DemField.distFactor
instead.[type: Real, not shown in the UI, not dumped, DEPRECATED, raises
ValueError
when accessed]

Grid1_Facet¶
Object
→ Functor
→ GridBoundFunctor
→ Grid1_Facet

class
woo.dem.
Grid1_Facet
¶ Functor filling
GridStore
fromFacet
, used withGridCollider
.[ pkg/dem/GridBound.hpp , pkg/dem/GridBound.cpp ]

movable
(= False)¶ Set to allow movable facets (with grid enlarged by
GridCollider.verletDist
. If false and a moving facet is encountered, an exception is raised.[type: bool]

Grid1_InfCylinder¶
Object
→ Functor
→ GridBoundFunctor
→ Grid1_InfCylinder

class
woo.dem.
Grid1_InfCylinder
¶ Functor filling
GridStore
fromInfCylinder
, used withGridCollider
.[ pkg/dem/GridBound.hpp , pkg/dem/GridBound.cpp ]

movable
(= False)¶ Set to allow movable cylinders (with grid enlarged by
GridCollider.verletDist
. If false and a moving cylinder is encountered, an exception is raised.[type: bool]

Grid1_Wall¶
Object
→ Functor
→ GridBoundFunctor
→ Grid1_Wall

class
woo.dem.
Grid1_Wall
¶ Functor filling
GridStore
fromWall
, used withGridCollider
.[ pkg/dem/GridBound.hpp , pkg/dem/GridBound.cpp ]

movable
(= False)¶ Set to allow movable walls (with grid enlarged by
GridCollider.verletDist
. If false and a movable wall is encountered, an exception is raised.[type: bool]

BoundDispatcher¶
Object
→ Engine
→ Dispatcher
→ BoundDispatcher

class
woo.dem.
BoundDispatcher
¶ Dispatcher calling
functors
based on received argument type(s).[ pkg/dem/Collision.hpp , pkg/dem/Collision.cpp ]

functors
(= [])¶ Functors active in the dispatch mechanism [overridden below].
[type: vector<shared_ptr<BoundFunctor> >]

dispFunctor
((BoundDispatcher)arg1, (Shape)arg2) → BoundFunctor :¶ Return functor that would be dispatched for given argument(s); None if no dispatch; ambiguous dispatch throws.

dispMatrix
((BoundDispatcher)arg1[, (bool)names=True]) → dict :¶ Return dictionary with contents of the dispatch matrix.

GridBoundDispatcher¶
Object
→ Engine
→ Dispatcher
→ GridBoundDispatcher

class
woo.dem.
GridBoundDispatcher
¶ Dispatcher calling
functors
based on received argument type(s).
functors
(= [])¶ Functors active in the dispatch mechanism [overridden below].
[type: vector<shared_ptr<GridBoundFunctor> >]

dispFunctor
((GridBoundDispatcher)arg1, (Shape)arg2) → GridBoundFunctor :¶ Return functor that would be dispatched for given argument(s); None if no dispatch; ambiguous dispatch throws.

dispMatrix
((GridBoundDispatcher)arg1[, (bool)names=True]) → dict :¶ Return dictionary with contents of the dispatch matrix.

Internal forces¶
TODO
IntraForce¶
Object
→ Engine
→ Dispatcher
→ IntraForce

class
woo.dem.
IntraForce
¶ Apply internal forces on integration nodes, by calling appropriate
IntraFunctor
objects.[ pkg/dem/IntraForce.hpp , pkg/dem/IntraForce.cpp ]

functors
(= [])¶ Functors active in the dispatch mechanism [overridden below].
[type: vector<shared_ptr<IntraFunctor> >]

dispFunctor
((IntraForce)arg1, (Shape)arg2, (Material)arg3) → IntraFunctor :¶ Return functor that would be dispatched for given argument(s); None if no dispatch; ambiguous dispatch throws.

dispMatrix
((IntraForce)arg1[, (bool)names=True]) → dict :¶ Return dictionary with contents of the dispatch matrix.

IntraFunctor¶
Object
→ Functor
→ IntraFunctor

class
woo.dem.
IntraFunctor
¶ Functor appying internal forces
In2_Facet¶
Object
→ Functor
→ IntraFunctor
→ In2_Facet
In2_Truss_ElastMat¶
Object
→ Functor
→ IntraFunctor
→ In2_Truss_ElastMat

class
woo.dem.
In2_Truss_ElastMat
¶ Compute elastic response of cylinder determined by 2 nodes.
[ pkg/dem/Truss.hpp , pkg/dem/Truss.cpp ]

setL0
(= True)¶ Automatically set equilibrium length of truss, when first encountered.
[type: bool]

In2_Sphere_ElastMat¶
Object
→ Functor
→ IntraFunctor
→ In2_Sphere_ElastMat

class
woo.dem.
In2_Sphere_ElastMat
¶ Apply contact forces on sphere; having one node only, Sphere generates no internal forces as such.
[ pkg/dem/Sphere.hpp , pkg/dem/Sphere.cpp ]

alreadyWarned_ContactLoopWithApplyForces
(= False)¶ Keep track of whether the warning on ContactLoop already applying forces was issued.
[type: bool, not shown in the UI]

In2_Wall_ElastMat¶
Object
→ Functor
→ IntraFunctor
→ In2_Wall_ElastMat

class
woo.dem.
In2_Wall_ElastMat
¶ Apply contact forces on wall. Wall generates no internal forces as such. Torque from applied forces is discarded, as Wall does not rotate.
Contacts¶
TODO
Contact¶

class
woo.dem.
Contact
¶ Contact in DEM
[ pkg/dem/Contact.hpp , pkg/dem/Contact.cpp ]

data
(= None)¶ Optional data stored by the functor for its own use
[type: shared_ptr<
CData
>, readonly in python]

cellDist
(= Vector3i(0, 0, 0))¶ Distace in the number of periodic cells by which pB must be shifted to get to the right relative position.
[type:
Vector3i
, readonly in python]

color
(= 0.0)¶ (Normalized) color value for this contact
[type: Real]

stepCreated
(= 1)¶ Step in which this contact was created by the collider, or step in which it was made real (if geom and phys exist). This number is NOT reset by Contact::reset(). If negative, it means the collider does not want to keep this contact around anymore (this happens if the contact is real but there is no overlap anymore).
[type: int, readonly in python]

minDist00Sq
(= 1.0)¶ Minimum distance between nodes[0] of both shapes so that the contact can exist. Set in ContactLoop by geometry functor once, and is used to check for possible contact without having to call the functor. If negative, not used. Currently, only SphereSphere contacts use this information.
[type: Real, readonly in python]

stepLastSeen
(= 1)¶ [type: int, readonly in python]

linIx
(= 0)¶ Position in the linear view (ContactContainer)
[type: size_t, not shown in the UI, readonly in python]

dPos
((Contact)arg1) → Vector3 :¶ Return position difference vector pBpA, taking Contact.cellDist in account properly. Both particles must be uninodal, exception is raised otherwise.

dist
((Contact)arg1) → float :¶ Shorthand for dPos.norm().

forceSign
((Contact)arg1, (Particle)p) → int :¶ Return sign of
CPhys.force
as it appies on the particle passed, i.e. +1 ifp==C.pA
and 1 ifp==C.pB
. Raise an exception ifp
is neitherpA
orpB
. forceSign( (Contact)arg1, (int)id) > int :
 Return sign of
CPhys.force
as it appies on the particle with idid
, i.e.id==C.id1
and 1 ifid==id2
. Raise an exception ifid
is neitherid1
orid2
.

id1
¶ Particle.id
of the first contacting particle.

id2
¶ Particle.id
of the second contacting particle.

isFresh
((Contact)arg1, (Scene)scene) → bool :¶ Say whether this contact has just been created. Equivalent to
C.stepCreated==scene.step
.

ContactLoop¶
Object
→ Engine
→ ContactLoop

class
woo.dem.
ContactLoop
¶ Loop over all contacts, possible in a parallel manner.
Special constructor
Constructs from 3 lists of
Cg2
,Cp2
,Law
functors respectively; they will be passed to interal dispatchers.[ pkg/dem/ContactLoop.hpp , pkg/dem/ContactLoop.cpp ]

geoDisp
(= <CGeomDispatcher @ 0x2a84410>)¶ CGeomDispatcher
object that is used for dispatch.[type: shared_ptr<
CGeomDispatcher
>, readonly in python]

phyDisp
(= <CPhysDispatcher @ 0x2ab7a10>)¶ CPhysDispatcher
object used for dispatch.[type: shared_ptr<
CPhysDispatcher
>, readonly in python]

lawDisp
(= <LawDispatcher @ 0x2ab7560>)¶ LawDispatcher
object used for dispatch.[type: shared_ptr<
LawDispatcher
>, readonly in python]

hook
(= None)¶ ContactHook
objects, empty by default.[type: shared_ptr<
ContactHook
>]

alreadyWarnedNoCollider
(= False)¶ Keep track of whether the user was already warned about missing collider.
[type: bool, not shown in the UI]

evalStress
(= False)¶ Evaluate stress tensor, in periodic simluations; if energy tracking is enabled, increments gradV energy.
[type: bool]

applyForces
(= True)¶ Apply forces directly; this avoids IntraForce engine, but will silently skip multinodal particles.
[type: bool]

updatePhys
(= 0)¶ Call
CPhysFunctor
even for contacts which already haveContact.phys
(to reflect changes in particle’s material, for example). ‘once’ will update only once and then set this back to ‘never’.[type: int, named enum, possible values are: ‘never’ (0), ‘always’ (1), ‘once’ (2)]

dist00
(= True)¶ Whether to apply the Contact.minDist00Sq optimization (for mesuring the speedup only)
[type: bool]

stress
(= Matrix3(0, 0, 0, 0, 0, 0, 0, 0, 0))¶ Stress value, used to compute gradV energy if trackWork is True.
[type:
Matrix3
, readonly in python]

reorderEvery
(= 1000)¶ Reorder contacts so that real ones are at the beginning in the linear sequence, making the OpenMP loop traversal (hopefully) less unbalanced.
[type: int]

prevVol
(= nan)¶ Previous value of cell volume
[type: Real, not accessible from python]

prevStress
(= Matrix3(0, 0, 0, 0, 0, 0, 0, 0, 0))¶ Previous value of stress, used to compute midstep stress
[type:
Matrix3
]

gradVIx
(= 1)¶ Cache energy index for gradV work
[type: int, not saved, not accessible from python]

ContactHook¶

class
woo.dem.
ContactHook
¶ Functor called from
ContactLoop
for some specific events on contacts; currently, these events are contact creation and contact deletion. This base class does nothing.
mask
(= 0)¶ Mask which must be matched by both particles in the contact.
[type: int]

CountContactsHook¶
Object
→ ContactHook
→ CountContactsHook

class
woo.dem.
CountContactsHook
¶ Functor counting contacts created and deleted in
ContactLoop
(contacts being deleted e.g. as a result of particle deletion are not counted), restricted by mask.[ pkg/dem/ContactHook.hpp , pkg/dem/ContactHook.cpp ]

nNew
(= 0)¶ Total number of new (real) contacts.
[type: OpenMPAccumulator<int>]

nDel
(= 0)¶ Total number of deleted contacts.
[type: OpenMPAccumulator<int>]

Geometry¶
TODO
CGeom¶

class
woo.dem.
CGeom
¶ Geometrical configuration of contact

dispHierarchy
((CGeom)arg1[, (bool)names=True]) → list :¶ Return list of dispatch classes (from down upwards), starting with the class instance itself, toplevel indexable at last. If names is true (default), return class names rather than numerical indices.

dispIndex
¶ Return class index of this instance.

G3Geom¶

class
woo.dem.
G3Geom
¶ Geometry of particles in contact, defining relative velocities.
[ pkg/dem/G3Geom.hpp , pkg/dem/G3Geom.cpp ]

uN
(= nan)¶ Normal displacement, distace of separation of particles (mathematically equal to integral of vel[0], but given here for numerically more stable results, as this component can be usually computed directly).
[type: Real]

L6Geom¶

class
woo.dem.
L6Geom
¶ Geometry of particles in contact, defining relative velocities.
[ pkg/dem/L6Geom.hpp , pkg/dem/L6Geom.cpp ]

vel
(= Vector3(0, 0, 0))¶ Relative displacement rate in local coordinates, defined by
CGeom.node
[type:
Vector3
, unit: m/s]

angVel
(= Vector3(0, 0, 0))¶ Relative rotation rate in local coordinates
[type:
Vector3
, unit: rad/s]

uN
(= nan)¶ Normal displacement, distace of separation of particles (mathematically equal to integral of vel[0], but given here for numerically more stable results, as this component can be usually computed directly).
[type: Real]

lens
(= Vector2(0, 0))¶ Hint for Cp2 functor on how to distribute material stiffnesses according to lengths on both sides of the contact; their sum should be equal to the initial contact length.
[type:
Vector2
, unit: m]

contA
(= nan)¶ (Fictious) contact area, used by Cp2 functor to compute stiffness.
[type: Real, unit: m²]

trsf
(= Matrix3(1, 0, 0, 0, 1, 0, 0, 0, 1))¶ Transformation (rotation) from global to local coordinates; only used internally, and is synchronized with
woo.core.Node.ori
automatically. If the algorithm works with pure quaternions at some point (it is not stable now), can be removed safely.[type:
Matrix3
]

CGeomFunctor¶
Object
→ Functor
→ CGeomFunctor

class
woo.dem.
CGeomFunctor
¶ Functor for creating/updating
Contact.geom
objects.
Cg2_Wall_Sphere_G3Geom¶
Cg2_Any_Any_L6Geom__Base¶
Object
→ Functor
→ CGeomFunctor
→ Cg2_Any_Any_L6Geom__Base

class
woo.dem.
Cg2_Any_Any_L6Geom__Base
¶ Common base for L6Geomcomputing functors such as
Cg2_Sphere_Sphere_L6Geom
, holding common approximation flags.[ pkg/dem/L6Geom.hpp , pkg/dem/L6Geom.cpp ]

noRatch
(= False)¶ FIXME: document what it really does.
[type: bool]

trsfRenorm
(= 100)¶ How often to renormalize
trsf
; if nonpositive, never renormalized (simulation might be unstable)[type: int]

approxMask
(= 0)¶ Selectively enable geometrical approximations (bitmask); add the values for approximations to be enabled.
1 use previous normal instead of midstep normal for computing tangent velocity 2 do not renormalize average (midstep) normal, if used. 4 use previous rotation instead of midstep rotation to transform velocities 8 use current branches instead of midstep branches to evaluate incident velocity (used without noRatch) By default, the mask is zero, wherefore none of these approximations is used.
[type: int, range: 0−15]

Cg2_Sphere_Sphere_L6Geom¶
Object
→ Functor
→ CGeomFunctor
→ Cg2_Any_Any_L6Geom__Base
→ Cg2_Sphere_Sphere_L6Geom

class
woo.dem.
Cg2_Sphere_Sphere_L6Geom
¶ Functor for computing incrementally configuration of 2
Spheres
stored inL3Geom
; the configuration is positioned in global space by local origin \(\vec{c}\) (contact point) and rotation matrix \(\mat{T}\) (orthonormal transformation matrix), and its degrees of freedom are local displacement \(\vec{u}\) (in one normal and two shear directions); withIg2_Sphere_Sphere_L6Geom
andL6Geom
, there is additionally \(\vec{\phi}\). The first row of \(\mat{T}\), i.e. local \(x\)axis, is the contact normal noted \(\vec{n}\) for brevity. Additionally, quasiconstant values of \(\vec{u}_0\) (and \(\vec{\phi}_0\)) are stored as shifted origins of \(\vec{u}\) (and \(\vec{\phi}\)); therefore, current value of displacement is always \(\curr{\vec{u}}\vec{u}_0\).Suppose two spheres with radii \(r_i\), positions \(\vec{x}_i\), velocities \(\vec{v}_i\), angular velocities \(\vec{\omega}_i\).
When there is not yet contact, it will be created if \(u_N=\curr{\vec{x}}_2\curr{\vec{x}}_1f_d(r_1+r2)<0\), where \(f_d\) is
distFactor
(sometimes also called “interaction radius”). If \(f_d>0\), then \(\vec{u}_{0x}\) will be initalized to \(u_N\), otherwise to 0. In another words, contact will be created if spheres enlarged by \(f_d\) touch, and the “equilibrium distance” (where \(\vec{u}_x\vec{u}{0x}\) is zero) will be set to the current distance if \(f_d\) is positive, and to the geometricallytouching distance if negative.Local axes (rows of \(\mat{T}\)) are initially defined as follows:
 local \(x\)axis is \(\vec{n}=\vec{x}_l=\normalized{\vec{x}_2\vec{x}_1}\);
 local \(y\)axis positioned arbitrarily, but in a deterministic manner: aligned with the \(xz\) plane (if \(\vec{n}_y<\vec{n}_z\)) or \(xy\) plane (otherwise);
 local \(z\)axis \(\vec{z}_l=\vec{x}_l\times\vec{y}_l\).
If there has already been contact between the two spheres, it is updated to keep track of rigid motion of the contact (one that does not change mutual configuration of spheres) and mutual configuration changes. Rigid motion transforms local coordinate system and can be decomposed in rigid translation (affecting \(\vec{c}\)), and rigid rotation (affecting \(\mat{T}\)), which can be split in rotation \(\vec{o}_r\) perpendicular to the normal and rotation \(\vec{o}_t\) (“twist”) parallel with the normal:
\[\pprev{\vec{o}_r}=\prev{\vec{n}}\times\curr{\vec{n}}.\]Since velocities are known at previous midstep (\(t\Dt/2\)), we consider midstep normal
\[\pprev{\vec{n}}=\frac{\prev{\vec{n}}+\curr{\vec{n}}}{2}.\]For the sake of numerical stability, \(\pprev{\vec{n}}\) is renormalized after being computed, unless prohibited by
approxMask
. IfapproxMask
has the appropriate bit set, the midnormal is not compute, and we simply use \(\pprev{\vec{n}}\approx\prev{\vec{n}}\).Rigid rotation parallel with the normal is
\[\pprev{\vec{o}_t}=\pprev{\vec{n}}\left(\pprev{\vec{n}}\cdot\frac{\pprev{\vec{\omega}}_1+\pprev{\vec{\omega}}_2}{2}\right)\Dt.\]Branch vectors \(\vec{b}_1\), \(\vec{b}_2\) (connecting \(\curr{\vec{x}}_1\), \(\curr{\vec{x}}_2\) with \(\curr{\vec{c}}\) are computed depending on
noRatch
(seehere
).\begin{align*} \vec{b}_1&=\begin{cases} r_1 \curr{\vec{n}} & \mbox{with noRatch} \\ \curr{\vec{c}}\curr{\vec{x}}_1 & \mbox{otherwise} \end{cases} \\ \vec{b}_2&=\begin{cases} r_2\curr{\vec{n}} & \mbox{with noRatch} \\ \curr{\vec{c}}\curr{\vec{x}}_2 & \mbox{otherwise} \end{cases} \\ \end{align*}Relative velocity at \(\curr{\vec{c}}\) can be computed as
\[\pprev{\vec{v}_r}=(\pprev{\vec{\tilde{v}}_2}+\vec{\omega}_2\times\vec{b}_2)(\vec{v}_1+\vec{\omega}_1\times\vec{b}_1)\]where \(\vec{\tilde{v}}_2\) is \(\vec{v}_2\) without meanfield velocity gradient in periodic boundary conditions (see
Cell.homoDeform
). In the numerial implementation, the normal part of incident velocity is removed (since it is computed directly) with \(\pprev{\vec{v}_{r2}}=\pprev{\vec{v}_r}(\pprev{\vec{n}}\cdot\pprev{\vec{v}_r})\pprev{\vec{n}}\).Any vector \(\vec{a}\) expressed in global coordinates transforms during one timestep as
\[\curr{\vec{a}}=\prev{\vec{a}}+\pprev{\vec{v}_r}\Dt\prev{\vec{a}}\times\pprev{\vec{o}_r}\prev{\vec{a}}\times{\pprev{\vec{t}_r}}\]where the increments have the meaning of relative shear, rigid rotation normal to \(\vec{n}\) and rigid rotation parallel with \(\vec{n}\). Local coordinate system orientation, rotation matrix \(\mat{T}\), is updated by rows, i.e.
\[\begin{split}\curr{\mat{T}}=\begin{pmatrix} \curr{\vec{n}_x}, \curr{\vec{n}_y}, \curr{\vec{n}_z} \\ \prev{\mat{T}_{1,\bullet}}\prev{\mat{T}_{1,\bullet}}\times\pprev{\vec{o}_r}\prev{\mat{T}_{1,\bullet}}\times\pprev{\vec{o}_t} \\ \prev{\mat{T}_{2,\bullet}}\prev{\mat{T}_{2,\bullet}}\times\pprev{\vec{o}_r}\prev{\mat{T}_{,\bullet}}\times\pprev{\vec{o}_t} \end{pmatrix}\end{split}\]This matrix is renormalized (unless prevented by
approxMask
) and midstep transformation is computed using quaternion spherical interpolation as\[\pprev{\mat{T}}=\mathrm{Slerp}\,\left(\prev{\mat{T}};\curr{\mat{T}};t=1/2\right).\]Depending on
approxMask
, this computation can be avoided by approximating \(\pprev{\mat{T}}=\prev{\mat{T}}\).Finally, current displacement is evaluated as
\[\curr{\vec{u}}=\prev{u}+\pprev{\mat{T}}\pprev{\vec{v}_r}\Dt.\]For the normal component, nonincremental evaluation is preferred, giving
\[\curr{\vec{u}_x}=\curr{\vec{x}_2}\curr{\vec{x}_1}(r_1+r_2)\]If this functor is called for
L6Geom
, local rotation is updated as\[\curr{\vec{\phi}}=\prev{\vec{\phi}}+\pprev{\mat{T}}\Dt(\vec{\omega}_2\vec{\omega}_1)\][ pkg/dem/Sphere.hpp , pkg/dem/Sphere.cpp ]

distFactor
(= 1.0)¶ removed in API 10103, set
DemField.distFactor
instead.[type: Real, not shown in the UI, not dumped, DEPRECATED, raises
ValueError
when accessed]
Cg2_InfCylinder_Capsule_L6Geom¶
Object
→ Functor
→ CGeomFunctor
→ Cg2_Any_Any_L6Geom__Base
→ Cg2_InfCylinder_Capsule_L6Geom

class
woo.dem.
Cg2_InfCylinder_Capsule_L6Geom
¶ Compute
L6Geom
for contact ofCapsule
andInfCylinder
.
Cg2_Facet_Sphere_L6Geom¶
Object
→ Functor
→ CGeomFunctor
→ Cg2_Any_Any_L6Geom__Base
→ Cg2_Facet_Sphere_L6Geom
Cg2_Sphere_Capsule_L6Geom¶
Object
→ Functor
→ CGeomFunctor
→ Cg2_Any_Any_L6Geom__Base
→ Cg2_Sphere_Capsule_L6Geom
Cg2_Capsule_Capsule_L6Geom¶
Object
→ Functor
→ CGeomFunctor
→ Cg2_Any_Any_L6Geom__Base
→ Cg2_Capsule_Capsule_L6Geom
Cg2_Facet_Ellipsoid_L6Geom¶
Object
→ Functor
→ CGeomFunctor
→ Cg2_Any_Any_L6Geom__Base
→ Cg2_Facet_Ellipsoid_L6Geom

class
woo.dem.
Cg2_Facet_Ellipsoid_L6Geom
¶ Compute
L6Geom
for contact ofellipsoid
andfacet
.Warning
This class does not work (the result is correct only for face contact, otherwise bogus) and is by default not returned in
woo.dem.DemField.minimalEngines
. See this question for a brief discussion.
Cg2_Ellipsoid_Ellipsoid_L6Geom¶
Object
→ Functor
→ CGeomFunctor
→ Cg2_Any_Any_L6Geom__Base
→ Cg2_Ellipsoid_Ellipsoid_L6Geom

class
woo.dem.
Cg2_Ellipsoid_Ellipsoid_L6Geom
¶ Incrementally compute
L6Geom
for contact of 2ellipsoids
. Uses the PerramWertheim potential function ([PW85], [PRPrstgaardL96], [DTS05]). See example scripts examples/ell0.py and examples/ell1.py.[ pkg/dem/Ellipsoid.hpp , pkg/dem/Ellipsoid.cpp ]

brent
(= True)¶ Use Brent iteration for finding maximum of the PerramWertheim potential. If false, use NewtonRaphson (not yet implemented).
[type: bool]

brentBits
(= 32)¶ Precision for the Brent method, as number of bits.
[type: int]

Object
→ Functor
→ CGeomFunctor
→ Cg2_Any_Any_L6Geom__Base
→ Cg2_Ellipsoid_Ellipsoid_L6Geom
→ Cg2_Sphere_Ellipsoid_L6Geom

class
woo.dem.
Cg2_Sphere_Ellipsoid_L6Geom
¶ Compute the geometry of
Ellipsoid
+Sphere
collision. Uses the code fromCg2_Ellipsoid_Ellipsoid_L6Geom
, representing the sphere as an ellipsoid with all semiaxes equal to the radius.
Cg2_Facet_Capsule_L6Geom¶
Object
→ Functor
→ CGeomFunctor
→ Cg2_Any_Any_L6Geom__Base
→ Cg2_Facet_Capsule_L6Geom
Cg2_Wall_Sphere_L6Geom¶
Object
→ Functor
→ CGeomFunctor
→ Cg2_Any_Any_L6Geom__Base
→ Cg2_Wall_Sphere_L6Geom

class
woo.dem.
Cg2_Wall_Sphere_L6Geom
¶ Incrementally compute
L6Geom
for contact betweenWall
andSphere
. Uses attributes ofCg2_Sphere_Sphere_L6Geom
.
Cg2_Wall_Ellipsoid_L6Geom¶
Object
→ Functor
→ CGeomFunctor
→ Cg2_Any_Any_L6Geom__Base
→ Cg2_Wall_Ellipsoid_L6Geom
Cg2_Rod_Sphere_L6Geom¶
Object
→ Functor
→ CGeomFunctor
→ Cg2_Any_Any_L6Geom__Base
→ Cg2_Rod_Sphere_L6Geom

class
woo.dem.
Cg2_Rod_Sphere_L6Geom
¶ Incrementally compute
L6Geom
for contact betweenRod
andSphere
. Uses attributes ofCg2_Sphere_Sphere_L6Geom
.
Cg2_Wall_Capsule_L6Geom¶
Object
→ Functor
→ CGeomFunctor
→ Cg2_Any_Any_L6Geom__Base
→ Cg2_Wall_Capsule_L6Geom
Cg2_Facet_Facet_L6Geom¶
Object
→ Functor
→ CGeomFunctor
→ Cg2_Any_Any_L6Geom__Base
→ Cg2_Facet_Facet_L6Geom
Cg2_Wall_Facet_L6Geom¶
Object
→ Functor
→ CGeomFunctor
→ Cg2_Any_Any_L6Geom__Base
→ Cg2_Wall_Facet_L6Geom
Cg2_InfCylinder_Sphere_L6Geom¶
Object
→ Functor
→ CGeomFunctor
→ Cg2_Any_Any_L6Geom__Base
→ Cg2_InfCylinder_Sphere_L6Geom

class
woo.dem.
Cg2_InfCylinder_Sphere_L6Geom
¶ Incrementally compute
L6Geom
for contact betweenInfCylinder
andSphere
. Uses attributes ofCg2_Sphere_Sphere_L6Geom
.
Cg2_Facet_InfCylinder_L6Geom¶
Object
→ Functor
→ CGeomFunctor
→ Cg2_Any_Any_L6Geom__Base
→ Cg2_Facet_InfCylinder_L6Geom

class
woo.dem.
Cg2_Facet_InfCylinder_L6Geom
¶ Incrementally compute
L6Geom
for contact betweenFacet
andInfCylinder
.
Cg2_Sphere_Sphere_G3Geom¶
Object
→ Functor
→ CGeomFunctor
→ Cg2_Sphere_Sphere_G3Geom

class
woo.dem.
Cg2_Sphere_Sphere_G3Geom
¶ Incrementally compute
G3Geom
for contact of 2 spheres. Detailed documentation in py/_extraDocs.py[ pkg/dem/G3Geom.hpp , pkg/dem/G3Geom.cpp ]

noRatch
(= True)¶ FIXME: document what it really does.
[type: bool]

useAlpha
(= True)¶ Use alpha correction proposed by McNamara, see source code for details
[type: bool]

CGeomDispatcher¶
Object
→ Engine
→ Dispatcher
→ CGeomDispatcher

class
woo.dem.
CGeomDispatcher
¶ Dispatcher calling
functors
based on received argument type(s).[ pkg/dem/ContactLoop.hpp , pkg/dem/ContactLoop.cpp ]

functors
(= [])¶ Functors active in the dispatch mechanism [overridden below].
[type: vector<shared_ptr<CGeomFunctor> >]

dispFunctor
((CGeomDispatcher)arg1, (Shape)arg2, (Shape)arg3) → CGeomFunctor :¶ Return functor that would be dispatched for given argument(s); None if no dispatch; ambiguous dispatch throws.

dispMatrix
((CGeomDispatcher)arg1[, (bool)names=True]) → dict :¶ Return dictionary with contents of the dispatch matrix.

Physical properties¶
TODO
CPhys¶

class
woo.dem.
CPhys
¶ Physical properties of contact.

force
(= Vector3(0, 0, 0))¶ Force applied on the first particle in the contact
[type:
Vector3
, unit: N]

torque
(= Vector3(0, 0, 0))¶ Torque applied on the first particle in the contact
[type:
Vector3
, unit: N·m]

dispHierarchy
((CPhys)arg1[, (bool)names=True]) → list :¶ Return list of dispatch classes (from down upwards), starting with the class instance itself, toplevel indexable at last. If names is true (default), return class names rather than numerical indices.

dispIndex
¶ Return class index of this instance.

FrictPhys¶

class
woo.dem.
FrictPhys
¶ Physical parameters of contact with sliding

tanPhi
(= nan)¶ Tangent of friction angle
[type: Real]

kn
(= nan)¶ Normal stiffness
[type: Real]

kt
(= nan)¶ Tangent stiffness
[type: Real]

PelletPhys¶
Object
→ CPhys
→ FrictPhys
→ PelletPhys
ConcretePhys¶
Object
→ CPhys
→ FrictPhys
→ ConcretePhys

class
woo.dem.
ConcretePhys
¶ Representation of a single interaction of the Concrete type: storage for relevant parameters.
[ pkg/dem/Concrete.hpp , pkg/dem/Concrete.cpp ]

E
(= nan)¶ normal modulus (stiffness / crossSection) [Pa]
[type: Real]

G
(= nan)¶ shear modulus [Pa]
[type: Real]

coh0
(= nan)¶ virgin material cohesion [Pa]
[type: Real]

epsCrackOnset
(= nan)¶ strain at which the material starts to behave nonlinearly
[type: Real]

epsFracture
(= nan)¶ strain at which the bond is fully broken []
[type: Real]

dmgTau
(= 1.0)¶ characteristic time for damage (if nonpositive, the law without ratedependence is used)
[type: Real]

dmgRateExp
(= 0.0)¶ exponent in the ratedependent damage evolution
[type: Real]

dmgStrain
(= 0.0)¶ damage strain (at previous or current step)
[type: Real]

dmgOverstress
(= 0.0)¶ damage viscous overstress (at previous step or at current step)
[type: Real]

plTau
(= 1.0)¶ characteristic time for viscoplasticity (if nonpositive, no ratedependence for shear)
[type: Real]

plRateExp
(= 0.0)¶ exponent in the ratedependent viscoplasticity
[type: Real]

isoPrestress
(= 0.0)¶ “prestress” of this link (used to simulate isotropic stress)
[type: Real]

neverDamage
(= False)¶ the damage evolution function will always return virgin state
[type: bool]

damLaw
(= 1)¶ Law for softening part of uniaxial tension. 0 for linear, 1 for exponential (default)
[type: int]

isCohesive
(= False)¶ if not cohesive, interaction is deleted when distance is greater than zero.
[type: bool]

epsT
(= Vector2(0, 0))¶ Shear strain; updated incrementally from
L6Geom.vel
.[type:
Vector2
, not saved, readonly in python]
► Autocomputed

omega
(= 0.0)¶ Damage parameter
[type: Real, not saved, readonly in python]

uN0
(= nan)¶ Initial normal displacement (equilibrium state)
[type: Real, readonly in python]

epsN
(= 0.0)¶ Normal strain
[type: Real, not saved, readonly in python]

sigmaN
(= 0.0)¶ Normal force
[type: Real, not saved, readonly in python]

epsNPl
(= 0.0)¶ Normal plastic strain
[type: Real, not saved, readonly in python]

kappaD
(= 0.0)¶ Value of the kappa function
[type: Real, not saved, readonly in python]

relResidualStrength
(= 1.0)¶ Relative residual strength
[type: Real, not saved, readonly in python]

static
funcG
((float)kappaD, (float)epsCrackOnset, (float)epsFracture[, (bool)neverDamage=False[, (int)damLaw=1]]) → float :¶ Damage evolution law, evaluating the $omega$ parameter. $kappa_D$ is historically maximum strain, epsCrackOnset ($varepsilon_0$) =
epsCrackOnset
, epsFracture =epsFracture
; if neverDamage isTrue
, the value returned will always be 0 (no damage).

static
funcGInv
((float)omega, (float)epsCrackOnset, (float)epsFracture[, (bool)neverDamage=False[, (int)damLaw=1]]) → float :¶ Inversion of damage evolution law, evaluating the $kappa_D$ parameter. $omega$ is damage, for other parameters see funcG function

setDamage
((ConcretePhys)arg1, (float)arg2) → None :¶ TODO

setRelResidualStrength
((ConcretePhys)arg1, (float)arg2) → None :¶ TODO

HertzPhys¶
Object
→ CPhys
→ FrictPhys
→ HertzPhys

class
woo.dem.
HertzPhys
¶ Physical properties of a contact of two
FrictMat
with viscous damping enabled (viscosity is currently not provided as material parameter).
kt0
(= 0.0)¶ Constant for computing current normal stiffness.
[type: Real]

R
(= 0.0)¶ Effective radius (for the Schwarz model)
[type: Real]

K
(= 0.0)¶ Effective stiffness (for the Schwarz model)
[type: Real]

gamma
(= 0.0)¶ Surface energy (for the Schwarz model)
[type: Real]

alpha
(= 0.0)¶ COS alpha coefficient
[type: Real]

contRad
(= 0.0)¶ Contact radius, used for storing previous value as the initial guess in the next step.
[type: Real]

IcePhys¶
Object
→ CPhys
→ FrictPhys
→ IcePhys

class
woo.dem.
IcePhys
¶ Physical properties of a contact of two
IceMat
.[ pkg/dem/Ice.hpp ]

brkNT
(= Vector2(nan, nan))¶ Limits of breakage in normal & tangential senses.
[type:
Vector2
, unit: N]

brkWR
(= Vector2(nan, nan))¶ Limits of breakage in twisting & rolling senses.
[type:
Vector2
, unit: N·m]

mu
(= nan)¶ Kinetic (rolling) friction coefficient.
[type: Real]

bonds
(= 0)¶ Bits specifying whether the contact is bonded (in 4 senses) and whether it is breakable (in 4 senses).
[type: int, bit accessors: bondN, bondT, bondW, bondR, brkN, brkT, brkW, brkR]

uN0
(= 0.0)¶ Initial value of normal overlap; set automatically by
Law_L6Geom_IcePhys
wheniniEqlb
is true (default).[type: Real]

isBondX
((IcePhys)arg1, (int)arg2) → bool :¶ Whether the contact is bonded in the x sense (0..3)

isBrkBondX
((IcePhys)arg1, (int)arg2) → bool :¶ Whether the contact is breakable and bonded in the x sense (0..3)

isBrkX
((IcePhys)arg1, (int)arg2) → bool :¶ Whether the contact is breakable in the x sense (0..3)

LudingPhys¶
Object
→ CPhys
→ FrictPhys
→ LudingPhys

class
woo.dem.
LudingPhys
¶ Physical properties for
ludingcontactmodel
.[ pkg/dem/Luding.hpp , pkg/dem/Luding.cpp ]

kn1
(= nan)¶ Normal plastic (loading) stiffness.
[type: Real]

kna
(= nan)¶ Normal adhesive stiffness.
[type: Real]

k2hat
(= nan)¶ Maximum stiffness.
[type: Real]

deltaMax
(= 0.0)¶ Historically maximum overlap value.
[type: Real]

kr
(= nan)¶ Roll stiffness.
[type: Real]

kw
(= nan)¶ Twist stiffness.
[type: Real]

viscN
(= nan)¶ Normal viscosity.
[type: Real]

viscT
(= nan)¶ Tangent viscosity.
[type: Real]

viscR
(= nan)¶ Roll viscosity.
[type: Real]

viscW
(= nan)¶ Twist viscosity.
[type: Real]

dynDivStat
(= nan)¶ Dynamic to static friction.
[type: Real]

statR
(= nan)¶ Roll static friction.
[type: Real]

statW
(= nan)¶ Twist static friction.
[type: Real]

xiW
(= 0.0)¶ Twist elastic rotation.
[type: Real]

work
(= [])¶ Percontact dissipation (unallocated when energy tracking is not enabled).
[type: vector<Real>]

CPhysFunctor¶
Object
→ Functor
→ CPhysFunctor

class
woo.dem.
CPhysFunctor
¶ Functor for creating/updating
Contact.phys
objects.
Cp2_FrictMat_FrictPhys¶
Object
→ Functor
→ CPhysFunctor
→ Cp2_FrictMat_FrictPhys

class
woo.dem.
Cp2_FrictMat_FrictPhys
¶ TODO
[ pkg/dem/FrictMat.hpp , pkg/dem/FrictMat.cpp ]

tanPhi
(= None)¶ Instance of
MatchMaker
determining how to compute contact friction angle. IfNone
, minimum value is used.[type: shared_ptr<
MatchMaker
>]

Cp2_PelletMat_PelletPhys¶
Object
→ Functor
→ CPhysFunctor
→ Cp2_FrictMat_FrictPhys
→ Cp2_PelletMat_PelletPhys

class
woo.dem.
Cp2_PelletMat_PelletPhys
¶ Compute
PelletPhys
given two instances of :ref`PelletMat`.PelletMat.normPlastCoeff
is averaged intoPelletPhys.normPlastCoeff
, while minimum ofPelletMat.kaDivKn
is taken to computePelletPhys.ka
.
Cp2_IceMat_IcePhys¶
Object
→ Functor
→ CPhysFunctor
→ Cp2_FrictMat_FrictPhys
→ Cp2_IceMat_IcePhys

class
woo.dem.
Cp2_IceMat_IcePhys
¶ Compute
IcePhys
given two instances of :ref`IceMat`.[ pkg/dem/Ice.hpp , pkg/dem/Ice.cpp ]

bonds0
(= 0)¶ Bonding bits for new contacts, for the initial configuration.
[type: int, bit accessors: bondN, bondT, bondW, bondR, brkN, brkT, brkW, brkR]

bonds1
(= 0)¶ Bonding bits for new contacts, for contacts created after the initial configuration.
[type: int, bit accessors: bondN, bondT, bondW, bondR, brkN, brkT, brkW, brkR]

Cp2_LudingMat_LudingPhys¶
Object
→ Functor
→ CPhysFunctor
→ Cp2_FrictMat_FrictPhys
→ Cp2_LudingMat_LudingPhys

class
woo.dem.
Cp2_LudingMat_LudingPhys
¶ Compute
LudingPhys
given two instances ofLudingMat
.
Cp2_HertzMat_HertzPhys¶
Object
→ Functor
→ CPhysFunctor
→ Cp2_FrictMat_FrictPhys
→ Cp2_HertzMat_HertzPhys

class
woo.dem.
Cp2_HertzMat_HertzPhys
¶ Compute
HertzPhys
given two instances of :ref`HertzMat`. The value ofHertzPhys.alpha
is averaged (fromHertzMat.alpha
) whileHertzPhys.gamma
is minimum (ofHertzMat.gamma
).[ pkg/dem/Hertz.hpp , pkg/dem/Hertz.cpp ]

poisson
(= 0.2)¶ Poisson ratio for computing contact properties (not provided by the material class currently)
[type: Real]

en
(= nan)¶ Normal coefficient of restitution (if outside the 01 range, there will be no damping, making
en
effectively equal to one).[type: Real]

Cp2_ConcreteMat_ConcretePhys¶
Object
→ Functor
→ CPhysFunctor
→ Cp2_ConcreteMat_ConcretePhys

class
woo.dem.
Cp2_ConcreteMat_ConcretePhys
¶ Compute
ConcretePhys
from twoConcreteMat
instances. Uses simple (arithmetic) averages if material are different. Simple copy of parameters is performed if the instance ofConcreteMat
is shared.[ pkg/dem/Concrete.hpp , pkg/dem/Concrete.cpp ]

cohesiveThresholdStep
(= 10)¶ Should new contacts be cohesive? They will before this iter#, they will not be afterwards. If 0, they will never be. If negative, they will always be created as cohesive (10 by default).
[type: long]

Cp2_FrictMat_FrictPhys_CrossAnisotropic¶
Object
→ Functor
→ CPhysFunctor
→ Cp2_FrictMat_FrictPhys_CrossAnisotropic

class
woo.dem.
Cp2_FrictMat_FrictPhys_CrossAnisotropic
¶ Call
Cp2_FrictMat_FrictPhys
to create a newFrictPhys
, but multiply resultingnormal
andshear
stiffnesses by smooth dimensionless anisotropy distribution given byalpha
andbeta
. The functionality is demonstrated in the following movie:[ pkg/dem/CrossAnisotropy.hpp , pkg/dem/CrossAnisotropy.cpp ]

E1
(= 1000000.0)¶ Inplane normal modulus
[type: Real, unit: Pa]

E2
(= 100000.0)¶ Outofplane normal modulus
[type: Real, unit: Pa]

G1
(= 10000.0)¶ Inplane shear modulus
[type: Real, unit: Pa]

G2
(= 10000.0)¶ Outofplane shear modulus
[type: Real, unit: Pa]

nu1
(= 0.4)¶ Major Poisson’s ratio; dependent value computed as \(\frac{E_1}{2G_1}1\).
[type: Real, readonly in python]

alpha
(= 0.0)¶ Strike angle for the local axes
[type: Real, unit: rad, range: 0−6.28319]

beta
(= 0.0)¶ Dip angle for the local axes
[type: Real, unit: rad, range: 0−1.5708]

CPhysDispatcher¶
Object
→ Engine
→ Dispatcher
→ CPhysDispatcher

class
woo.dem.
CPhysDispatcher
¶ Dispatcher calling
functors
based on received argument type(s).[ pkg/dem/ContactLoop.hpp , pkg/dem/ContactLoop.cpp ]

functors
(= [])¶ Functors active in the dispatch mechanism [overridden below].
[type: vector<shared_ptr<CPhysFunctor> >]

dispFunctor
((CPhysDispatcher)arg1, (Material)arg2, (Material)arg3) → CPhysFunctor :¶ Return functor that would be dispatched for given argument(s); None if no dispatch; ambiguous dispatch throws.

dispMatrix
((CPhysDispatcher)arg1[, (bool)names=True]) → dict :¶ Return dictionary with contents of the dispatch matrix.

Contact law¶
TODO
PelletCData¶
Object
→ CData
→ PelletCData
G3GeomCData¶
Object
→ CData
→ G3GeomCData

class
woo.dem.
G3GeomCData
¶ Internal variables for use with G3Geom
IdealElPlData¶
Object
→ CData
→ IdealElPlData
LawFunctor¶
Object
→ Functor
→ LawFunctor
Law2_L6Geom_LudingPhys¶
Object
→ Functor
→ LawFunctor
→ Law2_L6Geom_LudingPhys

class
woo.dem.
Law2_L6Geom_LudingPhys
¶ Contact law implementing
ludingcontactmodel
.[ pkg/dem/Luding.hpp , pkg/dem/Luding.cpp ]

wImmediate
(= True)¶ Increment plastic & viscous work in
S.energy
in every step rather than commiting the sum when contact dissolves. Note thatParticle.matState
(if aLudingMatState
) is always updated only when the contact dissolves.[type: bool]

viscIx
(= 1)¶ Index of viscous dissipation.
[type: int, not saved, not accessible from python]

plastIx
(= 1)¶ Index of plastic dissipation.
[type: int, not saved, not accessible from python]

Law2_L6Geom_FrictPhys_LinEl6¶
Object
→ Functor
→ LawFunctor
→ Law2_L6Geom_FrictPhys_LinEl6

class
woo.dem.
Law2_L6Geom_FrictPhys_LinEl6
¶ Ideally elasticplastic behavior.
[ pkg/dem/IdealElPl.hpp , pkg/dem/IdealElPl.cpp ]

charLen
(= 1.0)¶ Characteristic length, which is equal to stiffnesses ratio kNormal/kTwist and kShear/kBend. Must be nonnegative.
[type: Real, unit: m]

elastPotIx
(= 1)¶ Index for elastic potential energy
[type: int, not saved, not accessible from python]

Law2_G3Geom_FrictPhys_IdealElPl¶
Object
→ Functor
→ LawFunctor
→ Law2_G3Geom_FrictPhys_IdealElPl

class
woo.dem.
Law2_G3Geom_FrictPhys_IdealElPl
¶ Ideally elasticplastic behavior, for use with G3Geom.
[ pkg/dem/G3Geom.hpp , pkg/dem/G3Geom.cpp ]

noSlip
(= False)¶ Disable plastic slipping
[type: bool]

noBreak
(= False)¶ Disable removal of contacts when in tension.
[type: bool]

plastDissipIx
(= 1)¶ Index of plastically dissipated energy
[type: int, not saved, not accessible from python]

elastPotIx
(= 1)¶ Index for elastic potential energy
[type: int, not saved, not accessible from python]

Law2_L6Geom_FrictPhys_IdealElPl¶
Object
→ Functor
→ LawFunctor
→ Law2_L6Geom_FrictPhys_IdealElPl

class
woo.dem.
Law2_L6Geom_FrictPhys_IdealElPl
¶ Ideally elasticplastic behavior.
[ pkg/dem/IdealElPl.hpp , pkg/dem/IdealElPl.cpp ]

iniEqlb
(= False)¶ Consider the intial distance as equilibrium distance (saved in contact data, subtracted from L6Geom.uN); enabling during simulation will only affect newly created contacts; disabling will affect all contacts.
[type: bool]

relRollStiff
(= 0.0)¶ Rolling stiffness relative to
FrictPhys.kn
×charLen
(with w``charLen`` being the sum ofL6Geom.lens
). If nonpositive, there is no rolling/twisting resistance.[type: Real]

relTwistStiff
(= 0.0)¶ Twisting stiffness relative to rolling stiffness (see
relRollStiff
).[type: Real]

rollTanPhi
(= 0.0)¶ Rolling friction angle – the rolling force will not exceed Fn × rollTanPhi. This value is applied separately to twisting as well. If nonpositive, there is no rolling/twisting resistance.
[type: Real, range: 0−1.5708]

noSlip
(= False)¶ Disable plastic slipping
[type: bool]

noBreak
(= False)¶ Disable removal of contacts when in tension.
[type: bool]

noFrict
(= False)¶ Turn off friction computation, it will be always zero regardless of material parameters
[type: bool]

plastDissipIx
(= 1)¶ Index of plastically dissipated energy
[type: int, not saved, not accessible from python]

elastPotIx
(= 1)¶ Index for elastic potential energy
[type: int, not saved, not accessible from python]

brokenIx
(= 1)¶ Index for energy lost in broken contacts with nonzero force
[type: int, not saved, not accessible from python]

Law2_L6Geom_ConcretePhys¶
Object
→ Functor
→ LawFunctor
→ Law2_L6Geom_ConcretePhys

class
woo.dem.
Law2_L6Geom_ConcretePhys
¶ Constitutive law for concrete.
[ pkg/dem/Concrete.hpp , pkg/dem/Concrete.cpp ]

yieldSurfType
(= 3)¶ yield function: 0: mohrcoulomb (original); 1: parabolic; 2: logarithmic, 3: log+lin_tension, 4: elliptic, 5: elliptic+log
[type: int, named enum, possible values are: ‘linear’ (‘lin’, ‘MC’, ‘mc’, ‘MohrCoulomb’; 0), ‘para’ (‘parabolic’; 1), ‘log’ (‘logarithmic’; 2), ‘log+lin’ (‘logarithmic, linear tension’, ‘loglin’; 3), ‘elliptic’ (‘ell’; 4), ‘elliptic+logarithmic’ (‘ell+log’; 5)]

yieldLogSpeed
(= 0.1)¶ scaling in the logarithmic yield surface (should be <1 for realistic results; >=0 for meaningful results)
[type: Real]

yieldEllipseShift
(= nan)¶ horizontal scaling of the ellipse (shifts on the +x axis as interactions with +y are given)
[type: Real]

omegaThreshold
(= 1.0)¶ damage after which the contact disappears (<1), since omega reaches 1 only for strain →+∞
[type: Real]

epsSoft
(= 0.003)¶ Strain at which softening in compression starts (nonnegative to deactivate)
[type: Real]

relKnSoft
(= 0.3)¶ Relative rigidity of the softening branch in compression (0=perfect elasticplastic, <0 softening, >0 hardening)
[type: Real]

elastPotIx
(= 1)¶ Index for elastic potential energy
[type: int, not saved, not accessible from python]

yieldSigmaTNorm
((Law2_L6Geom_ConcretePhys)arg1, (float)sigmaN, (float)omega, (float)coh0, (float)tanPhi) → float :¶ Return radius of yield surface for given material and state parameters; uses attributes of the current instance (
yieldSurfType
etc), change them before calling if you need that.

Law2_L6Geom_HertzPhys_DMT¶
Object
→ Functor
→ LawFunctor
→ Law2_L6Geom_HertzPhys_DMT

class
woo.dem.
Law2_L6Geom_HertzPhys_DMT
¶ Law for Hertz contact with optional adhesion (DMT (DerjaguinMullerToporov) [DMT75]), nonlinear viscosity ([AE11]) The formulation is taken mainly from [Joh87]. The parameters are given through
Cp2_FrictMat_HertzPhys
. More details are given inhertzian_contact_models
.[ pkg/dem/Hertz.hpp , pkg/dem/Hertz.cpp ]

noAttraction
(= True)¶ Avoid nonphysical normal attraction which may result from viscous effects by making the normal force zero if there is attraction (\(F_n>0\)). This condition is only applied to elastic and viscous part of the normal force. Adhesion, if present, is not limited. See [AE11], the ‘Model choice’ section (pg. 5), for discussion of this effect. .. note:: It is technically not possible to break the contact completely while there is still geometrical overlap, so only force is set to zero but the contact still exists.
[type: bool]

nCallsIters
(= [])¶ Count number of calls of the functor and of iterations in the Halley solver (if used).
[type: OpenMPArrayAccumulator<int>, not shown in the UI]

avgIter
(= nan)¶ Average number of Halley iterations per contact when using the Schwarz model (updated ondemand).
[type: Real, readonly in python]

digits
(= 26)¶ Precision for Halley iteration with the Schwarz model, measured in binary digits; the maximum is the number of digits of the floating point type for given platform. Precision above 2/3 of the maximum will very likely have no effect on the result, but it will require extra (few) iterations before converging.
[type: int, range: 1−53]

plastIx
(= 1)¶ Index of plastically dissipated energy.
[type: int, not saved, not accessible from python]

viscNIx
(= 1)¶ Index of viscous dissipation in the normal sense.
[type: int, not saved, not accessible from python]

viscTIx
(= 1)¶ Index of viscous dissipation in the tangent sense.
[type: int, not saved, not accessible from python]

elastPotIx
(= 1)¶ Index for elastic potential energy.
[type: int, not saved, not accessible from python]

dmtIx
(= 1)¶ Index for elastic energy of new/broken contacts.
[type: int, not saved, not accessible from python]

resetCounters
((Law2_L6Geom_HertzPhys_DMT)arg1) → None :¶ Reset nCallsIters and thus avgIter.

Law2_L6Geom_PelletPhys_Pellet¶
Object
→ Functor
→ LawFunctor
→ Law2_L6Geom_PelletPhys_Pellet

class
woo.dem.
Law2_L6Geom_PelletPhys_Pellet
¶ Contact law with friction and plasticity in compression, designed for pellet behavior. See
pelletcontactmodel
for details.[ pkg/dem/Pellet.hpp , pkg/dem/Pellet.cpp ]

thinRate
(= 0.0)¶ The amount of reducing particle radius (\(\theta_t\)), relative to plastic deformation increment (nonpositive to disable thinning)
[type: Real]

thinRelRMin
(= 0.7)¶ Minimum radius reachable with sphere thinning at plastic deformation, relative to initial particle size (\(r_{\min}^{\mathrm{rel}}\))
[type: Real]

thinExp
(= 1.0)¶ Exponent for reducing the rate of thinning as the minimum radius is being approached (\(\gamma_t\))
[type: Real]

thinRefRad
(= 0.0)¶ Reference radius for thinning; if positive,
thinRateExp
andthinMinExp
are in effect.[type: Real, unit: m]

thinMinExp
(= 0.0)¶ Multiply minimum radius \(r_0\) by \(\left(\frac{r}{r_{\rm thinRefRad}}\right)^{\rm thinMinExp}\) (sizedependent minimum radius).
[type: Real]

thinRateExp
(= 0.0)¶ Multiply thinning rate \(\theta_t\) (
thinRate
) by \(\left(\frac{r}{r_{\rm thinRefRad}}\right)^{\rm thinRateExp}\) (sizedependent minimum radius).[type: Real]

confSigma
(= 0.0)¶ Confinement stress (acting on
contact area
). Negative values will make particles stick together. The strainstress diagram is shifted vertically with this parameter. The value of confinement can be further scaled withconfRefRad
.Note
Energy computation might be incorrect with confinement (not yet checked).
[type: Real]

confRefRad
(= 0.0)¶ If positive, scale the confining stress (
confSigma
) using the value of \(\left(\frac{A}{\pi r_{\rm ref}^2}\right)^{\beta_c}\); this allows to introduce confinement which varies depending on particle size.[type: Real, unit: m]

confExp
(= 1.0)¶ Dimensionless exponent to be used in conjunction with
confRefRad
.[type: Real]

iniEqlb
(= False)¶ Use the initial distance as equilibrium.
[type: bool]

plastSplit
(= False)¶ Track energy dissipated in normal and tangential sliding separately
[type: bool]

plastIx
(= 1)¶ Index of plastically dissipated energy
[type: int, not saved, not accessible from python]

normPlastIx
(= 1)¶ Index of plastically dissipated energy in the normal sense
[type: int, not saved, not accessible from python]

elastPotIx
(= 1)¶ Index for elastic potential energy
[type: int, not saved, not accessible from python]

static
adhesionForce
((float)uN, (float)uNPl, (float)ka) → float :¶ Adhesion force function $h$ evaluated with given parameters

static
yieldForce
((float)uN, (float)d0, (float)kn, (float)alpha) → float :¶ Return yield force for
alpha
and given parameters.

static
yieldForceDerivative
((float)uN, (float)d0, (float)kn, (float)alpha) → float :¶ Return yield force derivative for given parameters.

Law2_L6Geom_IcePhys¶
Object
→ Functor
→ LawFunctor
→ Law2_L6Geom_IcePhys

class
woo.dem.
Law2_L6Geom_IcePhys
¶ Contact law implementing
icecontactmodel
.[ pkg/dem/Ice.hpp , pkg/dem/Ice.cpp ]

iniEqlb
(= True)¶ Set the intial distance as equilibrium distance (saved in
IcePhys.uN0
, subtracted from L6Geom.uN); enabling during simulation will only affect newly created contacts).[type: bool]

elastIx
(= 1)¶ Index of elastic energy (cache).
[type: int, readonly in python]

brokenIx
(= 1)¶ Index of energy which disappeared when contacts broke (cache).
[type: int, readonly in python]

plastIx
(= 1)¶ Index of plastically dissipated energy (cache).
[type: int, readonly in python]

LawDispatcher¶
Object
→ Engine
→ Dispatcher
→ LawDispatcher

class
woo.dem.
LawDispatcher
¶ Dispatcher calling
functors
based on received argument type(s).
functors
(= [])¶ Functors active in the dispatch mechanism [overridden below].
[type: vector<shared_ptr<LawFunctor> >]

dispFunctor
((LawDispatcher)arg1, (CGeom)arg2, (CPhys)arg3) → LawFunctor :¶ Return functor that would be dispatched for given argument(s); None if no dispatch; ambiguous dispatch throws.

dispMatrix
((LawDispatcher)arg1[, (bool)names=True]) → dict :¶ Return dictionary with contents of the dispatch matrix.

Testing contact laws¶
TODO
LawTester¶

class
woo.dem.
LawTester
¶ Engine for testing contact laws by prescribing various loading scenarios, which are a combination of prescribing force or velocity along given contactlocal axes.
[ pkg/dem/LawTester.hpp , pkg/dem/LawTester.cpp ]

done
(= 'tester.dead=True')¶ Python expression to run once all stages had finished. This is run after
LawTesterStage.done
of the last stage.[type: string]

abWeight
(= 1.0)¶ Float, usually ∈〈0,1〉, determining on how are displacements/rotations distributed between particles (0 for A, 1 for B); intermediate values will apply respective part to each of them.
[type: Real]

f
(= Vector6(0, 0, 0, 0, 0, 0))¶ Force on contact, NaN if contact is broken
[type:
Vector6
, readonly in python]

k
(= Vector6(0, 0, 0, 0, 0, 0))¶ Tangent contact stiffness, NaN if there is no contact (or the contact model does not define it). Diagonal of the K matrix in df=Kdu.
[type:
Vector6
, readonly in python]

smooF
(= Vector6(0, 0, 0, 0, 0, 0))¶ Smoothed value of generalized contact forces.
[type:
Vector6
, readonly in python]

u
(= Vector6(0, 0, 0, 0, 0, 0))¶ Cumulative value of contact displacement, NaN if contact is broken
[type:
Vector6
, readonly in python]

smooU
(= Vector6(0, 0, 0, 0, 0, 0))¶ Smoothed value of generalized contact displacements.
[type:
Vector6
, readonly in python]

v
(= Vector6(0, 0, 0, 0, 0, 0))¶ Relative velocity on contact; NaN if the contact is broken
[type:
Vector6
, readonly in python]

smooV
(= Vector6(0, 0, 0, 0, 0, 0))¶ Smoothed value of generalized contact relative velocity.
[type:
Vector6
, readonly in python]

fErrRel
(= Vector6(inf, inf, inf, inf, inf, inf))¶ Relative error of contact force (with respect to smoothed value)
[type:
Vector6
, readonly in python]

fErrAbs
(= Vector6(inf, inf, inf, inf, inf, inf))¶ Absolute error of contact force (with respect to smoothed value)
[type:
Vector6
, readonly in python]

uErrRel
(= Vector6(inf, inf, inf, inf, inf, inf))¶ Relative error of contact displacement (with respect to smoothed value)
[type:
Vector6
, readonly in python]

uErrAbs
(= Vector6(inf, inf, inf, inf, inf, inf))¶ Absolute error of contact displacement (with respect to smoothed value)
[type:
Vector6
, readonly in python]

vErrRel
(= Vector6(inf, inf, inf, inf, inf, inf))¶ Relative error of contact velocity (with respect to smoothed value)
[type:
Vector6
, readonly in python]

vErrAbs
(= Vector6(inf, inf, inf, inf, inf, inf))¶ Absolute error of contact velocity (with respect to smoothed value)
[type:
Vector6
, readonly in python]

smoothErr
(= 1.0)¶ Smoothing factor for computing errors; if negative, set to smooth automatically.
[type: Real]

smooth
(= 0.0001)¶ Smoothing factor for computing smoothF
[type: Real]

stage
(= 0)¶ Current stage to be finished
[type: int, readonly in python]

stageT0
(= 1.0)¶ Time at which this stage was entered
[type: Real, readonly in python]

stages
(= [])¶ Stages to be reached during the testing
[type: vector<shared_ptr<LawTesterStage>>]

maxStageSteps
(= 100000)¶ Throw error if stage takes this many steps
[type: int, not shown in the UI]

fuv
((LawTester)arg1) → dict :¶ Return python dictionary containing f,u,v,smooF,smooU,smooU; useful for plotting with woo.plot.addData(**tester.fuv())

restart
((LawTester)arg1) → None :¶ Reset the tester to initial state; all stages are reset via
LawTesterStage.reset
, thewoo.core.Engine.dead
flag is unset.

LawTesterStage¶

class
woo.dem.
LawTesterStage
¶ Stage to be reached by LawTester.
[ pkg/dem/LawTester.hpp , pkg/dem/LawTester.cpp ]

values
(= Vector6(0, 0, 0, 0, 0, 0))¶ Prescribed values during this step (DoFordering: x,y,z linear, x,y,z angular)
[type:
Vector6
]

whats
(= Vector6i(0, 0, 0, 0, 0, 0))¶ Meaning of values components (DoFodering). The constructor acceps this attribute specified as string of 6 characters, where each of them can be:
.
for imposing nothing,v
for imposing velocity,i
for imposing initial velocity only,f
for imposing force.[type:
Vector6i
]

until
(= '')¶ Stage finishes when until (python expression) evaluates to True. Besides receiving global variables, several local variables are passed: C (contact object; None if contact does not exist), pA (first particle), pB (second particle), scene (current scene object), tester (LawTester object), stage (LawTesterStage object).
[type: string]

untilEvery
(= 1)¶ Test the
until
expression only every untilEvery steps (this may make the execution faster)[type: int]

done
(= '')¶ Run this python command when the stage finishes
[type: string]

step
(= 0)¶ Step in this stage
[type: int]

time
(= 0.0)¶ Time in this stage
[type: Real]

hadC
(= False)¶ Flag keeping track of whether there was a contact in this stage at all
[type: bool]

hasC
(= False)¶ Flag keeping track of whether there was a contact in this stage at all
[type: bool]

timeC0
(= nan)¶ Time of creating of the last contact (NaN if there has never been one).
[type: Real]

bounces
(= 0)¶ Number of sign changes of the normal relative velocity in this stage
[type: int]

broken
¶ Test whether an existing contact broke in this stage; this is useful for saying
until='stage.broken'
(equivalent tostage.hadC and not stage.hasC
). This is different fromuntil='not C'
, since this condition will be satisfied before any contact exists at all.

cTime
¶ Time since creation of the last contact (NaN if there has never been one). Useful for testing collision time after the condition
until='stage.rebound'
has been satisfied. Equivalent tostage.timestage.timeC0
.

rebound
¶ Test for rebound; rebound is considered complete when sign of relative normal velocity changed more than once (adhesive contacts may never separate once they are created – this catches a single period of the oscillation) or if contact
breaks
. Equivalent tostage.bounces>=2 or stage.broken
.

reset
((LawTesterStage)arg1) → None :¶ Reset this stage to its initial stage such that it can be used again as if new. This is called automatically from
LawTester.restart
.

Inlets & Outlets¶
TODO
Inlet¶
Object
→ Engine
→ PeriodicEngine
→ Inlet

class
woo.dem.
Inlet
¶ Inlet generating new particles. This is an abstract base class which in itself does not generate anything, but provides some unified interface to derived classes.
[ pkg/dem/Inlet.hpp , pkg/dem/Inlet.cpp ]

maxMass
(= 1.0)¶ Mass at which the engine will not produce any particles (inactive if not positive)
[type: Real, unit: kg]

maxNum
(= 1)¶ Number of generated particles after which no more will be produced (inactive if not positive)
[type: long]

doneHook
(= '')¶ Python string to be evaluated when
maxMass
ormaxNum
have been reached (or withRandomInlet
,maxAttempts
were exhausted andRandomInlet.atMaxAttempts
equals'done'
). The engine is made dead automatically even if doneHook is not specified.[type: string]

mass
(= 0.0)¶ Generated mass total
[type: Real, unit: kg]

num
(= 0)¶ Number of generated particles
[type: long]

currRate
(= nan)¶ Current value of mass flow rate
[type: Real, unit: kg/s, readonly in python]

zeroRateAtStop
(= True)¶ When the generator stops (mass/number of particles reached, …), set
currRate
to zero immediately[type: bool]

currRateSmooth
(= 1.0)¶ Smoothing factor for currRate ∈〈0,1〉
[type: Real, range: 0−1]

glColor
(= 0.0)¶ Color for rendering (nan disables rendering)
[type: Real, not shown in the UI]

RandomInlet¶
Object
→ Engine
→ PeriodicEngine
→ Inlet
→ RandomInlet

class
woo.dem.
RandomInlet
¶ Inlet generating new particles. This class overrides
woo.core.Engine.critDt
, which in turn callswoo.dem.ParticleGenerator.critDt
with all possiblematerials
one by one.[ pkg/dem/Inlet.hpp , pkg/dem/Inlet.cpp ]

massRate
(= nan)¶ Mass flow rate; if nonpositive, keep generating and placing new particles until
maxAttempts
is exhausted andatMaxAttempts
is used to decide what to do next.[type: Real, unit: kg/s]

materials
(= [])¶ Set of materials for new particles, randomly picked from
[type: vector<shared_ptr<Material>>]

matStates
(= [])¶ Set of material states; when material is picked from
materials
,MatState
at the same index is assigned to the particle; if it isNone
ormatStates
is shorter than requested index, no material state will be assigned.[type: vector<shared_ptr<MatState>>]

generator
(= None)¶ Particle generator instance
[type: shared_ptr<
ParticleGenerator
>]

shooter
(= None)¶ Particle shooter instance (assigns velocities to generated particles. If not given, particles have zero velocities initially.
[type: shared_ptr<
ParticleShooter
>]

spatialBias
(= None)¶ Make random position biased based on the radius of the current particle; if unset, distribute uniformly.
[type: shared_ptr<
SpatialBias
>]

maxAttempts
(= 5000)¶ Maximum attempts to position new particles randomly, without collision. If 0, no limit is imposed. When reached,
atMaxAttempts
determines, what will be done. Each particle is tried maxAttempts/maxMetaAttempts times, then a new particle is tried.[type: int]

attemptPar
(= 5)¶ Number of trying a different particle to position (each will be tried maxAttempts/attemptPar times)
[type: int]

atMaxAttempts
(= 0)¶ What to do when maxAttempts is reached.
[type: int, named enum, possible values are: ‘error’ (0), ‘dead’ (1), ‘warn’ (2), ‘silent’ (‘nothing’, ‘ignore’, ‘’; 3), ‘doneHook’ (‘done’; 4)]

padDist
(= 0.0)¶ Pad geometry by this distance inside; random points will be chosen inside the shrunk geometry, whereas boxes will be validated in the larger one. This attribute must be set by the generator.
[type: Real, readonly in python]

kinEnergyIx
(= 1)¶ Index for kinetic energy in scene.energy
[type: int, not saved, not accessible from python]

color
(= nan)¶ Color for new particles (NaN for random; negative for keeping color assigned by the generator).
[type: Real]

stepGoalMass
(= 0.0)¶ Mass to be attained in this step
[type: Real, readonly in python]

collideExisting
(= True)¶ Consider collisions with preexisting particle; this is generally a good idea, though if e.g. there are no preexisting particles, it is useful to set to
False
to avoid having to define collider for no other reason than makeRandomInlet
happy.[type: bool]

clear
((RandomInlet)arg1) → None¶

randomPosition
((RandomInlet)arg1, (float)arg2, (float)arg3) → Vector3¶

validateBox
((RandomInlet)arg1, (AlignedBox3)arg2) → bool¶

ArcInlet¶
Object
→ Engine
→ PeriodicEngine
→ Inlet
→ RandomInlet
→ ArcInlet

class
woo.dem.
ArcInlet
¶ Inlet generating particles in prismatic arc (revolved rectangle) specified using cylindrical coordinates (with the
ISO 3111
convention, as mentioned at the Wikipedia page) in a local system.[ pkg/dem/Inlet.hpp , pkg/dem/Inlet.cpp ]

node
(= <Node @ 0x2ae9030, at (0, 0, 0)>)¶ Node defining local coordinate system. Must be given.
[type: shared_ptr<
Node
>]

cylBox
(= AlignedBox3((1.7976931348623157e308, 1.7976931348623157e308, 1.7976931348623157e308), (1.7976931348623157e308, 1.7976931348623157e308, 1.7976931348623157e308)))¶ Box in cylindrical coordinates, as: (ρ₀,φ₀,z₀),(ρ₁,φ₁,z₁). ρ must be nonnegative, (φ₁φ₀)≤2π.
[type:
AlignedBox3
]

glSlices
(= 32)¶ Number of slices for rendering circle (the arc takes the proportionate value
[type: int]

CylinderInlet¶
Object
→ Engine
→ PeriodicEngine
→ Inlet
→ RandomInlet
→ CylinderInlet

class
woo.dem.
CylinderInlet
¶ Generate particle inside an arbitrarily oriented cylinder.
[ pkg/dem/Inlet.hpp , pkg/dem/Inlet.cpp ]

node
(= None)¶ Node defining local coordinate system. If not given, global coordinates are used.
[type: shared_ptr<
Node
>]

height
(= nan)¶ Height along the local \(x\)axis.
[type: Real, unit: m]

radius
(= nan)¶ Radius of the cylinder (perpendicular to the local \(x\)axis).
[type: Real, unit: m]

glSlices
(= 16)¶ Number of subdivision slices for rendering.
[type: int]

BoxInlet¶
Object
→ Engine
→ PeriodicEngine
→ Inlet
→ RandomInlet
→ BoxInlet

class
woo.dem.
BoxInlet
¶ Generate particle inside axisaligned box volume.
[ pkg/dem/Inlet.hpp , pkg/dem/Inlet.cpp ]

box
(= AlignedBox3((nan, nan, nan), (nan, nan, nan)))¶ Box volume specification (lower and upper corners)
[type:
AlignedBox3
]

BoxInlet2d¶
Object
→ Engine
→ PeriodicEngine
→ Inlet
→ RandomInlet
→ BoxInlet
→ BoxInlet2d
ConveyorInlet¶
Object
→ Engine
→ PeriodicEngine
→ Inlet
→ ConveyorInlet

class
woo.dem.
ConveyorInlet
¶ Inlet producing infinite band of particles from packing periodic in the xdirection. Clumps are fully supported.
[ pkg/dem/Conveyor.hpp , pkg/dem/Conveyor.cpp ]
► Particles

spherePack
(= None)¶ woo.pack.SpherePack
object; when specified,centers
,radii
(andclumps
, if clumps are contained) are discarded and will be computed from thisSpherePack
. The attribute is reset afterwards.[type: shared_ptr<SpherePack>, not shown in the UI, not saved]

shapePack
(= None)¶ Purely geomerical description of particles to be generated (will replace
spherePack
,centers
,radii
,clumps
andcellLen
in the future).[type: shared_ptr<
ShapePack
>, not dumped]

zTrim
(= False)¶ Trim packing from above so that the ratio of
vel
/packVel
is as small as possible. Spheres/clumps will be discarded from above and this flag will be set to false once trimming is done (it will not be called again explicitly even ifmassRate
orvel
change.[type: bool, not shown in the UI]

zTrimHt
(= nan)¶ Height at which the packing was trimmed if
zTrim
was set.[type: Real, not shown in the UI]

cellLen
(= nan)¶ Length of the band cell, which is repeated periodically (if
spherePack
is given and is periodic, this value is deduced)[type: Real, unit: m]

radii
(= [])¶ Radii for the packing (if
spherePack
is given, radii are computed)[type: vector<Real>, not shown in the UI, not dumped]

centers
(= [])¶ Centers of spheres/clumps in the packing (if
spherePack
is given, centers are computed)[type: vector<Vector3r>, not shown in the UI, not dumped]

clumps
(= [])¶ Clump geometry, corresponding to each
radii
andcenters
. (ifspherePack
is given, clumps are computed)[type: vector<shared_ptr<SphereClumpGeom>>, not shown in the UI, not dumped]

massRate
(= nan)¶ Average mass flow rate; if given,
vel
is adjusted (if both are given,massRate
takes precedence).[type: Real, unit: kg/s]

vel
(= nan)¶ Velocity of particles; if specified,
massRate
is adjusted (of both are given, such as in constructor,massRate
has precedence and a warning is issued if the two don’t match)[type: Real, unit: m/s]

packVel
(= nan)¶ Velocity by which the packing is traversed and new particles emmited; always smaller than or equal to
vel
. Computed automatically.[type: Real, unit: m/s, readonly in python]

relLatVel
(= 0.0)¶ Relative velocity components lateral to
vel
(local xaxis); both components are assigned with uniform probability from range (relLatVel*vel,+relLatVel*vel), at the moment the particle leaves the barrier layer.[type: Real]
► Clipping

clipX
(= [])¶ If given, clip the given packing from above by the given function \(z_max(x)\) given as piecewiselinear function in samelength arrays
clipX
andclipZ
. IfclipX
is empty, no clipping is done.[type: vector<Real>, unit: m]

clipZ
(= [])¶ Zcoordinate (max sphere \(z\) coordinate), with points corresponding to
clipX
.[type: vector<Real>, unit: m]

clipLastX
(= 0.0)¶ Xcoordinate of lastgenerated particles, for use with clipping (clipping may have different periodicity than the packing, this value can be different from
lastX
and wraps aroundcellLen
.[type: Real, readonly in python]

clipPos
(= 0)¶ Internal variable for optimizing interpolation in
clipX
andclipZ
.[type: size_t, not shown in the UI, readonly in python]
► Tunables

startLen
(= nan)¶ Band to be created at the very start; if NaN, only the usual starting amount is created (depending on feed velocity)
[type: Real]

barrierColor
(= 0.2)¶ Color for barrier particles (NaN for random)
[type: Real]

color
(= nan)¶ Color for nonbarrier particles (NaN for random)
[type: Real]

barrierLayer
(= 3.0)¶ Some length of the last part of new particles has all DoFs blocked, so that when new particles are created, there are no sudden contacts in the band; in the next step, DoFs in this layer are unblocked. If barrierLayer is negative, it is relative to the maximum radius in the given packing, and is automatically set to the correct value at the first run
[type: Real]

movingBedZ
(= nan)¶ If given, particles with z coordinate lower than this value will move indefinitely with the conveyor (contact velocity, blocked DOFs), technically not added to the barrier at all.
[type: Real]

movingBedColor
(= 0.5)¶ Color for particles selected with
movingBedZ
(NaN for random).[type: Real]

save
(= True)¶ Save generated particles so that PSD can be generated afterwards
[type: bool]

matState
(= False)¶ Endow new particles with
InletMatState
(for tracking when a particular particle was created and similar.[type: bool]
► Bookkeeping

nextIx
(= 1)¶ Index of lastgenerated particles in the packing
[type: int, readonly in python]

lastX
(= 0.0)¶ Xcoordinate of lastgenerated particles in the packing
[type: Real, readonly in python]

barrier
¶ Nodes which make up the barrier and will be unblocked once they leave barrierLayer.
[type: list<shared_ptr<Node>>, not shown in the UI, readonly in python]

node
(= <Node @ 0x2a75b70, at (0, 0, 0)>)¶ Position and orientation of the factory; local xaxis is the feed direction.
[type: shared_ptr<
Node
>]

streamBeginNode
(= None)¶ Node at which the particle stream will start, which can be moving during the simulation without disrupting stream continuity. Only the position of this node, projected onto \(x\)axis of
node
is relevant.[type: shared_ptr<
Node
>]

xDebt
(= 0.0)¶ Length of packing which was not covered in the last step due to
streamBeginNode
offset.[type: Real, not shown in the UI, readonly in python]

initSortLimit
(= 200)¶ Limit of number of particles generated in a single step above which
woo.dem.InsertionSortCollider.forceInitSort
will be set (only useful ifInsertionSortCollider
is actually used).[type: int]

avgRate
(= nan)¶ Average feed rate (computed from
Material density
, packing and andvel
[type: Real, unit: kg/s, readonly in python]

kinEnergyIx
(= 1)¶ Index for kinetic energy in scene.energy
[type: int, not saved, not accessible from python]

genDiamMassTime
(= [])¶ List of generated diameters, masses and times (for making granulometry)
[type: vector<Vector3r>, not shown in the UI, readonly in python]

clear
((ConveyorInlet)arg1) → None¶

diamMass
((ConveyorInlet)arg1[, (bool)zipped=False]) → object :¶ Return masses and diameters of generated particles. With zipped, return list of (diameter, mass); without zipped, return tuple of 2 arrays, diameters and masses.

massOfDiam
((ConveyorInlet)arg1[, (float)min=0[, (float)max=inf]]) → float :¶ Return mass of particles of which diameters are between min and max.

psd
((ConveyorInlet)arg1[, (bool)mass=True[, (bool)cumulative=True[, (bool)normalize=False[, (Vector2)dRange=Vector2(nan, nan)[, (Vector2)tRange=Vector2(nan, nan)[, (int)num=80]]]]]]) → object :¶ Return PSD for particles generated.

ParticleGenerator¶

class
woo.dem.
ParticleGenerator
¶ Abstract class for generating particles
[ pkg/dem/Inlet.hpp , pkg/dem/Inlet.cpp ]

genDiamMassTime
(= [])¶ List of generated particle’s (equivalent) radii and masses (for making granulometry)
[type: vector<Vector3r>, not shown in the UI, not dumped, readonly in python]

save
(= True)¶ Save generated particles so that PSD can be generated afterwards
[type: bool]

__call__
((ParticleGenerator)arg1, (Material)mat[, (float)time=0]) → tuple :¶ Call the generation routine, returning one particle (at origin) and its boundingbox when at origin. Useful for debugging.

clear
((ParticleGenerator)arg1) → None :¶ Clear stored data about generated particles; only subsequently generated particles will be considered in the PSD.

critDt
((ParticleGenerator)arg1, (float)density, (float)young) → float :¶ Return critical timestep for particles generated by us, given that their density and Young’s modulus are as given in arguments.

diamMass
((ParticleGenerator)arg1[, (bool)zipped=False]) → object :¶ With zipped, return list of (diameter, mass); without zipped, return tuple of 2 arrays, diameters and masses.

massOfDiam
((ParticleGenerator)arg1[, (float)min=0[, (float)max=inf]]) → float :¶ Return mass of particles of which diameters are between min and max.

minMaxDiam
((ParticleGenerator)arg1) → Vector2 :¶ Return the range of minimum and maximum diameters.

padDist
((ParticleGenerator)arg1) → float :¶ Return padding distance by which the factory geometry should be shrunk before generating a random point.

psd
((ParticleGenerator)arg1[, (bool)mass=True[, (bool)cumulative=True[, (bool)normalize=True[, (Vector2)dRange=Vector2(nan, nan)[, (Vector2)tRange=Vector2(nan, nan)[, (int)num=80]]]]]]) → object :¶ Return PSD for particles generated.

PharmaCapsuleGenerator¶
Object
→ ParticleGenerator
→ PharmaCapsuleGenerator

class
woo.dem.
PharmaCapsuleGenerator
¶ Generate pharmaceutical capsules of fixed size; they consist of body and cap. two caps of differing diameter and are thus represented as two interpenetrated (clumped) capsules. The default value corresponds to Human Cap Size 1 from Torpac <http://www.torpac.com>.
[ pkg/dem/Psd.hpp , pkg/dem/Psd.cpp ]

len
(= 0.0194)¶ Total (locked) length of the capsule.
[type: Real]

capLen
(= 0.00978)¶ Cut length of the cap.
[type: Real]

colors
(= Vector2(0.5, 0.99))¶ Color of body and cap; white and red with the default (coolwarm) colormap.
[type:
Vector2
]

cutCorr
(= 0.5)¶ Make the cap shorter by this amount relative to the area of outer cap over the inner cap; this is to compensate for the approximation that the cap is not cut sharply.
[type: Real]

PsdSphereGenerator¶
Object
→ ParticleGenerator
→ PsdSphereGenerator

class
woo.dem.
PsdSphereGenerator
¶ Generate spherical particles following a given Particle Size Distribution (PSD)
[ pkg/dem/Psd.hpp , pkg/dem/Psd.cpp ]

discrete
(= False)¶ The points on the PSD curve will be interpreted as the only allowed diameter values; if false, linear interpolation between them is assumed instead. Do not change once the generator is running.
[type: bool]

psdPts
(= [])¶ Points of the PSD curve; the first component is particle diameter [m] (not radius!), the second component is passing percentage. Both diameter and passing values must be increasing (diameters must be strictly increasing). Passing values are normalized so that the last value is 1.0 (therefore, you can enter the values in percents if you like).
[type: vector<Vector2r>, units: [m,]]

mass
(= True)¶ PSD has mass percentages; if false, number of particles percentages are assumed. Do not change once the generator is running.
[type: bool]

weightPerBin
(= [])¶ Keep track of mass/number of particles for each point on the PSD so that we get as close to the curve as possible. Only used for discrete PSD.
[type: vector<Real>, not shown in the UI, not dumped, readonly in python]

weightTotal
(= 0.0)¶ Total mass (number, with discrete) of of particles generated.
[type: Real, not shown in the UI, not dumped, readonly in python]

inputPsd
((PsdSphereGenerator)arg1[, (bool)normalize=True[, (bool)cumulative=True[, (int)num=80]]]) → tuple :¶ Return input PSD; it will be a staircase function if discrete is true, otherwise linearly interpolated. With normalize, the maximum is equal to 1.; otherwise, the curve is multiplied with the actually generated mass/numer of particles (depending on whether
mass
is true or false); the result should then be very similar to thewoo.dem.ParticleGenerator.psd
output with actually generated spheres. Discrete noncumulative PSDs are handled specially: discrete distributions return skypline plot with peaks represented as plateaus of the relative width 1/num; continuous distributions return ideal histogram computed for relative bin with 1/num; thus returned histogram will match noncummulative histogram returned byParticleGenerator.psd(cumulative=False)
, provided num is the same in both cases.Todo
with
cumulative=False
and when the PSD does not \(x\)start at 0, the plot is not correct as the hump coming from the jump in the PSD (from 0 to nonzero at the left) is not taken in account.

PsdCapsuleGenerator¶
Object
→ ParticleGenerator
→ PsdSphereGenerator
→ PsdCapsuleGenerator

class
woo.dem.
PsdCapsuleGenerator
¶ Generate capsules following a given Particle Size Distribution; elongation is chosen randomly using
shaftRadiusRatio
; orientation is random.
PsdClumpGenerator¶
Object
→ ParticleGenerator
→ PsdSphereGenerator
→ PsdClumpGenerator

class
woo.dem.
PsdClumpGenerator
¶ Generate clump particles following a given Particle Size Distribution (
psd
) and selection ofclump shapes
, using thewoo.dem.SphereClumpGeom.scaleProb
function.For example, with
psd=[(.1, 0), (.2, .7), (.4, 1.)]
, the PSD function (which is a cumulative distribution function) looks likewhile the probability density function is
Now suppose three clumps are given with
scaleProb
as:[(.1, 1), (.3, 0)] # for d>.3, the leftmost value (0) is used [(.2, .1) ] # value extends to both left and right with just one point [(.2, 0), (.4, .6)] # for d<.2, the rightmost value (0) is used
which define the following piecewiselinear probability functions
For every diameter \(d\) chosen according to the PSD, values of
scaleProb
functions are found in \(d\) and used to choose which clump to create. The PDF for diameter combined with clumps probabilities then gives the following probability:Selected clump configuration is scaled to \(d\) (using its
equivRad
).[ pkg/dem/Psd.hpp , pkg/dem/Psd.cpp ]

clumps
(= [])¶ Sequence of clump geometry definitions (
SphereClumpGeom
); for every selected radius from the PSD, clump will be chosen based on theSphereClumpGeom.scaleProb
function and scaled to that radius.[type: vector<shared_ptr<SphereClumpGeom>>]

scaleMethod
(= 0)¶ Method to compute clump scaling. The default uses the equivalent radius to determine scaling to fulfill prescribed PSD. Other methods are to scale according to the radius of the first sphere in the clump, or according to the average sphere radius in the clump.
[type: int, named enum, possible values are: ‘equiv’ (‘equivRad’; 0), ‘firstSphere’ (1), ‘avgSphere’ (2)]

genClumpNo
(= [])¶ If
save
is set, keeps clump numbers (indices inclumps
for each generated clump.[type: vector<int>, not shown in the UI, readonly in python]

oris
(= [])¶ Base orientations for clumps, in the same order as
clumps
. If the sequence is shorter than selected clump configuration, its orientation will be completely random.[type: vector<Quaternionr>]

oriFuzz
(= [])¶ Fuzz (in radians) for orientation, if set based on
oris
; iforiFuzz
is shorter than clump configuration in question, the base orientation (oriFuzz
) is used asis. Random orientation axis is picked first, then rotation angle is taken from〈oriFuzz[i],+oriFuzz[i]〉
with uniform probability. Note: this simple algorithm does not generate completely homogeneous probability density in the rotation space.[type: vector<Real>]

PsdEllipsoidGenerator¶
Object
→ ParticleGenerator
→ PsdSphereGenerator
→ PsdEllipsoidGenerator

class
woo.dem.
PsdEllipsoidGenerator
¶ Generate ellipsoids following a given Particle Size Distribution; ratio of
Ellipsoid.semiAxes
is chosen randomly from thesemiAxesRatio
range; orientation is random.
MinMaxSphereGenerator¶
Object
→ ParticleGenerator
→ MinMaxSphereGenerator

class
woo.dem.
MinMaxSphereGenerator
¶ Generate particles with given minimum and maximum radius
SpatialBias¶

class
woo.dem.
SpatialBias
¶ Functor which biases random position (in unit cube) based on particle diameter, returning the biased position in unit cube. These objects are used with
RandomInlet.spatialBias
to make possible things like sptially graded distribution of random particles.
unitPos
((SpatialBias)arg1, (float)diam) → Vector3 :¶ Return biased position inside a unit cube (caller transforms this to cartesian coordinates in the simulation space.

NonuniformAxisPlacementBias¶
Object
→ SpatialBias
→ NonuniformAxisPlacementBias

class
woo.dem.
NonuniformAxisPlacementBias
¶ Distribute particle placement probability nonuniformly along given
axis
, following a piecewiselinear probability density function.[ pkg/dem/Inlet.hpp , pkg/dem/Inlet.cpp ]

axis
(= 0)¶ Biased axis.
[type: int]

pdf
(= [])¶ Probability density function values, on uniform grid spanning the axis unit range. If given, integrated numerically (trapezoid integration) to obtain
cdf
(which is normalized).[type: vector<Real>]

cdf
(= [])¶ Cumulative distribution function, either given directly, or computed from
pdf
, on uniform grid on unit range. Automatically normalized so that it ends at unity.[type: vector<Real>]

dx
(= nan)¶ Precomputed value of step size.
[type: Real, not shown in the UI, not dumped, readonly in python]

AxialBias¶
Object
→ SpatialBias
→ AxialBias

class
woo.dem.
AxialBias
¶ Bias position (within unit interval) along
axis
\(p\), so that radii are distributed alongaxis
, as in \(p=\frac{dd_0}{d_1d_0}+f\left(a\frac{1}{2}\right)\), where \(f\) is thefuzz
, \(a\) is unit random number, \(d\) is the current particle diameter and \(d_0\) and \(d_1\) are diameters at the lower and upper end (d01
). \(p\) is clamped to \(\rangle0,1\langle\) after the computation.[ pkg/dem/Inlet.hpp , pkg/dem/Inlet.cpp ]

axis
(= 0)¶ Axis which is biased.
[type: int]

d01
(= Vector2(nan, nan))¶ Diameter at the lower and upper end (the order matters); it is possible that \(r_0>r_1\), in which case the bias is reversed (bigger radii have smaller coordinate).
[type:
Vector2
]

fuzz
(= 0.0)¶ Allow for random variations around the position determined from diameter.
[type: Real]

PsdAxialBias¶
Object
→ SpatialBias
→ AxialBias
→ PsdAxialBias

class
woo.dem.
PsdAxialBias
¶ Bias position based on PSD curve, so that fractions get the amount of space they require according to their percentage. The PSD must be specified with mass fractions, using With
discrete
(suitable for use withPsdParticleGenerator.discrete
), the whole interval between the current and previous radius will be used with uniform probability, allowing for layered particle arangement. Thed01
attribute is ignored with PSD.[ pkg/dem/Inlet.hpp , pkg/dem/Inlet.cpp ]

psdPts
(= [])¶ Points of the mapping function, similar to
PsdParticleGenerator.psdPts
.[type: vector<Vector2r>]

invert
(= False)¶ Reverse the ordering along the axis, which makes the bigger particles be close to zero.
[type: bool]

discrete
(= False)¶ Interpret
psdPts
as piecewiseconstant (rather than piecewiselinear) function. Each diameter will be distributed uniformly in the whole interval between percentage of the current and previous points.[type: bool]

reorder
(= [])¶ Reorder the PSD fractions; this is mainly useful for discrete distributions, where the order can be nonincreasing, such as with
reorder=[1,0,2]
which will put the finest fraction in the middle of the other two[type: vector<int>]

LayeredAxialBias¶
Object
→ SpatialBias
→ AxialBias
→ LayeredAxialBias

class
woo.dem.
LayeredAxialBias
¶ Bias position so that particles occupy different layers based on their diameter. This is similar to
PsdAxialBias
withdiscrete
, but allows for more flexibility, such as one fraction occupying multiple nonadjacent layers.[ pkg/dem/Inlet.hpp , pkg/dem/Inlet.cpp ]

layerSpec
(= [])¶ Vector specifying layering; each item contains the following numbers:
dMin, dMax, xMin0, xMax0, xMin1, xMax1, ...
. A particle which falls withindMin, dMax
will be placed, with uniform probability, into intervals specified by other couples. Coordinates are given in normalized space, soxMin..xMax
must lie in in 〈0,1〉. Particles which do not fall into any fraction will not be biased (thus placed uniformly randomly), and a warning will be issued.[type: vector<VectorXr>]

xRangeSum
(= [])¶ Sum of
xMax_ixMin_i
for each fraction, for faster lookup. Internal/debugging use only.[type: vector<Real>, not shown in the UI, not dumped, not saved, readonly in python]

ParticleShooter¶

class
woo.dem.
ParticleShooter
¶ Abstract class for assigning initial velocities to generated particles.
ArcShooter¶
Object
→ ParticleShooter
→ ArcShooter

class
woo.dem.
ArcShooter
¶ Shoot particles in direction defined by (normallydistributed) angles from tangent and base plane (cylindrical coordinates defined by
node
) in given point, with magnitude constraind byvRange
.[ pkg/dem/Inlet.hpp , pkg/dem/Inlet.cpp ]

node
(= <Node @ 0x2a69050, at (0, 0, 0)>)¶ Node defining local coordinate system. Must be given.
[type: shared_ptr<
Node
>]

elevRange
(= Vector2(0, 0))¶ Range for elevation from the plane perpendicular to the local \(z\)axis (as defined by
node
). The actual value is chosen with uniform probability from this range.[type:
Vector2
, unit: rad]

AlignedMinMaxShooter¶
Outlet¶
Object
→ Engine
→ PeriodicEngine
→ Outlet

class
woo.dem.
Outlet
¶ Delete/mark particles which fall outside (or inside, if inside is True) given box. Deleted/mark particles are optionally stored in the diamMassTime array for later processing, if needed.
Particle are deleted when
markMask
is 0, otherwise they are only marked withmarkMask
and not deleted.[ pkg/dem/Outlet.hpp , pkg/dem/Outlet.cpp ]

markMask
(= 0)¶ When nonzero, switch to marking mode – particles of which
Particle.mask
does not comtainmarkMask
(i.e.(mask&markMask)!=markMask
) havemarkMask
bitadded toParticle.mask
(this can happen only once for each particle); particles are not deleted, but their diameter/mass added todiamMassTime
ifsave
is True.[type: uint]

mask
(= 4)¶ If nonzero, only particles matching the mask will be candidates for removal
[type: uint]

inside
(= False)¶ Delete particles which fall inside the volume rather than outside
[type: bool]

save
(= False)¶ Save particle data which are deleted in the
diamMassTime
list[type: bool]

recoverRadius
(= False)¶ Recover radius of Spheres by computing it back from particle’s mass and its material density (used when radius is changed due to radius thinning (in Law2_L6Geom_PelletPhys_Pellet.thinningFactor). When radius is recovered, the \(r/r_0\) ratio is added to
rDivR0
for further processing.[type: bool]

rDivR0
(= [])¶ List of the \(r/r_0\) ratio of deleted particles, when
recoverRadius
is true.[type: vector<Real>, not shown in the UI, readonly in python]

diamMassTime
(= [])¶ Radii and masses of deleted particles; not accessible from python (shadowed by the
diamMassTime
method).[type: vector<Vector3r>, not shown in the UI, not dumped, readonly in python]

locs
(= [])¶ Integer location specified for particles; 1 by default, derived classes can use this for any purposes (usually more precise location within the outlet volume).
[type: vector<int>, not shown in the UI, readonly in python]

num
(= 0)¶ Number of deleted particles
[type: int, readonly in python]

par
(= [])¶ Deleted
particles
(only saved withsavePar
.[type: vector<shared_ptr<Particle>>, not shown in the UI, not dumped, readonly in python]

mass
(= 0.0)¶ Total mass of deleted particles
[type: Real, readonly in python]

glColor
(= 0.0)¶ Color for rendering (NaN disables rendering)
[type: Real]

glHideZero
(= False)¶ Show numbers (mass and rate) even if they are zero.
[type: bool]

currRate
(= nan)¶ Current value of mass flow rate
[type: Real, readonly in python]

currRateSmooth
(= 1.0)¶ Smoothing factor for currRate ∈〈0,1〉
[type: Real, range: 0−1]

kinEnergyIx
(= 1)¶ Index for kinetic energy in scene.energy
[type: int, not saved, not accessible from python]

clear
((Outlet)arg1) → None :¶ Clear information about saved particles (particle list, if saved, mass and number, rDivR0)

diamMass
((Outlet)arg1[, (bool)zipped=False]) → object :¶ With zipped, return list of (diameter, mass); without zipped, return tuple of 2 arrays, diameters and masses.

massOfDiam
((Outlet)arg1[, (float)min=0[, (float)max=inf]]) → float :¶ Return mass of particles of which diameters are between min and max.

psd
((Outlet)arg1[, (bool)mass=True[, (bool)cumulative=True[, (bool)normalize=True[, (int)num=80[, (Vector2)dRange=Vector2(nan, nan)[, (Vector2)tRange=Vector2(nan, nan)[, (bool)zip=False[, (bool)emptyOk=False[, (list)locs=[]]]]]]]]]]) → object :¶ Return particle size distribution of deleted particles (only useful with save), spaced between dRange (a 2tuple of minimum and maximum radius); )

BoxOutlet¶
Object
→ Engine
→ PeriodicEngine
→ Outlet
→ BoxOutlet

class
woo.dem.
BoxOutlet
¶ Outlet with box geometry
[ pkg/dem/Outlet.hpp , pkg/dem/Outlet.cpp ]

box
(= AlignedBox3((1.7976931348623157e308, 1.7976931348623157e308, 1.7976931348623157e308), (1.7976931348623157e308, 1.7976931348623157e308, 1.7976931348623157e308)))¶ Box volume specification (lower and upper corners). If
node
is specified, the box is in local coordinates; otherwise, global coorinates are used.[type:
AlignedBox3
]

StackedBoxOutlet¶
Object
→ Engine
→ PeriodicEngine
→ Outlet
→ BoxOutlet
→ StackedBoxOutlet

class
woo.dem.
StackedBoxOutlet
¶ Box outlet with subdivision along one axis, so that more precise location can be obtained; this is functionally equivalent to multiple adjacent
BoxOutlet's
, but faster since it is a single engine.[ pkg/dem/Outlet.hpp , pkg/dem/Outlet.cpp ]

divs
(= [])¶ Coordinates of division between boxes in the stack; must be an increasing sequence.
[type: vector<Real>]

divColors
(= [])¶ Colors for rendering the dividers; if not given, use darkened
color
, same for all dividers.[type: vector<Real>]

axis
(= 0)¶ Axis along which the
box
is subdivided.[type: short]

loc0
(= 0)¶ Index at which numbering of boxes starts. The first box is 0 by default, but it can be changed using this attribute, e.g. setting loc0=10 will make the first box 10, second 11 etc.
[type: int]

ArcOutlet¶
Object
→ Engine
→ PeriodicEngine
→ Outlet
→ ArcOutlet

class
woo.dem.
ArcOutlet
¶ Outlet detnig/marking particles in prismatic arc (revolved rectangle) specified using cylindrical coordinates (with the
ISO 3111
convention, as mentioned at the Wikipedia page) in a local system. See also analogousArcInlet
.[ pkg/dem/Outlet.hpp , pkg/dem/Outlet.cpp ]

node
(= <Node @ 0x2a6add0, at (0, 0, 0)>)¶ Node defining local coordinates system. Must be given.
[type: shared_ptr<
Node
>]

cylBox
(= AlignedBox3((1.7976931348623157e308, 1.7976931348623157e308, 1.7976931348623157e308), (1.7976931348623157e308, 1.7976931348623157e308, 1.7976931348623157e308)))¶ Box in cylindrical coordinates, as: (ρ₀,φ₀,z₀),(ρ₁,φ₁,z₁). ρ must be nonnegative, (φ₁φ₀)≤2π.
[type:
AlignedBox3
]

glSlices
(= 32)¶ Number of slices for rendering circle (the arc takes the proportionate value
[type: int]

DetectSteadyState¶
Object
→ Engine
→ PeriodicEngine
→ DetectSteadyState

class
woo.dem.
DetectSteadyState
¶ Detect steady state from summary flows of relevant inlets (total influx) and outlets (total efflux), plus waiting times inbetween.The detection is done is several stages:
 (init) wait for
waitInit
before doing anything else;  (flow) execute
hookFlow
, check if \(\sum_i o_i \geq \alpha \sum_j i_j\) (\(\alpha\) isrelFlow
); if true, protosteady state was reached and we proceed;  (trans) execute
hookTrans
, then wait forwaitTrans
, then proceed to the next stage;  (steady) executed
hookSteady
, then wait forwaitSteady
, then proceed;  (done) execute
hookDone
and do nothing more.
[ pkg/dem/SteadyState.hpp , pkg/dem/SteadyState.cpp ]

waitInit
(= 0.0)¶ Time to wait in
init
stage, before moving toflow
.[type: Real, unit: s]

relFlow
(= 1.0)¶ Relative flow used for comparing influx and efflux in the
flow
stage.[type: Real, unit: s]

waitTrans
(= 0.0)¶ Time to wait in
trans
stage, before moving tosteady
.[type: Real, unit: s]

waitSteady
(= 0.0)¶ Time to wait in the steady stage, before moving to
done
.[type: Real, unit: s]

hookFlow
(= '')¶ Hook executed when the
flow
stage is entered.[type: string]

hookTrans
(= '')¶ Hook executed when the
trans
stage is entered.[type: string]

hookSteady
(= '')¶ Hook executed when the
steady
stage is entered.[type: string]

hookDone
(= 'e.dead=True')¶ Hook executed when the
done
stage is entered.[type: string]

rateSmooth
(= 1.0)¶ Smoothing factor for rates ∈〈0,1〉
[type: Real, range: 0−1]

stage
(= 0)¶ Stage in which we currently are.
[type: int, readonly in python, named enum, possible values are: ‘init’ (0), ‘flow’ (1), ‘trans’ (2), ‘steady’ (3), ‘done’ (4)]

stageEntered
(= 0.0)¶ Time when the current stage was entered.
[type: Real, unit: s, readonly in python]

inlets
(= [])¶ Inlets of which rates are used to compute summary influx.
[type: vector<shared_ptr<Inlet>>]

outlets
(= [])¶ Inlets of which rates are used to compute summary efflux.
[type: vector<shared_ptr<Outlet>>]

influx
(= nan)¶ Smoothed summary influx value.
[type: Real, readonly in python]

efflux
(= nan)¶ Smoothed summary efflux value.
[type: Real, readonly in python]
 (init) wait for
MeshVolume¶
Object
→ Engine
→ PeriodicEngine
→ MeshVolume

class
woo.dem.
MeshVolume
¶ Compute volume of (possibly deforming) closed triangulated surface; depends on the gts feature.
[ pkg/dem/MeshVolume.hpp , pkg/dem/MeshVolume.cpp ]

mask
(= 0)¶ Mask for finding surface triangles
[type: int]

reinit
(= False)¶ If true, recreate internal data from scratch
[type: bool]

nodes
(= [])¶ List of nodes, in the same order as the GTS surface structure.
[type: vector<shared_ptr<Node>>, not shown in the UI, not saved]

vol
(= nan)¶ Volume as computed when last run
[type: Real]

thickVol
(= nan)¶ Volume of the inner side of the mesh: the mesh is defined by
facets'
midplanes, but some facets may have nonzeroFacet.halfThick
. This number is the sum of (initial!) facet area timesFacet.halfThick
. To get the volume with this part subtracted, usenetVol
.[type: Real]

ClusterAnalysis¶
Object
→ Engine
→ PeriodicEngine
→ ClusterAnalysis

class
woo.dem.
ClusterAnalysis
¶ Analyze particle connectivity and assign cluster numbers to them.
[ pkg/dem/Clustering.hpp , pkg/dem/Clustering.cpp ]

box
(= AlignedBox3((1.7976931348623157e308, 1.7976931348623157e308, 1.7976931348623157e308), (1.7976931348623157e308, 1.7976931348623157e308, 1.7976931348623157e308)))¶ Limit particles considered in the analysis to this box only. If not specified, analyze all particles in the simulation.
[type:
AlignedBox3
]

mask
(= 0)¶ Particles to consider in cluster analysis. If 0, consider all particles.
[type: int]

clustMin
(= 5)¶ Minimum number of particles to mark them as clustered.
[type: int]

lastLabels
(= [])¶ Next free labels to be used for respective connectivity level.
[type: vector<int>, readonly in python]

maxConn
(= 0)¶ Maximum connectivity (recursion) for cluster analysis. Only 0 is implemented so far.
[type: int]

replMatState
(= 0)¶ What to do when an existing
MatState
is attached to a particle but it is not aClusterMatState
.[type: int, named enum, possible values are: ‘always’ (‘yes’, ‘ok’; 0), ‘never’ (‘no’; 1), ‘error’ (2)]

glColor
(= 0.4)¶ Color for rendering the box (NaN to disable rendering)
[type: Real]

Export¶
TODO
VtkExport¶
Object
→ Engine
→ PeriodicEngine
→ VtkExport

class
woo.dem.
VtkExport
¶ Export DEM simulation to VTK files for postprocessing.
[ pkg/dem/VtkExport.hpp , pkg/dem/VtkExport.cpp ]

out
(= '')¶ Filename prefix to write into;
woo.core.Scene.tags
written as {tagName} are expanded at the first run.[type: string]

compress
(= True)¶ Compress output XML files
[type: bool]

ascii
(= False)¶ Store data as readable text in the XML file (sets vtkXMLWriter data mode to
vtkXMLWriter::Ascii
, while the default isAppended
[type: bool]

multiblock
(= False)¶ Write to multiblock VTK files, rather than separate files; currently borken, do not use.
[type: bool]

mask
(= 0)¶ If nonzero, only particles matching the mask will be exported.
[type: int]

what
(= 47)¶ Select data to be saved (e.g. VtkExport.spheresVtkExport.mesh, or use VtkExport.all for everything)
[type: int]

sphereSphereOnly
(= False)¶ Only export contacts between two spheres (not sphere+facet and such)
[type: bool]

infError
(= True)¶ Raise exception for infinite objects which don’t have the glAB attribute set properly.
[type: bool]

skipInvisible
(= True)¶ Skip invisible particles
[type: bool]

savePos
(= False)¶ Save positions of spheres (redundant information, but useful for coloring by position in Paraview.
[type: bool]

clip
(= AlignedBox3((1.7976931348623157e308, 1.7976931348623157e308, 1.7976931348623157e308), (1.7976931348623157e308, 1.7976931348623157e308, 1.7976931348623157e308)))¶ Only export particles of which first node is in the clip box (if given).
[type:
AlignedBox3
]

staticMeshBit
(= 8)¶ Bit for identifying static mesh particles (
Facet
,Wall
,InfCylinder
only) which will be exported only once.[type: int]

staticMeshDone
(= False)¶ Whether static mesh was already exported
[type: bool]

subdiv
(= 16)¶ Subdivision fineness for circular objects (such as cylinders).
Note
Facets
are rendered without rounded edges (they are closed flat).Note
Ellipsoids
triangulation is controlled via theellLev
parameter.[type: int]

ellLev
(= 0)¶ Tesselation level for exporting ellipsoids (0 = icosahedron, each level subdivides one triangle into three.
[type: int, range: 0−3]

thickFacetDiv
(= 1)¶ Subdivision for
woo.dem.Facet
objects with nonzerowoo.dem.Facet.halfThick
; the value of 1 will usesubdiv
; 0 will render only faces, without edges; 1 will close the edge flat; higher values mean the number of subdivisions.[type: int]

cylCaps
(= True)¶ Render caps of
InfCylinder
(atInfCylinder.glAB
).[type: bool]

rodSurf
(= False)¶ Export rods (and derived classes) as capsuleshaped triangulated surfaces; without this option, rods are exported as plain connecting lines.
[type: bool]

nanValue
(= 0.0)¶ Use this number instead of NaN in entries, since VTK cannot read NaNs properly
[type: Real]

outFiles
¶ Files which have been written out, keyed by what they contain: ‘spheres’,’mesh’,’con’.
[type: map_string_vector_string, not shown in the UI, not dumped, readonly in python]

outTimes
(= [])¶ Times at which files were written.
[type: vector<Real>, not shown in the UI, readonly in python]

outSteps
(= [])¶ Steps at which files were written.
[type: vector<int>, not shown in the UI, readonly in python]

mkDir
(= False)¶ Attempt to create directory for output files, if not present.
[type: bool]

prevCellNum
(= Vector3i(0, 0, 0))¶ Previous cell array sized, for preallocation.
[type:
Vector3i
, not shown in the UI, not saved, readonly in python]

makePvdFiles
((VtkExport)arg1) → dict :¶ Write PVD files (one file for each category) and return dictionary mapping category name to the PVD filename; this requires that all active categories were saved at each step. Time points are output in the PVD file.

FlowAnalysis¶
Object
→ Engine
→ PeriodicEngine
→ FlowAnalysis

class
woo.dem.
FlowAnalysis
¶ Collect particle flow data in rectangular grid, watching different particle groups (radius ranges via
dLim
or groups by mask viamasks
– only one of them may be specified), and saving averages to as VTK uniform grid once finished.Note
Only particles returning meaningful
woo.dem.Shape.equivRad
are considered, all other are ignored.[ pkg/dem/FlowAnalysis.hpp , pkg/dem/FlowAnalysis.cpp ]

box
(= AlignedBox3((1.7976931348623157e308, 1.7976931348623157e308, 1.7976931348623157e308), (1.7976931348623157e308, 1.7976931348623157e308, 1.7976931348623157e308)))¶ Domain in which the flow is to be analyzed; the box may glow slightly to accomodate integer number of cells. Do not change once there is some data alread. Do not change once there is some data already.
[type:
AlignedBox3
]

node
(= None)¶ Defines local coordinates system; it undefined, uses global coordinates.
[type: shared_ptr<
Node
>]

data
¶ Grid data – 5d since each 3d point contains multiple entries, and there are multiple grids.
[type: boost_multi_array_real_5, not accessible from python]

dLim
(= [])¶ Limiting diameter values, for defining fractions which are analyzed separately. Do not change when there is some data already.
[type: vector<Real>]

masks
(= [])¶ Mask values for fractions; it is an error if a particle matches multiple masks. Do not change when there is some data already.
[type: vector<int>]

nFractions
(= 1)¶ Number of fractions, defined via
dLim
ormasks
; set automatically.[type: int, readonly in python]

cellSize
(= nan)¶ Size of one cell in the box (in all directions); will be satisfied exactly at the expense of perhaps slightly growing
box
. Do not change once there is some data already.[type: Real]

boxCells
(= Vector3i(0, 0, 0))¶ Number of cells in the box (computed automatically)
[type:
Vector3i
, readonly in python]

mask
(= 0)¶ Particles to consider in the flow analysis (0 to consider everything).
[type: int]

cellData
(= False)¶ Write flow rate as cell data rather than point data.
[type: bool]

porosity
(= False)¶ Compute (and export) solid ratio (1porosity) for all spheroidal particles (requires triangulation of the domain at every step, hence slow and not enabled by default.
[type: bool]

matStateScalar
(= 1)¶ If nonnegative, index of material state to analyze.
[type: int]

matStateName
(= '')¶ If given, used for VTKexport of the scalar; if not given, is filled form the first instance encountered automatically.
[type: string]

timeSpan
(= 0.0)¶ Total time that the analysis has been running.
[type: Real]

reset
((FlowAnalysis)arg1) → None :¶ Reset all data so that next analysis will be run from virgin state.

vtkExport
((FlowAnalysis)arg1, (str)out) → object :¶ Export all fractions separately, and also an overall flow (sum). out specifies prefix for all export filenames, the rest is created to describe the fraction or
all
for the sum. Exported file names are returned, the sum being at the very end. Internally callsvtkExportFractions
for all fractions.

vtkExportFractions
((FlowAnalysis)arg1, (str)out, (object)fractions) → str :¶ Export one single fraction to file named out. The extension
.vti
is added automatically. fractions specifies existing fraction numbers to export. If fractions are an empty list ([]
), all fractions are exported at once.

vtkExportVectorOps
((FlowAnalysis)arg1, (str)out, (object)fracA, (object)fracB) → str :¶ Export operations on two fraction sets: crossproduct, weighted differences and such, for segregation analysis. Appends
.opt.vti
to the output filename in out.

POVRayExport¶
Object
→ Engine
→ PeriodicEngine
→ POVRayExport

class
woo.dem.
POVRayExport
¶ Export DEM simulation to POVRay input files (work in progress) for raytracing.
[ pkg/dem/POVRayExport.hpp , pkg/dem/POVRayExport.cpp ]

out
(= '')¶ Filename prefix to write into;
woo.core.Scene.tags
written as{tagName}
are expanded at the first run.[type: string]

mask
(= 0)¶ If nonzero, only particles matching the mask will be exported.
[type: int]

skipInvisible
(= True)¶ Skip invisible particles
[type: bool]

clip
(= AlignedBox3((1.7976931348623157e308, 1.7976931348623157e308, 1.7976931348623157e308), (1.7976931348623157e308, 1.7976931348623157e308, 1.7976931348623157e308)))¶ Only export particles of which first node is in the clip box (if given).
[type:
AlignedBox3
]

frameCounter
(= 0)¶ Counts exported frames and uses the number to name output files.
[type: int]

colorRange
(= <ScalarRange @ 0x2a55080>)¶ Range to map
woo.dem.Shape.color
to RGB for pigment specification.[type: shared_ptr<
ScalarRange
>]

colorFuzz
(= 0.2)¶ Relative fuzz for particle color; the texture is called with RGB colors mapped (via
colorRange
) fromShape.color
 colorFuzz andShape.color
+ colorFuzz, clamped to (0,1)).[type: Real]

staticMask
(= 8)¶ Mask for static particles, which will be exported only once into a special incude file separate from the perframe include files.
[type: int]

masks
(= [8, 4, 1])¶ Masks which will be tried one after another (first match counts) on each particle to determine which texture will be applied to it. Texture names are taken from
textures
and must be defined in the master file.[type: vector<int>]

textures
(= ['static', 'outlet', 'movable'])¶ Texture names applied to particles matching
masks
– the first matching mask counts, textures are namedwoo_tex_*
and must be modified in the master file by the user (only an example definition is written by Woo). Particles not matching any mask will be assigned texturedefault
(woo_tex_default
). Each texture receives two rgb arguments which are colormapped fromwoo.dem.Shape.color
usingcolorRange
andcolorFuzz
.[type: vector<string>]

cylCapTexture
(= '')¶ If nonempty,
InfCylinder
objects will be drawn as several objects, with caps having this separate texture type.[type: string]

wallTexture
(= '')¶ If nonempty,
Wall
objects will have this texture applied, regardless of their mask. Meant for easily assigning checkerboard texture to wall objects.[type: string]

connMesh
(= 1)¶ Whether to export facets (
Facet
and derived classes) as connected meshes, and in what cases. This entails building topology and determining connected components of the topology graph, which can demand nonnegligible computation; the default is to do it for static mesh only, which is done only once, but not at every simulations steps. It is however necessary to set toalways
if nonstatic mesh is moving and should be exported.Note
Facets are normally exported onebyone. Mesh allows for more efficient processing in POVRay and for things like texture covering more facets.
[type: int, named enum, possible values are: ‘none’ (‘’, ‘never’; 0), ‘static’ (‘stat’, ‘static only’; 1), ‘always’ (‘yes’; 2)]

BoxTraceTimeSetter¶
Object
→ Engine
→ PeriodicEngine
→ BoxTraceTimeSetter

class
woo.dem.
BoxTraceTimeSetter
¶ Set
TraceVisRep.t0
of nodes insidebox
to the current time <Scene.time>; this is used for tracking how long has a particle been away from that region.[ pkg/dem/Tracer.hpp , pkg/dem/Tracer.cpp ]

box
(= AlignedBox3((1.7976931348623157e308, 1.7976931348623157e308, 1.7976931348623157e308), (1.7976931348623157e308, 1.7976931348623157e308, 1.7976931348623157e308)))¶ Box volume; in local coordinates if
node
is given, global otherwise.[type:
AlignedBox3
]

glColor
(= 0.5)¶ Color for rendering (NaN disables), mapped using the default colormap.
[type: Real]

AnisoPorosityAnalyzer¶
Object
→ Engine
→ AnisoPorosityAnalyzer

class
woo.dem.
AnisoPorosityAnalyzer
¶ Engine which analyzes current scene and computes directionaly porosity value by intersecting spheres with lines. The algorithm only works on periodic simulations.
[ pkg/dem/Porosity.hpp , pkg/dem/Porosity.cpp ]

poro
(= Matrix3(0, 0, 0, 0, 0, 0, 0, 0, 0))¶ Store analysis result here
[type:
Matrix3
, readonly in python]

div
(= 10)¶ Fineness of division of interval (0…1) for \(u\),\(v\) ∈〈0…1〉, which are used for uniform distribution over the positive octant as \(\theta= rac{\pi}{2}u\), \(\phi=\arccos v\) (see http://mathworld.wolfram.com/SpherePointPicking.html)
[type: int]

initStep
(= 1)¶ Step in which internal data were last updated
[type: long, not accessible from python]

initNum
(= 18446744073709551615)¶ Number of particles at last update
[type: size_t, not accessible from python]

rayIds
(= [])¶ Particles intersected with ray when oneRay was last called from python.
[type: vector<Particle::id_t>, readonly in python]

rayPts
(= [])¶ Starting and ending points of segments intersecting particles.
[type: vector<Vector3r>, readonly in python]

clearVis
((AnisoPorosityAnalyzer)arg1) → None :¶ Clear visualizable intersection segments

oneRay
((AnisoPorosityAnalyzer)arg1, (Vector3)A[, (Vector3)B=Vector3(0, 0, 0)[, (bool)vis=True]]) → float¶ oneRay( (AnisoPorosityAnalyzer)arg1, (float)theta, (float)phi [, (bool)vis=True]) > float

relSolid
((AnisoPorosityAnalyzer)arg1, (float)theta, (float)phi[, (Vector3)pt0=Vector3(0, 0, 0)[, (bool)vis=False]]) → float¶

static
splitRay
((float)theta, (float)phi[, (Vector3)pt0=Vector3(0, 0, 0)[, (Matrix3)T=Matrix3(1, 0, 0, 0, 1, 0, 0, 0, 1)]]) → object¶

Suspicious¶
Object
→ Engine
→ PeriodicEngine
→ Suspicious

class
woo.dem.
Suspicious
¶ Watch the simulation and signal suspicious evolutions, such as sudden increase in contact force beyond usual measure or unsual velocity.
[ pkg/dem/Suspicious.hpp , pkg/dem/Suspicious.cpp ]

avgVel
(= nan)¶ Average velocity norm.
[type: Real, readonly in python]

avgForce
(= nan)¶ Average particle force norm.
[type: Real, readonly in python]

avgFn
(= nan)¶ Average normal force norm.
[type: Real, readonly in python]

avgFt
(= nan)¶ Average shear force norm.
[type: Real, readonly in python]

avgUn
(= nan)¶ Average normal overlap.
[type: Real, readonly in python]

relThreshold
(= 100.0)¶ Break on quantity this much larger than the average.
[type: Real]

errPar
(= [])¶ Particle where there was some error (shown in OpenGL).
[type: vector<shared_ptr<Particle>>]

errCon
(= [])¶ Contacts where there was some error (shown in OpenGL)
[type: vector<shared_ptr<Contact>>]

DEM field¶
TODO
DemField¶

class
woo.dem.
DemField
¶ Field describing a discrete element assembly. Each particle references (possibly many) nodes.
Special constructor
When passed the
par
parameter in constructor, this sequence of particles will be assigned toparticles
and nodes created as withS.dem.add
. An additional optional parameterparNodes
will be passed as nodes toS.dem.add(...,nodes=...)
to determine which nodes are to be added.[ pkg/dem/Particle.hpp , pkg/dem/Particle.cpp ]

particles
(= <ParticleContainer @ 0x2a6b590>)¶ Particles (each particle holds its contacts, and references associated nodes)
[type: shared_ptr<
ParticleContainer
>, readonly in python]

contacts
(= <ContactContainer @ 0x2a6c010>)¶ Linear view on particle contacts
[type: shared_ptr<
ContactContainer
>, readonly in python]

loneMask
(= 2)¶ Particle groups which have bits in loneMask in common (i.e. (A.mask & B.mask & loneMask)!=0) will not have contacts between themselves
[type: uint]

distFactor
(= 1.0)¶ Relative enlargement of bounding boxes, and of radii in contacts; only supported by a few functors (
Bo1_Sphere_Aabb
,Cg2_Sphere_Sphere_L6Geom
), storing the value inDemField
ensures the values are synchronized between all functors interested. Deactivated if negative; any negative value (1
by default) is equivalent to1
(no enlargement at all).[type: Real]

saveDead
(= False)¶ Save unused nodes of deleted particles, which would be otherwise removed (useful for displaying traces of deleted particles).
[type: bool]

deadNodes
(= [])¶ List of nodes belonging to deleted particles; only used if
saveDead
isTrue
[type: vector<shared_ptr<Node>>, not shown in the UI, readonly in python]

deadParticles
(= [])¶ Deleted particles; only used if
saveDead
isTrue
[type: vector<shared_ptr<Particle>>, not shown in the UI, readonly in python]

clearDead
((DemField)arg1) → None¶

collectNodes
((DemField)arg1[, (bool)fromCxx=False]) → int :¶ Collect nodes from all particles and clumps and insert them to nodes defined for this field. Nodes are not added multiple times, even if they are referenced from different particles.

con
¶ Linear view on particle contacts

static
minimalEngines
(damping=0.0, gravity=None, verletDist=0.05, kinSplit=False, dontCollect=False, noSlip=False, noBreak=False, cp2=None, law=None, model=None, grid=False, dynDtPeriod=100, cpKw={}, lawKw={})¶ Return default set of engines, suitable for basic simulations during testing.

nodesAppend
((DemField)arg1, (Node)arg2) → None :¶ Append given node to
nodes
, and setDemData.linIx
to the correct value automatically. nodesAppend( (DemField)arg1, (NodeList)arg2) > None :
 Append given list of nodes to
nodes
, and setDemData.linIx
to the correct value automatically.

nodesAppendFromPar
((DemField)arg1, (ParticleList)arg2) → None :¶ Append nodes of all particles given; nodes may repeat between particles (a set is created first), but nodes already in
nodes
before calling this method will cause an error.

par
¶ Particles (each particle holds its contacts, and references associated nodes)

static
sceneGetField
((Scene)arg1) → DemField¶

static
sceneHasField
((Scene)arg1) → bool¶

setNodesRefPos
((DemField)arg1) → None :¶ Set reference position and orientation of all nodes to the current one; does nothing (silently) on builds without OpenGL.

splitNode
((DemField)arg1, (Node)node, (ParticleList)pars[, (float)massMult=nan[, (float)inertiaMult=nan]]) → NodeList :¶ For particles pars, replace their node node by a clone (
deepcopy
) of this node. If massMult and inertiaMult are given, mass/inertia of both original and cloned node are multiplied by those factors. Returns the original and the new node. Both nodes will be coincident in space. This function is used to unshare node shared by multiple particles, such as when breaking mesh apart.

ContactContainer¶

class
woo.dem.
ContactContainer
¶ Linear view on all contacts in the DEM field
[ pkg/dem/ContactContainer.hpp , pkg/dem/ContactContainer.cpp ]

linView
(= [])¶ Linear storage of references; managed by accessor methods, do not modify directly!
[type: ContainerT, not accessible from python]

dirty
(= False)¶ Flag for notifying the collider that persistent data should be invalidated
[type: bool, not accessible from python]

stepColliderLastRun
(= 1)¶ Step number when a collider was last run; set by the collider, if it wants contacts that were not encoutered in that step to be deleted by ContactLoop (such as SpatialQuickSortCollider). Other colliders (such as InsertionSortCollider) set it it 1, which is the default.
[type: int, readonly in python]

threadsPending
¶ Contacts which might be deleted by the collider in the next step (separate for each thread, for safe lockfree writes)
[type: std::vector<std::vector<PendingContact>>, not accessible from python]

__getitem__
((ContactContainer)arg1, (Vector2i)arg2) → Contact¶ __getitem__( (ContactContainer)arg1, (int)arg2) > Contact

__iter__
((ContactContainer)arg1) → ContactContainer_iterator¶

__len__
((ContactContainer)arg1) → int¶

clear
((ContactContainer)arg1) → None¶

countReal
((ContactContainer)arg1) → int¶

exists
((ContactContainer)arg1, (int)arg2, (int)arg3) → bool¶

existsReal
((ContactContainer)arg1, (int)arg2, (int)arg3) → bool¶

realRatio
((ContactContainer)arg1) → float¶

remove
((ContactContainer)arg1, (Contact)contact[, (bool)force=False]) → None¶

removeNonReal
((ContactContainer)arg1) → None¶

ParticleContainer¶

class
woo.dem.
ParticleContainer
¶ Storage for DEM particles
[ pkg/dem/ParticleContainer.hpp , pkg/dem/ParticleContainer.cpp ]

parts
(= [])¶ Actual particle storage
[type: ContainerT, not accessible from python]

freeIds
¶ Free particle id’s
[type: list<id_t>, not accessible from python]

__getitem__
((ParticleContainer)arg1, (int)arg2) → Particle¶

__iter__
((ParticleContainer)arg1) → ParticleContainer_iterator¶

__len__
((ParticleContainer)arg1) → int¶

add
((ParticleContainer)arg1, (Particle)par[, (int)nodes=1]) → int :¶ Add single particle, and maybe also add its nodes to
DemField.nodes
. nodes can be 1/True (always), 0/False (never) or 1 (maybe – based on heuristics). The heuristics is defined inwoo.dem.DemData.guessMoving
. add( (ParticleContainer)arg1, (ParticleList)pars [, (int)nodes=1]) > list :
 Add list of particles, and optionally also adding its nodes to
DemField.nodes
; seeadd
for explanation of nodes.

addClumped
((ParticleContainer)arg1, (ParticleList)par[, (Node)centralNode=None[, (int)nodes=False]]) → Node :¶ Add particles as rigid aggregate. Add resulting clump node (which is not a particle) to Scene.dem.nodes, subject to integration. centralNode must be provided if particles have zero mass (in that case, clump position cannot be computed), all DOFs will be blocked automatically in that case; centralNode.dem will be set with a new instance of
ClumpData
and the old value, if any, discarded. Clump node is added automatically toDemField.nodes
.Note
Clumped nodes are not added to
DemField.nodes
by default; this can be changed bynodes=True
, but it is to be done only in cases, such as whenwoo.dem.NodalForcesToHdf5
should use those nodes. Nodes will still be skipped for motion integration, which is done on the clump node itself.

clear
((ParticleContainer)arg1) → None :¶ Bruteforce removal of all particles; bypasses any consistency checks (like nodeparticle refcounting), do not use.

disappear
((ParticleContainer)arg1, (object)ids, (int)mask) → None :¶ Remask particle (so that it does not have contacts with other particles), remove contacts, which would no longer exist and make it invisible. Shorthand for calling
remask(ids,mask,visible=False,removeContacts=True)

exists
((ParticleContainer)arg1, (int)id) → bool :¶ Tell whether particle with this
id
exists in the container.

reappear
((ParticleContainer)arg1, (object)ids, (int)mask[, (bool)removeOverlapping=False]) → None :¶ Remask particle, remove particles, which would overlap with newlyappeared particle (if
removeOverlapping
isTrue
), make it visible again. Shorthand forremask(ids,mask,visible=True,removeContacts=False)

remask
((ParticleContainer)arg1, (object)ids, (int)mask, (bool)visible, (bool)removeContacts, (bool)removeOverlapping) → None :¶ Change particle mask and visibility; optionally remove contacts, which would no longer exist due to mask change; or remove particles, which would newly overlap with the particle. See also
disappear
andreappear
.

Motion integration¶
TODO
Leapfrog¶

class
woo.dem.
Leapfrog
¶ Engine integrating newtonian motion equations, using the leapfrog scheme. See
theorymotionintegration
for details.[ pkg/dem/Leapfrog.hpp , pkg/dem/Leapfrog.cpp ]

IpLL4h
(= Matrix3(0, 0, 0, 0, 0, 0, 0, 0, 0))¶ \(I+\frac{\nnext{\tens{L}}+\pprev{\tens{L}}}{4}\Dt\)
[type:
Matrix3
, not saved, readonly in python]

ImLL4hInv
(= Matrix3(0, 0, 0, 0, 0, 0, 0, 0, 0))¶ \(\left(\tens{I}\frac{\nnext{\tens{L}}\pprev{\tens{L}}}{4}\Dt\right)^{1}\)
[type:
Matrix3
, not saved, readonly in python]

LmL
(= Matrix3(0, 0, 0, 0, 0, 0, 0, 0, 0))¶ \(\nnext{\tens{L}}\pprev{\tens{L}}\)
[type:
Matrix3
, not saved, readonly in python]

deltaSpinVec
(= Vector3(0, 0, 0))¶ \(\frac{1}{2}\epsilon_{ijk}\frac{\pprev{\tens{L}}{\pprev{\tens{L}}}^T}{2}+\frac{1}{2}\epsilon_{ijk}\frac{\nnext{\tens{L}}{\nnext{\tens{L}}}^T}{2}\).
[type:
Vector3
, not saved, readonly in python]

damping
(= 0.2)¶ damping coefficient for nonviscous damping
[type: Real]

reset
(= False)¶ Reset forces immediately after applying them.
[type: bool]

_forceResetChecked
(= False)¶ Whether we already issued a warning for forces being (probably) not reset
[type: bool, not shown in the UI]

maxVelocitySq
(= nan)¶ store square of max. velocity, for informative purposes; computed again at every step.
[type: Real, readonly in python]

dontCollect
(= False)¶ Don’t attempt to collect DEM nodes when there are none in the first step.
[type: bool, not shown in the UI]

kinSplit
(= False)¶ Whether to separately track translational and rotational kinetic energy.
[type: bool]

nonviscDampIx
(= 1)¶ Index of the energy dissipated using the nonviscous damping (
damping
).[type: int, not saved, not accessible from python]

gravWorkIx
(= 1)¶ Index for gravity work
[type: int, not saved, not accessible from python]

kinEnergyIx
(= 1)¶ Index for kinetic energy in scene>energies.
[type: int, not saved, not accessible from python]

kinEnergyTransIx
(= 1)¶ Index for translational kinetic energy in scene>energies.
[type: int, not saved, not accessible from python]

kinEnergyRotIx
(= 1)¶ Index for rotational kinetic energy in scene>energies.
[type: int, not saved, not accessible from python]

ForceResetter¶
Object
→ Engine
→ ForceResetter

class
woo.dem.
ForceResetter
¶ Reset forces on nodes in DEM field.
DynDt¶
Object
→ Engine
→ PeriodicEngine
→ DynDt

class
woo.dem.
DynDt
¶ Adjusts
Scene.dt
based on current stiffness of particle contacts.[ pkg/dem/DynDt.hpp , pkg/dem/DynDt.cpp ]

maxRelInc
(= 0.0001)¶ Maximum relative increment of timestep within one step, to void abrupt changes in timestep leading to numerical artefacts.
[type: Real]

DemData¶

class
woo.dem.
DemData
¶ Dynamic state of node.
[ pkg/dem/Particle.hpp , pkg/dem/Particle.cpp ]

angVel
(= Vector3(0, 0, 0))¶ Angular velocity; when set,
angMom
is reset (and updated fromangVel
inLeapfrog
)..[type:
Vector3
, unit: rad/s]

mass
(= 0.0)¶ Associated mass.
[type: Real, unit: kg]

angMom
(= Vector3(nan, nan, nan))¶ Angular momentum; used with the aspherical integrator. If NaN and aspherical integrator (
Leapfrog
) is used, the value is initialized toinertia
×angVel
.[type:
Vector3
, unit: N·m·s]

flags
(= 0)¶ Bit flags storing blocked DOFs, clump status, …
[type: unsigned, readonly in python, bit accessors: blockX, blockY, blockZ, blockRotX, blockRotY, blockRotZ, clumped, clump, energySkip, gravitySkip, tracerSkip, dampingSkip]

linIx
(= 1)¶ Index within DemField.nodes (for efficient removal)
[type: long, not shown in the UI, readonly in python]

parRef
¶ Backreference for particles using this node; this is important for knowing when a node may be deleted (no particles referenced) and such. Should be kept consistent.
[type: std::list<Particle*>, not shown in the UI, not saved, not accessible from python]

impose
(= None)¶ Impose arbitrary velocity, angular velocity, … on the node; the functor is called from Leapfrog, after new position and velocity have been computed.
[type: shared_ptr<
Impose
>]

master
¶ Master node; currently only used with clumps (since this is never set from python, it is safe to use weak_ptr).
[type: weak_ptr<
Node
>, not shown in the UI, not accessible from python]

addParRef
((DemData)arg1, (Particle)arg2) → None¶

blocked
¶ Degress of freedom where linear/angular velocity will be always constant (equal to zero, or to an userdefined value), regardless of applied force/torque. String that may contain ‘xyzXYZ’ (translations and rotations).

guessMoving
((DemData)arg1) → bool :¶ Tell whether the node is likely to be moving or not. Returns true if any of the following is true:
 nonzero
mass
and not all DoFs areblocked
(this will be false for nodes with mass, but which are completely blocked),  nonzero
velocity
,  nonzero
angular velocity
,  anything is
imposed
.
This function is used as heuristics by
S.dem.par.add
when called withnodes=1
(default), to decide whether the particle’s nodes should be added to S.dem.nodes. nonzero

isAspherical
¶ Return
True
when inertia components are not equal.

static
setOriMassInertia
((Node)arg1) → None :¶ Lump mass and inertia from all attached particles and attempt to rotate the node so that its axes are principal axes of inertia, if allowed by particles shape (without chaning the geometry).

useAsphericalLeapfrog
¶ Say whether the node will use aspherical
leapfrog
integration routine. The criterion is that the nodeis aspherical
and does not have all rotationsblocked
.

DemDataTagged¶
Object
→ NodeData
→ DemData
→ DemDataTagged

class
woo.dem.
DemDataTagged
¶ Add integer tag to each node, used with
ForcesToHdf5
so that nodes can be numbered differently than in Woo.
tag
(= 1)¶ External identifier of th node (unused by Woo itself).
[type: int]

ClumpData¶
Object
→ NodeData
→ DemData
→ ClumpData

class
woo.dem.
ClumpData
¶ Data of a DEM particle which binds multiple particles together.
[ pkg/dem/Clump.hpp , pkg/dem/Clump.cpp ]

nodes
(= [])¶ Member nodes
[type: vector<shared_ptr<Node>>, not shown in the UI, readonly in python]

relPos
(= [])¶ Relative member’s positions
[type: vector<Vector3r>, readonly in python]

relOri
(= [])¶ Relative member’s orientations
[type: vector<Quaternionr>, readonly in python]

static
applyToMembers
((Node)arg1) → None :¶ Move/rotate member nodes; this is only useful after setting clump’s node position/orientation by hand, so that memebrs are updated without running Leapfrog.

static
forceTorqueFromMembers
((Node)arg1) → tuple :¶ Return the tuple (F,T), summary force and torque values collected from clump members, as acting on the clump node passed as argument.

Impose¶

class
woo.dem.
Impose
¶ Impose arbitrary changes in Node and DemData, at certain hook points during motion integration. Velocity is imposed after motion integration (and again after computing acceleration from forces, to make sure forces don’t alter what is prescribed), force is imposed when forces from the previous step are being reset (thus additional force may be applied on the node as usual); readForce is a special imposition before resetting force, which is meant to look at summary force applied onto node(s).

what
(= 0)¶ What values are to be imposed; this is set by the derived engine automatically depending on what is to be prescribed.
[type: int, bit accessors: vel, force, iniVel, readForce]

stepLast
(= 1)¶ Step in which this imposition was last used; updated atomically by callers from c++ by calling isFirstStepRun.
[type: long, readonly in python]

timeLast
(= nan)¶ Time in which this imposition was last used; updated automatically bu callers from c++ via
isFirstStepRun
, just likestepLast
.[type: Real, readonly in python]

__add__
((Impose)arg1, (Impose)arg2) → Impose :¶ Return combined imposition, a new instance of
CombinedImpose
.

CircularOrbit¶
Object
→ Impose
→ CircularOrbit

class
woo.dem.
CircularOrbit
¶ Imposes circular orbiting around the local zaxis; the velocity is prescribed using approximated midstep position in an incremental manner. This can lead to unstabilities (such as changing radius) when used over millions of steps, but does not require radius to be given explicitly (see also
StableCircularOrbit
).Angular velocity
is touched only whenrotate
is set.[ pkg/dem/Impose.hpp , pkg/dem/Impose.cpp ]

rotate
(= False)¶ Impose rotational velocity so that orientation relative to the local zaxis is always the same. If false, angular velocity is left asis.
[type: bool]

omega
(= nan)¶ Orbiting angular velocity.
[type: Real]

angle
(= 0.0)¶ Cumulative angle turned, incremented at every step.
[type: Real]

StableCircularOrbit¶
Object
→ Impose
→ CircularOrbit
→ StableCircularOrbit

class
woo.dem.
StableCircularOrbit
¶ Impose circular orbiting around local zaxis, enforcing constant radius of orbiting. The note about
rotate
applies to this imposition.[ pkg/dem/Impose.hpp , pkg/dem/Impose.cpp ]

radius
(= nan)¶ Radius, i.e. enforced distance from the rotation axis.
[type: Real]

VariableAlignedRotation¶
Object
→ Impose
→ VariableAlignedRotation

class
woo.dem.
VariableAlignedRotation
¶ Impose piecewiselinear angular velocity along
axis
, based on thetimeAngVel
.[ pkg/dem/Impose.hpp , pkg/dem/Impose.cpp ]

axis
(= 0)¶ Rotation axis.
[type: int]

timeAngVel
(= [])¶ Angular velocity values in time. Time values must be increasing.
[type: vector<Vector2r>]

wrap
(= False)¶ Wrap time around the last time value (float modulo), if greater.
[type: bool]

AlignedHarmonicOscillations¶
Local6Dofs¶
Object
→ Impose
→ Local6Dofs

class
woo.dem.
Local6Dofs
¶ Impose force or velocity along all local 6 axes given by the trsf matrix.
[ pkg/dem/Impose.hpp , pkg/dem/Impose.cpp ]

ori
(= Quaternion((1, 0, 0), 0))¶ Local coordinates rotation
[type:
Quaternion
]

VariableVelocity3d¶
Object
→ Impose
→ VariableVelocity3d

class
woo.dem.
VariableVelocity3d
¶ Impose velocity in 3 independent senses, interpolated from piecewiselinear velocity function values, optional periodic in time; NaN values of velocity will impose nothing in that direction.
[ pkg/dem/Impose.hpp , pkg/dem/Impose.cpp ]

angVels
(= [])¶ Components of angular velocity, in local coordinates defined by
ori
. If empty, angular velocity will not be imposed at all.Note
Only nodes which are using spherical integration can be prescribed angular velocity, since the aspherical integrator in
woo.dem.Leapfrog
usesangular momentum
rather thanangular velocity
as input. This can be queried withNode.dem.useAsphericalLeapfrog
.[type: vector<Vector3r>]

ori
(= Quaternion((1, 0, 0), 0))¶ Orientation of coordinate axes (by default, impose velocity along global axes)
[type:
Quaternion
]

hooks
(= [])¶ Python hooks to be run when time points are reached (max Δt later than
times
items). Must be same length thantimes
, or shorter; use empty string for not doing anything at that time point.[type: vector<string>]

diff
(= False)¶ Prescribed velocity can be applied as total velocity value (with
diff==False
) or as difference added to the actual nodal velocity (withdiff==True
).[type: bool]

wrap
(= False)¶ Wrap time around the last time value (float modulo), if greater.
[type: bool]

HarmonicOscillation¶
Object
→ Impose
→ HarmonicOscillation

class
woo.dem.
HarmonicOscillation
¶ Impose harmonic oscillation around initial center position, with given frequency
freq
(\(f\)) and amplitudeamp
(\(A\)), by prescribing velocity. Nodal velocity magnitude alongdir
is \(x'(t)=A\omega\cos(\omega(tt_0))\) (with \(\omega=2\pi f\)), which is the derivative of the harmonic motion equation \(x(t)=A\sin(\omega(tt_0))\). The motion starts in zero (for \(t_0=0\)); to reverse the direction, either reversedir
or assign \(t_0=\frac{1}{2f}=\frac{\pi}{\omega}\).
freq
(= nan)¶ Frequence of oscillation
[type: Real]

amp
(= nan)¶ Amplitude of oscillation
[type: Real]

t0
(= 0.0)¶ Time when the oscillator is in the center position (phase)
[type: Real]

perpFree
(= False)¶ If true, only velocity in the dir sense will be prescribed, velocity in the perpendicular sense will be preserved.
[type: bool]

RadialForce¶
Object
→ Impose
→ RadialForce

class
woo.dem.
RadialForce
¶ Impose constant force towards an axis in 3d.
[ pkg/dem/Impose.hpp , pkg/dem/Impose.cpp ]

F
(= 0.0)¶ Magnitude of the force applied. Positive value means away from the axis given by nodeA and nodeB.
[type: Real]

CombinedImpose¶
Object
→ Impose
→ CombinedImpose

class
woo.dem.
CombinedImpose
¶ Combine several impositions and apply them one after another.
[ pkg/dem/Impose.hpp , pkg/dem/Impose.cpp ]

imps
(= [])¶ Impositions which are combined together, always called in this order.
[type: vector<shared_ptr<Impose>>]

ConstantForce¶
Object
→ Impose
→ ConstantForce

class
woo.dem.
ConstantForce
¶ Impose constant force, which is added to other acting forces.
InterpolatedMotion¶
Object
→ Impose
→ InterpolatedMotion

class
woo.dem.
InterpolatedMotion
¶ Impose linear and angular velocity such that given positions and orientations are reached in at given timepoints.
[ pkg/dem/Impose.hpp , pkg/dem/Impose.cpp ]

poss
(= [])¶ Positions which will be interpolated between.
[type: vector<Vector3r>]

oris
(= [])¶ Orientations which will be interpolated between.
[type: vector<Quaternionr>]

times
(= [])¶ Times at which given
positions
andorientations
should be reached.[type: vector<Real>]

t0
(= 0.0)¶ Time offset to add to all time points.
[type: Real]

ReadForce¶

class
woo.dem.
ReadForce
¶ Sum forces and torques acting on all nodes with this imposition; this imposition does not change the behavior of particles in any way.
VelocityAndReadForce¶
Object
→ Impose
→ VelocityAndReadForce

class
woo.dem.
VelocityAndReadForce
¶ Impose velocity in one direction, and optionally read and sum force on all nodes with this imposition (force is not changed in any way). Velocity lateral to the imposition may be free or zero depending on
latBlock
.[ pkg/dem/Impose.hpp , pkg/dem/Impose.cpp ]

dir
(= Vector3(1, 0, 0))¶ Direction (automatically normalized) for prescribed velocity and force readings.
[type:
Vector3
]

vel
(= 0.0)¶ Prescribed velocity magnitude.
[type: Real]

latBlock
(= True)¶ Whether lateral velocity (perpendicular to
vel
) is set to zero, or left free.[type: bool]

sumF
(= 0.0)¶ Summary force on nodes with this imposition, in the direction of
vel
.[type: OpenMPAccumulator<Real>, readonly in python]

invF
(= False)¶ Invert force value (so that it has the meaning of reactin rather than force exerted).
[type: bool]

dist
(= 0.0)¶ Cumulative displacement of this imposition.
[type: Real]

energyName
(= '')¶ If given, and
trackEnergy
isTrue
, cumulate work done by this imposition under this name[type: string]

workIx
(= 1)¶ Index for fast access to the energy.
[type: int, not saved, not accessible from python]

Tracer¶
Object
→ Engine
→ PeriodicEngine
→ Tracer

class
woo.dem.
Tracer
¶ Save trace of node’s movement
[ pkg/dem/Tracer.hpp , pkg/dem/Tracer.cpp ]

num
(= 50)¶ Number of positions to save (when creating new glyph)
[type: int]

compress
(= 2)¶ Ratio by which history is compress when all data slots are filled; if 0, cycle and don’t compress.
[type: int]

compSkip
(= 2)¶ Number of leading points to skip during compression; if negative, the value of compress is used.
[type: int]

minDist
(= 0.0)¶ Only add new point when last point is at least minDist away, or no point exists at all.
[type: Real]

scalar
(= 0)¶ Scalars associated with history points (determine line color)
[type: int, named enum, possible values are: ‘none’ (‘‘, ‘’; 0), ‘time’ (‘t’; 1), ‘trace time’ (‘reltime’; 2), ‘velocity’ (‘vel’, ‘v’; 3), ‘angular velocity’ (‘angVel’, ‘angvel’; 4), ‘signed accel’ (5), ‘radius’ (‘rad’, ‘r’; 6), ‘number of contacts’ (‘numCon’, ‘ncon’, ‘numcon’; 7), ‘Shape.color’ (‘color’; 8), ‘kinetic energy’ (‘Ek’; 9), ‘ordinal (+ordinalMod)’ (‘ordinal’, ‘ord’; 10), ‘matState.getScalar’ (‘mat’, ‘material state’; 11)]

vecAxis
(= 1)¶ Scalar to use for vector values.
[type: int, named enum, possible values are: ‘norm’ (1), ‘x’ (0), ‘y’ (1), ‘z’ (2)]

nextReset
(= True)¶ Reset all traces at the next step (scalar changed)
[type: bool, not accessible from python]

lineColor
(= <ScalarRange @ 0x2a6fbe0>)¶ Color range for coloring the trace line
[type: shared_ptr<
ScalarRange
>, readonly in python]

modulo
(= Vector2i(0, 0))¶ Only add trace to nodes with ordinal number such that
(i+modulo[1])%modulo[0]==0
.[type:
Vector2i
]

rRange
(= Vector2(0, 0))¶ If nonzero, only show traces of spheres of which radius falls into this range. (not applicable to clumps); traces of nonspheres are not shown in this case.
[type:
Vector2
]

noneColor
(= Vector3(0.3, 0.3, 0.3))¶ Color for traces without scalars, when scalars are saved (e.g. for nonspheres when radius is saved
[type:
Vector3
]

clumps
(= True)¶ Also make traces for clumps (for the central node, not for clumped nodes
[type: bool]

saveTime
(= False)¶ Save time values along with scalars (must be enabled before the trace starts collecting data).
[type: bool]

glSmooth
(= False)¶ Render traced lines with GL_LINE_SMOOTH
[type: bool]

glWidth
(= 1)¶ Width of trace lines in pixels
[type: int, range: 1−10]

resetNodesRep
((Tracer)arg1[, (bool)setupEmpty=False[, (bool)includeDead=True]]) → None :¶ Reset
woo.core.Node.rep
on allwoo.dem.DemField.nodes
. With setupEmpty, create new instances ofTraceVisRep
. With includeDead,woo.core.Node.rep
on allwoo.dem.DemField.deadNodes
is also cleared (new are not created, even with setupEmpty).

AxialGravity¶
Object
→ Engine
→ AxialGravity

class
woo.dem.
AxialGravity
¶ Apply acceleration (independent of distance) directed towards an axis.
[ pkg/dem/Gravity.hpp , pkg/dem/Gravity.cpp ]

axisDir
(= Vector3(1, 0, 0))¶ direction of the gravity axis (will be normalized automatically)
[type:
Vector3
]

accel
(= 0.0)¶ Acceleration magnitude [kgms⁻²]
[type: Real]

HalfspaceBuoyancy¶
Object
→ Engine
→ HalfspaceBuoyancy

class
woo.dem.
HalfspaceBuoyancy
¶ Apply Buoyancy force for uninodal particles, depending on their position in the \(z\) halfspace in local coordinate system (
node
). TODO: references to papers, wikipedia with formulas, or write formulas here.[ pkg/dem/Buoyancy.hpp , pkg/dem/Buoyancy.cpp ]

mask
(= 5)¶ Mask for particles Buoyancy is applied to.
[type: uint]

liqRho
(= 1000.0)¶ Density of the medium.
[type: Real]

dragCoef
(= 0.47)¶ Drag coefficient.
[type: Real]

drag
(= False)¶ Flag for turning water drag on or off
[type: bool]

Stress/strain control¶
TODO
PeriIsoCompressor¶
Object
→ Engine
→ PeriIsoCompressor

class
woo.dem.
PeriIsoCompressor
¶ Compress/decompress cloud of spheres by controlling periodic cell size until it reaches prescribed average stress, then moving to next stress value in given stress series.
[ pkg/dem/PeriIsoCompressor.hpp , pkg/dem/PeriIsoCompressor.cpp ]

stresses
(= [])¶ Stresses that should be reached, one after another
[type: vector<Real>]

charLen
(= 1.0)¶ Characteristic length, should be something like mean particle diameter (default 1=invalid value))
[type: Real]

maxSpan
(= 1.0)¶ Maximum body span in terms of bbox, to prevent periodic cell getting too small.
[type: Real, readonly in python]

maxUnbalanced
(= 0.0001)¶ if actual unbalanced force is smaller than this number, the packing is considered stable,
[type: Real]

globalUpdateInt
(= 20)¶ how often to recompute average stress, stiffness and unbalanced force
[type: int]

state
(= 0)¶ Where are we at in the stress series
[type: size_t]

doneHook
(= '')¶ Python command to be run when reaching the last specified stress
[type: string]

keepProportions
(= True)¶ Exactly keep proportions of the cell (stress is controlled based on average, not its components
[type: bool]

currUnbalanced
(= nan)¶ Current unbalanced force (updated internally)
[type: Real, readonly in python]

avgStiffness
(= nan)¶ Value of average stiffness (updated internally)
[type: Real, readonly in python]

WeirdTriaxControl¶
Object
→ Engine
→ WeirdTriaxControl

class
woo.dem.
WeirdTriaxControl
¶ Engine for independently controlling stress or strain in periodic simulations.
strainStress
contains absolute values for the controlled quantity, andstressMask
determines meaning of those values (0 for strain, 1 for stress): e.g.( 1<<0  1<<2 ) = 1  4 = 5
means thatstrainStress[0]
andstrainStress[2]
are stress values, andstrainStress[1]
is strain.See scripts/test/periodictriax.py for a simple example.
[ pkg/dem/PeriIsoCompressor.hpp , pkg/dem/PeriIsoCompressor.cpp ]

goal
(= Vector3(0, 0, 0))¶ Desired stress or strain values (depending on stressMask), strains defined as
strain(i)=log(Fii)
.Warning
Strains are relative to the
woo.core.Scene.cell.refSize
(reference cell size), not the current one (e.g. at the moment when the new strain value is set).[type:
Vector3
]

stressMask
(= 0)¶ mask determining strain/stress (0/1) meaning for goal components
[type: int]

maxUnbalanced
(= 0.0001)¶ maximum unbalanced force.
[type: Real]

absStressTol
(= 1000.0)¶ Absolute stress tolerance
[type: Real]

relStressTol
(= 3e05)¶ Relative stress tolerance; if negative, it is relative to the largest stress value along all axes, where strain is prescribed.
[type: Real]

maxStrainedStress
(= nan)¶ Current absmaximum stress in straincontrolled directions; useda as reference when
relStressTol
is negative.[type: Real, readonly in python]

growDamping
(= 0.25)¶ Damping of cell resizing (0=perfect control, 1=no control at all).
[type: Real]

relVol
(= 1.0)¶ For stress computation, use volume of the periodic cell multiplied by this constant.
[type: Real]

globUpdate
(= 5)¶ How often to recompute average stress, stiffness and unbalaced force.
[type: int]

doneHook
(= '')¶ python command to be run when the desired state is reached
[type: string]

currUnbalanced
(= nan)¶ current unbalanced force (updated every globUpdate)
[type: Real]

mass
(= nan)¶ mass of the cell (user set); if not set, it will be computed as sum of masses of all particles.
[type: Real]

externalWork
(= 0.0)¶ Work input from boundary controller.
[type: Real]

gradVWorkIx
(= 1)¶ Index for work done by velocity gradient, if tracking energy
[type: int, not saved, not accessible from python]

Particle¶
Each particles in DEM is defined by its shape (given by multiple nodes) and other parameters.
Particle¶

class
woo.dem.
Particle
¶ Particle in DEM
[ pkg/dem/Particle.hpp , pkg/dem/Particle.cpp ]

id
(= 1)¶ Index in DemField::particles
[type: id_t, readonly in python]

mask
(= 1)¶ Bitmask for collision detection and other (group 1 by default)
[type: uint]

matState
(= None)¶ Material state of the particle (such as damage data and similar)
[type: shared_ptr<
MatState
>]

contacts
¶ Contacts of this particle, indexed by id of the other particle.
[type: MapParticleContact, not saved, not accessible from python]

Ek
¶ Summary kinetic energy of the particle, shorthand for
p.Ekt+p.Ekr
.

Ekr
¶ Rotational kinetic energy of the particle, computed ondemand as \(\frac{1}{2}\vec{\omega}^T\mat{T}^T\mat{I}\mat{T}\omega\) (where \(\mat{T}\) is
p.shape.nodes[0].ori
as rotation matrix, \(\mat{I}\) isp.shape.nodes[0].dem.inertia
as diagonal matrix – uninodal particles only (raises exception otherwise). Space deformation is not considered here, seegetEk
.

Ekt
¶ Translational kinetic energy of the particle, computed ondemand as \(\frac{1}{2}m\vec{v}^2\) – uninodal particles only (raises exception otherwise). Space deformation is not considered here, see
getEk
.

allContacts
¶ Return dictionary mapping
other particles' IDs <Particle.id
toContact
objects, including contacts which are notreal
.

angVel
¶ Particle angular velocity; shorthand for
p.shape.nodes[0].dem.angVel
– uninodal particles only (raises exception otherwise).

blocked
¶ Blocked degrees of freedom of the particle; shorthand for
p.shape.nodes[0].dem.blocked
– uninodal particles only (raises exception otherwise).

con
¶ Return list of
IDs
of contacting particles (real
contacts only); shorthand forp.contacts.keys()
.

f
¶ Force on particle; shorthand for
p.shape.nodes[0].dem.force
– uninodal particles only (raises exception otherwise).

getEk
((Particle)arg1[, (bool)trans=True[, (bool)rot=True[, (Scene)scene=None]]]) → float :¶ Compute kinetic energy (translational and/or rotational); when scene is given, only fluctuation linear/angular velocity will be considered if periodic boundary conditions are active.

impose
¶ Particle imposed constraints; shorthand for
p.shape.nodes[0].dem.impose
– uninodal particles only (raises exception otherwise).

inertia
¶ Particle inertia; shorthand for
p.shape.nodes[0].dem.inertia
– uninodal particles only (raises exception otherwise).

static
make
((Shape)shape, (Material)mat[, (bool)fixed=False]) → Particle :¶ Return Particle instance created from given shape and material; nodes with DemData are automatically added to the shape, mass and inertia is recomuted.

mass
¶ Particle mass; shorthand for
p.shape.nodes[0].dem.mass
– uninodal particles only (raises exception otherwise).

mat
¶ Material of the particle

nodes
¶ List of particle nodes; shorthand for
p.shape.nodes
.

ori
¶ Particle orientation; shorthand for
p.shape.nodes[0].ori
– uninodal particles only (raises exception otherwise).

pos
¶ Particle position; shorthand for
p.shape.nodes[0].pos
– uninodal particles only (raises exception otherwise).

refPos
¶ Reference particle position; shorthand for
p.shape.nodes[0].gl.refPos
, andVector3(nan,nan,nan)
ifgl
is not defined on the node.

t
¶ Torque on particle; shorthand for
p.shape.nodes[0].dem.torque
– uninodal particles only (raises exception otherwise).

tacts
¶ Return list of
Contact
objects where this particle takes part (real
contacts only); shorthand forp.contact.values()
.

updateMassInertia
((Particle)arg1) → None :¶ Internal use only. Recompute mass and inertia of all particle’s nodes; this function is usually called by particle construction routines; interally calls
Shape::updateMassInertia
and only works for particles without shared nodes.

vel
¶ Particle velocity; shorthand for
p.shape.nodes[0].dem.vel
– uninodal particles only (raises exception otherwise).

Shape¶

class
woo.dem.
Shape
¶ Particle geometry
[ pkg/dem/Particle.hpp , pkg/dem/Particle.cpp ]

nodes
(= [])¶ Nodes associated with this particle
[type: vector<shared_ptr<Node> >]

color
(= 0.9522297251747128)¶ Normalized color for rendering; negative values render with wire (rather than solid), \(\text{color}\)>2 means invisible. (use wire, hi and visible to manipulate those)
[type: Real]

asRaw
((Shape)arg1) → tuple¶

dispHierarchy
((Shape)arg1[, (bool)names=True]) → list :¶ Return list of dispatch classes (from down upwards), starting with the class instance itself, toplevel indexable at last. If names is true (default), return class names rather than numerical indices.

dispIndex
¶ Return class index of this instance.

equivRadius
¶ Volumetrically equivalent radius of this shape. Returns NaN if the shape is multinodal or infinite.

isInside
((Shape)arg1, (Vector3)pt) → bool :¶ Fast predicate testing whether pt is inside or outside this shape.

lumpMassInertia
((Shape)arg1, (Node)arg2, (float)arg3) → tuple¶

setFromRaw
((Shape)arg1, (Vector3)arg2, (float)arg3, (NodeList)arg4, (object)arg5) → None¶

volume
¶ Volume of this shape; returns NaN for multinodal or infinite shapes.

Wall¶

class
woo.dem.
Wall
¶ Object representing infinite plane aligned with the coordinate system (axisaligned wall).
[ pkg/dem/Wall.hpp , pkg/dem/Wall.cpp ]

sense
(= 0)¶ Which side of the wall interacts: 1 for negative only, 0 for both, +1 for positive only.
[type: int]

axis
(= 0)¶ Axis of the normal; can be 0,1,2 for +x, +y, +z respectively (Node’s orientation is disregarded for walls)
[type: int]

glAB
(= AlignedBox2((nan, nan), (nan, nan)))¶ Points between which the wall is drawn (if NaN, computed automatically to cover the visible part of the scene)
[type:
AlignedBox2
]

static
make
(position, axis, sense=0, glAB=None, fixed=True, mass=0, color=None, mat=<function defaultMaterial>, visible=True, mask=3)¶ Return readymade wall body.
Parameters:  position (floatorVector3orNode) – center of the wall. If float, it is the position along given axis, the other 2 components being zero
 axis (∈{0,1,2}) – orientation of the wall normal (0,1,2) for x,y,z (sc. planes yz, xz, xy)
 sense (∈{1,0,1}) – sense in which to interact (0: both, 1: negative, +1: positive; see
woo.dem.Wall
)
See
woo.utils.sphere
’s documentation for meaning of other parameters.

static
makeBox
(box, which=(1, 1, 1, 1, 1, 1), **kw)¶ Return box delimited by walls, created by
woo.dem.Wall.make
, which receives most arguments.Wall.glAB
are computed automatically so that walls visually end at the edges.Note
Since
walls
are infinite, they will still interact with other particle beyond this box; usewoo.triangulated.box
for true box with arbitrary orientation.Parameters:  box – axisaligned box determining positions of walls.
 which – determines which of the 6 walls are created (boolean values), in the order x, y, z, +x, +y, +z. For instance, to create a box which does not have the top, say
which=(1,1,1,1,1,0)
).
Returns: list of
Particle
objects.

Facet¶

class
woo.dem.
Facet
¶ Facet (triangle in 3d) particle.
[ pkg/dem/Facet.hpp , pkg/dem/Facet.cpp ]

fakeVel
(= Vector3(0, 0, 0))¶ Fake velocity when computing contact, in global coordinates (for modeling moving surface modeled using static triangulation); only inplane velocity is meaningful, but this is not enforced.
Note
If the xcomponent is NaN, the meaning is special:
fakeVel
is taken as zero vector and, in addition, local inplane facet’s linear velocity at the contact is taken as zero (rather than linearly interpolated between velocity of nodes).[type:
Vector3
]

halfThick
(= 0.0)¶ Geometric thickness (added in all directions)
[type: Real]

n21lim
(= Vector3(nan, nan, nan))¶ Edge & vertex contact: limit value for dotproduct with normal (dotproduct of normal with inplane angle of neighboring facet, perpendicular to the edge).
[type:
Vector3
]

area
((Facet)arg1) → float :¶ Return surface area of the facet

computeNeighborAngles
((Facet)arg1) → None :¶ Compute
n21Min
using beighboring facets so that contact direction can be adjusted (only some FacetX functors support that currently).

getCentroid
((Facet)arg1) → Vector3 :¶ Return centroid of the facet

getNormal
((Facet)arg1) → Vector3 :¶ Return normal vector of the facet

static
make
(vertices, fakeVel=None, halfThick=0.0, fixed=True, wire=True, color=None, highlight=False, mat=<function defaultMaterial>, visible=True, mask=3, flex=None, __class=<class 'woo.dem.Facet'>)¶ Create facet with given parameters.
Parameters:  vertices ([Vector3,Vector3,Vector3]) – coordinates of vertices in the global coordinate system.
 wire (bool) – if
True
, facets are shown as skeleton; otherwise facets are filled
See
woo.utils.sphere
’s documentation for meaning of other parameters.

outerEdgeNormals
((Facet)arg1) → object :¶ Return outer edge normal vectors

InfCylinder¶
Object
→ Shape
→ InfCylinder

class
woo.dem.
InfCylinder
¶ Object representing infinite plane aligned with the coordinate system (axisaligned wall).
[ pkg/dem/InfCylinder.hpp , pkg/dem/InfCylinder.cpp ]

radius
(= nan)¶ Radius of the cylinder
[type: Real]

axis
(= 0)¶ Axis of the normal; can be 0,1,2 for +x, +y, +z respectively (Node’s orientation is disregarded for walls)
[type: int]

glAB
(= Vector2(nan, nan))¶ Endpoints between which the infinite cylinder is drawn, in local coordinate system along
axis
; if NaN, taken from scene view to be visible[type:
Vector2
]

static
make
(position, radius, axis, glAB=None, fixed=True, mass=0, color=None, wire=False, angVel=None, mat=<function defaultMaterial>, mask=5)¶ Return a readymade infinite cylinder particle.

Rod¶

class
woo.dem.
Rod
¶ Line element without internal forces, with circular crosssection and hemispherical caps at both ends. Geometrically the same
Capsule
, but with 2 nodes.[ pkg/dem/Truss.hpp , pkg/dem/Truss.cpp ]

radius
(= nan)¶ Radius of the rod.
[type: Real]

static
make
(vertices, radius, fixed=True, wire=True, color=None, mat=<function defaultMaterial>, visible=True, mask=3, __class=<class 'woo.dem.Rod'>)¶ Create
Rod
with given parameters:Parameters:  vertices – endpoints given as coordinates (Vector3) or nodes
 radius – radius of the rod
 wire – render as wire by default
 color – color as scalar (0…1); if not given, random color is assigned
 mat – material; if not given, default material is assigned
 visible –
 mask –

Truss¶

class
woo.dem.
Truss
¶ Describes line element (cylinder) with optional caps and with free or constrained rotations at either end.

l0
(= nan)¶ Initial (usually equilibrium) length
[type: Real]

axialStress
(= 0.0)¶ Current normal stress (informative only)
[type: Real]

preStress
(= 0.0)¶ Prestress (stress at zero strain)
[type: Real]

Sphere¶

class
woo.dem.
Sphere
¶ Spherical particle.

radius
(= nan)¶ Radius.
[type: Real, unit: m]

static
make
(center, radius, mat=<function defaultMaterial>, fixed=False, wire=False, color=None, highlight=False, mask=5, vel=None)¶ Create sphere with given parameters; mass and inertia computed automatically.
Parameters:  center (Vector3) – center
 radius (float) – radius
 floatorNone – particle’s color as float; random color will be assigned if
None
.  mat –
 specify
woo.dem.Particle.material
; different types are accepted: woo.dem.Material
instance: this instance will be used callable: will be called without arguments; returned Material value will be used (Material factory object, if you like)
 specify
 mask (int) –
woo.dem.Particle.mask
for the body
Returns: Particle instance with desired characteristics.
Instance of material can be given:
>>> from woo import utils >>> s1=utils.sphere((0,0,0),1,wire=False,color=.7,mat=ElastMat(young=30e9,density=2e3)) >>> s1.shape.wire False >>> s1.shape.color 0.7 >>> s1.mat.density 2000.0
Finally, material can be a callable object (taking no arguments), which returns a Material instance. Use this if you don’t call this function directly (for instance, through woo.pack.randomDensePack), passing only 1 material parameter, but you don’t want material to be shared.
For instance, randomized material properties can be created like this:
>>> import random >>> def matFactory(): return ElastMat(young=1e10*random.random(),density=1e3+1e3*random.random()) ... >>> s2=utils.sphere([0,2,0],1,mat=matFactory) >>> s3=utils.sphere([1,2,0],1,mat=matFactory)

Capsule¶

class
woo.dem.
Capsule
¶ Cylinder with halfspherical caps on both sides, Mindowski sum of segment with sphere.
[ pkg/dem/Capsule.hpp , pkg/dem/Capsule.cpp ]

radius
(= nan)¶ Radius of the capsule – of halfspherical caps and also of the middle part.
[type: Real, unit: m]

shaft
(= nan)¶ Length of the middle segment
[type: Real, unit: m]

endPt
((Capsule)arg1, (int)i) → Vector3 :¶ Return one of capsule endpoints. The first (negative on local \(x\)axis) is returned with *i=0, otherwise the second one is returned.

static
make
(center, radius, shaft, ori=Quaternion((1, 0, 0), 0), fixed=False, color=None, wire=False, mat=<function defaultMaterial>, mask=5)¶ Return a readymade capsule particle.

Ellipsoid¶

class
woo.dem.
Ellipsoid
¶ Ellipsoidal particle.
[ pkg/dem/Ellipsoid.hpp , pkg/dem/Ellipsoid.cpp ]

static
make
(center, semiAxes, ori=Quaternion((1, 0, 0), 0), angVel=None, color=None, mat=<function defaultMaterial>, fixed=False, wire=False, visible=True, mask=5, **kw)¶ Return an
woo.dem.Ellipsoid
particle.

static
Material properties¶
TODO
Material¶

class
woo.dem.
Material
¶ Particle material

density
(= 1000.0)¶ Density
[type: Real, unit: kg/m³]

id
(= 1)¶ Some number identifying this material; used with MatchMaker objects, useless otherwise
[type: int, not shown in the UI]

dispHierarchy
((Material)arg1[, (bool)names=True]) → list :¶ Return list of dispatch classes (from down upwards), starting with the class instance itself, toplevel indexable at last. If names is true (default), return class names rather than numerical indices.

dispIndex
¶ Return class index of this instance.

ElastMat¶

class
woo.dem.
ElastMat
¶ Elastic material with contact friction. See also
ElastMat
.
young
(= 1000000000.0)¶ Young’s modulus
[type: Real, unit: Pa]

FrictMat¶
Object
→ Material
→ ElastMat
→ FrictMat

class
woo.dem.
FrictMat
¶ Elastic material with contact friction. See also
ElastMat
.
tanPhi
(= 0.5)¶ Tangent of internal friction angle.
[type: Real]

ktDivKn
(= 0.2)¶ Ratio of tangent and shear modulus on contact.
[type: Real]

LudingMat¶
Object
→ Material
→ ElastMat
→ FrictMat
→ LudingMat

class
woo.dem.
LudingMat
¶ Material for
ludingcontactmodel
.► Normal

k1DivKn
(= 0.5)¶ Ratio of plastic (loading) stiffness to maximum normal (elastic, unloading/reloading) stiffness.
[type: Real]

kaDivKn
(= 0.2)¶ Ratio of adhesive ‘stiffness’ to elastic (unloading) stiffness.
[type: Real]

deltaLimRel
(= 0.1)¶ Maximum plasticity depth relative to minimum radius of contacting particles.
[type: Real]

viscN
(= 0.0)¶ Normal viscous coefficient.
[type: Real]
► Tangential

dynDivStat
(= 0.7)¶ Dynamic to static friction ratio (\(\phi_d=\mu_d/\mu_s\)); applied in tangential, rolling and twisting senses.
[type: Real]

viscT
(= 0.0)¶ Tangential viscosity.
[type: Real]
► Rolling

krDivKn
(= 0.2)¶ Rolling stiffness relative to maximal elastic stiffness (divided by average contact radius for dimensional consistency).
[type: Real]

statR
(= 0.4)¶ Rolling static friction coefficient.
[type: Real]

viscR
(= 0.1)¶ Rolling viscous coefficient for rolling.
[type: Real]
► Twisting

kwDivKn
(= 0.2)¶ Twist stiffness relative to maximal elastic stiffness (divided by average contact radius for dimensional consistency).
[type: Real]

statW
(= 0.3)¶ Twisting static friction coefficient.
[type: Real]

viscW
(= 0.1)¶ Twisting viscous coefficient.
[type: Real]

IceMat¶
Object
→ Material
→ ElastMat
→ FrictMat
→ IceMat

class
woo.dem.
IceMat
¶ Ice material; see
icecontactmodel
for details.[ pkg/dem/Ice.hpp ]

breakN
(= 0.0001)¶ Normal strain where cohesion stress is reached.
[type: Real]

alpha
(= Vector2(1, 1))¶ Factors \((\alpha_w, \alpha_t)\) to compute twisting/rolling stiffnesses from \(k_n\) and \(k_t\).
[type:
Vector2
]

beta
(= Vector3(0.1, 0.1, 0.1))¶ Factors \((\beta_t,\beta_w,\beta_r)\) for computing cohesion from normal cohesion \(c_n\)
[type:
Vector3
]

mu
(= 0.05)¶ Kinetic (rolling) friction coefficient.
[type: Real]

ConcreteMat¶
Object
→ Material
→ ElastMat
→ FrictMat
→ ConcreteMat

class
woo.dem.
ConcreteMat
¶ Concrete material, for use with other Concrete classes.
[ pkg/dem/Concrete.hpp , pkg/dem/Concrete.cpp ]

sigmaT
(= nan)¶ Initial cohesion [Pa]
[type: Real]

neverDamage
(= False)¶ If true, no damage will occur (for testing only).
[type: bool]

epsCrackOnset
(= nan)¶ Limit elastic strain []
[type: Real]

relDuctility
(= nan)¶ relative ductility of bonds in normal direction
[type: Real]

damLaw
(= 1)¶ Law for damage evolution in uniaxial tension. 0 for linear stressstrain softening branch, 1 (default) for exponential damage evolution law
[type: int, named enum, possible values are: ‘linear softening’ (‘lin’; 0), ‘exponential softening’ (‘exp’; 1)]

dmgTau
(= 1.0)¶ Characteristic time for normal viscosity. [s]
[type: Real]

dmgRateExp
(= 0.0)¶ Exponent for normal viscosity function. []
[type: Real]

plTau
(= 1.0)¶ Characteristic time for viscoplasticity. [s]
[type: Real]

plRateExp
(= 0.0)¶ Exponent for viscoplasticity function. []
[type: Real]

isoPrestress
(= 0.0)¶ Isotropic prestress of the whole specimen. [P a]
[type: Real]

PelletMat¶
Object
→ Material
→ ElastMat
→ FrictMat
→ PelletMat

class
woo.dem.
PelletMat
¶ Material describing pellet behavior; see
Law2_L6Geom_PelletPhys_Pellet
for details of the material model.
normPlastCoeff
(= 0.0)¶ Coefficient \(\alpha\) in the normal yield function; nonpositive deactivates.
[type: Real]

kaDivKn
(= 0.0)¶ Ratio of \(\frac{k_A}{K_N}\) for the adhesion function; nonpositive deactivates.
[type: Real]

Object
→ Engine
→ PelletAgglomerator

class
woo.dem.
PelletAgglomerator
¶ Compute agglomeration of pellets due to contact some special particles, or wearing due to impacts (only applies to particles with
PelletMat
.[ pkg/dem/Pellet.hpp , pkg/dem/Pellet.cpp ]

agglomSrcs
(= [])¶ Sources of agglomerating mass; particles in contact with this source will have their radius increased based on their relative angular velocity.
[type: vector<shared_ptr<Particle>>]

massIncPerRad
(= nan)¶ Increase of sphere mass per one radian of rolling (radius is increased in such way that mass increase is satisfied).
[type: Real]

dampHalfLife
(= 10000.0)¶ Halflife for rotation damping (includes both rolling and twist); if negative, relative to the (initial)
woo.core.Scene.dt
; zero deactivates damping. Halflife is \(t_{1/.2}=\frac{\ln 2}{\lambda}\) where \(\lambda\) is decay coefficient applied as \(\d\omega=\lambda\omega\) (see http://en.wikipedia.org/wiki/Exponential_decay for details).[type: Real]

currRate
(= 0.0)¶ Current rate of mass increase due to agglomeration.
[type: Real]

currRateSmooth
(= 0.001)¶ Smoothing coefficient for currRate ∈〈0,1〉 (should be rather low, since this engine runs at every step).
[type: Real]

mass
(= 0.0)¶ Total cumulative mass increase due to agglomeration.
[type: Real]

HertzMat¶
MatState¶

class
woo.dem.
MatState
¶ Holds data related to material state of each particle.

getNumScalars
((MatState)arg1) → int :¶ Return number of scalars (index to
getScalar
andgetScalarName
should be lower than this number).

getScalar
((MatState)arg1, (int)index[, (float)time=0[, (int)step=1[, (float)smooth=0]]]) → float :¶ Return scalar value given its numerical index. step is used to check whether data are uptodate, smooth (if positive) is used to smooth out old data (usually using exponential decay function)

getScalarName
((MatState)arg1, (int)index) → str :¶ Return name of scalar at given index (humanreadable description)

LudingMatState¶
Object
→ MatState
→ LudingMatState

class
woo.dem.
LudingMatState
¶ Hold detailed perparticle data such as dissipated energy, for the Luding model (
ludingcontactmodel
.)
total
(= 0.0)¶ Total dissipated energy (sum of the terms below)
[type: Real]

visco
(= 0.0)¶ Energy dissipated by viscous effects.
[type: Real]

plast
(= 0.0)¶ Energy dissipated by plastic effects.
[type: Real]

InletMatState¶
ConcreteMatState¶
PelletMatState¶
Object
→ MatState
→ PelletMatState

class
woo.dem.
PelletMatState
¶ Hold dissipated energy data for this particles, to evaluate wear.

normPlast
(= 0.0)¶ Plastic energy dissipated in the normal sense
[type: Real]

shearPlast
(= 0.0)¶ Plastic energy dissipated in the tangential sense
[type: Real]

agglomRate
(= nan)¶ Agglomeration speed
[type: Real]

stepAgglomUpdated
(= 1)¶ Step in which the agglomeration speed was updated for the last time.
[type: long]

cumAgglomMass
(= 0.0)¶ Cumulative mass agglomerated by this particle.
[type: Real]

cumAgglomAngle
(= 0.0)¶ Cumulative length of rolling when agglomeration was active.
[type: Real]

TraceVisRep¶
Object
→ NodeVisRep
→ TraceVisRep

class
woo.dem.
TraceVisRep
¶ Data with node’s position history; created by
Tracer
.[ pkg/dem/Tracer.hpp , pkg/dem/Tracer.cpp ]

pts
(= [])¶ History points
[type: vector<Vector3r>, not shown in the UI, readonly in python]

scalars
(= [])¶ History scalars
[type: vector<Real>, not shown in the UI, readonly in python]

times
(= [])¶ History times (only saved with
Tracer.saveTime
).[type: vector<Real>, not shown in the UI, readonly in python]

t0
(= nan)¶ Time the trace was created/reset, for plotting relative time; does not change with compression.
[type: Real]

tracer
(= None)¶ Tracer
which created (and is, presumably, managing) this object; it is necessary for getting rendering parameters, and is updated automatically.[type: shared_ptr<
Tracer
>, readonly in python]

writeIx
(= 0)¶ Index where next data will be written
[type: size_t]

flags
(= 0)¶ Flags for this instance
[type: short]

consolidate
((TraceVisRep)arg1) → None :¶ Make
pts
sequential (normally, the data are stored as circular buffer, with next write position atwriteIx
, so that they are ordered temporally.

pt
((TraceVisRep)arg1, (int)arg2) → Vector3 :¶ Get one history point (to avoid copying arrays), indexed as in python (negative counts backwards).

scalar
((TraceVisRep)arg1, (int)arg2) → float :¶ Get one history scalar (to avoid copying arrays), indexed as in python (negative counts backwards).

time
((TraceVisRep)arg1, (int)arg2) → float :¶ Get one history time (to avoid copying arrays), indexed as in python (negative counts backwards).

Tip
Got questions? Ask at ask.woodem.org. Report issues to github.