Tissue Forge C 0.2.1
Interactive, particle-based physics, chemistry and biology modeling and simulation environment
Loading...
Searching...
No Matches
tfCUniverse.h File Reference
#include "tf_port_c.h"
#include "tfCParticle.h"
#include "tfCBoundaryConditions.h"
Include dependency graph for tfCUniverse.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  tfUniverseConfigHandle
 Handle to a UniverseConfig instance. More...
 

Functions

HRESULT tfUniverse_getDim (tfFloatP_t **dim)
 Get the dimensions of the universe.
 
HRESULT tfUniverse_getIsRunning (bool *isRunning)
 Get whether the universe is running.
 
HRESULT tfUniverse_getName (char **name, unsigned int *numChars)
 Get the name of the model / script.
 
HRESULT tfUniverse_getVirial (tfFloatP_t **virial)
 Get the virial tensor of the universe.
 
HRESULT tfUniverse_getVirialT (struct tfParticleTypeHandle **phandles, unsigned int numTypes, tfFloatP_t **virial)
 Get the virial tensor of the universe for a set of particle types.
 
HRESULT tfUniverse_getVirialO (tfFloatP_t *origin, tfFloatP_t radius, tfFloatP_t **virial)
 Get the virial tensor of a neighborhood.
 
HRESULT tfUniverse_getVirialOT (struct tfParticleTypeHandle **phandles, unsigned int numTypes, tfFloatP_t *origin, tfFloatP_t radius, tfFloatP_t **virial)
 Get the virial tensor for a set of particle types in a neighborhood.
 
HRESULT tfUniverse_getNumParts (unsigned int *numParts)
 Get the number of particles in the universe.
 
HRESULT tfUniverse_getParticle (unsigned int pidx, struct tfParticleHandleHandle *handle)
 Get the i'th particle of the universe.
 
HRESULT tfUniverse_getCenter (tfFloatP_t **center)
 Get the center of the universe.
 
HRESULT tfUniverse_step (tfFloatP_t until, tfFloatP_t dt)
 Integrates the universe for a duration as given by until, or for a single time step if 0 is passed.
 
HRESULT tfUniverse_stop ()
 Stops the universe time evolution. This essentially freezes the universe, everything remains the same, except time no longer moves forward.
 
HRESULT tfUniverse_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.
 
HRESULT tfUniverse_reset ()
 Reset the universe.
 
HRESULT tfUniverse_resetSpecies ()
 Reset all species in all particles.
 
HRESULT tfUniverse_getTemperature (tfFloatP_t *temperature)
 Get the universe temperature.
 
HRESULT tfUniverse_getTime (tfFloatP_t *time)
 Get the current time.
 
HRESULT tfUniverse_getDt (tfFloatP_t *dt)
 Get the period of a time step.
 
HRESULT tfUniverse_getBoundaryConditions (struct tfBoundaryConditionsHandle *bcs)
 Get the boundary conditions.
 
HRESULT tfUniverse_getKineticEnergy (tfFloatP_t *ke)
 Get the current system kinetic energy.
 
HRESULT tfUniverse_getNumTypes (int *numTypes)
 Get the current number of registered particle types.
 
HRESULT tfUniverse_getCutoff (tfFloatP_t *cutoff)
 Get the global interaction cutoff distance.
 
HRESULT tfUniverseConfig_init (struct tfUniverseConfigHandle *handle)
 Initialize a new instance.
 
HRESULT tfUniverseConfig_destroy (struct tfUniverseConfigHandle *handle)
 Destroy an instance.
 
HRESULT tfUniverseConfig_getDim (struct tfUniverseConfigHandle *handle, tfFloatP_t **dim)
 Get the dimensions of the universe.
 
HRESULT tfUniverseConfig_setDim (struct tfUniverseConfigHandle *handle, tfFloatP_t *dim)
 Set the dimensions of the universe.
 
HRESULT tfUniverseConfig_getCells (struct tfUniverseConfigHandle *handle, int **cells)
 Get the grid discretization.
 
HRESULT tfUniverseConfig_setCells (struct tfUniverseConfigHandle *handle, int *cells)
 Set the grid discretization.
 
HRESULT tfUniverseConfig_getCutoff (struct tfUniverseConfigHandle *handle, tfFloatP_t *cutoff)
 Get the global interaction cutoff distance.
 
HRESULT tfUniverseConfig_setCutoff (struct tfUniverseConfigHandle *handle, tfFloatP_t cutoff)
 Set the global interaction cutoff distance.
 
HRESULT tfUniverseConfig_getFlags (struct tfUniverseConfigHandle *handle, unsigned int *flags)
 Get the universe flags.
 
HRESULT tfUniverseConfig_setFlags (struct tfUniverseConfigHandle *handle, unsigned int flags)
 Set the universe flags.
 
HRESULT tfUniverseConfig_getDt (struct tfUniverseConfigHandle *handle, tfFloatP_t *dt)
 Get the period of a time step.
 
HRESULT tfUniverseConfig_setDt (struct tfUniverseConfigHandle *handle, tfFloatP_t dt)
 Set the period of a time step.
 
HRESULT tfUniverseConfig_getTemperature (struct tfUniverseConfigHandle *handle, tfFloatP_t *temperature)
 Get the universe temperature.
 
HRESULT tfUniverseConfig_setTemperature (struct tfUniverseConfigHandle *handle, tfFloatP_t temperature)
 Set the universe temperature.
 
HRESULT tfUniverseConfig_getNumThreads (struct tfUniverseConfigHandle *handle, unsigned int *numThreads)
 Get the number of threads for parallel execution.
 
HRESULT tfUniverseConfig_setNumThreads (struct tfUniverseConfigHandle *handle, unsigned int numThreads)
 Set the number of threads for parallel execution.
 
HRESULT tfUniverseConfig_getNumFluxSteps (struct tfUniverseConfigHandle *handle, unsigned int *numFluxSteps)
 Get the number of flux steps per simulation step.
 
HRESULT tfUniverseConfig_setNumFluxSteps (struct tfUniverseConfigHandle *handle, unsigned int numFluxSteps)
 Set the number of flux steps per simulation step.
 
HRESULT tfUniverseConfig_getIntegrator (struct tfUniverseConfigHandle *handle, unsigned int *integrator)
 Get the engine integrator enum.
 
HRESULT tfUniverseConfig_setIntegrator (struct tfUniverseConfigHandle *handle, unsigned int integrator)
 Set the engine integrator enum.
 
HRESULT tfUniverseConfig_getBoundaryConditions (struct tfUniverseConfigHandle *handle, struct tfBoundaryConditionsArgsContainerHandle *bargsHandle)
 Get the boundary condition argument container.
 
HRESULT tfUniverseConfig_setBoundaryConditions (struct tfUniverseConfigHandle *handle, struct tfBoundaryConditionsArgsContainerHandle *bargsHandle)
 Set the boundary condition argument container.
 

Function Documentation

◆ tfUniverse_getBoundaryConditions()

HRESULT tfUniverse_getBoundaryConditions ( struct tfBoundaryConditionsHandle * bcs)

Get the boundary conditions.

Parameters
bcsboundary conditions
Returns
S_OK on success

◆ tfUniverse_getCenter()

HRESULT tfUniverse_getCenter ( tfFloatP_t ** center)

Get the center of the universe.

Parameters
center3-element allocated array
Returns
S_OK on success

◆ tfUniverse_getCutoff()

HRESULT tfUniverse_getCutoff ( tfFloatP_t * cutoff)

Get the global interaction cutoff distance.

Parameters
cutoff
Returns
S_OK on success

◆ tfUniverse_getDim()

HRESULT tfUniverse_getDim ( tfFloatP_t ** dim)

Get the dimensions of the universe.

Parameters
dim3-element allocated array
Returns
S_OK on success

◆ tfUniverse_getDt()

HRESULT tfUniverse_getDt ( tfFloatP_t * dt)

Get the period of a time step.

Parameters
dt
Returns
S_OK on success

◆ tfUniverse_getIsRunning()

HRESULT tfUniverse_getIsRunning ( bool * isRunning)

Get whether the universe is running.

Parameters
isRunning
Returns
S_OK on success

◆ tfUniverse_getKineticEnergy()

HRESULT tfUniverse_getKineticEnergy ( tfFloatP_t * ke)

Get the current system kinetic energy.

Parameters
ke
Returns
S_OK on success

◆ tfUniverse_getName()

HRESULT tfUniverse_getName ( char ** name,
unsigned int * numChars )

Get the name of the model / script.

Parameters
name
numChars
Returns
S_OK on success

◆ tfUniverse_getNumParts()

HRESULT tfUniverse_getNumParts ( unsigned int * numParts)

Get the number of particles in the universe.

Parameters
numPartsnumber of particles
Returns
S_OK on success

◆ tfUniverse_getNumTypes()

HRESULT tfUniverse_getNumTypes ( int * numTypes)

Get the current number of registered particle types.

Parameters
numTypes
Returns
S_OK on success

◆ tfUniverse_getParticle()

HRESULT tfUniverse_getParticle ( unsigned int pidx,
struct tfParticleHandleHandle * handle )

Get the i'th particle of the universe.

Parameters
pidxindex of particle
handlehandle to populate
Returns
S_OK on success

◆ tfUniverse_getTemperature()

HRESULT tfUniverse_getTemperature ( tfFloatP_t * temperature)

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.

Parameters
temperature
Returns
S_OK on success

◆ tfUniverse_getTime()

HRESULT tfUniverse_getTime ( tfFloatP_t * time)

Get the current time.

Parameters
time
Returns
S_OK on success

◆ tfUniverse_getVirial()

HRESULT tfUniverse_getVirial ( tfFloatP_t ** virial)

Get the virial tensor of the universe.

Parameters
virialvirial tensor
Returns
S_OK on success

◆ tfUniverse_getVirialO()

HRESULT tfUniverse_getVirialO ( tfFloatP_t * origin,
tfFloatP_t radius,
tfFloatP_t ** virial )

Get the virial tensor of a neighborhood.

Parameters
originorigin of neighborhood
radiusradius of neighborhood
virialvirial tensor
Returns
S_OK on success

◆ tfUniverse_getVirialOT()

HRESULT tfUniverse_getVirialOT ( struct tfParticleTypeHandle ** phandles,
unsigned int numTypes,
tfFloatP_t * origin,
tfFloatP_t radius,
tfFloatP_t ** virial )

Get the virial tensor for a set of particle types in a neighborhood.

Parameters
phandlesarray of types
numTypesnumber of types
originorigin of neighborhood
radiusradius of neighborhood
virialvirial tensor
Returns
S_OK on success

◆ tfUniverse_getVirialT()

HRESULT tfUniverse_getVirialT ( struct tfParticleTypeHandle ** phandles,
unsigned int numTypes,
tfFloatP_t ** virial )

Get the virial tensor of the universe for a set of particle types.

Parameters
phandlesarray of types
numTypesnumber of types
virialvirial tensor
Returns
S_OK on success

◆ tfUniverse_reset()

HRESULT tfUniverse_reset ( )

Reset the universe.

Returns
S_OK on success

◆ tfUniverse_resetSpecies()

HRESULT tfUniverse_resetSpecies ( )

Reset all species in all particles.

Returns
S_OK on success

◆ tfUniverse_start()

HRESULT tfUniverse_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.

Returns
S_OK on success

◆ tfUniverse_step()

HRESULT tfUniverse_step ( tfFloatP_t until,
tfFloatP_t dt )

Integrates the universe for a duration as given by until, or for a single time step if 0 is passed.

Parameters
untilperiod to execute, in units of simulation time.
dtoverrides the existing time step, and uses this value for time stepping; currently not supported.
Returns
S_OK on success

◆ tfUniverse_stop()

HRESULT tfUniverse_stop ( )

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

Returns
S_OK on success

◆ tfUniverseConfig_destroy()

HRESULT tfUniverseConfig_destroy ( struct tfUniverseConfigHandle * handle)

Destroy an instance.

Parameters
handlepopulated handle
Returns
S_OK on success

◆ tfUniverseConfig_getBoundaryConditions()

HRESULT tfUniverseConfig_getBoundaryConditions ( struct tfUniverseConfigHandle * handle,
struct tfBoundaryConditionsArgsContainerHandle * bargsHandle )

Get the boundary condition argument container.

Parameters
handlepopulated handle
bargsHandleargument container
Returns
S_OK on success

◆ tfUniverseConfig_getCells()

HRESULT tfUniverseConfig_getCells ( struct tfUniverseConfigHandle * handle,
int ** cells )

Get the grid discretization.

Parameters
handlepopulated handle
cellsgrid discretization
Returns
S_OK on success

◆ tfUniverseConfig_getCutoff()

HRESULT tfUniverseConfig_getCutoff ( struct tfUniverseConfigHandle * handle,
tfFloatP_t * cutoff )

Get the global interaction cutoff distance.

Parameters
handlepopulated handle
cutoffcutoff distance
Returns
S_OK on success

◆ tfUniverseConfig_getDim()

HRESULT tfUniverseConfig_getDim ( struct tfUniverseConfigHandle * handle,
tfFloatP_t ** dim )

Get the dimensions of the universe.

Parameters
handlepopulated handle
dim3-element allocated array
Returns
S_OK on success

◆ tfUniverseConfig_getDt()

HRESULT tfUniverseConfig_getDt ( struct tfUniverseConfigHandle * handle,
tfFloatP_t * dt )

Get the period of a time step.

Parameters
handlepopulated handle
dtperiod of a time step
Returns
S_OK on success

◆ tfUniverseConfig_getFlags()

HRESULT tfUniverseConfig_getFlags ( struct tfUniverseConfigHandle * handle,
unsigned int * flags )

Get the universe flags.

Parameters
handlepopulated handle
flagsuniverse flags
Returns
S_OK on success

◆ tfUniverseConfig_getIntegrator()

HRESULT tfUniverseConfig_getIntegrator ( struct tfUniverseConfigHandle * handle,
unsigned int * integrator )

Get the engine integrator enum.

Parameters
handlepopulated handle
integratorengine integrator enum
Returns
S_OK on success

◆ tfUniverseConfig_getNumFluxSteps()

HRESULT tfUniverseConfig_getNumFluxSteps ( struct tfUniverseConfigHandle * handle,
unsigned int * numFluxSteps )

Get the number of flux steps per simulation step.

Parameters
handlepopulated handle
numFluxStepsnumber of flux steps per simulation step
Returns
S_OK on success

◆ tfUniverseConfig_getNumThreads()

HRESULT tfUniverseConfig_getNumThreads ( struct tfUniverseConfigHandle * handle,
unsigned int * numThreads )

Get the number of threads for parallel execution.

Parameters
handlepopulated handle
numThreadsnumber of threads for parallel execution
Returns
S_OK on success

◆ tfUniverseConfig_getTemperature()

HRESULT tfUniverseConfig_getTemperature ( struct tfUniverseConfigHandle * handle,
tfFloatP_t * temperature )

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.

Parameters
handlepopulated handle
temperatureuniverse temperature
Returns
S_OK on success

◆ tfUniverseConfig_init()

HRESULT tfUniverseConfig_init ( struct tfUniverseConfigHandle * handle)

Initialize a new instance.

Parameters
handlehandle to populate
Returns
S_OK on success

◆ tfUniverseConfig_setBoundaryConditions()

HRESULT tfUniverseConfig_setBoundaryConditions ( struct tfUniverseConfigHandle * handle,
struct tfBoundaryConditionsArgsContainerHandle * bargsHandle )

Set the boundary condition argument container.

Parameters
handlepopulated handle
bargsHandleargument container
Returns
S_OK on success

◆ tfUniverseConfig_setCells()

HRESULT tfUniverseConfig_setCells ( struct tfUniverseConfigHandle * handle,
int * cells )

Set the grid discretization.

Parameters
handlepopulated handle
cellsgrid discretization
Returns
S_OK on success

◆ tfUniverseConfig_setCutoff()

HRESULT tfUniverseConfig_setCutoff ( struct tfUniverseConfigHandle * handle,
tfFloatP_t cutoff )

Set the global interaction cutoff distance.

Parameters
handlepopulated handle
cutoffcutoff distance
Returns
S_OK on success

◆ tfUniverseConfig_setDim()

HRESULT tfUniverseConfig_setDim ( struct tfUniverseConfigHandle * handle,
tfFloatP_t * dim )

Set the dimensions of the universe.

Parameters
handlepopulated handle
dim3-element array
Returns
S_OK on success

◆ tfUniverseConfig_setDt()

HRESULT tfUniverseConfig_setDt ( struct tfUniverseConfigHandle * handle,
tfFloatP_t dt )

Set the period of a time step.

Parameters
handlepopulated handle
dtperiod of a time step
Returns
S_OK on success

◆ tfUniverseConfig_setFlags()

HRESULT tfUniverseConfig_setFlags ( struct tfUniverseConfigHandle * handle,
unsigned int flags )

Set the universe flags.

Parameters
handlepopulated handle
flagsuniverse flags
Returns
S_OK on success

◆ tfUniverseConfig_setIntegrator()

HRESULT tfUniverseConfig_setIntegrator ( struct tfUniverseConfigHandle * handle,
unsigned int integrator )

Set the engine integrator enum.

Parameters
handlepopulated handle
integratorengine integrator enum
Returns
S_OK on success

◆ tfUniverseConfig_setNumFluxSteps()

HRESULT tfUniverseConfig_setNumFluxSteps ( struct tfUniverseConfigHandle * handle,
unsigned int numFluxSteps )

Set the number of flux steps per simulation step.

Parameters
handlepopulated handle
numFluxStepsnumber of flux steps per simulation step
Returns
S_OK on success

◆ tfUniverseConfig_setNumThreads()

HRESULT tfUniverseConfig_setNumThreads ( struct tfUniverseConfigHandle * handle,
unsigned int numThreads )

Set the number of threads for parallel execution.

Parameters
handlepopulated handle
numThreadsnumber of threads for parallel execution
Returns
S_OK on success

◆ tfUniverseConfig_setTemperature()

HRESULT tfUniverseConfig_setTemperature ( struct tfUniverseConfigHandle * handle,
tfFloatP_t temperature )

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

Parameters
handlepopulated handle
temperatureuniverse temperature
Returns
S_OK on success