yade.gridpfacet module

Helper functions for creating cylinders, grids and membranes. For more details on this type of elements see [Effeindzourou2016], [Effeindzourou2015a], [Bourrier2013],.

For examples using GridConnections, see

For examples using PFacets, see

yade.gridpfacet.chainedCylinder(begin=Vector3(0, 0, 0), end=Vector3(1, 0, 0), radius=0.2, dynamic=None, fixed=False, wire=False, color=None, highlight=False, material=-1, mask=1)[source]

Create and connect a chainedCylinder with given parameters. The shape generated by repeted calls of this function is the Minkowski sum of polyline 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.

Note

ChainedCylinder is deprecated and will be removed in the future, use GridConnection instead. See gridpfacet.cylinder and gridpfacet.cylinderConnection.

yade.gridpfacet.cylinder(begin=Vector3(0, 0, 0), end=Vector3(1, 0, 0), radius=0.2, nodesIds=[], cylIds=[], dynamic=None, fixed=False, wire=False, color=None, highlight=False, intMaterial=-1, extMaterial=-1, mask=1)[source]

Create a cylinder with given parameters. The shape corresponds to the Minkowski sum of line-segment and sphere, hence, the cylinder has rounded vertices. The cylinder (GridConnection) and its corresponding nodes (yref:GridNodes<GridNode>) are automatically added to the simulation. The lists with nodes and cylinder ids will be updated automatically.

Parameters:
  • begin (Vector3) – first point of the Minkowski sum in the global coordinate system.
  • end (Vector3) – last point of the Minkowski sum in the global coordinate system.
  • radius (Real) – radius of sphere in the Minkowski sum.
  • nodesIds (list) – list with ids of already existing GridNodes. New ids will be added.
  • cylIds (list) – list with ids of already existing GridConnections. New id will be added.
  • intMaterialBody.material used to create the interaction physics between the two GridNodes
  • extMaterialBody.material used to create the interaction physics between the Cylinder (GridConnection) and other bodies (e.g., spheres interaction with the cylinder)

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

yade.gridpfacet.cylinderConnection(vertices, radius=0.2, nodesIds=[], cylIds=[], dynamic=None, fixed=False, wire=False, color=None, highlight=False, intMaterial=-1, extMaterial=-1, mask=1)[source]

Create a chain of cylinders with given parameters. The cylinders (GridConnection) and its corresponding nodes (yref:GridNodes<GridNode>) are automatically added to the simulation. The lists with nodes and cylinder ids will be updated automatically.

Parameters:vertices ([[Vector3]]) – coordinates of vertices to connect in the global coordinate system.

See gridpfacet.cylinder documentation for meaning of other parameters.

yade.gridpfacet.gmshPFacet(meshfile='file.mesh', shift=Vector3(0, 0, 0), scale=1.0, orientation=Quaternion((1, 0, 0), 0), radius=1.0, wire=True, fixed=True, materialNodes=-1, material=-1, color=None)[source]

Imports mesh geometry from .mesh file and automatically creates connected PFacet elements. For an example see examples/pfacet/mesh-pfacet.py.

Parameters:
  • filename (string) – .gts file to read.
  • shift ([float,float,float]) – [X,Y,Z] parameter shifts the mesh.
  • scale (float) – factor scales the mesh.
  • orientation (quaternion) – orientation of the imported geometry.
  • radius (float) – radius used to create the PFacets.
  • materialNodes – specify Body.material of GridNodes. This material is used to make the internal connections.
  • material – specify Body.material of PFacets. This material is used for interactions with external bodies.

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

Returns:lists of GridNode ids nodesIds, GridConnection ids cylIds, and PFacet ids pfIds

mesh files can easily be created with GMSH.

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

yade.gridpfacet.gridConnection(id1, id2, radius, wire=False, color=None, highlight=False, material=-1, mask=1, cellDist=None)[source]

Create a GridConnection by connecting two GridNodes.

Parameters:
  • id1,id2 – the two GridNodes forming the cylinder.
  • radius (float) – radius of the cylinder. Note that the radius needs to be the same as the one for the GridNodes.
  • cellDist (Vector3) – for periodic boundary conditions, see Interaction.cellDist. Note: periodic boundary conditions for gridConnections are not yet implemented!

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

Returns:Body object with the GridConnection shape.

Note

The material of the GridNodes will be used to set the constitutive behaviour of the internal connection, i.e., the constitutive behaviour of the cylinder. The material of the GridConnection is used for interactions with other (external) bodies.

yade.gridpfacet.gridNode(center, radius, dynamic=None, fixed=False, wire=False, color=None, highlight=False, material=-1)[source]

Create a GridNode which is needed to set up GridConnections.

See documentation of utils.sphere for meaning of parameters.

Returns:Body object with the gridNode shape.
yade.gridpfacet.gtsPFacet(meshfile, shift=Vector3(0, 0, 0), scale=1.0, radius=1, wire=True, fixed=True, materialNodes=-1, material=-1, color=None)[source]

Imports mesh geometry from .gts file and automatically creates connected PFacet3 elements. For an example see examples/pfacet/gts-pfacet.py.

Parameters:
  • filename (string) – .gts file to read.
  • shift ([float,float,float]) – [X,Y,Z] parameter shifts the mesh.
  • scale (float) – factor scales the mesh.
  • radius (float) – radius used to create the PFacets.
  • materialNodes – specify Body.material of GridNodes. This material is used to make the internal connections.
  • material – specify Body.material of PFacets. This material is used for interactions with external bodies.

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

Returns:lists of GridNode ids nodesIds, GridConnection ids cylIds, and PFacet ids pfIds
yade.gridpfacet.pfacet(id1, id2, id3, wire=True, color=None, highlight=False, material=-1, mask=1, cellDist=None)[source]

Create a PFacet element from 3 GridNodes which are already connected via 3 GridConnections:

Parameters:
  • id1,id2,id3 – already with GridConnections connected GridNodes
  • wire (bool) – if True, top and bottom facet are shown as skeleton; otherwise facets are filled.
  • color (Vector3-or-None) – color of the PFacet; random color will be assigned if None.
  • cellDist (Vector3) – for periodic boundary conditions, see Interaction.cellDist. Note: periodic boundary conditions are not yet implemented for PFacets!

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

Returns:Body object with the PFacet shape.

Note

GridNodes and GridConnections need to have the same radius. This is also the radius used to create the PFacet

yade.gridpfacet.pfacetCreator1(vertices, radius, nodesIds=[], cylIds=[], pfIds=[], wire=False, fixed=True, materialNodes=-1, material=-1, color=None)[source]

Create a PFacet element from 3 vertices and automatically append to simulation. The function uses the vertices to create GridNodes and automatically checks for existing nodes.

Parameters:
  • vertices ([Vector3,Vector3,Vector3]) – coordinates of vertices in the global coordinate system.
  • radius (float) – radius used to create the PFacets.
  • nodesIds (list) – list with ids of already existing GridNodes. New ids will be added.
  • cylIds (list) – list with ids of already existing GridConnections. New ids will be added.
  • pfIds (list) – list with ids of already existing PFacets. New ids will be added.
  • materialNodes – specify Body.material of GridNodes. This material is used to make the internal connections.
  • material – specify Body.material of PFacets. This material is used for interactions with external bodies.

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

yade.gridpfacet.pfacetCreator2(id1, id2, vertex, radius, nodesIds=[], wire=True, materialNodes=-1, material=-1, color=None, fixed=True)[source]

Create a PFacet element from 2 already existing and connected GridNodes and one vertex. The element is automatically appended to the simulation.

Parameters:
  • id1,id2 (int) – ids of already with GridConnection connected GridNodes.
  • vertex (Vector3) – coordinates of the vertex in the global coordinate system.

See documentation of gridpfacet.pfacetCreator1 for meaning of other parameters.

yade.gridpfacet.pfacetCreator3(id1, id2, id3, cylIds=[], pfIds=[], wire=True, material=-1, color=None, fixed=True, mask=-1)[source]

Create a PFacet element from 3 already existing GridNodes which are not yet connected. The element is automatically appended to the simulation.

Parameters:id1,id2,id3 (int) – id of the 3 GridNodes forming the PFacet.

See documentation of gridpfacet.pfacetCreator1 for meaning of other parameters.

yade.gridpfacet.pfacetCreator4(id1, id2, id3, pfIds=[], wire=True, material=-1, color=None, fixed=True, mask=-1)[source]

Create a PFacet element from 3 already existing GridConnections. The element is automatically appended to the simulation.

Parameters:id1,id2,id3 (int) – id of the 3 GridConnections forming the PFacet.

See documentation of gridpfacet.pfacetCreator1 for meaning of other parameters.