Accessing physical constants
Physical constants in different units used in LAMMPS (for example, SI, "real", and "metal") are available using arrow operators from force.h
. A list of these constants is shown in the following screenshot:
Figure 4.6 – Screenshot from force.h showing the variables used to implement physical constants
As you can see in the preceding screenshot, force.h
only contains the variables names that represent the various physical constants. The numeric values of these constants are provided in update.cpp
, which imports force.h
and assigns values to these variables in the Update::set_units()
method, as shown in the following screenshot:
Figure 4.7 – Code snippet from update.cpp that assigns numeric values to variables representing physical constants
The constants in the correct unit are retrieved by the Update::set_units()
method when they are accessed from other classes. For example...