Tinker9 70bd052 (Thu Nov 9 12:11:35 2023 -0800)
|
Definitions of data types used in the MD simulations. More...
Macros | |
#define | TINKER_DETERMINISTIC_FORCE 1 |
#define | TINKER_REAL_SIZE 4 |
#define | TINKER_MIXED_SIZE 8 |
#define | TINKER_DOUBLE_PRECISION 0 |
#define | TINKER_MIXED_PRECISION 1 |
#define | TINKER_SINGLE_PRECISION 0 |
Typedefs | |
typedef unsigned long long | tinker::fixed |
typedef float | tinker::real |
typedef double | tinker::mixed |
typedef mixed | tinker::time_prec |
Floating-point type for time. More... | |
typedef mixed | tinker::T_prec |
Floating-point type for temperature. More... | |
typedef mixed | tinker::vel_prec |
Floating-point type for velocities. More... | |
typedef mixed | tinker::pos_prec |
Floating-point type for coordinates. More... | |
typedef real | tinker::e_prec |
Floating-point type for the pairwise energy components. More... | |
typedef real | tinker::v_prec |
Floating-point type for the pairwise virial components. More... | |
typedef real | tinker::g_prec |
Floating-point type for the pairwise gradient components. More... | |
typedef mixed | tinker::energy_prec |
Floating-point type for total energies. More... | |
typedef mixed | tinker::virial_prec |
typedef fixed | tinker::grad_prec |
Definitions of data types used in the MD simulations.
#define TINKER_DETERMINISTIC_FORCE 1 |
Logical macro for the underlying type of energy gradients.
true
, always uses fixed-point arithmetic to accumulate energy gradients, regardless of the underlying type of each individual component.false
, use type real
, which can either be float
or double
based on the precision macro.In general, evaluating energy, forces, etc. twice, we don't expect to get two identical answers, but we may not care as much because the difference is usually negligible. [See Why is cos(x) != cos(y)?] Whereas in MD, two simulations with the same initial configurations can easily diverge due to the accumulated difference. If, for whatever reason, you are willing to elongate the process of the inevitable divergence at the cost of slightly slower simulation speed, a more "deterministic" force (using fixed-point arithmetic) can help.
To accumulate floating-point values via fixed-point arithmetic, we first scale the values by a large integer then sum only the integer part.
To get the floating-point sum, we have to cast the integer sum back to floating-point number, then divide it by the same large integer.
#define TINKER_DOUBLE_PRECISION 0 |
Macro for the precision mode. Types real
and mixed
have different definitions in different modes.
Macros | real | mixed |
---|---|---|
DOUBLE | double | double |
MIXED | float | double |
SINGLE | float | float |
Only one of the precision macros can be set to 1 and the others will be set to 0.
#define TINKER_MIXED_PRECISION 1 |
Macro for the precision mode. Types real
and mixed
have different definitions in different modes.
Macros | real | mixed |
---|---|---|
DOUBLE | double | double |
MIXED | float | double |
SINGLE | float | float |
Only one of the precision macros can be set to 1 and the others will be set to 0.
#define TINKER_MIXED_SIZE 8 |
Number of bytes of the type mixed
.
#define TINKER_REAL_SIZE 4 |
Number of bytes of the type real
.
#define TINKER_SINGLE_PRECISION 0 |
Macro for the precision mode. Types real
and mixed
have different definitions in different modes.
Macros | real | mixed |
---|---|---|
DOUBLE | double | double |
MIXED | float | double |
SINGLE | float | float |
Only one of the precision macros can be set to 1 and the others will be set to 0.
typedef real tinker::e_prec |
Floating-point type for the pairwise energy components.
typedef mixed tinker::energy_prec |
Floating-point type for total energies.
64-bit unsigned integer type for fixed-point arithmetic.
typedef real tinker::g_prec |
Floating-point type for the pairwise gradient components.
Floating-point or fixed-point type for the total gradients.
Floating-point type with higher precision (not lower than real).
typedef mixed tinker::pos_prec |
Floating-point type for coordinates.
Floating-point type with lower precision (not higher than mixed).
typedef mixed tinker::T_prec |
Floating-point type for temperature.
typedef mixed tinker::time_prec |
Floating-point type for time.
typedef real tinker::v_prec |
Floating-point type for the pairwise virial components.
typedef mixed tinker::vel_prec |
Floating-point type for velocities.
typedef mixed tinker::virial_prec |
Floating-point type for total virials.