Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
InPartSBiome.jl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Emergent Dynamics in Living Systems
InPartS Models
InPartSBiome.jl
Commits
f832c4a0
Commit
f832c4a0
authored
3 months ago
by
Patrick Zimmer
Browse files
Options
Downloads
Patches
Plain Diff
This does not belong there
parent
dce63d58
Branches
propose_force_fix
No related tags found
1 merge request
!7
Propose force fix
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/obstacleinteractions.jl
+27
-0
27 additions, 0 deletions
src/obstacleinteractions.jl
src/spherocylinders/spherocylinder_common.jl
+0
-32
0 additions, 32 deletions
src/spherocylinders/spherocylinder_common.jl
with
27 additions
and
32 deletions
src/obstacleinteractions.jl
+
27
−
0
View file @
f832c4a0
...
...
@@ -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
.
eφ
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
)
...
...
This diff is collapsed.
Click to expand it.
src/spherocylinders/spherocylinder_common.jl
+
0
−
32
View file @
f832c4a0
...
...
@@ -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
.
eφ
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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment