tapply distance modification during contact search - Granular.jl - Julia packag… | |
git clone git://src.adamsgaard.dk/Granular.jl | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit d3ccfa13eceaac8e9f56ceb7872e6c0919d79289 | |
parent 8e3305398e56df7d14cc2fe448838530cdb6532e | |
Author: Anders Damsgaard <[email protected]> | |
Date: Wed, 1 Nov 2017 15:56:18 -0400 | |
apply distance modification during contact search | |
Diffstat: | |
M src/contact_search.jl | 11 ++++++++--- | |
1 file changed, 8 insertions(+), 3 deletions(-) | |
--- | |
diff --git a/src/contact_search.jl b/src/contact_search.jl | |
t@@ -146,7 +146,8 @@ function findContactsInGrid!(simulation::Simulation, grid:… | |
end | |
@inbounds for idx_j in grid.grain_list[i_corrected, j_correcte… | |
- checkAndAddContact!(simulation, idx_i, idx_j) | |
+ checkAndAddContact!(simulation, idx_i, idx_j, | |
+ distance_modifier) | |
end | |
end | |
end | |
t@@ -169,8 +170,12 @@ written to `simulation.contact_parallel_displacement`. | |
* `simulation::Simulation`: the simulation object containing the grains. | |
* `i::Int`: index of the first grain. | |
* `j::Int`: index of the second grain. | |
+* `distance_Modifier::Vector{Float64}`: vector modifying percieved | |
+ inter-particle distance, which is used for contact search across periodic | |
+ boundaries. | |
""" | |
-function checkAndAddContact!(sim::Simulation, i::Int, j::Int) | |
+function checkAndAddContact!(sim::Simulation, i::Int, j::Int, | |
+ distance_modifier::Vector{Float64} = [0., 0.]) | |
if i < j | |
@inbounds if (sim.grains[i].fixed && sim.grains[j].fixed) || | |
t@@ -179,7 +184,7 @@ function checkAndAddContact!(sim::Simulation, i::Int, j::I… | |
end | |
# Inter-grain position vector and grain overlap | |
- position_ij = interGrainPositionVector(sim, i, j) | |
+ position_ij = interGrainPositionVector(sim, i, j) + distance_modifier | |
overlap_ij = findOverlap(sim, i, j, position_ij) | |
contact_found = false |