src/filament/make_fila.jl

MEDYAN.make_fila!

make_fila!(c::Context;
    type=1,
    mono_states,
    node_mids,
    node_positions,
)::Tag{FilaTipIdx}

Return the tag of the plus tip of the new filament. Error if the filament isn’t initially at least 2 monomers long. Newly added filaments can’t be selected from nearby monomers until after minimization.

Keyword Arguments

  • type=1: filament type id or symbol.
  • mono_states: Collection of the MonomerState or Symbol of the monomers in the new filament. In order from minus end to plus end. length(mono_states)>1
  • node_positions: Collection of SVector{3,Float64}. The positions of the nodes, monomers are between nodes. The filament is straight between consecutive nodes, and the monomers between them are evenly spaced. The first node is at the minus end of the first monomer, and the last node is at the plus end of the last monomer. So for a straight filament at its rest length, the end nodes are length(mono_states)*spacing apart. The nodes don’t need to be at chem cylinder boundaries; the chem beads are interpolated between them. fila_node_positions returns node positions in this format.
  • node_mids: Collection of Integer. The monomer ids at (slightly plus side of) the node_positions. The monomer id with parenthesis (M) below will be in node_mids. node_mids[begin] is the id of the first monomer. It can be any integer; the chem cylinder boundaries are at monomer ids that are multiples of numpercylinder. Usually length(node_mids) == length(node_positions) - 1, because the id at the last node is implied. It can also include that id, node_mids[begin] + length(mono_states), as the last element, so length(node_mids) == length(node_positions). fila_node_mids returns this form.
                               |
                    -----+-----|-----+-----
minus end <----       M  |  M  | (M) |  M        ----> plus end
                    -----+-----|-----+-----
                               |
                               ^ A node_position is indicated by the line.
  • minus_end_mat_dir=nothing: SVector{3,Float64}. The mat direction of the minus end node.
  • joint_twists=nothing: Collection ofFloat64`. The extra material frame axial rotation at the joints between the cylinders.
  • tip_load_forces=(0.0=>0.0): tip load forces, usually don’t use this, because load forces will automatically get updated at the next minimization.
  • minus_tip_extension=0.0: tip extension for the minus end in monomer spacings. 0=monomer center. See fila_tip_extension.
  • plus_tip_extension=0.0: tip extension for the plus end in monomer spacings. 0=monomer center. See fila_tip_extension.

Example

A straight filament of 3 monomers along the x axis, with its minus end node at the origin, where spacing is the monomer spacing of the filament type:

make_fila!(c; mono_states=[:a, :a, :a], node_mids=[0], node_positions=[SA[0.0, 0, 0], SA[3*spacing, 0, 0]])

The monomer centers are at x = 0.5*spacing, 1.5*spacing, and 2.5*spacing. With the default zero tip extensions, the tips are at the end monomer centers, x = 0.5*spacing and x = 2.5*spacing, half a spacing inside the end nodes.