Hipace
DeprecatedInput.H
Go to the documentation of this file.
1 /* Copyright 2021
2  *
3  * This file is part of HiPACE++.
4  *
5  * Authors: MaxThevenet
6  * License: BSD-3-Clause-LBNL
7  */
8 #ifndef HIPACE_DeprecatedInput_H_
9 #define HIPACE_DeprecatedInput_H_
10 
11 #include "Parser.H"
12 #include <AMReX_ParmParse.H>
13 #include <AMReX_Parser.H>
14 
15 inline void
16 DeprecatedInput (std::string const& pp_name, char const * const str,
17  std::string const& replacement, std::string const& msg="", bool new_prefix=false)
18 {
19  amrex::ParmParse pp(pp_name);
20  std::string tmp_str = "";
21  if (queryWithParser(pp, str, tmp_str)) {
23  "DEPRECATED INPUT ERROR:\n"
24  "Input parameter " + pp_name + "." + str + " no longer supported.\n"
25  "See " + (new_prefix ? "" : pp_name + ".") + replacement +
26  " instead (more info in the documentation). " + msg);
27  }
28 }
29 
30 #endif // HIPACE_DeprecatedInput_H_
amrex::ParmParse pp
void DeprecatedInput(std::string const &pp_name, char const *const str, std::string const &replacement, std::string const &msg="", bool new_prefix=false)
Definition: DeprecatedInput.H:16
bool queryWithParser(const amrex::ParmParse &pp, char const *const str, T &val)
return if input file contains the expression, if so it is parsed into val
Definition: Parser.H:467
void Abort(const std::string &msg)
str
Definition: checksumAPI.py:112