tadd spatial scaling function - 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 3564015486511f6af75707d8bca98f6ad15af9c0
 (DIR) parent eb1e47ed6e19f31f6b9ace58925721045eaa2493
 (HTM) Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
       Date:   Thu, 14 May 2015 19:52:50 +0200
       
       add spatial scaling function
       
       Diffstat:
         M python/halfshear-darcy-combined.py  |       3 ++-
         M python/sphere.py                    |      20 ++++++++++++++++++++
       
       2 files changed, 22 insertions(+), 1 deletion(-)
       ---
 (DIR) diff --git a/python/halfshear-darcy-combined.py b/python/halfshear-darcy-combined.py
       t@@ -299,6 +299,7 @@ ax7.text(bbox_x, bbox_y, 'd',
        ax9 = plt.subplot(5, 1, 5, sharex=ax1)
        poros_max = 0.45
        poros_min = 0.37
       +poros[:,0] = poros[:,2] # remove erroneous porosity increase
        cmap = matplotlib.cm.get_cmap('Blues_r')
        #cmap = matplotlib.cm.get_cmap('afmhot')
        #im9 = ax9.pcolormesh(t, zpos_c, poros,
       t@@ -308,7 +309,7 @@ xvel[xvel < 0.0] = 0.0
        im9 = ax9.pcolormesh(t, zpos_c, poros,
        #im9 = ax9.pcolormesh(t, zpos_c, xvel,
                cmap=cmap,
       -        vmin=poros_min, vmax=poros_max,
       +        #vmin=poros_min, vmax=poros_max,
                #norm=matplotlib.colors.LogNorm(vmin=1.0e-8, vmax=xvel.max()),
                shading='goraud',
                rasterized=rasterized)
 (DIR) diff --git a/python/sphere.py b/python/sphere.py
       t@@ -3731,6 +3731,26 @@ class sim:
                '''
                self.rho_f[0] = rho_f
        
       +    def scaleSize(self, factor):
       +        '''
       +        Scale the positions, linear velocities, forces, torques and radii of all
       +        particles and mobile walls.
       +
       +        :param factor: Spatial scaling factor ]0;inf[
       +        :type factor: float
       +        '''
       +        self.L *= factor
       +        self.x *= factor
       +        self.radius *= factor
       +        self.xysum *= factor
       +        self.vel *= factor
       +        self.force *= factor
       +        self.torque *= factor
       +        self.w_x *= factor
       +        self.w_m *= factor
       +        self.w_vel *= factor
       +        self.w_force *= factor
       +
            def bond(self, i, j):
                '''
                Create a bond between particles with index i and j