Commit 2f9ec364 authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

Force CLUSTER to choose among the maximum allowed order and the recommended order

parent d7bef347
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -732,6 +732,8 @@ int cluster_jxi488_cycle(int jxi488, ScattererConfiguration *sconf, GeometryConf
    output->vec_xi[jindex - 1] = xi;
  }
  // Dynamic order check
  const int max_li = gconf->li;
  const int max_le = gconf->le;
  const double alamb = 2.0 * pi / cid->vk;
  double size_par_li = 2.0 * pi * sqrt(exdc) * sconf->get_max_radius() / alamb;
  int recommended_li = 4 + (int)ceil(size_par_li + 4.05 * pow(size_par_li, 1.0 / 3.0));
@@ -758,15 +760,15 @@ int cluster_jxi488_cycle(int jxi488, ScattererConfiguration *sconf, GeometryConf
	+ to_string(recommended_le) + " for scale iteration " + to_string(jxi488) + ".\n";
      logger->log(message, LOG_INFO);
    }
    if (recommended_li < cid->c1->li || recommended_le < cid->c1->le) {
      int new_li = (recommended_li < cid->c1->li) ? recommended_li : cid->c1->li;
      int new_le = (recommended_le < cid->c1->le) ? recommended_le : cid->c1->le;
    if (recommended_li < max_li || recommended_le < max_le) {
      int new_li = (recommended_li < max_li) ? recommended_li : max_li;
      int new_le = (recommended_le < max_le) ? recommended_le : max_le;
      cid->update_orders(sconf->_rcf, new_li, new_le);
      is_first_scale = true;
      jaw = 1;
    }
      cid->refinemode = 2;
    }
  }
  int li = cid->c1->li;
  int le = cid->c1->le;
  int lm = cid->c1->lm;