Universe

class Universe(object)

The universe is a top level singleton object, and is automatically initialized when the simulator loads. The universe is a representation of the physical universe that we are simulating, and is the repository for all phyical object representations.

All properties and methods on the universe are static, and you never actually instantiate a universe.

Universe has a variety of properties such as boundary conditions, and stores all the physical objects such as particles, bonds, potentials, etc..

static bind(thing, a, b)
kinetic_energy

A read-only attribute that returns the total kinetic energy of the system

Type:double
dt

Get the main simulation time step.

Type:double
time

Get the current simulation time

temperature

Get / set the universe temperature.

The universe can be run with, or without a thermostat. With a thermostat, getting / setting the temperature changes the temperture that the thermostat will try to keep the universe at. When the universe is run without a thermostat, reading the temperature returns the computed universe temp, but attempting to set the temperature yields an error.

boltzmann_constant

Get / set the Boltzmann constant, used to convert average kinetic energy to temperature

particles

List of all the particles in the universe. A particle can be removed from the universe using the standard python del syntax

del Universe.particles[23]
Type:list
dim

Get / set the size of the universe, this is a length 3 list of floats. Currently we can only read the size, but want to enable changing universe size.

Type:Vector3
static start()

Starts the universe time evolution, and advanced the universe forward by timesteps in dt. All methods to build and manipulate universe objects are valid whether the universe time evolution is running or stopped.

static stop()

Stops the universe time evolution. This essentially freezes the universe, everythign remains the same, except time no longer moves forward.

static step(until=None, dt=None)

Performs a single time step dt of the universe if no arguments are given. Optionally runs until until, and can use a different timestep of dt.

Parameters:
  • until – runs the timestep for this length of time, optional.
  • dt – overrides the existing time step, and uses this value for time stepping, optional.