\( \usepackage{euler} % must be loaded before fontspec for the whole doc (below); this must be kept for pngmath, however \usepackage{hyperref} \usepackage{amsmath} \usepackage{amsbsy} %\usepackage{mathabx} \usepackage{underscore} \usepackage[all]{xy} % Metadata of the pdf output \hypersetup{pdftitle={Yade Documentation}} \hypersetup{pdfauthor={Smilauer, V., et al.}} \hypersetup{pdfkeywords={Discrete element method, granular materials, contact law, hydromechanical coupling}} % symbols \renewcommand{\mat}{\boldsymbol} \renewcommand{\vec}{\boldsymbol} \renewcommand{\tens}{\boldsymbol} %normalized and locfram here \def\normalized#1{\widehat{#1}} \def\locframe#1{\widetilde{#1}} % timestep \def\Dt{\Delta t} \def\Dtcr{\Dt_{\rm cr}} % algorithm complexity \def\bigO#1{{\mathcal{O}(#1)}} % variants for greek symbols \let\epsilon\varepsilon \let\theta\vartheta \let\phi\varphi % shorthands \let\sig\sigma \let\eps\epsilon % variables at different points of time \def\prev#1{#1^-} \def\pprev#1{#1^\ominus} \def\curr#1{#1^{\circ}} \def\nnext#1{#1^\oplus} \def\next#1{#1^+} % shorthands for geometry \def\currn{\curr{\vec{n}}} \def\currC{\curr{\vec{C}}} \def\uT{\vec{u}_T} \def\curruT{\curr{\vec{u}}_T} \def\prevuT{\prev{\vec{u}}_T} \def\currn{\curr{\vec{n}}} \def\prevn{\prev{\vec{n}}} % motion \def\pprevvel{\pprev{\dot{\vec{u}}}} \def\nnextvel{\nnext{\dot{\vec{u}}}} \def\curraccel{\curr{\ddot{\vec{u}}}} \def\prevpos{\prev{\vec{u}}} \def\currpos{\curr{\vec{u}}} \def\nextpos{\next{\vec{u}}} \def\curraaccel{\curr{\dot{\vec{\omega}}}} \def\pprevangvel{\pprev{\vec{\omega}}} \def\nnextangvel{\nnext{\vec{\omega}}} \def\loccurr#1{\curr{\locframe{#1}}} \def\numCPU{n_{\rm cpu}} \DeclareMathOperator{\Align}{Align} \DeclareMathOperator{\sign}{sgn} % sorting algorithms \def\isleq#1{\currelem{#1}\ar@/^/[ll]^{\leq}} \def\isnleq#1{\currelem{#1}\ar@/^/[ll]^{\not\leq}} \def\currelem#1{\fbox{$#1$}} \def\sortSep{||} \def\sortInv{\hbox{\phantom{||}}} \def\sortlines#1{\xymatrix@=3pt{#1}} \def\crossBound{||\mkern-18mu<} \)

# yade.ymport module

Import geometry from various formats (‘import’ is python keyword, hence the name ‘ymport’).

yade.ymport.blockMeshDict(path, patchasWall=True, emptyasWall=True, **kw)

  Load openfoam’s blockMeshDict file’s “boundary” section as facets.

  Parameters:

    - path (str) – file name. Typical value is: “system/blockMeshDict”.

    - patchasWall (bool) – load “patch”-es as walls.

    - emptyasWall (bool) – load “empty”-es as walls.

    - **kw – (unused keyword arguments) is passed to utils.facet

  Returns:

    list of facets.

yade.ymport.ele(nodeFileName, eleFileName, shift=(0, 0, 0), scale=1.0, **kw)

  Import tetrahedral mesh from .ele file, return list of created tetrahedrons.

  Parameters:

    - nodeFileName (string) – name of .node file

    - eleFileName (string) – name of .ele file

    - shift ((float,float,float)|Vector3) – (X,Y,Z) parameter moves the specimen.

    - scale (float) – factor scales the given data.

    - **kw – (unused keyword arguments) is passed to utils.polyhedron

yade.ymport.gengeo(mntable, shift=Vector3(0, 0, 0), scale=1.0, **kw)

  Imports geometry from LSMGenGeo library and creates spheres. Since 2012 the package is available in Debian/Ubuntu and known as python-demgengeo http://packages.qa.debian.org/p/python-demgengeo.html

  Parameters:
    mntable: mntable

      object, which creates by LSMGenGeo library, see example

    shift: [float,float,float]

      [X,Y,Z] parameter moves the specimen.

    scale: float

      factor scales the given data.

    **kw: (unused keyword arguments)

      is passed to utils.sphere

  LSMGenGeo library allows one to create pack of spheres with given [Rmin:Rmax] with null stress inside the specimen. Can be useful for Mining Rock simulation.

  Example: examples/packs/packs.py, usage of LSMGenGeo library in examples/test/genCylLSM.py.

  - https://answers.launchpad.net/esys-particle/+faq/877

  - http://www.access.edu.au/lsmgengeo_python_doc/current/pythonapi/html/GenGeo-module.html

  - https://svn.esscc.uq.edu.au/svn/esys3/lsm/contrib/LSMGenGeo/

yade.ymport.gengeoFile(fileName='file.geo', shift=Vector3(0, 0, 0), scale=1.0, orientation=Quaternion((1, 0, 0), 0), **kw)

  Imports geometry from LSMGenGeo .geo file and creates spheres. Since 2012 the package is available in Debian/Ubuntu and known as python-demgengeo http://packages.qa.debian.org/p/python-demgengeo.html

  Parameters:
    filename: string

      file which has 4 colums [x, y, z, radius].

    shift: Vector3

      Vector3(X,Y,Z) parameter moves the specimen.

    scale: float

      factor scales the given data.

    orientation: quaternion

      orientation of the imported geometry

    **kw: (unused keyword arguments)

      is passed to utils.sphere

  Returns:

    list of spheres.

  LSMGenGeo library allows one to create pack of spheres with given [Rmin:Rmax] with null stress inside the specimen. Can be useful for Mining Rock simulation.

  Example: examples/packs/packs.py, usage of LSMGenGeo library in examples/test/genCylLSM.py.

  - https://answers.launchpad.net/esys-particle/+faq/877

  - http://www.access.edu.au/lsmgengeo_python_doc/current/pythonapi/html/GenGeo-module.html

  - https://svn.esscc.uq.edu.au/svn/esys3/lsm/contrib/LSMGenGeo/

yade.ymport.gmsh(meshfile='file.mesh', shift=Vector3(0, 0, 0), scale=1.0, orientation=Quaternion((1, 0, 0), 0), **kw)

  Imports geometry from .mesh file and creates facets.

  Parameters:
    shift: [float,float,float]

      [X,Y,Z] parameter moves the specimen.

    scale: float

      factor scales the given data.

    orientation: quaternion

      orientation of the imported mesh

    **kw: (unused keyword arguments)

      is passed to utils.facet

  Returns:

    list of facets forming the specimen.

  mesh files can easily be created with GMSH. Example added to examples/packs/packs.py

  Additional examples of mesh-files can be downloaded from http://www-roc.inria.fr/gamma/download/download.php

yade.ymport.gts(meshfile, shift=Vector3(0, 0, 0), scale=1.0, **kw)

  Read given meshfile in gts format.

  Parameters:
    meshfile: string

      name of the input file.

    shift: [float,float,float]

      [X,Y,Z] parameter moves the specimen.

    scale: float

      factor scales the given data.

    **kw: (unused keyword arguments)

      is passed to utils.facet

  Returns:

    list of facets.

yade.ymport.iges(fileName, shift=(0, 0, 0), scale=1.0, returnConnectivityTable=False, **kw)

  Import triangular mesh from .igs file, return list of created facets.

  Parameters:

    - fileName (string) – name of iges file

    - shift ((float,float,float)|Vector3) – (X,Y,Z) parameter moves the specimen.

    - scale (float) – factor scales the given data.

    - **kw – (unused keyword arguments) is passed to utils.facet

    - returnConnectivityTable (bool) – if True, apart from facets returns also nodes (list of (x,y,z) nodes coordinates) and elements (list of (id1,id2,id3) element nodes ids). If False (default), returns only facets

yade.ymport.polyMesh(path, patchasWall=True, emptyasWall=True, **kw)

  Load openfoam’s polyMesh directory as facets.

  Parameters:

    - path (str) – directory path. Typical value is: “constant/polyMesh”.

    - patchAsWall (bool) – load “patch”-es as walls.

    - emptyAsWall (bool) – load “empty”-es as walls.

    - **kw – (unused keyword arguments) is passed to utils.facet

  Returns:

    list of facets.

yade.ymport.stl(file, dynamic=None, fixed=True, wire=True, color=None, highlight=False, noBound=False, material=-1, scale=1.0, shift=Vector3(0, 0, 0))

  Import a .stl geometry in the form of a set of Facet-shaped bodies.

  Parameters:

    - file (string) – the .stl file serving as geometry input

    - dynamic (bool) – controls Body.dynamic

    - fixed (bool) – controls Body.dynamic (with fixed = True imposing Body.dynamic = False) if dynamic attribute is not given

    - wire (bool) – rendering option, passed to Facet.wire

    - color – rendering option, passed to Facet.color

    - highlight (bool) – rendering option, passed to Facet.highlight

    - noBound (bool) – sets Body.bounded to False if True, preventing collision detection (and vice-versa)

    - material – defines material properties, see Defining materials for usage

    - scale (float) – scaling factor to e.g. dilate the geometry if > 1

    - shift (Vector3) – for translating the geometry

  Returns:

    a corresponding list of Facet-shaped bodies

yade.ymport.text(fileName, shift=Vector3(0, 0, 0), scale=1.0, **kw)

  Load sphere coordinates from file, returns a list of corresponding bodies; that may be inserted to the simulation with O.bodies.append().

  Parameters:

    - filename (string) – file which has 4 colums [x, y, z, radius].

    - shift ([float,float,float]) – [X,Y,Z] parameter moves the specimen.

    - scale (float) – factor scales the given data.

    - **kw – (unused keyword arguments) is passed to utils.sphere

  Returns:

    list of spheres.

  Lines starting with # are skipped

yade.ymport.textClumps(fileName, shift=Vector3(0, 0, 0), discretization=0, orientation=Quaternion((1, 0, 0), 0), scale=1.0, **kw)

  Load clumps-members from file in a format selected by the `format` argument, insert them to the simulation.

  Parameters:

    - filename (str) – file name

    - format (str) – selected input format. Supported `'x_y_z_r'``(default), ``'x_y_z_r_clumpId'`

    - shift ([float,float,float]) – [X,Y,Z] parameter moves the specimen.

    - scale (float) – factor scales the given data.

    - **kw – (unused keyword arguments) is passed to utils.sphere

  Returns:

    list of spheres.

  Lines starting with # are skipped

yade.ymport.textExt(fileName, format='x_y_z_r', shift=Vector3(0, 0, 0), scale=1.0, attrs=[], **kw)

  Load sphere coordinates from file in a format selected by the `format` argument, returns a list of corresponding bodies; that may be inserted to the simulation with `O.bodies.append()`.

  Parameters:

    - filename (str) – file name

    - format (str) – selected input format. Supported `'x_y_z_r'` (default), `'x_y_z_r_matId'`, `'id_x_y_z_r_matId'` (with `id` left unused), `'x_y_z_r_attrs'`; with whitespace delimiters in all cases

    - shift ([float,float,float]) – [X,Y,Z] parameter moves the specimen.

    - scale (float) – factor scales the given data.

    - attrs (list) – attrs read from file if export.textExt(format=’x_y_z_r_attrs’) were used (‘passed by reference’ style)

    - **kw – (unused keyword arguments) is passed to utils.sphere

  Returns:

    list of spheres.

  Lines starting with # are skipped

yade.ymport.textFacets(fileName, format='x1_y1_z1_x2_y2_z2_x3_y3_z3', shift=Vector3(0, 0, 0), scale=1.0, attrs=[], **kw)

  Load facet coordinates from file in a format selected by the `format` argument, returns a list of corresponding bodies; that may be inserted to the simulation with O.bodies.append().

  Parameters:

    - filename (str) – file name

    - format (str) – selected input format. Supported `'x1_y1_z1_x2_y2_z2_x3_y3_z3'``(default), ``'x1_y1_z1_x2_y2_z2_x3_y3_z3_matId'`, `'id_x1_y1_z1_x2_y2_z2_x3_y3_z3_matId'` or `'x1_y1_z1_x2_y2_z2_x3_y3_z3_attrs'`

    - shift ([float,float,float]) – [X,Y,Z] parameter moves the specimen.

    - scale (float) – factor scales the given data.

    - attrs (list) – attrs read from file (‘passed by reference’ style)

    - **kw – (unused keyword arguments) is passed to utils.facet

  Returns:

    list of facets.

  Lines starting with # are skipped

yade.ymport.textPolyhedra(fileName, material, shift=Vector3(0, 0, 0), scale=1.0, orientation=Quaternion((1, 0, 0), 0), **kw)

  Load polyhedra from a text file.

  Parameters:

    - filename (str) – file name. Expected file format is the one output by export.textPolyhedra.

    - shift ([float,float,float]) – [X,Y,Z] parameter moves the specimen.

    - scale (float) – factor scales the given data.

    - orientation (quaternion) – orientation of the imported polyhedra

    - **kw – (unused keyword arguments) is passed to polyhedra_utils.polyhedra

  Returns:

    list of polyhedras.

  Lines starting with # are skipped

yade.ymport.unv(fileName, shift=(0, 0, 0), scale=1.0, returnConnectivityTable=False, **kw)

  Import geometry from unv file, return list of created facets.

  > param string fileName:

  >   name of unv file

  > param (float,float,float)|Vector3 shift:

  >   (X,Y,Z) parameter moves the specimen.

  > param float scale:

  >   factor scales the given data.

  > param **kw:

  >   (unused keyword arguments) is passed to utils.facet

  > param bool returnConnectivityTable:

  >   if True, apart from facets returns also nodes (list of (x,y,z) nodes coordinates) and elements (list of (id1,id2,id3) element nodes ids). If False (default), returns only facets

  unv files are mainly used for FEM analyses (are used by OOFEM and Abaqus), but triangular elements can be imported as facets. These files cen be created e.g. with open-source free software Salome.

  Example: examples/test/unv-read/unvRead.py.