tparticle vtk files can be written without vtk module - sphere - GPU-based 3D discrete element method algorithm with optional fluid coupling
 (HTM) git clone git://src.adamsgaard.dk/sphere
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) LICENSE
       ---
 (DIR) commit 9625b73a6b76e9c4209e05ed4e13acd265290359
 (DIR) parent e2a12272ca527de82574fa07d2531cbf36c9c36d
 (HTM) Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
       Date:   Mon, 30 Jun 2014 09:21:53 +0200
       
       particle vtk files can be written without vtk module
       
       Diffstat:
         M python/sphere.py                    |      11 ++++-------
       
       1 file changed, 4 insertions(+), 7 deletions(-)
       ---
 (DIR) diff --git a/python/sphere.py b/python/sphere.py
       t@@ -9,7 +9,8 @@ import subprocess
        try:
            import vtk
        except ImportError:
       -    print('Warning: Could not find "vtk" python module. VTK calls unavailable')
       +    print('Warning: Could not find "vtk" python module. ' +
       +          'Fluid VTK calls will be unavailable')
            py_vtk = False
        else:
            py_vtk = True
       t@@ -1164,9 +1165,6 @@ class sim:
                :param verbose: Show diagnostic information (default = True)
                :type verbose: bool
                '''
       -        if py_vtk == False:
       -            raise Exception('Error: vtk module not found.')
       -
                lastfile = status(self.sid)
                sb = sim(fluid = self.fluid)
                for i in range(lastfile+1):
       t@@ -1226,8 +1224,6 @@ class sim:
                :param verbose: Show diagnostic information (default = True)
                :type verbose: bool
                '''
       -        if py_vtk == False:
       -            raise Exception('Error: vtk module not found.')
        
                fh = None
                try :
       t@@ -1469,7 +1465,8 @@ class sim:
                :type verbose: bool
                '''
                if py_vtk == False:
       -            raise Exception('Error: vtk module not found.')
       +            print('Error: vtk module not found, cannot writeFluidVTK.')
       +            return
        
                filename = folder + '/fluid-' + self.sid + '.vti' # image grid