Drivers
Note
Drivers are a planned feature. The APIs on this page are planned APIs that are not yet implemented, and the code is not yet tested. See Designing Drivers for the design.
Running a calculation usually means configuring more than one module. For example, to compute the force on a charged particle (see Module Development) with a screened electric field, a user must:
bind the “electric field” submodule of the “Classical Force” module to the “Coulomb’s Law with screening” module, and
set the “threshold” input of the “Coulomb’s Law with screening” module.
The user has to know which modules to change, and which of their inputs and submodules. If they forget one, e.g., they set the threshold but not the submodule, the setting silently has no effect.
A driver collects these choices in one place. A driver is a module whose
inputs and submodules are the settings of a whole calculation. When the driver
runs, it applies those settings to the modules below it. The user configures
the driver with the same change_input and change_submod calls they use
for any other module.
This part of the tutorials writes a driver, ForceDriver, for the force
calculation above, and then shows how to use it. The design of drivers is
covered in Designing Drivers.