Skip to content

Commit

Permalink
Add version of Read that takes MultiFab as argument
Browse files Browse the repository at this point in the history
  • Loading branch information
dpgrote committed Nov 1, 2024
1 parent d071ae4 commit 4c4ee46
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Base/VisMF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,15 @@ void init_VisMF(py::module &m)
py::return_value_policy::move,
py::arg("name"),
"Reads a MultiFab from the specified file")
.def_static("Read",
[](const std::string &name, amrex::MultiFab &mf) {
if (amrex::VisMF::Exist(name)) {
amrex::VisMF::Read(mf, name);
} else {
throw std::runtime_error("MultiFab file " + name + " couldn't be found!");
}
},
py::arg("name"), py::arg("mf"),
"Reads a MultiFab from the specified file into the given MultiFab. The BoxArray on the disk must match the BoxArray * in mf")
;
}

0 comments on commit 4c4ee46

Please sign in to comment.