Class ToroidalBoundaryStrategy

Class ToroidalBoundaryStrategy#

Inheritance Relationships#

Base Type#

Class Documentation#

class ToroidalBoundaryStrategy : public BoundaryStrategy

Implements the methods for toroidal boundary conditions.

The simulation area is assumed to have periodic boundary conditions at x = side_x, y = side_y.

Public Functions

inline ToroidalBoundaryStrategy(double side_x, double side_y)
inline ~ToroidalBoundaryStrategy()
virtual double distance(const Point &p1, const Point &p2) override

Calculates the shortest periodic distance between two points.

Parameters:
  • p1[in] first point

  • p2[in] second point

Returns:

The shortest distance between the points.

virtual Point relative_pos(const Point &p1, const Point &p2) override

Returns the relative position of the second point to the first.

Parameters:
  • loc1[in] point 1

  • loc2[in] point 2

Returns:

The relative coordinates of the second point.