diff --git a/Cargo.toml b/Cargo.toml index 6eae03c0a..7d4446da0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -56,6 +56,6 @@ pcsaft = ["association"] gc_pcsaft = ["association"] uvtheory = ["lazy_static"] pets = [] -rayon = ["dep:rayon", "ndarray/rayon", "feos-core/rayon"] +rayon = ["dep:rayon", "ndarray/rayon", "feos-core/rayon", "feos-dft?/rayon"] python = ["pyo3", "numpy", "feos-core/python", "feos-dft?/python", "rayon"] all_models = ["dft", "estimator", "pcsaft", "gc_pcsaft", "uvtheory", "pets"] diff --git a/feos-dft/CHANGELOG.md b/feos-dft/CHANGELOG.md index 6e44fd674..8cf352dc0 100644 --- a/feos-dft/CHANGELOG.md +++ b/feos-dft/CHANGELOG.md @@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Changed +- Added `Send` and `Sync` as supertraits to `HelmholtzEnergyFunctional` and all related traits. [#57](https://github.com/feos-org/feos/pull/57) +- Renamed the `3d_dft` feature to `rayon` in accordance to the other feos crates. [#62](https://github.com/feos-org/feos/pull/62) ## [0.3.2] - 2022-10-13 ### Changed diff --git a/feos-dft/Cargo.toml b/feos-dft/Cargo.toml index b2fc7e40c..96581316a 100644 --- a/feos-dft/Cargo.toml +++ b/feos-dft/Cargo.toml @@ -14,7 +14,7 @@ exclude = ["/.github/*", "*.ipynb"] [package.metadata.docs.rs] rustdoc-args = [ "--html-in-header", "./docs-header.html" ] -features = [ "3d_dft" ] +features = [ "rayon" ] [dependencies] quantity = { version = "0.5", features = ["linalg"] } @@ -33,5 +33,5 @@ pyo3 = { version = "0.16", optional = true } [features] default = [] -3d_dft = ["gauss-quad", "ndarray/rayon"] -python = ["pyo3", "numpy", "feos-core/python", "3d_dft"] +rayon = ["gauss-quad", "ndarray/rayon"] +python = ["pyo3", "numpy", "feos-core/python", "rayon"] diff --git a/feos-dft/src/adsorption/external_potential.rs b/feos-dft/src/adsorption/external_potential.rs index 2f01bd973..51ac41ad4 100644 --- a/feos-dft/src/adsorption/external_potential.rs +++ b/feos-dft/src/adsorption/external_potential.rs @@ -1,12 +1,12 @@ -#[cfg(feature = "3d_dft")] +#[cfg(feature = "rayon")] use crate::adsorption::fea_potential::calculate_fea_potential; use crate::functional::HelmholtzEnergyFunctional; -#[cfg(feature = "3d_dft")] +#[cfg(feature = "rayon")] use crate::geometry::Geometry; use feos_core::EosUnit; use libm::tgamma; use ndarray::{Array1, Array2, Axis as Axis_nd}; -#[cfg(feature = "3d_dft")] +#[cfg(feature = "rayon")] use quantity::{QuantityArray2, QuantityScalar}; use std::{f64::consts::PI, marker::PhantomData}; @@ -52,7 +52,7 @@ pub enum ExternalPotential { rho_s: f64, }, /// Free-energy averaged potential: - #[cfg(feature = "3d_dft")] + #[cfg(feature = "rayon")] FreeEnergyAveraged { coordinates: QuantityArray2, sigma_ss: Array1, @@ -192,7 +192,7 @@ impl ExternalPotential { * (2.0 * (sigma_sf[i] / z_grid).mapv(|x| x.powi(9)) - 15.0 * (sigma_sf[i] / z_grid).mapv(|x| x.powi(3)))) } - #[cfg(feature = "3d_dft")] + #[cfg(feature = "rayon")] Self::FreeEnergyAveraged { coordinates, sigma_ss, @@ -358,7 +358,7 @@ impl ExternalPotential { * sigma_sf[i].powi(3) * *rho_s) } - #[cfg(feature = "3d_dft")] + #[cfg(feature = "rayon")] Self::FreeEnergyAveraged { coordinates, sigma_ss, @@ -548,7 +548,7 @@ impl ExternalPotential { * (2.0 / 5.0 * sum_n(10, r_grid, sigma_sf[i], pore_size) - sum_n(4, r_grid, sigma_sf[i], pore_size))) } - #[cfg(feature = "3d_dft")] + #[cfg(feature = "rayon")] Self::FreeEnergyAveraged { coordinates, sigma_ss, diff --git a/feos-dft/src/adsorption/mod.rs b/feos-dft/src/adsorption/mod.rs index 3a6ac50f2..12885984d 100644 --- a/feos-dft/src/adsorption/mod.rs +++ b/feos-dft/src/adsorption/mod.rs @@ -11,15 +11,15 @@ use std::iter; use std::sync::Arc; mod external_potential; -#[cfg(feature = "3d_dft")] +#[cfg(feature = "rayon")] mod fea_potential; mod pore; pub use external_potential::{ExternalPotential, FluidParameters}; pub use pore::{Pore1D, PoreProfile, PoreProfile1D, PoreSpecification}; -#[cfg(feature = "3d_dft")] +#[cfg(feature = "rayon")] mod pore3d; -#[cfg(feature = "3d_dft")] +#[cfg(feature = "rayon")] pub use pore3d::{Pore3D, PoreProfile3D}; const MAX_ITER_ADSORPTION_EQUILIBRIUM: usize = 50; diff --git a/feos-dft/src/profile.rs b/feos-dft/src/profile.rs index af24b20f4..4b7f09970 100644 --- a/feos-dft/src/profile.rs +++ b/feos-dft/src/profile.rs @@ -16,7 +16,7 @@ use std::ops::MulAssign; use std::sync::Arc; pub(crate) const MAX_POTENTIAL: f64 = 50.0; -#[cfg(feature = "3d_dft")] +#[cfg(feature = "rayon")] pub(crate) const CUTOFF_RADIUS: f64 = 14.0; /// General specifications for the chemical potential in a DFT calculation. diff --git a/feos-dft/src/solvation/mod.rs b/feos-dft/src/solvation/mod.rs index 482d097f8..e5f6dcb35 100644 --- a/feos-dft/src/solvation/mod.rs +++ b/feos-dft/src/solvation/mod.rs @@ -2,7 +2,7 @@ mod pair_correlation; pub use pair_correlation::{PairCorrelation, PairPotential}; -#[cfg(feature = "3d_dft")] +#[cfg(feature = "rayon")] mod solvation_profile; -#[cfg(feature = "3d_dft")] +#[cfg(feature = "rayon")] pub use solvation_profile::SolvationProfile;