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 | Static Public Member Functions
PointsOnSphere Class Reference

## Detailed Description

Todo:
  we could replace here the Coulomb repulsive interaction by a linear force

The number of points is arbitrary, see http://mathworld.wolfram.com/SphericalCode.html
Algorithm:

1. The points are distributed randomly on the sphere
2. A 1/r^3 repulsive force is assumed for all points, to which corresponds a certain potential energy in 1/r^2
3. New positions are calculated form the current one, the forces and an adjustable scaling factor: dx = scale * ( force at x )
4. The potential energy of the new configuration is calculated, and:
   - If the total energy is lower, the move is accepted and the scaling factor is increased,
   - If the energy is higher, the move is rejected and the scaling factor is reduced.

The procedure (steps 2-4) is continues until convergence.
The main method is the class constructor, or equivalently distributePoints(), which take the number of points as argument and makes the calculation. Points coordinates can then be retrieved using either:

- copyPositionsForAllPoints()
- copyCoordinatesOfPoint()

Author
  F. Nedelec, created August 2002, last modified October 10, 2002

## Public Member Functions
| PointsOnSphere ()
| default constructor, does nothing
| PointsOnSphere (int nbp)
| constructor that also calls distributePoints(),
virtual | ~PointsOnSphere ()
| default destructor
unsigned int | nbPoints ()
| number of points in the configuration
real | finalEnergy ()
| the 'virtual' total energy of the configuration
real | minimumDistance ()
| minimum distance in the configuration, in 3D space
void | scale (real factor)
| multiply all coordinates by the given factor
const real * | addr (const unsigned int ii) const
| address where the coordinates for point ii are
void | copyCoordinatesOfPoint (real x[3], unsigned int ii)
| copy the coordinates from point ii onto the given 3-dim array x
void | copyCoordinatesOfPoint (real *x, real *y, real *z, unsigned int ii)
| copy the coordinates from point ii onto x,y,z
void | copyPositionsForAllPoints (real x[])
| copy the array points coordinates onto the given array x
void | printAllPositions (FILE *file=stdout)
| write points coordinates
int | distributePoints (unsigned int nbp, real precision=1e-4)
| distribute the nbp points on the sphere and store their coordinates

## Static Public Member Functions
static real | expectedDistance (int)
| expected distance between neighboring points More...

## Member Function Documentation

real expectedDistance | ( | int | n | ) |
| static

With N points on the sphere according to a triagular lattice, each of ~2N triangles should occupy an area of S = 4*PI/2*N, and the distance between points should be ~2 * sqrt(S/sqrt(3)).