Skip to content

Commit 570fada

Browse files
committed
Take dipole moment in Debye units
1 parent 1cda889 commit 570fada

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

src/analysis.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,11 @@ impl Moments {
8989
coc.norm()
9090
);
9191

92+
let mu = self.dipole_moment_scalar / self.number_of_samples as f64;
9293
println!(
93-
"dipole moment 𝛍 = ⟨|∑qᵢ𝐫ᵢ|⟩ = {:.1} eÅ",
94-
self.dipole_moment_scalar / self.number_of_samples as f64
94+
"mean dipole moment 𝛍 = ⟨|∑qᵢ𝐫ᵢ|⟩ = {:.1} eÅ = {:.1} D",
95+
mu,
96+
mu / 0.2081943
9597
);
9698
}
9799
}

src/input.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ pub struct Args {
5151
#[clap(short, long, default_value_t = 7.0)]
5252
pub bjerrum_length: f64,
5353

54-
/// Target dipole moment ()
54+
/// Target dipole moment (Debye)
5555
#[clap(short = 'u', long = "--dipole", required = false)]
5656
pub target_dipole_moment: Option<f64>,
5757
}

src/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,10 @@ fn main() -> Result<(), Box<dyn Error>> {
5050
let pair_potential = energy::Coulomb::new(args.bjerrum_length);
5151
hamiltonian.push(energy::Nonbonded::new(pair_potential));
5252
if args.target_dipole_moment.is_some() {
53+
// in Debye units
5354
hamiltonian.push(energy::ConstrainDipole::new(
5455
100.0,
55-
args.target_dipole_moment.unwrap(),
56+
args.target_dipole_moment.unwrap() * 0.2081943,
5657
))
5758
}
5859

0 commit comments

Comments
 (0)