Tissue Forge C++ 0.2.1
Interactive, particle-based physics, chemistry and biology modeling and simulation environment
Loading...
Searching...
No Matches
TissueForge::Universe Struct Reference

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 physical object representations. More...

#include <tfUniverse.h>

Collaboration diagram for TissueForge::Universe:

Public Types

enum  Flags { RUNNING = 1 << 0 , SHOW_PERF_STATS = 1 << 1 , IPYTHON_MSGLOOP = 1 << 2 , POLLING_MSGLOOP = 1 << 3 }
 

Static Public Member Functions

static FVector3 dim ()
 Gets the dimensions of the universe.
 
static FloatP_t volume ()
 Gets the volume of the universe.
 
static std::string getName ()
 Get the name of the model / script.
 
static FMatrix3virial (FVector3 *origin=NULL, FloatP_t *radius=NULL, std::vector< ParticleType * > *types=NULL)
 Computes the virial tensor for the either the entire simulation domain, or a specific local virial tensor at a location and radius. Optionally can accept a list of particle types to restrict the virial calculation for specify types.
 
static FVector3 getCenter ()
 
static HRESULT step (const FloatP_t &until=0, const FloatP_t &dt=0)
 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.
 
static HRESULT stop ()
 Stops the universe time evolution. This essentially freezes the universe, everything remains the same, except time no longer moves forward.
 
static HRESULT 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 HRESULT reset ()
 
static Universeget ()
 
static ParticleList particles ()
 Gets all particles in the universe.
 
static std::vector< int32_t > particleIds ()
 Gets all particles in the universe.
 
static void resetSpecies ()
 Reset all species in all particles.
 
static std::vector< std::vector< std::vector< ParticleList > > > grid (iVector3 shape)
 Gets a three-dimesional array of particle lists, of all the particles in the system.
 
static std::vector< BondHandlebonds ()
 Get all bonds in the universe.
 
static std::vector< AngleHandleangles ()
 Get all angles in the universe.
 
static std::vector< DihedralHandledihedrals ()
 Get all dihedrals in the universe.
 
static FloatP_t getTemperature ()
 Get the universe temperature.
 
static FloatP_t getTime ()
 Get the current time.
 
static FloatP_t getDt ()
 Get the period of a time step.
 
static event::EventListgetEventList ()
 
static BoundaryConditionsgetBoundaryConditions ()
 
static FloatP_t getKineticEnergy ()
 Get the current system kinetic energy.
 
static int getNumTypes ()
 Get the current number of registered particle types.
 
static FloatP_t getCutoff ()
 Get the global interaction cutoff distance.
 
static unsigned int getNumFluxSteps ()
 Get the number of flux steps per simulation step.
 

Public Attributes

bool isRunning = false
 
event::EventBaseListevents
 
std::string name
 

Detailed Description

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 physical 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.

Member Function Documentation

◆ dim()

static FVector3 TissueForge::Universe::dim ( )
static

Gets the dimensions of the universe.

Returns
FVector3

◆ getBoundaryConditions()

static BoundaryConditions * TissueForge::Universe::getBoundaryConditions ( )
static

Universe boundary conditions

◆ getCenter()

static FVector3 TissueForge::Universe::getCenter ( )
static

Center of the universe

◆ getTemperature()

static FloatP_t TissueForge::Universe::getTemperature ( )
static

Get the universe temperature.

The universe can be run with, or without a thermostat. With a thermostat, getting / setting the temperature changes the temperature 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.

◆ grid()

static std::vector< std::vector< std::vector< ParticleList > > > TissueForge::Universe::grid ( iVector3 shape)
static

Gets a three-dimesional array of particle lists, of all the particles in the system.

Parameters
shapeshape of grid

◆ step()

static HRESULT TissueForge::Universe::step ( const FloatP_t & until = 0,
const FloatP_t & dt = 0 )
static

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
untilperiod to execute, in units of simulation time (default executes one time step).
dtoverrides the existing time step, and uses this value for time stepping; currently not supported.

◆ virial()

static FMatrix3 * TissueForge::Universe::virial ( FVector3 * origin = NULL,
FloatP_t * radius = NULL,
std::vector< ParticleType * > * types = NULL )
static

Computes the virial tensor for the either the entire simulation domain, or a specific local virial tensor at a location and radius. Optionally can accept a list of particle types to restrict the virial calculation for specify types.

Parameters
originAn optional length-3 array for the origin. Defaults to the center of the simulation domain if not given.
radiusAn optional number specifying the size of the region to compute the virial tensor for. Defaults to the entire simulation domain.
typesAn optional list of :class:Particle types to include in the calculation. Defaults to every particle type.

◆ volume()

static FloatP_t TissueForge::Universe::volume ( )
static

Gets the volume of the universe.

Returns
FloatP_t

The documentation for this struct was generated from the following file: