-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
221 additions
and
5 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
use crate::solution::Solutions; | ||
use hdf5::{File, Result}; | ||
use std::path::PathBuf; | ||
|
||
pub struct RISMWriter { | ||
pub name: String, | ||
pub data: Solutions, | ||
} | ||
|
||
impl RISMWriter { | ||
pub fn new(name: &String, data: Solutions) -> Self { | ||
RISMWriter { | ||
name: name.clone(), | ||
data, | ||
} | ||
} | ||
|
||
pub fn write(&self) -> Result<()> { | ||
let file = File::create(&self.name)?; | ||
let correlations_group = file.create_group("correlations")?; | ||
let direct_group = correlations_group.create_group("direct")?; | ||
|
||
let cr_builder = direct_group.new_dataset_builder(); | ||
let cr = cr_builder | ||
.with_data(&self.data.vv.correlations.cr) | ||
.create("direct correlation function")?; | ||
println!("{:?}", file); | ||
Ok(()) | ||
} | ||
} |