Skip to content
This repository was archived by the owner on Jul 28, 2022. It is now read-only.
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: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ 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]
### Added
- Added getters for the fields of `Pore1D` in Python. [#30](https://github.com/feos-org/feos-dft/pull/30)

## [0.2.0] - 2022-04-12
### Added
Expand Down
11 changes: 5 additions & 6 deletions src/adsorption/pore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ const DEFAULT_GRID_POINTS: usize = 2048;

/// Parameters required to specify a 1D pore.
pub struct Pore1D<U> {
// functional: Rc<DFT<F>>,
geometry: Geometry,
pore_size: QuantityScalar<U>,
potential: ExternalPotential<U>,
n_grid: Option<usize>,
potential_cutoff: Option<f64>,
pub geometry: Geometry,
pub pore_size: QuantityScalar<U>,
pub potential: ExternalPotential<U>,
pub n_grid: Option<usize>,
pub potential_cutoff: Option<f64>,
}

impl<U: EosUnit> Pore1D<U> {
Expand Down
25 changes: 25 additions & 0 deletions src/python/adsorption/pore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,31 @@ macro_rules! impl_pore {
)?))
}

#[getter]
fn get_geometry(&self)-> Geometry {
self.0.geometry
}

#[getter]
fn get_pore_size(&self)-> PySINumber {
self.0.pore_size.into()
}

#[getter]
fn get_potential(&self)-> PyExternalPotential {
PyExternalPotential(self.0.potential.clone())
}

#[getter]
fn get_n_grid(&self)-> Option<usize> {
self.0.n_grid
}

#[getter]
fn get_potential_cutoff(&self)-> Option<f64> {
self.0.potential_cutoff
}

/// The pore volume using Helium at 298 K as reference.
#[getter]
fn get_pore_volume(&self) -> PyResult<PySINumber> {
Expand Down