Granular.jl

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

commit a79f1155bfb16f8da74ac94efe92e7d9eff79fb3
parent 6ea9dc8a5734e221c53212c444ebd90b91eb578b
Author: Anders Damsgaard <andersd@riseup.net>
Date:   Sun, 30 Apr 2017 13:53:40 -0400

use ocean grid for ice-floe binning and contact search if it exists

Diffstat:
Msrc/contact_search.jl | 2+-
Msrc/ocean.jl | 2+-
Msrc/simulation.jl | 4+++-
3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/contact_search.jl b/src/contact_search.jl @@ -17,7 +17,7 @@ within the vicinity. When this method is applied, it is assumed that the * `method::String`: the contact-search method to apply. Valid options are "all to all" and "ocean grid". """ -function findContacts!(simulation::Simulation, +function findContacts!(simulation::Simulation; method::String = "all to all") if method == "all to all" diff --git a/src/ocean.jl b/src/ocean.jl @@ -285,6 +285,6 @@ function applyOceanDragToIceFloe!(ice_floe::IceFloeCylindrical, width = ice_floe.areal_radius*2. ice_floe.force += - rho_w * (.5*c_o_v*width*draft*freeboard + c_o_h*length*width) * + rho_o * (.5*c_o_v*width*draft*freeboard + c_o_h*length*width) * ([u, v] - ice_floe.vel)*norm([u, v] - ice_floe.vel) end diff --git a/src/simulation.jl b/src/simulation.jl @@ -110,8 +110,10 @@ function run!(simulation::Simulation; zeroForcesAndTorques!(simulation) if typeof(simulation.ocean.input_file) != Bool sortIceFloesInOceanGrid!(simulation) + findContacts!(simulation, method="ocean grid") + else + findContacts!(simulation, method="all to all") end - findContacts!(simulation) interact!(simulation) if typeof(simulation.ocean.input_file) != Bool addOceanDrag!(simulation)