Export (not only) geometry to various formats.
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=’vtkExporter.exportSomething(params)’
Example: examples/test/vtk-exporter/vtkExporter.py, examples/test/unv-read/unvReadVTKExport.py.
Parameters: |
|
---|
exports facets (positions) and defined properties. Facets are exported with multiplicated nodes
:param [int]|”all” ids: if “all”, then export all facets, otherwise only facets from integer list :param [tuple(2)] what: see exportSpheres :param string comment: comment to add to vtk file :param int numLabel: number of file (e.g. time step), if unspecified, the last used value + 1 will be used
exports facets (positions) and defined properties. Facets are exported as mesh (not with multiplicated nodes). Therefore additional parameters (nodes and elements) is needed
:param [int]|”all” ids: if “all”, then export all facets, otherwise only facets from integer list :param [tuple(2)] what: see exportSpheres :param string comment: comment to add to vtk file :param int numLabel: number of file (e.g. time step), if unspecified, the last used value + 1 will be used :param [(float,float,float)|Vector3] nodes: list of coordinates of nodes :param [(int,int,int)] elements: list of node ids of individual elements (facets)
exports spheres (positions and radius) and defined properties.
:param ids: if dd “all”, then export all spheres, otherwise only spheres from integer list :type ids: [int] | “all” :param what: 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()’, ... :type what: [tuple(2)] :param string comment: comment to add to vtk file :param int numLabel: number of file (e.g. time step), if unspecified, the last used value + 1 will be used
USAGE: create object vtk_writer = VTKWriter(‘base_file_name’), add to engines PyRunner with command=’vtk_writer.snapshot()’
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: |
|
---|---|
Returns: | number of spheres which were written. |
Return type: | int |
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.
Parameters: |
|
---|---|
Returns: | number of spheres which were written. |
Return type: | int |