yade.export module

Export (not only) geometry to various formats.

class yade.export.VTKExporter[source]

Class for exporting data to VTK Simple Legacy File (for example if, for some reason, you are not able to use VTKRecorder). Export of spheres and facets is supported.

USAGE: create object vtkExporter = VTKExporter(‘baseFileName’), add to engines PyRunner with command=’vtkWriter.exportSomething(params)’

exportFacets()[source]

exports facets (positions) and defined properties.

:parameters: `ids`: list | “all” if “all”, then export all spheres, otherwise only spheres from integer list `what`: [tuple(2)] see exportSpheres `comment`: string comment to add to vtk file `numLabel`: int number of file (e.g. time step), if unspecified, the last used value + 1 will be used

exportSpheres()[source]

exports spheres (positions and radius) and defined properties.

:parameters: `ids`: [int] | “all” if “all”, then export all spheres, otherwise only spheres from integer list `what`: [tuple(2)] what other than then position and radius export. parameter is list of couple (name,command). Name is string under which it is save to vtk, command is string to evaluate. Node that the bodies are labeled as b in this function. Scalar, vector and tensor variables are supported. For example, to export velocity (with name particleVelocity) and the distance form point (0,0,0) (named as dist) you should write: ... what=[(‘particleVelocity’,’b.state.vel’),(‘dist’,’b.state.pos.norm()’, ... `comment`: string comment to add to vtk file `numLabel`: int number of file (e.g. time step), if unspecified, the last used value + 1 will be used

class yade.export.VTKWriter[source]

USAGE: create object vtk_writer = VTKWriter(‘base_file_name’), add to engines PyRunner with command=’vtk_writer.snapshot()’

snapshot()[source]
yade.export.text(filename, mask=-1)[source]

Save sphere coordinates into a text file; the format of the line is: x y z r. Non-spherical bodies are silently skipped. Example added to examples/regular-sphere-pack/regular-sphere-pack.py :parameters: filename: string

the name of the file, where sphere coordinates will be exported.
mask:
export only spheres with the corresponding mask
Returns:number of spheres which were written.
yade.export.textExt(filename, format='x_y_z_r', comment='', mask=-1)[source]
Save sphere coordinates and other parameters into a text file in specific format.

Non-spherical bodies are silently skipped. Users can add here their own specific format, giving meaningful names. The first file row will contain the format name. Be sure to add the same format specification in ymport.textExt.

param string filename:
 the name of the file, where sphere coordinates will be exported.
param string format:
 the name of output format. Supported x_y_z_r`(default), `x_y_z_r_matId
param string comment:
 the text, which will be added as a comment at the top of file. If you want to create several lines of text, please use `
#` for next lines.
param int mask`:
 export only spheres with the corresponding mask export only spheres with the corresponding mask

Return number of spheres which were written.

Previous topic

yade.eudoxos module

Next topic

yade.geom module

This Page