tUse correct syntax when checking bools - 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 6478ba3c7f4f23cb7f122e51d963be379d758c27
 (DIR) parent c57e00820eb2d87c653321649e2b09de8ca969be
 (HTM) Author: Anders Damsgaard <anders@adamsgaard.dk>
       Date:   Mon,  2 Sep 2019 06:38:20 +0200
       
       Use correct syntax when checking bools
       
       Diffstat:
         M python/sphere.py                    |      22 +++++++++++-----------
       
       1 file changed, 11 insertions(+), 11 deletions(-)
       ---
 (DIR) diff --git a/python/sphere.py b/python/sphere.py
       t@@ -3148,7 +3148,7 @@ class sim:
                self.angvel[I,0]=0.0
                self.angvel[I,1]=0.0
                self.angvel[I,2]=0.0
       -        if shear_stress == False:
       +        if not shear_stress:
                    self.vel[I,0]=(z_max-z_min)*shear_strain_rate
                else:
                    self.vel[I,0]=0.0
       t@@ -3354,7 +3354,7 @@ class sim:
                    # Computational time step (O'Sullivan et al, 2003)
                    #self.time_dt[0]=0.17*math.sqrt(m_min/k_max)
        
       -        elif self.fluid == False:
       +        elif not self.fluid:
                    raise Exception('Error: Could not automatically set a time step.')
        
                # Check numerical stability of the fluid phase, by criteria derived
       t@@ -4069,31 +4069,31 @@ class sim:
        
                self.lambda_bar[0]=1.0 # Radius multiplier to parallel-bond radii
        
       -        if hasattr(self, 'bonds') == False:
       +        if not hasattr(self, 'bonds'):
                    self.bonds=numpy.array([[i,j]], dtype=numpy.uint32)
                else :
                    self.bonds=numpy.vstack((self.bonds, [i,j]))
        
       -        if hasattr(self, 'bonds_delta_n') == False:
       +        if not hasattr(self, 'bonds_delta_n'):
                    self.bonds_delta_n=numpy.array([0.0], dtype=numpy.uint32)
                else :
                    #self.bonds_delta_n=numpy.vstack((self.bonds_delta_n, [0.0]))
                    self.bonds_delta_n=numpy.append(self.bonds_delta_n, [0.0])
        
       -        if hasattr(self, 'bonds_delta_t') == False:
       +        if not hasattr(self, 'bonds_delta_t'):
                    self.bonds_delta_t=numpy.array([[0.0, 0.0, 0.0]],\
                            dtype=numpy.uint32)
                else :
                    self.bonds_delta_t=numpy.vstack((self.bonds_delta_t,\
                            [0.0, 0.0, 0.0]))
        
       -        if hasattr(self, 'bonds_omega_n') == False:
       +        if not hasattr(self, 'bonds_omega_n'):
                    self.bonds_omega_n=numpy.array([0.0], dtype=numpy.uint32)
                else :
                    #self.bonds_omega_n=numpy.vstack((self.bonds_omega_n, [0.0]))
                    self.bonds_omega_n=numpy.append(self.bonds_omega_n, [0.0])
        
       -        if hasattr(self, 'bonds_omega_t') == False:
       +        if not hasattr(self, 'bonds_omega_t'):
                    self.bonds_omega_t=numpy.array([[0.0, 0.0, 0.0]],\
                            dtype=numpy.uint32)
                else :
       t@@ -4498,7 +4498,7 @@ class sim:
                valgrindbin=""
                cudamemchk=""
                binary="sphere"
       -        if verbose == False:
       +        if not verbose:
                    quiet="-q "
                if hideinputfile:
                    stdout=" > /dev/null"
       t@@ -4631,7 +4631,7 @@ class sim:
                print("Rendering {} images with the raytracer".format(self.sid))
        
                quiet=""
       -        if verbose == False:
       +        if not verbose:
                    quiet="-q"
        
                # Render images using sphere raytracer
       t@@ -7319,7 +7319,7 @@ class sim:
                elif method == 'porosity':
        
                    sb.readfirst(verbose=False)
       -            if sb.fluid == False:
       +            if not sb.fluid:
                        raise Exception('Porosities can only be visualized in wet ' +
                                'simulations')
        
       t@@ -7612,7 +7612,7 @@ def run(binary, verbose=True, hideinputfile=False):
        
            quiet=''
            stdout=''
       -    if verbose == False:
       +    if not verbose:
                quiet='-q'
            if hideinputfile:
                stdout=' > /dev/null'