aboutsummaryrefslogtreecommitdiff
path: root/Source/ablastr/utils/UsedInputsFile.cpp
diff options
context:
space:
mode:
authorGravatar Axel Huebl <axel.huebl@plasma.ninja> 2022-09-12 15:32:15 -0700
committerGravatar GitHub <noreply@github.com> 2022-09-12 15:32:15 -0700
commit425d22a5b596eb1ceb8e5a07d1ed3766870f9d9e (patch)
tree6313c8618f4964aacdf7094e3ec6a0345dfe2cfd /Source/ablastr/utils/UsedInputsFile.cpp
parent70f9a863469f5e005d5742433c5207d723d3ac42 (diff)
downloadWarpX-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.cpp30
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();
+ }
+}