Created
August 29, 2017 13:23
-
-
Save C0nsultant/b309c2061c3fb5d2bdb35a2f735e45f6 to your computer and use it in GitHub Desktop.
Writing scalar openPMD recrod
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
#include "include/Output.hpp" | |
int main(int argc, char *argv[]) | |
{ | |
Output o("./working/directory/", | |
"file_name", | |
Output::IterationEncoding::fileBased, | |
Format::HDF5, | |
AccessType::CREAT); | |
Mesh& m = o.iterations[1].meshes["mesh_name"]; | |
auto& scalar = m[RecordComponent::SCALAR]; | |
double *d; | |
Dataset dset = Dataset(d, {1000, 1000, 1000}); | |
scalar.resetDataset(dset); | |
std::shared_ptr< double > data(d); | |
scalar.storeChunk({0, 0, 0}, {1000, 1000, 1000}, data); | |
o.flush(); | |
return 0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As little of a readable boilerplate as possible for writing a single scalar mesh record. @s0vereign