aboutsummaryrefslogtreecommitdiff
path: root/Source/Utils/WarpXUtil.H
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Utils/WarpXUtil.H')
-rw-r--r--Source/Utils/WarpXUtil.H14
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/Utils/WarpXUtil.H b/Source/Utils/WarpXUtil.H
index d3682be2f..e5a01a44a 100644
--- a/Source/Utils/WarpXUtil.H
+++ b/Source/Utils/WarpXUtil.H
@@ -161,6 +161,20 @@ T trilinear_interp(T x0, T x1,T y0, T y1, T z0, T z1,
*/
WarpXParser makeParser (std::string const& parse_function, std::vector<std::string> const& varnames);
+/**
+ * \brief Similar to amrex::ParmParse::query, but also supports math expressions for the value.
+ *
+ * amrex::ParmParse::query reads a name and a value from the input file. This function does the
+ * same, and applies the WarpXParser to the value, so the user has the choice to specify a value or
+ * a math expression (including user-defined constants).
+ * Only works for amrex::Real numbers, one would need another version for integers etc.
+ *
+ * \param[in] a_pp amrex::ParmParse object
+ * \param[in] str name of the parameter to read
+ * \param[out] val where the value queried and parsed is stored
+ */
+int queryWithParser (amrex::ParmParse& a_pp, char const * const str, amrex::Real& val);
+
namespace WarpXUtilMsg{
/** \brief If is_expression_true is false, this function prints msg and calls amrex::abort()