Granular.jl

Julia package for granular dynamics simulation
git clone git://src.adamsgaard.dk/Granular.jl
Log | Files | Refs | README | LICENSE

commit 7dec6050d81c68a29ace3658afbfbfdb0d6aeda5
parent 54c0475aa12d6e37d03c2bffca3d1ae8794a165c
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Wed,  6 Jun 2018 13:10:42 -0400

Use .= operator for assigning to multiple values in array

Diffstat:
Mtest/atmosphere.jl | 4++--
Mtest/grid.jl | 2+-
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/atmosphere.jl b/test/atmosphere.jl @@ -86,8 +86,8 @@ sim = deepcopy(sim_init) sim.atmosphere = Granular.createRegularAtmosphereGrid([1, 1, 1], [1., 1., 1.]) sim.grains[1].lin_pos[1] = 0.5 sim.grains[1].lin_pos[2] = 0.5 -sim.atmosphere.v[1, :, 1, 1] = 0.1 -sim.atmosphere.v[2, :, 1, 1] = -0.1 +sim.atmosphere.v[1, :, 1, 1] .= 0.1 +sim.atmosphere.v[2, :, 1, 1] .= -0.1 E_kin_lin_init = Granular.totalGrainKineticTranslationalEnergy(sim) E_kin_rot_init = Granular.totalGrainKineticRotationalEnergy(sim) Granular.run!(sim, verbose=false) diff --git a/test/grid.jl b/test/grid.jl @@ -192,7 +192,7 @@ Compat.@info "Testing atmosphere drag" sim = Granular.createSimulation() sim.atmosphere = Granular.createRegularAtmosphereGrid([4, 4, 2], [4., 4., 2.]) atmosphere = Granular.createRegularAtmosphereGrid([4, 4, 2], [4., 4., 2.]) -sim.atmosphere.u[:,:,1,1] = 5. +sim.atmosphere.u[:,:,1,1] .= 5. Granular.addGrainCylindrical!(sim, [2.5, 3.5], 1., 1., verbose=verbose) Granular.addGrainCylindrical!(sim, [2.6, 2.5], 1., 1., verbose=verbose) Granular.sortGrainsInGrid!(sim, sim.atmosphere, verbose=verbose)