28 ParmParse pp_erf(
"erf");
31 pp.add(
"refine_grid_layout_x",1);
32 pp.add(
"refine_grid_layout_y",1);
33 pp.add(
"refine_grid_layout_z",0);
46 int no_box_split_dir = 2;
47 pp.queryAdd(
"no_box_split_dir",no_box_split_dir);
57 int max_grid_size = 2048;
58 pp.queryAdd(
"max_grid_size",max_grid_size);
62 int blocking_factor = 1;
63 pp.queryAdd(
"blocking_factor",blocking_factor);
66 pp.queryAdd(
"n_error_buf",n_error_buf);
68 amrex::Vector<int> legacy_n_cell;
69 amrex::Vector<int> erf_n_cell;
70 const bool has_legacy_n_cell =
pp.queryarr(
"n_cell", legacy_n_cell);
71 const bool has_erf_n_cell = pp_erf.queryarr(
"n_cell", erf_n_cell);
72 if (has_erf_n_cell && has_legacy_n_cell) {
73 amrex::Abort(
"erf.n_cell and amr.n_cell are both specified. Please use only one!");
76 pp.addarr(
"n_cell", erf_n_cell);
79 ParmParse pp_geometry(
"geometry");
80 amrex::Vector<amrex::Real> legacy_prob_lo;
81 amrex::Vector<amrex::Real> legacy_prob_hi;
82 amrex::Vector<amrex::Real> legacy_prob_extent;
83 amrex::Vector<int> legacy_is_periodic;
84 amrex::Vector<amrex::Real> erf_prob_lo;
85 amrex::Vector<amrex::Real> erf_prob_hi;
86 amrex::Vector<amrex::Real> erf_prob_extent;
87 amrex::Vector<int> erf_is_periodic;
89 const bool has_legacy_prob_lo = pp_geometry.queryarr(
"prob_lo", legacy_prob_lo);
90 const bool has_legacy_prob_hi = pp_geometry.queryarr(
"prob_hi", legacy_prob_hi);
91 const bool has_legacy_prob_extent = pp_geometry.queryarr(
"prob_extent", legacy_prob_extent);
92 const bool has_legacy_is_periodic = pp_geometry.queryarr(
"is_periodic", legacy_is_periodic);
94 const bool has_erf_prob_lo = pp_erf.queryarr(
"prob_lo", erf_prob_lo);
95 const bool has_erf_prob_hi = pp_erf.queryarr(
"prob_hi", erf_prob_hi);
96 const bool has_erf_prob_extent = pp_erf.queryarr(
"prob_extent", erf_prob_extent);
97 const bool has_erf_is_periodic = pp_erf.queryarr(
"is_periodic", erf_is_periodic);
99 if (has_erf_prob_lo && has_legacy_prob_lo) {
100 amrex::Abort(
"erf.prob_lo and geometry.prob_lo are both specified. Please use only one!");
102 if ((has_erf_prob_hi || has_erf_prob_extent) && !has_erf_prob_lo) {
103 amrex::Abort(
"ERF prefixed geometry requires erf.prob_lo together with erf.prob_hi or erf.prob_extent.");
105 if (has_erf_is_periodic && has_legacy_is_periodic) {
106 amrex::Abort(
"erf.is_periodic and geometry.is_periodic are both specified. Please use only one!");
108 if (has_erf_prob_hi && has_legacy_prob_hi) {
109 amrex::Abort(
"erf.prob_hi and geometry.prob_hi are both specified. Please use only one!");
111 if (has_erf_prob_extent && has_legacy_prob_extent) {
112 amrex::Abort(
"erf.prob_extent and geometry.prob_extent are both specified. Please use only one!");
114 if (has_erf_prob_hi || has_erf_prob_extent) {
115 if (has_legacy_prob_hi || has_legacy_prob_extent) {
116 amrex::Abort(
"ERF prefixed geometry and legacy geometry.prob_hi/prob_extent are both specified. Please use only one form.");
119 if (has_erf_prob_hi && has_erf_prob_extent) {
120 amrex::Vector<amrex::Real> derived_prob_hi(erf_prob_extent.size(), 0.0);
121 for (
int i = 0; i < static_cast<int>(erf_prob_extent.size()); ++i) {
122 derived_prob_hi[i] = (i < static_cast<int>(erf_prob_lo.size()) ? erf_prob_lo[i] : 0.0) + erf_prob_extent[i];
125 derived_prob_hi.size() == erf_prob_hi.size(),
126 "erf.prob_hi and erf.prob_extent have inconsistent lengths.");
127 for (
int i = 0; i < static_cast<int>(erf_prob_hi.size()); ++i) {
128 if (derived_prob_hi[i] != erf_prob_hi[i]) {
129 amrex::Abort(
"erf.prob_hi and erf.prob_extent are both specified but inconsistent.");
134 if (has_erf_prob_lo) {
135 pp_geometry.addarr(
"prob_lo", erf_prob_lo);
137 if (has_erf_prob_hi) {
138 pp_geometry.addarr(
"prob_hi", erf_prob_hi);
139 }
else if (has_erf_prob_extent) {
140 amrex::Vector<amrex::Real> derived_prob_hi(erf_prob_extent.size(), 0.0);
141 for (
int i = 0; i < static_cast<int>(erf_prob_extent.size()); ++i) {
142 derived_prob_hi[i] = (i < static_cast<int>(erf_prob_lo.size()) ? erf_prob_lo[i] : 0.0) + erf_prob_extent[i];
144 pp_geometry.addarr(
"prob_hi", derived_prob_hi);
146 if (has_erf_is_periodic) {
147 pp_geometry.addarr(
"is_periodic", erf_is_periodic);
AMREX_ALWAYS_ASSERT_WITH_MESSAGE(m_cloud_chamber_config.active, "Cloud Chamber: initializer reached without a parsed configuration")