gosh_adaptor/
null.rs

1// core
2
3use gosh_core::gchemol;
4use gosh_core::gut::prelude::*;
5use gosh_model::ModelProperties;
6use std::path::Path;
7
8/// Siesta model adaptor.
9pub struct Null();
10
11impl crate::ModelAdaptor for Null {
12    fn parse_all<P: AsRef<Path>>(&self, outfile: P) -> Result<Vec<ModelProperties>> {
13        unimplemented!()
14    }
15
16    fn parse_last<P: AsRef<Path>>(&self, outfile: P) -> Result<ModelProperties> {
17        use gchemol::prelude::*;
18
19        let mol = gchemol::Molecule::from_file(outfile)?;
20        let mut mp = ModelProperties::default();
21        mp.set_energy(0.0);
22        let f: Vec<_> = mol.positions().map(|_| [0.0; 3]).collect();
23        mp.set_forces(f);
24
25        Ok(mp)
26    }
27}