39 std::string poisson_solver =
"fft";
40 pp_algo.
queryAdd(
"poisson_solver", poisson_solver);
45 if (max_level > 1 && space_charge != SpaceChargeAlgo::False)
46 throw std::runtime_error(
47 "Mesh-refinement (amr.max_level>=0) is only supported with "
48 "space charge modeling (algo.space_charge=1).");
52 prob_relative[0] = 3.0;
53 pp_geometry.
queryarr(
"prob_relative", prob_relative);
55 if (prob_relative[0] < 3.0 && space_charge != SpaceChargeAlgo::False && poisson_solver ==
"multigrid")
57 "ImpactX::read_mr_prob_relative",
58 "Dynamic resizing of the mesh uses a geometry.prob_relative "
59 "padding of less than 3 for level 0. This might result in boundary "
60 "artifacts for space charge calculation. "
61 "There is no minimum good value for this parameter, consider "
62 "doing a convergence test.",
63 ablastr::warn_manager::WarnPriority::high
66 if (prob_relative[0] < 1.0)
67 throw std::runtime_error(
"geometry.prob_relative must be >= 1.0 (the beam size) on the coarsest level");
70 amrex::Real last_lev_rel = std::numeric_limits<amrex::Real>::max();
71 for (
int lev = 0; lev <= max_level; ++lev) {
72 amrex::Real
const prob_relative_lvl = prob_relative[lev];
73 if (prob_relative_lvl <= 0.0)
74 throw std::runtime_error(
"geometry.prob_relative must be strictly positive for all levels");
75 if (prob_relative_lvl > last_lev_rel)
76 throw std::runtime_error(
"geometry.prob_relative must be descending over refinement levels");
78 last_lev_rel = prob_relative_lvl;