woo.paraviewscript¶
Convenience module for setting up visualization pipelines for Paraview through python scripts.
- 
woo.paraviewscript.findPV()[source]¶ Find Paraview executable in the system. Under Windows (64bit only), this entails searching the registry (see this post); under Linux, look in
$PATH44 for executable called ``paraview. ReturnsNoneis Paraview is not found.
- 
woo.paraviewscript.fromEngines(S, out=None, launch=False, noDataOk=False, **extraKw)[source]¶ Write paraview script showing data from the current VTK-related engines and objects:
woo.dem.VtkExportis queried for files already written, and those are returned;woo.dem.FlowAnalysisis made to export its internal data at the moment of calling this function;woo.dem.Tracerindicates there are particles traces, which are exported by callingwoo.utils.vtkExportTraces.S.energy.grid, if enabled, is exported to indicate spatial distribution of dissipated energy.
- Parameters
 out (str) – script name written (if None, temporary file is used). Tags written as
{tag}will be expanded using S.expandTags <woo.core.Scene.expandTags>.
- 
woo.paraviewscript.fromFlowAnalysis(flowAnalysis, out=None, findMesh=True, launch=False)[source]¶ Have flowAnalysis (
FlowAnalysis) export flow and split data, write Paraview script for it and optionally launch Paraview. With findMesh, try to find aVtkExportand use its last exported mesh file as mesh to show with flow data as well.
- 
woo.paraviewscript.fromVtkExport(vtkExport, out=None, launch=False)[source]¶ Write script for vtkExport (
VtkExport) and optionally launch Paraview on it.
- 
woo.paraviewscript.kwFromFlowAnalysis(flowAnalysis, outPrefix=None, fractions=[], fracA=[], fracB=[])[source]¶ Extract keywords suitable for
writefrom a givenVtkFlowAnalysisinstance.
- 
woo.paraviewscript.kwFromVtkExport(vtkExport, out=None, launch=False)[source]¶ Extract keywords suitable for
writefrom a givenVtkExportinstance.
- 
woo.paraviewscript.launchPV(script)[source]¶ Launch paraview as background process, passing –script=*script* as the only argument. If Paraview executable is not found via
findPV, only a warning is printed and Paraview is not launched.
- 
woo.paraviewscript.write(out, sphereFiles=[], meshFiles=[], conFiles=[], triFiles=[], staticFile='', flowFile='', splitFile='', flowMeshFiles=[], heightMapImageFiles=[], tracesFile='', energyGridFile='', flowMeshOpacity=0.2, splitStride=2, splitClip=False, flowStride=2)[source]¶ Write out script suitable for running with Paraview (with the
--scriptoption). The options to this function are:- Parameters
 sphereFiles – files from
woo.dem.VtkExport.outFiles(spheres);meshFiles – files from
woo.dem.VtkExport.outFiles(mesh);conFiles – files from
woo.dem.VtkExport.outFiles(con);triFiles – files from
woo.dem.VtkExport.outFiles(tri);staticFile – file from
woo.dem.VtkExport.outFiles(static);flowFile – file written by
woo.dem.FlowAnalysis.vtkExportFractions(usually all fractions together);splitFile – file written by
woo.dem.FlowAnalysis.vtkExportVectorOps;flowMeshFiles – mesh files to be used for showing boundaries for split analysis;
heightMapImageFiles – image files which will be warped by scalar;
tracesFile – file written by
woo.utils.vtkExportTraces, for per-particle traces;flowMeshOpacity – opacity of the mesh for flow analysis;
splitStride – spatial stride for segregation analysis; use 2 and more for very dense data meshes which are difficult to see through;
flowStride – spatial stride for flow analysis.
Tip
Report issues or inclarities to github.