gosh_dimer/options.rs
1// [[file:../dimer.note::c38894e0][c38894e0]]
2use super::*;
3
4/// Options for tuning DIMER algorithm from user side
5#[derive(Deserialize, Debug, Clone, Serialize)]
6#[serde(default)]
7pub struct UserOptions {
8 /// force component criteria for convergence test
9 pub fmax: f64,
10
11 /// dimer distance between image 0 and image 1
12 pub distance: f64,
13
14 /// Trial angle for the finite difference estimate of the rotational angle
15 /// in radians.
16 pub trial_rot_angle: f64,
17
18 /// Use a fixed angle for trial rotation step.
19 pub use_fixed_rot_angle: bool,
20
21 /// The minimum rotational angle for skipping trial rotation step.
22 pub min_rot_angle: f64,
23
24 /// Maximum number of rotation steps allowed in iteratons.
25 pub max_num_rot: usize,
26
27 /// Use extrapolated force on the new dimer endpoint R1 to reduce one
28 /// evulation per dimer rotation. Kastner2008JCP
29 pub use_extrapolated_force: bool,
30
31 /// Use Conjugate gradient algorithm to determine the rotation plane,
32 /// instead of simple steepest descent direction.
33 pub use_cg_rot: bool,
34}
35
36impl Default for UserOptions {
37 fn default() -> Self {
38 Self {
39 fmax: 0.1,
40 distance: 1E-3,
41 min_rot_angle: 5f64.to_radians(),
42 trial_rot_angle: PI / 4.0,
43 use_fixed_rot_angle: true,
44 max_num_rot: 5,
45 use_extrapolated_force: false,
46 use_cg_rot: true,
47 }
48 }
49}
50// c38894e0 ends here