Commit 4d69debb authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

Fix dielectric constant definition for parallel SPHERE working in XIV mode

parent 9db49646
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -494,7 +494,8 @@ int sphere_jxi488_cycle(
  // Dynamic order check
  const int max_lm = gconf->l_max;
  int l_max = gconf->l_max;
  const double alamb = 2.0 * pi / vk;
  double xi_factor = (sconf->reference_variable_name.compare("XIV") == 0) ? xi : 1.0;
  const double alamb = 2.0 * pi * xi_factor / vk;
  double size_par_lm = 2.0 * pi * sqrt(exdc) * sconf->get_max_radius() / alamb;
  int recommended_lm = 4 + (int)ceil(size_par_lm + 4.05 * pow(size_par_lm, 1.0 / 3.0));
  if (recommended_lm != l_max) {
@@ -502,7 +503,7 @@ int sphere_jxi488_cycle(
      if (gconf->dyn_order_flag > 0) {
	int new_lm = recommended_lm;
	message = "INFO: lowering internal order from " + to_string(max_lm) + " to "
	  + to_string(recommended_lm) + " for scale iteration " + to_string(jxi488) + ".\n";
	  + to_string(recommended_lm) + " for scale iteration " + to_string(jxi488 + 1) + ".\n";
	logger->log(message, LOG_INFO);
	sid->update_order(new_lm);
	is_first_scale = true;
@@ -510,7 +511,7 @@ int sphere_jxi488_cycle(
	l_max = new_lm;
      } else {
	message = "WARNING: internal order " + to_string(max_lm) + " for scale iteration "
	  + to_string(jxi488) + " too high (recommended order is " + to_string(recommended_lm)
	  + to_string(jxi488 + 1) + " too high (recommended order is " + to_string(recommended_lm)
	  + ").\n";
      logger->log(message, LOG_WARN);
      }
@@ -536,8 +537,9 @@ int sphere_jxi488_cycle(
	sid->c1->dc0[ic] = sconf->get_dielectric_constant(ic, i132, jxi488); // WARNING: IDFC=0 is not tested!
    } else { // IDFC != 0
      if (is_first_scale) {
	int scale_to_extract = (sconf->reference_variable_name.compare("XIV") == 0) ? 0 : jxi488;
	for (int ic = 0; ic < ici; ic++) {
	  sid->c1->dc0[ic] = sconf->get_dielectric_constant(ic, i132, jxi488);
	  sid->c1->dc0[ic] = sconf->get_dielectric_constant(ic, i132, scale_to_extract);
	}
      }
    }
+2 −2

File changed.

Contains only whitespace changes.