diff options
Diffstat (limited to 'Source/Laser/LaserProfilesImpl/LaserProfileFieldFunction.cpp')
-rw-r--r-- | Source/Laser/LaserProfilesImpl/LaserProfileFieldFunction.cpp | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/Source/Laser/LaserProfilesImpl/LaserProfileFieldFunction.cpp b/Source/Laser/LaserProfilesImpl/LaserProfileFieldFunction.cpp index bc0b4381d..876a56d53 100644 --- a/Source/Laser/LaserProfilesImpl/LaserProfileFieldFunction.cpp +++ b/Source/Laser/LaserProfilesImpl/LaserProfileFieldFunction.cpp @@ -27,33 +27,12 @@ using namespace amrex; void WarpXLaserProfiles::FieldFunctionLaserProfile::init ( const amrex::ParmParse& ppl, - const amrex::ParmParse& ppc, CommonLaserParameters /*params*/) { // Parse the properties of the parse_field_function profile - ppl.get("field_function(X,Y,t)", m_params.field_function); - m_parser.define(m_params.field_function); - m_parser.registerVariables({"X","Y","t"}); - - std::set<std::string> symbols = m_parser.symbols(); - symbols.erase("X"); - symbols.erase("Y"); - symbols.erase("t"); // after removing variables, we are left with constants - for (auto it = symbols.begin(); it != symbols.end(); ) { - Real v; - if (utils::parser::queryWithParser(ppc, it->c_str(), v)) { - m_parser.setConstant(*it, v); - it = symbols.erase(it); - } else { - ++it; - } - } - - std::stringstream ss; - for (auto const& s : symbols) ss << " " << s; - WARPX_ALWAYS_ASSERT_WITH_MESSAGE(symbols.empty(), - "Laser Profile: Unknown symbols " + ss.str()); - + utils::parser::Store_parserString( + ppl, "field_function(X,Y,t)", m_params.field_function); + m_parser = utils::parser::makeParser(m_params.field_function,{"X","Y","t"}); } void |