IRockySimulationVariables is an interface that allows users to find and access existing simulation variables during the simulation. Similar to scalars, users can use the IRockySimulationVariables find methods to get the variable index passing the variable name, and call get_variable using this index to retrieve its value at any moment in the simulation.
Its role is to allow access to an internally represented simulation variable, making it possible to retrieve its value at any given time in the simulation within hooks executed on the host side. The values returned for the variables depend on the update frequency of it, if a variable is configured to update only at output, its value will only change when a simulation output happens. The other option for update frequency is at the solver curves frequency, which can be configured in the project setup.
Variables associated with surfaces may return different values at each iteration. This is because their update frequency happens in solver iterations frequency due to the particles surface crossing verification. And also, these variables have an accumulation behavior until reaching its output time. So variables of type average, for example, will return the current average value until it got written to disk. The same is true for variables of type rate. They will return the accumulated value up to the current time.
Members
Public functions
Function find_particles_variable
- name: The name given to the simulation variable at the moment of its creation.
- const char * name
Function find_sph_variable
- name: The name given to the simulation variable at the moment of its creation.
- const char * name
Function get_variable
- variable_index: The integer index that was associated to the simulation variable during the setup of the module.
- int variable_index