35 #ifndef AIMS_POINTS_DISTRIBUTION_POINTS_DISTRIBUTION_H
36 #define AIMS_POINTS_DISTRIBUTION_POINTS_DISTRIBUTION_H
100 typedef std::map<unsigned, std::set<unsigned> >
LinkSet;
199 double step = 0.01 );
Utility function for sphere_distribution.
virtual Point3df force(const Point3df &p1, const Point3df &p2, bool has_link)
Force between 2 points.
virtual ~CoulombAndRestoringForce()
CoulombAndRestoringForce()
virtual double energy(const Point3df &p1, const Point3df &p2, bool has_link)
Energy of the force between 2 points.
Utility function for sphere_distribution.
virtual double energy(const Point3df &p1, const Point3df &p2, bool has_link)
Coulomb energy of the force between 2 points (1/r)
virtual Point3df force(const Point3df &p1, const Point3df &p2, bool has_link)
Coulomb electrostatic force between 2 points (r_vec/r^3)
Utility force class for sphere_distribution.
virtual double energy(const Point3df &p1, const Point3df &p2, bool has_link)=0
Energy of the force between 2 points.
virtual Point3df force(const Point3df &p1, const Point3df &p2, bool has_link)=0
Force between 2 points.
Utility function for sphere_distribution.
virtual ~MoveConstraints()
virtual Point3df position(const Point3df &pt, const Point3df &f, double step)
The default is unconstrained: just move the requested amount.
Move point constrained to a uinit sphere: project the force to be tangent to the sphere,...
virtual Point3df position(const Point3df &pt, const Point3df &f, double step)
The default is unconstrained: just move the requested amount.
Points repartition using forces in a given geometry (on a sphere for instance).
PointsDistribution(ForceFunction *force=new CoulombForce, MoveConstraints *move_constraint=new SphereMove)
Constructor.
PointSet * distribute(unsigned npoints, unsigned nsteps=100, double step=0.01)
Same as above but point are randomly initialized on a sphere, using the init_points() function.
void setForceFunction(ForceFunction *force)
Set the individual force function.
std::vector< Point3df > PointSet
void set_links(const LinkSet &links)
Set linked points set.
PointSet * get_forces(const PointSet &pts)
PointSet * distribute(const PointSet &pts, unsigned nsteps=100, double step=0.01)
get a points distribution on a sphere.
std::map< unsigned, std::set< unsigned > > LinkSet
void setMoveConstraints(MoveConstraints *move_constaint)
Set the individual move constraints function.
static PointSet init_points(unsigned npoints)
Randomly initialize npoints points on a unit sphere.
double get_coulomb_energy(const PointSet &pts)