yade.utils module

Heap of functions that don’t (yet) fit anywhere else.

Devs: please DO NOT ADD more functions here, it is getting too crowded!

yade.utils.NormalRestitution2DampingRate(en)

Compute the normal damping rate as a function of the normal coefficient of restitution e_n. For e_n\in\langle0,1\rangle damping rate equals

-\frac{\log e_n}{\sqrt{e_n^2+\pi^2}}

yade.utils.SpherePWaveTimeStep(radius, density, young)

Compute P-wave critical timestep for a single (presumably representative) sphere, using formula for P-Wave propagation speed \Delta t_{c}=\frac{r}{\sqrt{E/\rho}}. If you want to compute minimum critical timestep for all spheres in the simulation, use utils.PWaveTimeStep instead.

>>> SpherePWaveTimeStep(1e-3,2400,30e9)
2.8284271247461903e-07
class yade.utils.TableParamReader

Class for reading simulation parameters from text file.

Each parameter is represented by one column, each parameter set by one line. Colums are separated by blanks (no quoting).

First non-empty line contains column titles (without quotes). You may use special column named ‘description’ to describe this parameter set; if such colum is absent, description will be built by concatenating column names and corresponding values (param1=34,param2=12.22,param4=foo)

  • from columns ending in ! (the ! is not included in the column name)
  • from all columns, if no columns end in !.

Empty lines within the file are ignored (although counted); # starts comment till the end of line. Number of blank-separated columns must be the same for all non-empty lines.

A special value = can be used instead of parameter value; value from the previous non-empty line will be used instead (works recursively).

This class is used by utils.readParamsFromTable.

__init__()

Setup the reader class, read data into memory.

paramDict()

Return dictionary containing data from file given to constructor. Keys are line numbers (which might be non-contiguous and refer to real line numbers that one can see in text editors), values are dictionaries mapping parameter names to their values given in the file. The special value ‘=’ has already been interpreted, ! (bangs) (if any) were already removed from column titles, description column has already been added (if absent).

yade.utils.aabbDim(cutoff=0.0, centers=False)

Return dimensions of the axis-aligned bounding box, optionally with relative part cutoff cut away.

yade.utils.aabbExtrema2d(pts)

Return 2d bounding box for a sequence of 2-tuples.

yade.utils.aabbWalls(extrema=None, thickness=None, oversizeFactor=1.5, **kw)

Return 6 boxes that will wrap existing packing as walls from all sides; extrema are extremal points of the Aabb of the packing (will be calculated if not specified) thickness is wall thickness (will be 1/10 of the X-dimension if not specified) Walls will be enlarged in their plane by oversizeFactor. returns list of 6 wall Bodies enclosing the packing, in the order minX,maxX,minY,maxY,minZ,maxZ.

yade.utils.avgNumInteractions(cutoff=0.0, skipFree=False)

Return average numer of interactions per particle, also known as coordination number Z. This number is defined as

Z=2C/N

where C is number of contacts and N is number of particles.

With skipFree, particles not contributing to stable state of the packing are skipped, following equation (8) given in [Thornton2000]:

Z_m=\frac{2C-N_1}{N-N_0-N_1}

Parameters:
  • cutoff – cut some relative part of the sample’s bounding box away.
  • skipFree
yade.utils.box(center, extents, orientation=[1, 0, 0, 0], dynamic=True, wire=False, color=None, highlight=False, material=-1, mask=1)

Create box (cuboid) with given parameters.

Parameters:extents (Vector3) – half-sizes along x,y,z axes

See utils.sphere‘s documentation for meaning of other parameters.

yade.utils.chainedCylinder(begin=Vector3(0, 0, 0), end=Vector3(1, 0, 0), radius=0.2, dynamic=True, wire=False, color=None, highlight=False, material=-1, mask=1)

Create and chain a MinkCylinder with given parameters. This shape is the Minkowski sum of line and sphere.

Parameters:
  • radius (Real) – radius of sphere in the Minkowski sum.
  • begin (Vector3) – first point positioning the line in the Minkowski sum
  • last (Vector3) – last point positioning the line in the Minkowski sum

In order to build a correct chain, last point of element of rank N must correspond to first point of element of rank N+1 in the same chain (with some tolerance, since bounding boxes will be used to create connections.

Returns:Body object with the ChainedCylinder shape.
yade.utils.defaultMaterial()

Return default material, when creating bodies with utils.sphere and friends, material is unspecified and there is no shared material defined yet. By default, this function returns:

FrictMat(density=1e3,young=1e7,poisson=.3,frictionAngle=.5,label=’defaultMat’)

yade.utils.downCast(obj, newClassName)

Cast given object to class deriving from the same yade root class and copy all parameters from given object. Obj should be up in the inheritance tree, otherwise some attributes may not be defined in the new class.

yade.utils.facet(vertices, dynamic=False, wire=True, color=None, highlight=False, noBound=False, material=-1, mask=1)

Create facet with given parameters.

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
  • noBound (bool) – set Body.bounded
  • color (Vector3-or-None) – color of the facet; random color will be assigned if None.

See utils.sphere‘s documentation for meaning of other parameters.

yade.utils.facetBox(center, extents, orientation=Quaternion((1, 0, 0), 0), wallMask=63, **kw)

Create arbitrarily-aligned box composed of facets, with given center, extents and orientation. If any of the box dimensions is zero, corresponding facets will not be created. The facets are oriented outwards from the box.

Parameters :
center: Vector3

center of the created box

extents: (eX,eY,eZ)

lengths of the box sides

orientation: quaternion

orientation of the box

wallMask: bitmask

determines which walls will be created, in the order -x (1), +x (2), -y (4), +y (8), -z (16), +z (32). The numbers are ANDed; the default 63 means to create all walls;

**kw: (unused keyword arguments)

passed to utils.facet

Returns :

list of facets forming the box.

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

Create arbitrarily-aligned cylinder composed of facets, with given center, radius, height and orientation. Return List of facets forming the cylinder;

Parameters:
  • center (Vector3) – center of the created cylinder
  • radius (float) – cylinder radius
  • height (float) – cylinder height
  • orientation (Quaternion) – orientation of the cylinder; the reference orientation has axis along the +x axis.
  • segmentsNumber (int) – number of edges on the cylinder surface (>=5)
  • wallMask (bitmask) – determines which walls will be created, in the order up (1), down (2), side (4). The numbers are ANDed; the default 7 means to create all walls
  • angleRange ((θmin,Θmax)) – allows one to create only part of cylinder by specifying range of angles; if None, (0,2*pi) is assumed.
  • closeGap (bool) – close range skipped in angleRange with triangular facets at cylinder bases.
  • **kw

    (unused keyword arguments) passed to utils.facet;

yade.utils.fractionalBox(fraction=1.0, minMax=None)

retrurn (min,max) that is the original minMax box (or aabb of the whole simulation if not specified) linearly scaled around its center to the fraction factor

yade.utils.loadVars(mark=None)

Load variables from saveVars, which are saved inside the simulation. If mark==None, all save variables are loaded. Otherwise only those with the mark passed.

yade.utils.makeVideo(frameSpec, out, renameNotOverwrite=True, fps=24, bps=2400)

Create a video from external image files using mencoder. Two-pass encoding using the default mencoder codec (mpeg4) is performed, running multi-threaded with number of threads equal to number of OpenMP threads allocated for Yade.

Parameters:
  • frameSpec – wildcard | sequence of filenames. If list or tuple, filenames to be encoded in given order; otherwise wildcard understood by mencoder’s mf:// URI option (shell wildcards such as /tmp/snap-*.png or and printf-style pattern like /tmp/snap-%05d.png)
  • out (str) – file to save video into
  • renameNotOverwrite (bool) – if True, existing same-named video file will have -number appended; will be overwritten otherwise.
  • fps (int) – Frames per second (-mf fps=…)
  • bps (int) – Bitrate (-lavcopts vbitrate=…)
yade.utils.perpendicularArea(axis)

Return area perpendicular to given axis (0=x,1=y,2=z) generated by bodies for which the function consider returns True (defaults to returning True always) and which is of the type Sphere.

yade.utils.plotDirections(aabb=(), mask=0, bins=20, numHist=True, noShow=False)

Plot 3 histograms for distribution of interaction directions, in yz,xz and xy planes and (optional but default) histogram of number of interactions per body.

Returns:If noShow is False, displays the figure and returns nothing. If noShow, the figure object is returned without being displayed (works the same way as plot.plot).
yade.utils.plotNumInteractionsHistogram(cutoff=0.0)

Plot histogram with number of interactions per body, optionally cutting away cutoff relative axis-aligned box from specimen margin.

yade.utils.randomColor()

Return random Vector3 with each component in interval 0…1 (uniform distribution)

yade.utils.randomizeColors(onlyDynamic=False)

Assign random colors to Shape::color.

If onlyDynamic is true, only dynamic bodies will have the color changed.

yade.utils.readParamsFromTable(tableFileLine=None, noTableOk=False, unknownOk=False, **kw)

Read parameters from a file and assign them to __builtin__ variables.

The format of the file is as follows (commens starting with # and empty lines allowed):

# commented lines allowed anywhere
name1 name2 … # first non-blank line are column headings
                        # empty line is OK, with or without comment
val1  val2  … # 1st parameter set
val2  val2  … # 2nd 
…

Assigned tags:

  • description column is assigned to Omega().tags[‘description’]; this column is synthesized if absent (see utils.TableParamReader);
  • Omega().tags['params']="name1=val1,name2=val2,…"
  • Omega().tags['defaultParams']="unassignedName1=defaultValue1,…"
  • Omega().tags['d.id']=O.tags['id']+'.'+O.tags['description']
  • Omega().tags['id.d']=O.tags['description']+'.'+O.tags['id']

All parameters (default as well as settable) are saved using utils.saveVars('table').

Parameters :
tableFile:

text file (with one value per blank-separated columns)

tableLine:

number of line where to get the values from.

noTableOk: bool

do not raise exception if the file cannot be open; use default values

unknownOk: bool

do not raise exception if unknown column name is found in the file; assign it as well

Returns:

number of assigned parameters.

yade.utils.replaceCollider(colliderEngine)

Replaces collider (Collider) engine with the engine supplied. Raises error if no collider is in engines.

yade.utils.runningInBatch()

Tell whether we are running inside the batch or separately.

yade.utils.saveVars(mark='', loadNow=True, **kw)

Save passed variables into the simulation so that it can be recovered when the simulation is loaded again.

For example, variables a, b and c are defined. To save them, use:

>>> from yade import utils
>>> utils.saveVars('mark',a=1,b=2,c=3)
>>> from yade.params.mark import *
>>> a,b,c
(1, 2, 3)

those variables will be save in the .xml file, when the simulation itself is saved. To recover those variables once the .xml is loaded again, use

>>> utils.loadVars('mark')

and they will be defined in the yade.params.mark module

m*==True, variables will be loaded immediately after saving. That effectively makes **kw available in builtin namespace.

yade.utils.sphere(center, radius, dynamic=True, wire=False, color=None, highlight=False, material=-1, mask=1)

Create sphere with given parameters; mass and inertia computed automatically.

Last assigned material is used by default (*material*=-1), and utils.defaultMaterial() will be used if no material is defined at all.

Parameters:
  • center (Vector3) – center
  • radius (float) – radius
  • Vector3-or-None – body’s color, as normalized RGB; random color will be assigned if ``None`.
  • material
    specify Body.material; different types are accepted:
    • int: O.materials[material] will be used; as a special case, if material==-1 and there is no shared materials defined, utils.defaultMaterial() will be assigned to O.materials[0]
    • string: label of an existing material that will be used
    • 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)
  • mask (int) – Body.mask for the body
Returns:

A Body instance with desired characteristics.

Creating default shared material if none exists neither is given:

>>> O.reset()
>>> from yade import utils
>>> len(O.materials)
0
>>> s0=utils.sphere([2,0,0],1)
>>> len(O.materials)
1

Instance of material can be given:

>>> s1=utils.sphere([0,0,0],1,wire=False,color=(0,1,0),material=ElastMat(young=30e9,density=2e3))
>>> s1.shape.wire
False
>>> s1.shape.color
Vector3(0,1,0)
>>> s1.mat.density
2000.0

Material can be given by label:

>>> O.materials.append(FrictMat(young=10e9,poisson=.11,label='myMaterial'))
1
>>> s2=utils.sphere([0,0,2],1,material='myMaterial')
>>> s2.mat.label
'myMaterial'
>>> s2.mat.poisson
0.11

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 yade.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())
... 
>>> s3=utils.sphere([0,2,0],1,material=matFactory)
>>> s4=utils.sphere([1,2,0],1,material=matFactory)
yade.utils.typedEngine(name)

Return first engine from current O.engines, identified by its type (as string). For example:

>>> from yade import utils
>>> O.engines=[InsertionSortCollider(),NewtonIntegrator(),GravityEngine()]
>>> utils.typedEngine("NewtonIntegrator") == O.engines[1]
True
yade.utils.uniaxialTestFeatures(filename=None, areaSections=10, axis=-1, **kw)

Get some data about the current packing useful for uniaxial test:

  1. Find the dimensions that is the longest (uniaxial loading axis)
  2. Find the minimum cross-section area of the specimen by examining several (areaSections) sections perpendicular to axis, computing area of the convex hull for each one. This will work also for non-prismatic specimen.
  3. Find the bodies that are on the negative/positive boundary, to which the straining condition should be applied.
Parameters :
filename:

if given, spheres will be loaded from this file (ASCII format); if not, current simulation will be used.

areaSection:

number of section that will be used to estimate cross-section

axis:

if given, force strained axis, rather than computing it from predominant length

Returns:

dictionary with keys ‘negIds’, ‘posIds’, ‘axis’, ‘area’.

Warning

The function utils.approxSectionArea uses convex hull algorithm to find the area, but the implementation is reported to be buggy (bot works in some cases). Always check this number, or fix the convex hull algorithm (it is documented in the source, see py/_utils.cpp).

yade.utils.vmData()

Return memory usage data from Linux’s /proc/[pid]/status, line VmData.

yade.utils.waitIfBatch()

Block the simulation if running inside a batch. Typically used at the end of script so that it does not finish prematurely in batch mode (the execution would be ended in such a case).

yade.utils.wall(position, axis, sense=0, color=None, material=-1, mask=1)

Return ready-made wall body.

Parameters :
Parameters:
  • position (float-or-Vector3) – 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 Wall)

See utils.sphere‘s documentation for meaning of other parameters.

yade.utils.xMirror(half)

Mirror a sequence of 2d points around the x axis (changing sign on the y coord). The sequence should start up and then it will wrap from y downwards (or vice versa). If the last point’s x coord is zero, it will not be duplicated.

yade._utils.PWaveTimeStep() → float

Get timestep accoring to the velocity of P-Wave propagation; computed from sphere radii, rigidities and masses.

yade._utils.aabbExtrema([(float)cutoff=0.0[, (bool)centers=False]]) → tuple

Return coordinates of box enclosing all bodies

Parameters:
  • centers (bool) – do not take sphere radii in account, only their centroids
  • cutoff (float∈〈0…1〉) – relative dimension by which the box will be cut away at its boundaries.
Returns:

(lower corner, upper corner) as (Vector3,Vector3)

yade._utils.approxSectionArea((float)arg1, (int)arg2) → float

Compute area of convex hull when when taking (swept) spheres crossing the plane at coord, perpendicular to axis.

yade._utils.bodyNumInteractionsHistogram([(tuple)aabb]) → tuple
yade._utils.coordsAndDisplacements((int)axis[, (tuple)Aabb=()]) → tuple

Return tuple of 2 same-length lists for coordinates and displacements (coordinate minus reference coordinate) along given axis (1st arg); if the Aabb=((x_min,y_min,z_min),(x_max,y_max,z_max)) box is given, only bodies within this box will be considered.

yade._utils.createInteraction((int)id1, (int)id2) → Interaction

Create interaction between given bodies by hand.

Current engines are searched for IGeomDispatcher and IPhysDispatcher (might be both hidden in InteractionLoop). Geometry is created using force parameter of the geometry dispatcher, wherefore the interaction will exist even if bodies do not spatially overlap and the functor would return false under normal circumstances.

This function will very likely behave incorrectly for periodic simulations (though it could be extended it to handle it farily easily).

yade._utils.elasticEnergy((tuple)arg1) → float
yade._utils.flipCell([(Matrix3)flip=Matrix3(0, 0, 0, 0, 0, 0, 0, 0, 0)]) → Matrix3

Flip periodic cell so that angles between R^3 axes and transformed axes are as small as possible. This function relies on the fact that periodic cell defines by repetition or its corners regular grid of points in R^3; however, all cells generating identical grid are equivalent and can be flipped one over another. This necessiatates adjustment of Interaction.cellDist for interactions that cross boundary and didn’t before (or vice versa), and re-initialization of collider. The flip argument can be used to specify desired flip: integers, each column for one axis; if zero matrix, best fit (minimizing the angles) is computed automatically.

In c++, this function is accessible as Shop::flipCell.

This function is currently broken and should not be used.

yade._utils.forcesOnCoordPlane((float)arg1, (int)arg2) → Vector3
yade._utils.forcesOnPlane((Vector3)planePt, (Vector3)normal) → Vector3

Find all interactions deriving from NormShearPhys that cross given plane and sum forces (both normal and shear) on them.

Parameters:
  • planePt (Vector3) – a point on the plane
  • normal (Vector3) – plane normal (will be normalized).
yade._utils.getSpheresVolume() → float

Compute the total volume of spheres in the simulation (might crash for now if dynamic bodies are not spheres)

yade._utils.getViscoelasticFromSpheresInteraction((float)tc, (float)en, (float)es) → dict

Get viscoelastic interaction parameters from analytical solution of a pair spheres collision problem.

Parameters :

`m` : float sphere mass `tc` : float collision time `en` : float normal restitution coefficient `es` : float tangential restitution coefficient.

Returns:

dict with keys:

kn : float normal elastic coefficient computed as:

k_n=\frac{m}{t_c^2}\left(\pi^2+(\ln e_n)^2\right)

cn : float normal viscous coefficient computed as:

c_n=-\frac{2m}{t_c}\ln e_n

kt : float tangential elastic coefficient computed as:

k_t=\frac27\frac{m}{t_c^2}\left(\pi^2+(\ln e_t)^2\right)

ct : float tangential viscous coefficient computed as:

c_t=-\frac27\frac{m}{t_c}\ln e_t.

For details see [Pournin2001].

yade._utils.highlightNone() → None

Reset highlight on all bodies.

yade._utils.inscribedCircleCenter((Vector3)v1, (Vector3)v2, (Vector3)v3) → Vector3

Return center of inscribed circle for triangle given by its vertices v1, v2, v3.

yade._utils.interactionAnglesHistogram((int)axis[, (int)mask[, (int)bins[, (tuple)aabb]]]) → tuple
yade._utils.kineticEnergy([(bool)findMaxId=False]) → object

Compute overall kinetic energy of the simulation as

\sum\frac{1}{2}\left(m_i\vec{v}_i^2+\vec{\omega}(\mat{I}\vec{\omega}^T)\right).

No transformation of inertia tensor (in local frame) \mat{I} is done, although it is multiplied by angular velocity \vec{\omega} (in global frame); the value will not be accurate for aspherical particles.

yade._utils.maxOverlapRatio() → float

Return maximum overlap ration in interactions (with ScGeom) of two spheres. The ratio is computed as \frac{u_N}{2(r_1 r_2)/r_1+r_2}, where u_N is the current overlap distance and r_1, r_2 are radii of the two spheres in contact.

yade._utils.negPosExtremeIds((int)axis[, (float)distFactor]) → tuple

Return list of ids for spheres (only) that are on extremal ends of the specimen along given axis; distFactor multiplies their radius so that sphere that do not touch the boundary coordinate can also be returned.

yade._utils.normalShearStressTensors([(bool)compressionPositive=False]) → tuple

Compute overall stress tensor of the periodic cell decomposed in 2 parts, one contributed by normal forces, the other by shear forces. The formulation can be found in [Thornton2000], eq. (3):

\tens{sigma}_{ij}=\frac{2}{V}\sum R N \vec{n}_i \vec{n}_j+\frac{2}{V}\sum R T \vec{n}_i\vec{t}_j

where V is the cell volume, R is “contact radius” (in our implementation, current distance between particle centroids), \vec{n} is the normal vector, \vec{t} is a vector perpendicular to \vec{n}, N and T are norms of normal and shear forces.

yade._utils.pointInsidePolygon((tuple)arg1, (object)arg2) → bool
yade._utils.porosity([(float)volume=-1]) → float

Compute packing porosity \frac{V-V_s}{V} where V is overall volume and V_s is volume of spheres.:param float volume: overall volume which must be specified for aperiodic simulations. For periodic simulations, current volume of the Cell is used.

yade._utils.ptInAABB((Vector3)arg1, (Vector3)arg2, (Vector3)arg3) → bool

Return True/False whether the point p is within box given by its min and max corners

yade._utils.scalarOnColorScale((float)arg1, (float)arg2, (float)arg3) → Vector3
yade._utils.setRefSe3() → None

Set reference positions and orientations of all bodies equal to their current positions and orientations.

yade._utils.spiralProject((Vector3)pt, (float)dH_dTheta[, (int)axis=2[, (float)periodStart=nan[, (float)theta0=0]]]) → tuple
yade._utils.stressTensorOfPeriodicCell([(bool)smallStrains=False]) → Matrix3

Compute overall (macroscopic) stress of periodic cell using equation published in [Kuhl2001]:

\vec{\sigma}=\frac{1}{V}\sum_cl^c[\vec{N}^cf_N^c+\vec{T}^{cT}\cdot\vec{f}^c_T],

where V is volume of the cell, l^c length of interaction c, f^c_N normal force and \vec{f}^c_T shear force. Sumed are values over all interactions c. \vec{N}^c and \vec{T}^{cT} are projection tensors (see the original publication for more details):

\vec{N}=\vec{n}\otimes\vec{n}\rightarrow N_{ij}=n_in_j

\vec{T}^T=\vec{I}_{sym}\cdot\vec{n}-\vec{n}\otimes\vec{n}\otimes\vec{n}\rightarrow T^T_{ijk}=\frac{1}{2}(\delta_{ik}\delta_{jl}+\delta_{il}\delta_{jk})n_l-n_in_jn_k

\vec{T}^T\cdot\vec{f}_T\equiv T^T_{ijk}f_k=(\delta_{ik}n_j/2+\delta_{jk}n_i/2-n_in_jn_k)f_k=n_jf_i/2+n_if_j/2-n_in_jn_kf_k,

where n is unit vector oriented along the interaction (normal) and \delta is Kronecker’s delta. As \vec{n} and \vec{f}_T are perpendicular (therfore n_if_i=0) we can write

\sigma_{ij}=\frac{1}{V}\sum l[n_in_jf_N+n_jf^T_i/2+n_if^T_j/2]

Parameters:smallStrains (bool) – if false (large strains), real values of volume and interaction lengths are computed. If true, only refLength of interactions and initial volume are computed (can save some time).
Returns:macroscopic stress tensor as Matrix3
yade._utils.sumFacetNormalForces((object)ids[, (int)axis=-1]) → float

Sum force magnitudes on given bodies (must have shape of the Facet type), considering only part of forces perpendicular to each facet’s face; if axis has positive value, then the specified axis (0=x, 1=y, 2=z) will be used instead of facet’s normals.

yade._utils.sumForces((tuple)ids, (Vector3)direction) → float

Return summary force on bodies with given ids, projected on the direction vector.

yade._utils.sumTorques((tuple)ids, (Vector3)axis, (Vector3)axisPt) → float

Sum forces and torques on bodies given in ids with respect to axis specified by a point axisPt and its direction axis.

yade._utils.totalForceInVolume() → tuple

Return summed forces on all interactions and average isotropic stiffness, as tuple (Vector3,float)

yade._utils.unbalancedForce([(bool)useMaxForce=False]) → float

Compute the ratio of mean (or maximum, if useMaxForce) summary force on bodies and maximum force magnitude on interactions. For perfectly static equilibrium, summary force on all bodies is zero (since forces from interactions cancel out and induce no acceleration of particles); this ratio will tend to zero as simulation stabilizes, though zero is never reached because of finite precision computation. Sufficiently small value can be e.g. 1e-2 or smaller, depending on how much equilibrium it should be.

yade._utils.wireAll() → None

Set Shape::wire on all bodies to True, rendering them with wireframe only.

yade._utils.wireNoSpheres() → None

Set Shape::wire to True on non-spherical bodies (Facets, Walls).

yade._utils.wireNone() → None

Set Shape::wire on all bodies to False, rendering them as solids.

Previous topic

yade.timing module

Next topic

yade.ymport module

This Page