Skip to main content

Command

Enum Command 

Source
pub enum Command {
Show 17 variants InitForceEnv { input: String, output: String, }, InitForceEnvWithGeometry {
Show 19 fields input: Cp2kInputSpec, output: String, symbols: Vec<String>, positions_angstrom: Vec<f64>, cell_angstrom: Vec<f64>, periodic: String, project_label: Option<String>, print_level: Option<String>, run_type: Option<String>, charge: Option<i32>, multiplicity: Option<i32>, walltime: Option<String>, seed: Option<Vec<i32>>, echo_input: Option<bool>, uks: Option<bool>, roks: Option<bool>, wfn_restart_file: Option<String>, kpoint_config: Option<KPointConfig>, dos_config: Option<DosConfig>,
}, CalcEnergyForce, CalcEnergy, GetNatom, GetNparticle, GetPositions, GetForces, GetPotentialEnergy, GetCell, GetQmmmCell, SetPositions { data: Vec<f64>, }, SetVelocities { data: Vec<f64>, }, SetCell { data: Vec<f64>, }, GetMoCount, Shutdown, GetVersion,
}
Expand description

A command sent from the Python frontend to the worker.

Variants§

§

InitForceEnv

Initialize a new force environment.

This is the legacy entry point that takes a path to a .inp file. Prefer [InitForceEnvWithGeometry], which supports geometry injection.

Fields

§input: String
§output: String
§

InitForceEnvWithGeometry

Initialise a new force environment and supply the starting geometry.

The worker constructs a temporary input by taking the input specified by input_spec and injecting &CELL and &COORD sections into &SUBSYS before passing the (temporary) file to CP2K.

For input_spec = FromFile, the file is read and patched. For input_spec = Generated, the settings are rendered and then patched (patching is still used to guarantee geometry correctness).

§Fields

input_spec Input source (file or generated settings). output Path for CP2K output. symbols Element symbol for each atom, e.g. ["W", "Al", "O"]. positions_angstrom Flat interleaved array [x0,y0,z0, x1,y1,z1, …] in Å. cell_angstrom 9-element row-major cell matrix in Å. cell_angstrom[i*3 + j] = j-th component of i-th lattice vector. periodic Periodicity string passed to CP2K’s PERIODIC keyword. Use "XYZ" for fully periodic systems (the common case), "NONE" for isolated molecules. Any valid CP2K PERIODIC token is accepted.

Fields

§output: String
§symbols: Vec<String>
§positions_angstrom: Vec<f64>
§cell_angstrom: Vec<f64>
§periodic: String
§project_label: Option<String>

Optional project label for the &GLOBAL block

§print_level: Option<String>

Optional print level for the &GLOBAL block

§run_type: Option<String>

Optional RUN_TYPE for the &GLOBAL block

§charge: Option<i32>

Optional CHARGE for the &DFT block

§multiplicity: Option<i32>

Optional MULTIPLICITY for the &DFT block

§walltime: Option<String>

Optional WALLTIME for the &GLOBAL block

§seed: Option<Vec<i32>>

Optional SEED for the &GLOBAL block

§echo_input: Option<bool>

Optional ECHO_INPUT for the &GLOBAL block

§uks: Option<bool>

Optional UKS (Unrestricted Kohn-Sham) for the &DFT block

§roks: Option<bool>

Optional ROKS (Restricted Open Kohn-Sham) for the &DFT block

§wfn_restart_file: Option<String>

Optional WFN_RESTART_FILE_NAME for the &DFT block

§kpoint_config: Option<KPointConfig>

Optional k-point configuration for periodic systems

§dos_config: Option<DosConfig>

Optional DOS configuration

§

CalcEnergyForce

Calculate energy and forces for the current geometry.

§

CalcEnergy

Calculate energy only.

§

GetNatom

Query the number of atoms.

§

GetNparticle

Query the number of particles.

§

GetPositions

Retrieve particle positions as a flat f64 array.

§

GetForces

Retrieve forces as a flat f64 array.

§

GetPotentialEnergy

Retrieve the potential energy.

§

GetCell

Retrieve the 3x3 simulation cell (row-major flat f64).

§

GetQmmmCell

Retrieve the 3x3 QMMM cell.

§

SetPositions

Set particle positions.

Fields

§data: Vec<f64>
§

SetVelocities

Set particle velocities.

Fields

§data: Vec<f64>
§

SetCell

Set simulation cell (9 floats, row-major).

Fields

§data: Vec<f64>
§

GetMoCount

Get number of MOs in the active space.

§

Shutdown

Ask the worker to shut down cleanly.

§

GetVersion

Get CP2K version string.

Trait Implementations§

Source§

impl Debug for Command

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Command

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Command

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> Ungil for T
where T: Send,