tUse .= operator for assigning to multiple values in array - Granular.jl - Juli… | |
git clone git://src.adamsgaard.dk/Granular.jl | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 7dec6050d81c68a29ace3658afbfbfdb0d6aeda5 | |
parent 54c0475aa12d6e37d03c2bffca3d1ae8794a165c | |
Author: Anders Damsgaard <[email protected]> | |
Date: Wed, 6 Jun 2018 13:10:42 -0400 | |
Use .= operator for assigning to multiple values in array | |
Diffstat: | |
M test/atmosphere.jl | 4 ++-- | |
M test/grid.jl | 2 +- | |
2 files changed, 3 insertions(+), 3 deletions(-) | |
--- | |
diff --git a/test/atmosphere.jl b/test/atmosphere.jl | |
t@@ -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 | |
t@@ -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) |