yade.eudoxos module

Miscillaneous functions that are not believed to be generally usable, therefore kept in my “private” module here.

They comprise notably oofem export and various CPM-related functions.

class yade.eudoxos.IntrSmooth3d

Return spatially weigted gaussian average of arbitrary quantity defined on interactions.

At construction time, all real interactions are put inside spatial grid, permitting fast search for points in neighbourhood defined by distance.

Parameters for the distribution are standard deviation \sigma and relative cutoff distance relThreshold (3 by default) which will discard points farther than relThreshold \times \sigma.

Given central point p_0, points are weighted by gaussian function

\rho(p_0,p)=\frac{1}{\sigma\sqrt{2\pi}}\exp\left(\frac{-||p_0-p||^2}{2\sigma^2}\right)

To get the averaged value, simply call the instance, passing central point and callable object which received interaction object and returns the desired quantity:

>>> O.reset()
>>> from yade import utils
>>> O.bodies.append([utils.sphere((0,0,0),1),utils.sphere((0,0,1.9),1)])
[0, 1]
>>> O.engines=[InteractionLoop([Ig2_Sphere_Sphere_Dem3DofGeom(),],[Ip2_FrictMat_FrictMat_FrictPhys()],[])]
>>> utils.createInteraction(0,1) 
<Interaction instance at 0x...>

>> is3d=IntrSmooth3d(0.003) >> is3d((0,0,0),lambda i: i.phys.normalForce) Vector3(0,0,0)

bounds()
count()
yade.eudoxos.displacementsInteractionsExport(fName)
yade.eudoxos.eliminateJumps(eps, sigma, numSteep=10, gapWidth=5, movWd=40)
yade.eudoxos.estimatePoissonYoung(principalAxis, stress=0, plot=False, cutoff=0.0)

Estimate Poisson’s ration given the “principal” axis of straining. For every base direction, homogenized strain is computed (slope in linear regression on discrete function particle coordinate → → particle displacement in the same direction as returned by utils.coordsAndDisplacements) and, (if axis ‘0’ is the strained axis) the poisson’s ratio is given as -½(ε₁+ε₂)/ε₀.

Young’s modulus is computed as σ/ε₀; if stress σ is not given (default 0), the result is 0.

cutoff, if > 0., will take only smaller part (centered) or the specimen into account

yade.eudoxos.estimateStress(strain, cutoff=0.0)

Use summed stored energy in contacts to compute macroscopic stress over the same volume, provided known strain.

yade.eudoxos.oofemDirectExport(fileBase, title=None, negIds=[], posIds=[])
yade.eudoxos.oofemPrescribedDisplacementsExport(fileName)
yade.eudoxos.oofemTextExport(fName)

Export simulation data in text format

The format is line-oriented as follows:

E G                                                 # elastic material parameters
epsCrackOnset relDuctility xiShear transStrainCoeff # tensile parameters; epsFr=epsCrackOnset*relDuctility
cohesionT tanPhi                                    # shear parameters
number_of_spheres number_of_links
id x y z r boundary                                 # spheres; boundary: -1 negative, 0 none, 1 positive
…
id1 id2 cp_x cp_y cp_z A                            # interactions; cp = contact point; A = cross-section
class yade._eudoxos.HelixInteractionLocator2d

Locate all real interactions in 2d plane (reduced by spiral projection from 3d, using Shop::spiralProject, which is the same as utils.spiralProject) using their contact points.

Note

Do not run simulation while using this object.

__init__((float)dH_dTheta[, (int)axis=0[, (float)periodStart=nan[, (float)theta0=0[, (float)thetaMin=nan[, (float)thetaMax=nan]]]]]) → None
Parameters:
  • dH_dTheta (float) – Spiral inclination, i.e. height increase per 1 radian turn;
  • axis (int) – axis of rotation (0=x,1=y,2=z)
  • theta (float) – spiral angle at zero height (theta intercept)
  • thetaMin (float) – only interactions with \thetathetaMin will be considered (NaN to deactivate)
  • thetaMax (float) – only interactions with \thetathetaMax will be considered (NaN to deactivate)

See utils.spiralProject.

hi

Return upper corner of the rectangle containing all interactions.

intrsAroundPt((Vector2)pt2d, (float)radius) → list

Return list of interaction objects that are not further from pt2d than radius in the projection plane

lo

Return lower corner of the rectangle containing all interactions.

macroAroundPt((Vector2)pt2d, (float)radius) → tuple

Compute macroscopic stress around given point; the interaction (n and \sigma^T are rotated to the projection plane by \theta (as given by utils.spiralProject) first, but no skew is applied). The formula used is

\sigma_{ij}=\frac{1}{V}\sum_{IJ}d^{IJ}A^{IJ}\left[\sigma^{N,IJ}n_i^{IJ}n_j^{IJ}+\frac{1}{2}\left(\sigma_i^{T,IJ}n_j^{IJ}+\sigma_j^{T,IJ}n_i^{IJ}\right)\right]

where the sum is taken over volume V containing interactions IJ between spheres I and J;

  • i, j indices denote Cartesian components of vectors and tensors,
  • d^{IJ} is current distance between spheres I and J,
  • A^{IJ} is area of contact IJ,
  • n is (\theta-rotated) interaction normal (unit vector pointing from center of I to the center of J)
  • \sigma^{N,IJ} is normal stress (as scalar) in contact IJ,
  • \sigma^{T,IJ} is shear stress in contact IJ in global coordinates and \theta-rotated.

Additionally, computes average of CpmPhys.omega (\bar\omega) and CpmPhys.kappaD (\bar\kappa_D). N is the number of interactions in the volume given.

Returns:tuple of (N, \tens{\sigma}, \bar\omega, \bar\kappa_D).
class yade._eudoxos.InteractionLocator

Locate all (real) interactions in space by their contact point. When constructed, all real interactions are spatially indexed (uses vtkPointLocator internally). Use instance methods to use those data.

Note

Data might become inconsistent with real simulation state if simulation is being run between creation of this object and spatial queries.

bounds

Return coordinates of lower and uppoer corner of axis-aligned abounding box of all interactions

count

Number of interactions held

intrsAroundPt((Vector3)point, (float)maxDist) → list

Return list of real interactions that are not further than maxDist from point.

macroAroundPt((Vector3)point, (float)maxDist[, (float)forceVolume=-1]) → tuple

Return tuple of averaged stress tensor (as Matrix3), average omega and average kappa values. forceVolume can be used (if positive) rather than the sphere (with maxDist radius) volume for the computation. (This is useful if point and maxDist encompass empty space that you want to avoid.)

yade._eudoxos.particleConfinement() → None
yade._eudoxos.velocityTowardsAxis((Vector3)axisPoint, (Vector3)axisDirection, (float)timeToAxis[, (float)subtractDist[, (float)perturbation]]) → None

Previous topic

Yade modules

Next topic

yade.export module

This Page