Cytosim PI Cytoskeleton Simulator

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

List of all members | Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions
Fiber Class Reference

## Detailed Description

A Fiber is a Mecable that can be simulated.

- FiberProp * prop points to the physical properties (ie. parameters) of the Fiber.
- frBinders keeps track of all attached FiberBinders.
- frRods provides pointers to the Segments of the Fiber.
- FiberDisp * disp points to display parameters.

Fibers are stored in a FiberSet.

Inheritance diagram for Fiber:

## Public Member Functions
| Fiber (FiberProp const *)
| constructor More...
virtual | ~Fiber ()
| destructor
virtual unsigned int | allocatePoints (unsigned int nbp)
| allocate memory for 'nbp' points
void | setDragCoefficient ()
| calculate viscous drag coefficient More...
void | prepareMecable ()
| prepare for Meca
void | setInteractions (Meca &) const
| add interactions to a Meca
void | sever (real abs)
| cut fiber at abscissa abs from the ORIGIN, in the next time step
void | cutAlongPlane (FiberSet *, Vector const &n, real a)
| Cut all segments intersecting the plane defined by n.x + a = 0
virtual void | join (Fiber *fib)
| call FiberNaked::join(), and transfer Hands (caller should delete fib).
virtual void | step ()
| simulation step
FiberLocus & | segment (unsigned int p) const
| FiberLocus representing the segment [p, p+1].
real | projectPoint (Vector const &w, real &dist) const
| return the abscissa of the closest position to `w` on this Fiber, and set dist to the square of the distance
virtual int | dynamicState (FiberEnd which) const
| return assembly/disassembly state of the FiberEnd
virtual void | setDynamicState (FiberEnd which, int new_state)
| change state of FiberEnd which to new_state
virtual real | freshAssembly (FiberEnd which) const
| the amount of freshly assembled polymer during the last time step (this has units of length)
bool | isGrowing (FiberEnd which) const
| true if the tip which has grown in the last time step ( freshAssembly(which) > 0 )
bool | isShrinking (FiberEnd which) const
| true if the tip which has shrunk in the last time step ( freshAssembly(which) < 0 )
void | addBinder (FiberBinder *)
| register a new Binder
void | removeBinder (FiberBinder *)
| unregister bound Binder
FiberBinder * | firstBinder () const
| a FiberBinder bound to this fiber (use ->next() to access all other binders)
void | updateBinders ()
| update all binders
void | detachBinders ()
| detach all binders
int | nbBinders () const
| number of attached FiberBinders
int | nbBindersInRange (real aMin, real aMax, FiberEnd from) const
| number of attached FiberBinders in a range of abscissa More...
int | nbBindersNearEnd (real len, FiberEnd which) const
| number of attached FiberBinders at the specified FiberEnd
int | nbBinders (unsigned int(*count)(FiberBinder const &)) const
| a function to count binders using custom criteria
void | setGlue1 (Single *glue, FiberEnd which, const Space *space)
| set the box glue for pure pushing More...
void | setGlue2 (Single *glue, FiberEnd which, const Space *space)
| set the box glue for pure pulling More...
void | setGlue3 (Single *glue, FiberEnd which, const Space *space)
| set the box glue for pushing and pulling More...
void | setGlue (Single *&glue, FiberEnd which, const Space *space, int glue_type)
| a setGlue to rule them all
Fiber * | next () const
| a static_cast<> of Node::next()
Fiber * | prev () const
| a static_cast<> of Node::prev()
Tag | tag () const
| return unique character identifying the class
const Property * | property () const
| return Object Property
void | write (OutputWrapper &) const
| write to file
void | read (InputWrapper &, Simul &)
| read from file
Public Member Functions inherited from RigidFiber
| RigidFiber ()
| Constructor.
| RigidFiber (RigidFiber const &)
| copy constructor
RigidFiber & | operator= (RigidFiber const &)
| copy assignment
virtual | ~RigidFiber ()
| Destructor.
virtual unsigned | allocatePoints (unsigned nbp)
| sets the number of points in the Fiber
real | lagrange (unsigned p) const
| Lagrange multiplier for segment p.
real | tension (unsigned p) const
| longitudinal force along segment p (positive=extension, negative=compression)
real | dragCoefficient () const
| total drag-coefficient of object (force = drag * speed)
real | pointMobility () const
| mobility of one point
void | makeProjection ()
| prepare for projection
void | projectForces (const real *X, real *Y, real s, real *work) const
| apply the projection: Y <- s * P * X More...
void | makeProjectionDiff (const real *)
| prepare the correction to the projection
void | addProjectionDiff (const real *, real *) const
| add the contribution from the projection correction
real | addBrownianForces (real *rhs, real sc) const
| add displacements due to the Brownian motion to rhs[] More...
void | setSpeedsFromForces (const real *X, real *Y, real, bool) const
| calculate the speeds from the forces, including projection More...
void | addRigidity (const real *X, real *Y) const
| add the rigidity force corresponding to configuration X into vector Y More...
void | addRigidityMatUp (Matrix &, int offset) const
| add rigidity terms into the matrix
Public Member Functions inherited from FiberNaked
| FiberNaked ()
| Constructor.
| ~FiberNaked ()
| Destructor.
void | setStraight (Vector const &pos, Vector const &dir)
| set position of MINUS_END and direction (length and Nb of points are not modified) More...
void | setStraight (Vector const &pos, Vector const &dir, FiberEnd ref)
| set position of 'ref' and direction of Fiber
void | setStraight (Vector const &pos, Vector const &dir, real len, FiberEnd ref)
| set position of 'ref', direction and length of Fiber
void | setShape (const real pts[], unsigned n_pts, unsigned np)
| import shape from the given array of size DIM*n_pts, and create a shape with np points More...
PointExact | exactEnd (FiberEnd) const
| exact representation of given end
PointInterpolated | interpolateEnd (FiberEnd) const
| interpolation representing a given end (CENTER is also a valid argument)
PointInterpolated | interpolateCenter () const
| interpolation representing a given end
PointInterpolated | interpolateMinusEnd () const
| interpolation representing the MINUS_END
PointInterpolated | interpolatePlusEnd () const
| interpolation representing the PLUS_END
PointInterpolated | interpolate (real ab) const
| interpolation of the site specified by its distance from the ORIGIN More...
PointInterpolated | interpolateM (real ab) const
| interpolation of the site specified from the MINUS_END More...
PointInterpolated | interpolate (real ab, FiberEnd from) const
| interpolation of a site specified by its distance from a FiberEnd
real | abscissaM () const
| signed distance from ORIGIN to MINUS_END (abscissa of MINUS_END)
real | abscissaP () const
| signed distance from ORIGIN to PLUS_END (abscissa of PLUS_END)
real | abscissaP (const real n) const
| signed distance from ORIGIN to given point or intermediate position
real | abscissa (FiberEnd end) const
| signed distance from the ORIGIN to the specified FiberEnd More...
real | abscissa (real ab, FiberEnd from) const
| converts abscissa from the specified FiberEnd, to abscissa from the ORIGIN More...
real | length () const
| the total length of the Fiber
bool | within (const real ab) const
| true if ( abscissaM() < ab < abscissaP() )
bool | withinP (const real ab) const
| true if abscissa is below abscissaP
bool | withinM (const real ab) const
| true if abscissa is above abscissaM
unsigned int | signature () const
| a random number which is used in speckle display
void | signature (unsigned int s)
| set signature
FiberEnd | whichEndDomain (real ab, real lambda) const
| calculate the domain in which ab is located (near a FiberEnd, or central) More...
Vector | pos (real ab) const
| position of a point specified by abscissa from the origin
Vector | posM (real ab) const
| position of a point specified by abscissa from the MINUS_END
Vector | pos (real ab, FiberEnd from) const
| position of a point specified by abscissa on the Fiber
Vector | posEnd (FiberEnd which) const
| position of a FiberEnd (CENTER is also a valid argument)
Vector | dirP (unsigned p) const
| normalized tangent vector to the fiber at given model point More...
Vector | dir (real ab) const
| normalized tangent vector to the fiber at given abscissa from the origin
Vector | dir (real ab, FiberEnd from) const
| normalized tangent vector to the fiber at given abscissa from given reference
Vector | dirEnd (FiberEnd which) const
| normalized tangent vector to the fiber at given end
real | projectedForceOnEnd (FiberEnd which) const
| dot-product (force/km on the end of the Fiber).(direction of Fiber growth) More...
void | segmentation (real c)
| set desired segmentation (the actual segmentation might be different)
real | segmentation () const
| the current segment length (distance between successive model-points)
real | segmentationCub () const
| returns segmentation() ^ 3
void | resegment (unsigned int nb_points)
| recalculate fiber to have nb_points model points More...
void | adjustSegmentation ()
| set the number of points to minimize abs( fnCut - fnCutWished ) More...
void | reshape ()
| re-establish the distance between successive model-points
void | getPoints (const real *x)
| set position
void | minMaxSegments (real &, real &) const
| calculate the minimum and maximum segment length More...
void | infoSegments (real &, real &) const
| calculate average and variance of the segment length More...
real | minCosinus () const
| the cosine of the maximum segment angle: indicate the errors due to curvature
unsigned | nbKinks (real threshold=0) const
| number of joints at which ( cosine(angle) < threshold ) More...
void | join (FiberNaked const *fib)
| merge two fibers by joining the PLUS_END of fib with the MINUS_END of this More...
void | growM (real dlen)
| increase/decrease length of Fiber by dlen, at the MINUS_END More...
void | addSegmentM ()
| add a segment of length segmentation() at the MINUS_END More...
void | cutM (real dlen)
| remove a piece of length dlen >= 0 at the MINUS_END More...
void | growP (real dlen)
| increase/decrease length of Fiber by dlen, at the PLUS_END More...
void | addSegmentP ()
| add a segment of length segmentation() at the MINUS_END More...
void | cutP (real dlen)
| remove a piece of length dlen >= 0 at the PLUS_END More...
void | setLength (real len, FiberEnd ref)
| adjust length without changing the position of ref
void | truncateM (unsigned int p)
| Remove all model points in [ 0, P-1 ], keep [ P, nbPoints() ].
void | truncateP (unsigned int p)
| Keep model points [ 0, p ], remove other points.
void | write (OutputWrapper &) const
| write to OutputWrapper
void | read (InputWrapper &, Simul &)
| read from InputWrapper More...
Public Member Functions inherited from PointSet
| PointSet ()
| Constructor.
| PointSet (const PointSet &)
| Copy constructor.
PointSet & | operator= (const PointSet &)
| Assignement operator.
virtual | ~PointSet ()
| Destructor.
virtual void | deallocatePoints ()
| free memory allocated by allocatePoints()
unsigned int | nbPoints () const
| Number of points.
unsigned int | lastPoint () const
| Index of the last point = nbPoints - 1.
unsigned int | nbSegments () const
| Number of segments = nbPoints - 1.
unsigned int | lastSegment () const
| Index of the last segment = nbPoints - 2.
Vector | posP (const unsigned p) const
| Position of point 'p' of the object.
real const * | addr () const
| Address of point p.
real const * | addrPoint (const unsigned p) const
| Address of point p.
void | setPoint (unsigned p, Vector const &w)
| Set position of point p to w.
void | nbPoints (const unsigned n)
| Set the number of points in the array.
unsigned int | addPoint (Vector const &w)
| Add a point, returning the array index that was used.
void | removePoint (unsigned int p)
| Remove a point from the array psPos, returns number of points remaining.
void | clearPoints ()
| Remove all points.
void | resetPoints ()
| Set all coordinates to zero (nicer for debug/testing)
void | addNoise (real amount)
| Add random noise uniformly to all coordinate (used for testing purposes)
virtual void | putPoints (real *) const
| copy current coordinates to argument
virtual void | getForces (const real *ptr)
| replace current forces by the ones provided
Vector | netForceP (const unsigned p) const
| Force on point p calculate by Brownian dynamics.
void | movePoint (const unsigned int p, Vector const &w)
| Shift point at index p by vector w.
Vector | diffPoints (const unsigned p) const
| Difference of two points = Q - P = vector PQ.
Vector | diffPoints (const unsigned int p, const unsigned int q) const
| Difference of two points = Q - P = vector PQ.
Vector | interpolatePoints (const unsigned int p, const unsigned int q, const real a) const
| Calculate intermediate position = P + a ( Q - P )
void | calculateMomentum (real[], bool divide=false)
| calculate first momentum of point coordinates More...
void | calculateMomentum (real[], real[], bool divide=false)
| calculate first and second momentum of point coordinates More...
virtual Vector | position () const
| Position of center of gravity. More...
virtual bool | translatable () const
| true if object accepts translations
virtual void | translate (Vector const &)
| Translate object (moves all the points by w)
virtual bool | rotatable () const
| true if object accepts translations
virtual void | rotate (Rotation const &)
| Rotate object by given rotation.
virtual void | foldPosition (const Modulo *)
| Modulo around the first point.
virtual void | foldPositionG (const Modulo *)
| Call modulo around the center of gravity.
void | write (OutputWrapper &) const
| Write to file.
void | read (InputWrapper &, Simul &)
| Read from file.
Public Member Functions inherited from Mecable
| Mecable ()
| The constructor resets the pointers.
virtual | ~Mecable ()
| Destructor de-allocates memory.
virtual Vector | posP (unsigned int P) const =0
| return position of point P
virtual void | putPoints (real[]) const =0
| copy current coordinates to provided array
virtual void | getPoints (const real[])=0
| replace current coordinates of points by values from the provided array
virtual Vector | netForceP (unsigned int p) const =0
| return Force on point p calculated at previous step by Brownian dynamics
virtual void | getForces (const real[])=0
| replace current forces by the ones provided
void | matIndex (Matrix::index_type index)
| Store the index where coordinates are located in Meca.
Matrix::index_type | matIndex () const
| Index in mB of the first point. the index in the vectors is DIM*matIndex() More...
bool | useBlock () const
| Tell Meca to use preconditionning on this object or not.
void | useBlock (bool b)
| change preconditionning flag
real * | allocateBlock (unsigned)
| Allocate a block of the requested size.
real * | block () const
| return allocated block
Public Member Functions inherited from Object
| Object ()
| constructor
std::string | reference () const
| concatenation of [ tag(), property()->index(), number() ] in plain ascii More...
void | writeReference (OutputWrapper &) const
| write a reference that identifies the Object uniquely More...
void | writeReference (OutputWrapper &, Tag tag) const
| write a reference, but using the provided Tag More...
int | mark () const
| birth mark value
void | mark (int m)
| set birth mark
int | fleck () const
| fleck value (not stored in trajectory files)
void | fleck (int f) const
| set fleck (the value is not stored in trajectory files)
Object * | next () const
| extends Node::next(), with a cast to preserve type
Object * | prev () const
| extends Node::prev(), with a cast to preserve type
Public Member Functions inherited from Node
| Node ()
| constructor set as unlinked
virtual | ~Node ()
| destructor More...
bool | linked () const
| true if Node is linked
Node * | next () const
| the next Node in the list, or zero if this is last
Node * | prev () const
| the previous Node in the list, or zero if this is first
NodeList * | list () const
| the list where the object is linked, or zero
ObjectSet * | objset () const
| return associated ObjectSet
Public Member Functions inherited from Inventoried
| Inventoried ()
| initialize (name=0)
| ~Inventoried ()
| destructor
void | number (Number n)
| change the serial number
Number | number () const
| serial number : a integer identifier, unique within each class
Public Member Functions inherited from Movable
| Movable ()
| constructor
virtual | ~Movable ()
| destructor
virtual void | setPosition (Vector const &)
| move object to specified position More...
virtual void | rotateP (Rotation const &)
| rotate the object around its current position More...
Public Member Functions inherited from Buddy
virtual | ~Buddy ()
| upon destruction, goodbye is called for all buddies
void | hello (Buddy *b)
| will make this and b mutual buddies
virtual void | goodbye (Buddy *)
| this is called everytime a known buddy is destroyed
Buddy * | buddy (unsigned int ix) const
| return buddy at index ix
void | buddy (Buddy *b, unsigned int ix)
| replace the buddy that may have been at index ix

## Public Attributes
FiberProp const * | prop
| the Property of this object
LineDisp mutable * | disp
| the display parameters

## Static Public Attributes
static const Tag | TAG = 'f'
| a unique character identifying the class
Static Public Attributes inherited from Object
static const Tag | TAG = 'v'
| Object::TAG = 'v' represents the 'void' pointer.

## Protected Member Functions
virtual Fiber * | severM (real abs)
| cut fiber at distance abs from the MINUS_END; returns section [ abs - PLUS_END ] More...
Fiber * | severNow (real abs)
| cut fiber at abscissa abs from the ORIGIN; returns section [ abs - PLUS_END ]
void | delayedSevering ()
| cut fiber at absicca given to sever() More...
virtual Fiber * | severPoint (unsigned int pti)
| cut Fiber at point pti, return section [ pti - PLUS_END ] More...
void | severKinkedFibers (FiberSet *set)
| cut fiber at points where consecutive segments make a kink More...
real | dragCoefficientSurface ()
| viscous drag coefficient for a cylinder moving close to a surface More...
real | dragCoefficientVolume ()
| viscous drag coefficient for a cylinder moving close to a surface More...
Protected Member Functions inherited from RigidFiber
void | storeDifferences ()
| calculate the average difference of successive model-point in rfDiff[] More...

## Additional Inherited Members
Static Public Member Functions inherited from PointSet
static Vector | diffPoints (const real *src, const unsigned p)
| Difference of two points = P+1 - P.
Static Public Member Functions inherited from Object
static std::string | strReference (char, int, Number, int)
| build a string reference by concatenating (tag, property_index, number, mark) More...
static void | readReference (InputWrapper &, int &, Number &, int &, char pretag)
| read a reference (property_index, number, mark) from input More...
static void | writeNullReference (OutputWrapper &)
| write a reference that does not refer to any Object
Static Public Member Functions inherited from Movable
static Vector | readPrimitive (std::istream &, const Space *)
| read a position specified with primitives, such as 'circle 5', etc. More...
static Vector | readPosition (std::istream &, const Space *)
| read a position in space More...
static Vector | readDirection (std::istream &, const Vector &, const Space *)
| read an orientation, and return a normalized vector More...
static Rotation | readRotation (std::istream &, const Vector &, const Space *)
| read a rotation specified in is, at position pos More...
Protected Attributes inherited from RigidFiber
real | rfMobility
| mobility of the points More...
real | rfRigidity
| rigidity scaling factor used in addRigidity()
Protected Attributes inherited from PointSet
real * | psPos
| psPos[] of size DIM*psAllocated contains DIM*psSize point-coordinates
real const * | psFor
| psFor[] of size DIM*psAllocated contains DIM*psSize force-coordinates
Vector | psCenter
| Center of gravity calculed in calculatePosition()
Protected Attributes inherited from Node
Node * | nNext
| the next Node in the list
Node * | nPrev
| the previous Node in the list
Protected Attributes inherited from Inventoried
Number | nNumber
| object identifier, unique within the class defined by tag()

## Constructor & Destructor Documentation

Fiber | ( | FiberProp const * | p | ) |

The rest of the initialization is done in FiberProp::newFiber(), and other newFiber() functions where the initial length is known.

## Member Function Documentation

void delayedSevering | ( |  | ) |
| protected

Performs the delayed severing events. This is called at the end of the time-step. Multiple cuts can occur. Fiber parts are added to set.

real dragCoefficientSurface | ( |  | ) |
| protected

Fiber::setDragCoefficientSurface() uses a formula calculated by F. Gittes in:
Hunt et al. Biophysical Journal (1994) v 67 pp 766-781
http://dx.doi.org/10.1016/S0006-3495(94)80537-5

It applies to a cylinder moving parallel to its axis and near an immobile surface:

drag-per-unit-length = 2 &pi &eta / acosh(h/r)

With:

- r = cylinder radius,
- h = distance between cylinder bottom and surface,
- &eta = viscosity of the fluid.

If the cylinder is exactly touching the surface, `h=0` and the drag coefficient is infinite.

The drag coefficient for motion perpendicular to the cylinder axis would be twice higher, but for gliding assays, the parallel drag coefficient is the appropriate choice.

Note that this is usually equivalent to the approximate formula:

drag-per-unit-length = 2 &pi &eta / log(2*h/r)

because `acosh(x) = ln[ x + sqrt(x^2-1)) ] ~ ln[2x] if x >> 1`

Hunt et al. also credit this reference for the formula:
The slow motion of a cylinder next to a plane wall. Jeffrey, D.J. & Onishi, Y. (1981) Quant. J. Mech. Appl. Math. 34, 129-137.

real dragCoefficientVolume | ( |  | ) |
| protected

Fiber::setDragCoefficientVolume() calculates the mobility for the entire fiber, considering that the cylinder is straight and moving in a infinite fluid. fiber:hydrodynamic_radius[1] is a hydrodynamic cutoff that makes the drag coefficient proportional to length for length longer than the cutoff.

The formula for a cylinder is taken from:
Tirado and de la Torre. J. Chem. Phys 71(6) 1979
http://link.aip.org/link/doi/10.1063/1.438613

We calculate the translational drag coefficient averaged over all possible configurations:

cylinder_drag = 3*PI*length*viscosity / ( log(length/diameter) + 0.312 )

If the length is shorter than the diameter, the formula above fails and may even give negative result. Hence we also calculate the drag of a sphere with the same radius as the cylinder:

sphere_drag = 6*PI*visc*R

We use the maximum of these two coefficients.

int nbBindersInRange | ( | real | aMin,
|  | real | aMax,
|  | FiberEnd | from
| ) |  | const

Todo:
  : Convert aMin and aMax instead of converting each Binder abscissa

void setDragCoefficient | ( |  | ) |
| virtual

Calculate drag coefficient from two possible formulas

if ( fiber:surface_effect )
setDragCoefficientSurface();
else
setDragCoefficientVolume();

Implements Mecable.

void setGlue1 | ( | Single * | glue,
|  | FiberEnd | which,
|  | const Space * | space
| ) |  |

setGlue1 creates a pushing force from the cortex

void setGlue2 | ( | Single * | glue,
|  | FiberEnd | which,
|  | const Space * | space
| ) |  |

setGlue2 creates a pulling force from the cortex

void setGlue3 | ( | Single * | glue,
|  | FiberEnd | which,
|  | const Space * | space
| ) |  |

setGlue3 creates pulling and pushing force from the cortex

void severKinkedFibers | ( | FiberSet * | set | ) |
| protected

This function tests the angle between consecutive segments on the Fiber. The Fiber is severed at points where the angle is such that ( cosine < 0 ), ie. if the angle 90 degrees or less. Multiple cuts can occur. Fiber parts are added to set.

Fiber * severM | ( | real | abs | ) |
| protected virtual

The Fiber is cut at distance abs from its MINUS_END:

- current Fiber is truncated to keep only the section [ MINUS_END - abs ]
- A new Fiber is created from the section [ abs - PLUS_END ],
- all FiberBinder attached to the section are transfered to the new Fiber,
- a pointer to the new Fiber is returned, and it should be added to the Simul

The return value is zero, if `abs` is not within the valid range of abscissa.

Reimplemented in DynamicFiber, ClassicFiber, Tubule, and TreadmillingFiber.

Fiber * severPoint | ( | unsigned int | pti | ) |
| protected virtual

The Fiber is cut at point P

- A new Fiber is created from the section [ P - PLUS_END ],
- all FiberBinder attached to this section are transferred to the new Fiber,
- a pointer to the new Fiber is returned, which should be added to the Simul

Returns
  zero, if `pti` is not an internal point