Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
3 changes: 3 additions & 0 deletions feos-dft/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions feos-dft/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand All @@ -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"]
14 changes: 7 additions & 7 deletions feos-dft/src/adsorption/external_potential.rs
Original file line number Diff line number Diff line change
@@ -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};

Expand Down Expand Up @@ -52,7 +52,7 @@ pub enum ExternalPotential<U> {
rho_s: f64,
},
/// Free-energy averaged potential:
#[cfg(feature = "3d_dft")]
#[cfg(feature = "rayon")]
FreeEnergyAveraged {
coordinates: QuantityArray2<U>,
sigma_ss: Array1<f64>,
Expand Down Expand Up @@ -192,7 +192,7 @@ impl<U: EosUnit> ExternalPotential<U> {
* (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,
Expand Down Expand Up @@ -358,7 +358,7 @@ impl<U: EosUnit> ExternalPotential<U> {
* sigma_sf[i].powi(3)
* *rho_s)
}
#[cfg(feature = "3d_dft")]
#[cfg(feature = "rayon")]
Self::FreeEnergyAveraged {
coordinates,
sigma_ss,
Expand Down Expand Up @@ -548,7 +548,7 @@ impl<U: EosUnit> ExternalPotential<U> {
* (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,
Expand Down
6 changes: 3 additions & 3 deletions feos-dft/src/adsorption/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion feos-dft/src/profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions feos-dft/src/solvation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;