GaPFlow.md.MolecularDynamics#
- class GaPFlow.md.MolecularDynamics#
Bases:
objectDriver for molecular dynamics simulations.
Abstract base class for MD setup, running, and reading outputs. Derived classes need to implement methods to write LAMMPS input files into a dtool dataset, and to read the output of this simulation.
- name#
Name of the MD object
- Type:
str
- params#
Parameters to control the MD setup, will be written to the dtool metadata.
- Type:
dict
- main_file#
File name of the main LAMMPS input file.
- Type:
str
- num_worker#
Number of cores to run the parallel MD simulation.
- Type:
int
- is_mock#
Whether the subclass is only a mock object, which does not run an actual MD simulation.
- Type:
bool
- __init__()#
Methods
__init__()build_input_files(dataset, location, X)Builds LAMMPS input files based on GP inputs
Read simulation output and returns observations and their standard error.
run(X_target, tag)Run an MD simulation and store its input, metadata, and output into a dtool dataset.
Attributes
File location, where dtool datasets are written into (default is '/tmp/').
- abstractmethod build_input_files(dataset, location, X) None#
- Builds LAMMPS input files based on GP inputs
and writes them to a dtool dataset.
- Parameters:
dataset (dtoolcore.proto_dataset) – A proto_dataset object.
location (str) – Absolute path of the proto dataset.
X (Array) – Input (i.e. density, gap height, …)
- property dtool_basepath#
File location, where dtool datasets are written into (default is ‘/tmp/’).
- is_mock: bool#
- main_file: str#
- name#
alias of
str
- num_worker: int#
- params: dict#
- abstractmethod read_output()#
Read simulation output and returns observations and their standard error.
- run(X_target, tag)#
Run an MD simulation and store its input, metadata, and output into a dtool dataset.
This method is called from a Database instance when new training data is added e.g. during initialization or in an active learning simulation.
- Parameters:
X_target (Array) – The training input.
tag (str) – A tag to attach to the dataset name.
- Returns:
Array – Training observations
Array – Standard error of training observations