Incorporating new data types
When a certain data type does not exist in the standard C++ repository, it can be created and incorporated in the LAMMPS source code by defining it appropriately in lmptype.h
. For example, the tagint
data type described earlier in tagint **bond_atom = atom->bond_atom
is a variation of the int
data type. This tagint
data type has been defined in lmptype.h
, as shown in the following screenshot:
As you can see, the built-in typedef
function in C++ can be used to declare new data types with custom properties in lmptype.h
, and these data types can be accessed in the rest of the source code.
Generally, int
is a 4-byte (32-bit) data type by default, which means it can accommodate a 10-digit number up to . Sometimes, if a simulation system has to accommodate a larger number, we can use typedef
to alias the int
(32 bit) and...