Skip to content

Commit

Permalink
fixing PW; setting up PC+
Browse files Browse the repository at this point in the history
I've put things together to run so I can calculate setschenow constants.
Fixed PW, forgot to use the inverse intramolecular correlations and setting the prefactor to negative.
Next is just doing the pressure calculations and then computing PC+.
Will compute it for HNC, GF, KH and PW.
  • Loading branch information
2AUK committed Nov 6, 2023
1 parent 4a64c34 commit 2ad35cc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/drivers/rism.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use crate::structure::system::Species;
use flate2::{read, write, Compression};
use log::{debug, info, trace, warn};
use ndarray::{Array, Array1, Array2, Array3, Axis, Zip};

use pyo3::prelude::*;
use std::cell::RefCell;
use std::f64::consts::PI;
use std::fs;
Expand All @@ -33,7 +33,7 @@ pub enum Verbosity {
VeryVerbose,
}

// #[pyclass]
#[pyclass(unsendable)]
#[derive(Clone, Debug)]
pub struct RISMDriver {
pub name: String,
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ impl Calculator {
/// import the module.
#[pymodule]
fn librism(_py: Python<'_>, m: &PyModule) -> PyResult<()> {
m.add_class::<PyCalculator>()?;
m.add_class::<RISMDriver>()?;
Ok(())
}
4 changes: 2 additions & 2 deletions src/thermodynamics/thermo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ fn pw_functional_impl(
.par_for_each(|mut h_out, h, wu, wv| {
let wv_inv = wv.inv().expect("inverted solvent intramolecular matrix");
let wu_inv = wu.inv().expect("inverted solute intramolecular matrix");
h_out.assign(&wu.dot(&h).dot(&wv).dot(density));
h_out.assign(&wu_inv.dot(&h).dot(&wv_inv).dot(density));
});

Zip::from(h_bar_uv_k.lanes(Axis(0)))
Expand All @@ -326,7 +326,7 @@ fn pw_functional_impl(
.for_each(|mut o, h_bar, c, h, ri| {
let r2 = &ri * &ri;
let integrand = &c + (0.5 * &c * &h) - (0.5 * &h_bar * &h);
o.assign(&(4.0 * PI * &(r2 * integrand).dot(density)));
o.assign(&(-4.0 * PI * &(r2 * integrand).dot(density)));
});
_out.sum_axis(Axis(2)).sum_axis(Axis(1))
}
Expand Down

0 comments on commit 2ad35cc

Please sign in to comment.