Class PBC

java.lang.Object
org.opensourcephysics.numerics.PBC

public class PBC extends Object
Implements methods to support periodic boundary condtions.
Author:
W. Christian
  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    position(double r, double size)
    Adjusts the postion of a particle assuming peridoic boundary conditions.
    static int
    position(int r, int size)
    Adjusts the postion of a particle assuming peridoic boundary conditions.
    static double
    separation(double dr, double size)
    Computes the minimum separation using periodic boundary conditions.
    static int
    separation(int dr, int size)
    Computes the minimum separation using periodic boundary conditions.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • position

      public static double position(double r, double size)
      Adjusts the postion of a particle assuming peridoic boundary conditions. The postion will be in the interval [0,size).
      Parameters:
      r - double
      size - double
      Returns:
      double
    • position

      public static int position(int r, int size)
      Adjusts the postion of a particle assuming peridoic boundary conditions. The postion will be in the interval [0,size).
      Parameters:
      r - int
      size - int
      Returns:
      int
    • separation

      public static double separation(double dr, double size)
      Computes the minimum separation using periodic boundary conditions.
      Parameters:
      dr - double the separation
      size - double the box size
      Returns:
      double
    • separation

      public static int separation(int dr, int size)
      Computes the minimum separation using periodic boundary conditions.
      Parameters:
      dr - int the separation
      size - int the box size
      Returns:
      int