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. Returns None is 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.VtkExport is queried for files already written, and those are returned;
  • woo.dem.FlowAnalysis is made to export its internal data at the moment of calling this function;
  • woo.dem.Tracer indicates there are particles traces, which are exported by calling woo.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 a VtkExport and 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.kwFromEnergyGrid(S, outPrefix=None)[source]
woo.paraviewscript.kwFromFlowAnalysis(flowAnalysis, outPrefix=None, fractions=[], fracA=[], fracB=[])[source]

Extract keywords suitable for write from a given VtkFlowAnalysis instance.

woo.paraviewscript.kwFromVtkExport(vtkExport, out=None, launch=False)[source]

Extract keywords suitable for write from a given VtkExport instance.

woo.paraviewscript.kwFromVtkExportTraces(S, dem, outPrefix=None)[source]
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 --script option). The options to this function are:

Parameters:

Tip

Got questions? Ask at ask.woodem.org. Report issues to github.