diff options
author | 2022-09-12 15:32:15 -0700 | |
---|---|---|
committer | 2022-09-12 15:32:15 -0700 | |
commit | 425d22a5b596eb1ceb8e5a07d1ed3766870f9d9e (patch) | |
tree | 6313c8618f4964aacdf7094e3ec6a0345dfe2cfd /Source/ablastr/utils/UsedInputsFile.cpp | |
parent | 70f9a863469f5e005d5742433c5207d723d3ac42 (diff) | |
download | WarpX-425d22a5b596eb1ceb8e5a07d1ed3766870f9d9e.tar.gz WarpX-425d22a5b596eb1ceb8e5a07d1ed3766870f9d9e.tar.zst WarpX-425d22a5b596eb1ceb8e5a07d1ed3766870f9d9e.zip |
ABLASTR: Move Used Inputs Helper (#3376)
Move the helper to write a file for used inputs to ABLASTR.
Diffstat (limited to '')
-rw-r--r-- | Source/ablastr/utils/UsedInputsFile.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Source/ablastr/utils/UsedInputsFile.cpp b/Source/ablastr/utils/UsedInputsFile.cpp new file mode 100644 index 000000000..175c67619 --- /dev/null +++ b/Source/ablastr/utils/UsedInputsFile.cpp @@ -0,0 +1,30 @@ +/* Copyright 2022 Axel Huebl + * + * This file is part of WarpX. + * + * License: BSD-3-Clause-LBNL + */ + +#include "UsedInputsFile.H" + +#include <AMReX_ParallelDescriptor.H> +#include <AMReX_ParmParse.H> +#include <AMReX_Print.H> + +#include <fstream> +#include <ios> +#include <string> + + +void +ablastr::utils::write_used_inputs_file (std::string const & filename) +{ + amrex::Print() << "For full input parameters, see the file: " << filename << "\n\n"; + + if (amrex::ParallelDescriptor::IOProcessor()) { + std::ofstream jobInfoFile; + jobInfoFile.open(filename.c_str(), std::ios::out); + amrex::ParmParse::dumpTable(jobInfoFile, true); + jobInfoFile.close(); + } +} |