Browse Source

[flags] allow for explicit treatment of mt force

Gaspard Jankowiak 9 months ago
parent
commit
5eba9fd01e
3 changed files with 16 additions and 10 deletions
  1. 1
    0
      src/CellSim.jl
  2. 1
    0
      src/CellSimCommon.jl
  3. 14
    10
      src/Centrosome.jl

+ 1
- 0
src/CellSim.jl View File

@@ -163,6 +163,7 @@ function read_config(config_filename::String)
163 163
           y_flags["nucleus"],
164 164
           y_flags["weighted_confinement"],
165 165
           y_flags["force_cortex_area"],
166
+          get(y_flags, "explicit_mt_force", false),
166 167
 
167 168
           # scheme/solver options
168 169
           y_flags["innerloop"],

+ 1
- 0
src/CellSimCommon.jl View File

@@ -102,6 +102,7 @@ mutable struct Flags
102 102
     nucleus::Bool
103 103
     weighted_confinement::Bool
104 104
     force_cortex_area::Bool
105
+    explicit_mt_force::Bool
105 106
 
106 107
     # scheme/solver options
107 108
     innerloop::Bool

+ 14
- 10
src/Centrosome.jl View File

@@ -261,21 +261,25 @@ function assemble_system(P::CSC.Params, F::CSC.Flags,
261 261
     # = -k ∫ |X(s)-Xc^(-(α+1)) [ (α+1)|X(s)-Xc|^-¹ (X(s)-Xc)⊗(X(s)-Xc) - I₂ ] δXc |Π_MT^-¹'| ds
262 262
 
263 263
     # |X(s) - Xc|
264
-    norm_nodes = abs.(CSC.@entry_norm(vr.nodes[1:vr.n,:]))
265
-
266
-    diff_mt_force_col_1 = -k*norm_nodes[1:vr.n,:].^p .* (((-p).*vr.nodes[1:vr.n,1].*vr.nodes[1:vr.n,:]./norm_nodes[1:vr.n,:]
267
-                                                                 - repeat([1 0], vr.n))
268
-                                                                + (2 ./norm_nodes[1:vr.n,:].^2 .*vr.nodes[1:vr.n,1]) .* vr.nodes[1:vr.n,:])
269
-    diff_mt_force_col_2 = -k*norm_nodes[1:vr.n,:].^p .* (((-p).*vr.nodes[1:vr.n,2].*vr.nodes[1:vr.n,:]./norm_nodes[1:vr.n,:]
270
-                                                                 - repeat([0 1], vr.n))
271
-                                                                + (2 ./norm_nodes[1:vr.n,:].^2 .*vr.nodes[1:vr.n,2]) .* vr.nodes[1:vr.n,:])
264
+    if !F.explicit_mt_force
265
+        norm_nodes = abs.(CSC.@entry_norm(vr.nodes[1:vr.n,:]))
266
+
267
+        diff_mt_force_col_1 = -k*norm_nodes[1:vr.n,:].^p .* (((-p).*vr.nodes[1:vr.n,1].*vr.nodes[1:vr.n,:]./norm_nodes[1:vr.n,:]
268
+                                                                     - repeat([1 0], vr.n))
269
+                                                                    + (2 ./norm_nodes[1:vr.n,:].^2 .*vr.nodes[1:vr.n,1]) .* vr.nodes[1:vr.n,:])
270
+        diff_mt_force_col_2 = -k*norm_nodes[1:vr.n,:].^p .* (((-p).*vr.nodes[1:vr.n,2].*vr.nodes[1:vr.n,:]./norm_nodes[1:vr.n,:]
271
+                                                                     - repeat([0 1], vr.n))
272
+                                                                    + (2 ./norm_nodes[1:vr.n,:].^2 .*vr.nodes[1:vr.n,2]) .* vr.nodes[1:vr.n,:])
273
+    end
272 274
 
273 275
     # ∫ F_MT
274 276
     b_ce_n[1:2] = integrate_θ(plotables.mt_force_indiv, qw, vr)
275 277
 
276 278
     # ∫ F_MT'
277
-    A[1:2,1] += -vec(P.δt*integrate_θ(diff_mt_force_col_1, qw, vr))
278
-    A[1:2,2] += -vec(P.δt*integrate_θ(diff_mt_force_col_2, qw, vr))
279
+    if !F.explicit_mt_force
280
+        A[1:2,1] += -vec(P.δt*integrate_θ(diff_mt_force_col_1, qw, vr))
281
+        A[1:2,2] += -vec(P.δt*integrate_θ(diff_mt_force_col_2, qw, vr))
282
+    end
279 283
 
280 284
     #  - k_MT ∫ ds/dt ∂_s Xθ^n
281 285
     b_ce_n[1:2] +=  - P.k_MT*reshape(integrate_θ(vr.M_inter*reshape(plotables.transport_force, P.N, 2), qw, vr), 2, 1)

Loading…
Cancel
Save