Gromacs
5.1.4
|
#include <gromacs/options/timeunitmanager.h>
Provides common functionality for time unit conversions.
Methods/objects that need to deal with time units can either take a TimeUnitManager object, or they can take a TimeUnit value and construct a TimeUnitManager object internally.
Default copy constructor and assignment are used: the copy is an independent object that is initialized with the same time unit as the original.
Public Member Functions | |
TimeUnitManager () | |
Creates a time unit manager with the default (ps) time unit. | |
TimeUnitManager (TimeUnit unit) | |
Creates a time unit manager with the given time unit. | |
TimeUnit | timeUnit () const |
Returns the currently selected time unit. | |
void | setTimeUnit (TimeUnit unit) |
Set a new time unit for the manager. | |
const char * | timeUnitAsString () const |
Returns a string constant corresponding to the current time unit. | |
double | timeScaleFactor () const |
Returns the scaling factor to convert times to ps. | |
double | inverseTimeScaleFactor () const |
Returns the scaling factor to convert times from ps. | |
void | setTimeUnitFromEnvironment () |
Sets the time unit in this manager from an environment variable. | |
void | addTimeUnitOption (Options *options, const char *name) |
Adds a common option for selecting the time unit. More... | |
void | scaleTimeOptions (Options *options) const |
Scales user input values given to time options. More... | |
void gmx::TimeUnitManager::addTimeUnitOption | ( | Options * | options, |
const char * | name | ||
) |
Adds a common option for selecting the time unit.
[in,out] | options | Options to which the common option is added. |
[in] | name | Name of the option to add. |
Adds an enum option to options
to select the time unit for this manager.
void gmx::TimeUnitManager::scaleTimeOptions | ( | Options * | options | ) | const |
Scales user input values given to time options.
[in,out] | options | Options in which to scale times. |
Scales each time option (see DoubleOption::timeValue()) in options
such that any user-given values are interpreted as given in the time unit specified by this manager, and scaled to picoseconds. Programmatically given values (e.g., as default values for the options) are not scaled.