Gromacs  5.1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions
gmx::TimeUnitManager Class Reference

#include <gromacs/options/timeunitmanager.h>

Description

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

Member Function Documentation

void gmx::TimeUnitManager::addTimeUnitOption ( Options options,
const char *  name 
)

Adds a common option for selecting the time unit.

Parameters
[in,out]optionsOptions to which the common option is added.
[in]nameName 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.

Parameters
[in,out]optionsOptions 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.


The documentation for this class was generated from the following files: