Skip to content
Snippets Groups Projects
Commit f832c4a0 authored by Patrick Zimmer's avatar Patrick Zimmer
Browse files

This does not belong there

parent dce63d58
No related tags found
1 merge request!7Propose force fix
......@@ -12,6 +12,33 @@
return
end
@forcedef function InPartS.obstacleforces!(so::InfiniteWall{N,Reflecting}, c::Spherocylinder{N}, sim::Simulation) where N
# which node is closest to the wall?
s = so.normal c.backbone.
node = s > 0 ? 0.0 : 1.0
# # project relevant node position onto relevant axis
signeddistance = so.normal (c.backbone(node) - so.support)
dedge = signeddistance - radius(c)
if dedge 0
# hertzian repulsion
force = hertzfactor(c, sim)*dedge*sqrt(-dedge) * so.normal
else
return
end
# add force to rod
distributeforce!(c, -force, node)
# force extraction
@force begin
midpoint = fold_back(c.backbone(node) - signeddistance/2 * so.normal, sim.domain)
forcecontribution(c.centerpos, -force, (midpoint-c.centerpos)%sim.domain)
end
return
end
@forcedef function InPartS.obstacleforces!(so::FiniteWall3D{Reflecting}, c::Dumbbell{3}, sim::Simulation)
h = hertzfactor(c, sim)
softness = 0.5 * (1 + c.growthprog)
......
......@@ -162,35 +162,3 @@ function orientation_descriptor(c::AbstractRod)
return "unknown"
end
end
############################################################################################
# Obstacle interactions #
############################################################################################
@forcedef function InPartS.obstacleforces!(so::InfiniteWall{N,Reflecting}, c::Spherocylinder{N}, sim::Simulation) where N
# which node is closest to the wall?
s = so.normal c.backbone.
node = s > 0 ? 0.0 : 1.0
# # project relevant node position onto relevant axis
signeddistance = so.normal (c.backbone(node) - so.support)
dedge = signeddistance - radius(c)
if dedge 0
# hertzian repulsion
force = hertzfactor(c, sim)*dedge*sqrt(-dedge) * so.normal
else
return
end
# add force to rod
distributeforce!(c, -force, node)
# force extraction
@force begin
midpoint = fold_back(c.backbone(node) - signeddistance/2 * so.normal, sim.domain)
forcecontribution(c.centerpos, -force, (midpoint-c.centerpos)%sim.domain)
end
return
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment