Reviewing the general structure of computes
In this section, we will briefly cover some of the methods most commonly used in compute child classes.
Similar to pair styles, individual computes inherit from the parent Compute
class described by compute.cpp
and compute.h
classes. These parent classes read the first three arguments (compute ID, group ID, and compute style) from the LAMMPS input script. The following screenshot shows some of the variables and arrays from compute.h
that are inherited:
The child compute classes may contain one or more of the following methods:
- The
init()
method sets up the class and performs preliminary validation checks. - The
init_list()
method sets up neighbor lists or pointers to neighboring lists. - The
compute_scalar()
method computes a scalar quantity generally used as an output. - The
compute_vector()
method computes a vector quantity generally used as an output...