Tabulated External Force¶
This force module enables the possibility of using a precalculated external potential. This can be useful if the external potential is known and does not change in time. The interpolation points are distributed on a uniform grid and must be calculated before usage.
Depending on the interpolation scheme, more than just the potential values will be needed.
If the scheme needs coefficients that can be calculated from the derivatives of the
potential, halmd.mdsim.forces.tabulated_generator
can be used for the calculation
of the coefficients.
Note
Particle species are unsupported, all particles from the given halmd.mdsim.particle
instance are treated equally.
-
class
halmd.mdsim.forces.
tabulated_external
(args)¶ Construct tabulated external force.
Parameters: - args (table) – keyword arguments
- args.particle – instance of
halmd.mdsim.particle
- args.box – instance of
halmd.mdsim.box
- args.interpolation – instance of
halmd.mdsim.forces.interpolation
- args.virial_interpolation – instance of
halmd.mdsim.forces.interpolation
Returns: instance of tabulated_external force module
-
set_coefficients
(coefficients)¶ Set the interpolation coefficients as needed by the scheme
Parameters: coefficients (table) – coefficients as needed by the interpolation scheme
-
read_coefficients
(args)¶ Read interpolation coefficients for external force from file.
Parameters: - args (table) – keyword arguments
- args.file – instance of file reader
- args.location (string table) – location within file (optional)
The argument
location
specifies a path in a structured file format like H5MD given as a table of strings. If omitted it defaults to{"parameters/halmd"}
.
-
disconnect
()¶ Disconnect force from profiler and particle module.