pub struct DFTD4RationalDampingParam {
pub s6: f64,
pub s8: f64,
pub s9: f64,
pub a1: f64,
pub a2: f64,
pub alp: f64,
}
Expand description
DFTD4 rational damping parameters.
§API documentation for custom damping parameter specification
If your task is to retrive damping parameters of some specific xc-functionals, you may wish to try DFTD4Param::load_rational_damping
function.
In this crate, you may have three ways to define customized parameters:
-
By
DFTD4RationalDampingParam
struct. In this way, all parameters (include optional parameters with default value) must be provided. For example:let param = DFTD4RationalDampingParam { s6: 1.0, s8: 1.683, s9: 1.0, a1: 1.139, a2: 1.5, alp: 16.0, }; let param = param.new_param(); // this will give param: DFTD4Param
-
By
DFTD4RationalDampingParamBuilder
struct. In this way, optional parameters can be omitted. For example:let param = DFTD4RationalDampingParamBuilder::default() .s8(1.683) .a1(1.139) .a2(1.5) .init(); // this will give param: DFTD4Param
-
By
DFTD4Param
utility. In this way, all parameters must be provided. For example of B3-Zero:let param = DFTD4Param::new_rational_damping( 1.0, // s6 1.683, // s8 1.0, // s9 1.139, // a1 1.0, // a2 16.0, // alp );
Fields§
§s6: f64
optional, default 1.0
s8: f64
§s9: f64
optional, default 1.0
a1: f64
§a2: f64
§alp: f64
optional, default 16.0
Implementations§
Source§impl DFTD4RationalDampingParam
impl DFTD4RationalDampingParam
Sourcepub fn new_param(self) -> DFTD4Param
pub fn new_param(self) -> DFTD4Param
Examples found in repository?
examples/test_interface.rs (line 295)
248fn test_pair_resolved() {
249 // Calculate pairwise resolved dispersion energy for a molecule
250 let thr = 1.0e-8;
251
252 let numbers = vec![16, 16, 16, 16, 16, 16, 16, 16];
253 #[rustfmt::skip]
254 let positions = vec![
255 -4.15128787379191, 1.71951973863958, -0.93066267097296,
256 -4.15128787379191, -1.71951973863958, 0.93066267097296,
257 -1.71951973863958, -4.15128787379191, -0.93066267097296,
258 1.71951973863958, -4.15128787379191, 0.93066267097296,
259 4.15128787379191, -1.71951973863958, -0.93066267097296,
260 4.15128787379191, 1.71951973863958, 0.93066267097296,
261 1.71951973863958, 4.15128787379191, -0.93066267097296,
262 -1.71951973863958, 4.15128787379191, 0.93066267097296,
263 ];
264 #[rustfmt::skip]
265 let pair_disp2 = vec![
266 -0.00000000e-0, -5.80599854e-4, -4.74689854e-4, -2.11149449e-4, -1.63163128e-4, -2.11149449e-4, -4.74689854e-4, -5.80599854e-4,
267 -5.80599854e-4, -0.00000000e-0, -5.80599854e-4, -4.74689854e-4, -2.11149449e-4, -1.63163128e-4, -2.11149449e-4, -4.74689854e-4,
268 -4.74689854e-4, -5.80599854e-4, -0.00000000e-0, -5.80599854e-4, -4.74689854e-4, -2.11149449e-4, -1.63163128e-4, -2.11149449e-4,
269 -2.11149449e-4, -4.74689854e-4, -5.80599854e-4, -0.00000000e-0, -5.80599854e-4, -4.74689854e-4, -2.11149449e-4, -1.63163128e-4,
270 -1.63163128e-4, -2.11149449e-4, -4.74689854e-4, -5.80599854e-4, -0.00000000e-0, -5.80599854e-4, -4.74689854e-4, -2.11149449e-4,
271 -2.11149449e-4, -1.63163128e-4, -2.11149449e-4, -4.74689854e-4, -5.80599854e-4, -0.00000000e-0, -5.80599854e-4, -4.74689854e-4,
272 -4.74689854e-4, -2.11149449e-4, -1.63163128e-4, -2.11149449e-4, -4.74689854e-4, -5.80599854e-4, -0.00000000e-0, -5.80599854e-4,
273 -5.80599854e-4, -4.74689854e-4, -2.11149449e-4, -1.63163128e-4, -2.11149449e-4, -4.74689854e-4, -5.80599854e-4, -0.00000000e-0,
274 ];
275 #[rustfmt::skip]
276 let pair_disp3 = vec![
277 0.00000000e-0, 3.39353850e-7, 8.74462839e-7, 1.17634100e-6, 9.86937310e-7, 1.17634100e-6, 8.74462839e-7, 3.39353850e-7,
278 3.39353850e-7, 0.00000000e-0, 3.39353850e-7, 8.74462839e-7, 1.17634100e-6, 9.86937310e-7, 1.17634100e-6, 8.74462839e-7,
279 8.74462839e-7, 3.39353850e-7, 0.00000000e-0, 3.39353850e-7, 8.74462839e-7, 1.17634100e-6, 9.86937310e-7, 1.17634100e-6,
280 1.17634100e-6, 8.74462839e-7, 3.39353850e-7, 0.00000000e-0, 3.39353850e-7, 8.74462839e-7, 1.17634100e-6, 9.86937310e-7,
281 9.86937310e-7, 1.17634100e-6, 8.74462839e-7, 3.39353850e-7, 0.00000000e-0, 3.39353850e-7, 8.74462839e-7, 1.17634100e-6,
282 1.17634100e-6, 9.86937310e-7, 1.17634100e-6, 8.74462839e-7, 3.39353850e-7, 0.00000000e-0, 3.39353850e-7, 8.74462839e-7,
283 8.74462839e-7, 1.17634100e-6, 9.86937310e-7, 1.17634100e-6, 8.74462839e-7, 3.39353850e-7, 0.00000000e-0, 3.39353850e-7,
284 3.39353850e-7, 8.74462839e-7, 1.17634100e-6, 9.86937310e-7, 1.17634100e-6, 8.74462839e-7, 3.39353850e-7, 0.00000000e-0,
285 ];
286
287 let model = DFTD4Model::new(&numbers, &positions, None, None, None);
288
289 let param = DFTD4RationalDampingParamBuilder::default()
290 .s8(1.20065498)
291 .a1(0.40085597)
292 .a2(5.02928789)
293 .build()
294 .unwrap()
295 .new_param();
296 let res = model.get_pairwise_dispersion(¶m);
297
298 for (a, b) in res.pair_energy2.iter().zip(pair_disp2.iter()) {
299 assert_abs_diff_eq!(a, b, epsilon = thr);
300 }
301
302 for (a, b) in res.pair_energy3.iter().zip(pair_disp3.iter()) {
303 assert_abs_diff_eq!(a, b, epsilon = thr);
304 }
305}
pub fn new_param_f(self) -> Result<DFTD4Param, DFTD4Error>
Trait Implementations§
Source§impl Clone for DFTD4RationalDampingParam
impl Clone for DFTD4RationalDampingParam
Source§fn clone(&self) -> DFTD4RationalDampingParam
fn clone(&self) -> DFTD4RationalDampingParam
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for DFTD4RationalDampingParam
impl RefUnwindSafe for DFTD4RationalDampingParam
impl Send for DFTD4RationalDampingParam
impl Sync for DFTD4RationalDampingParam
impl Unpin for DFTD4RationalDampingParam
impl UnwindSafe for DFTD4RationalDampingParam
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more