Commit a85f35ba authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

Remove average radius calculation from particle geometry description

parent acf7a405
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -1169,19 +1169,17 @@ double ScattererConfiguration::get_particle_radius(GeometryConfiguration *gc) {
  } else {
    double dist2, max_dist;
    double max_dist2 = 0.0;
    double avgX = 0.0, avgY = 0.0, avgZ = 0.0, avg_radius = 0.0;
#pragma omp parallel for reduction(+: avgX, avgY, avgZ, avg_radius)
    double avgX = 0.0, avgY = 0.0, avgZ = 0.0;
#pragma omp parallel for reduction(+: avgX, avgY, avgZ)
    for (int si = 0; si < _number_of_spheres; si++) {
      double sph_radius = get_radius(si);
      avgX += (sph_radius * gc->get_sph_x(si));
      avgY += (sph_radius * gc->get_sph_y(si));
      avgZ += (sph_radius * gc->get_sph_z(si));
      avg_radius += sph_radius;
    }
    avg_radius /= _number_of_spheres;
    avgX /= (_number_of_spheres * avg_radius);
    avgY /= (_number_of_spheres * avg_radius);
    avgZ /= (_number_of_spheres * avg_radius);
    avgX /= _number_of_spheres;
    avgY /= _number_of_spheres;
    avgZ /= _number_of_spheres;
    // int configuration = 0;
    for (int si = 0; si < _number_of_spheres; si++) {
      // int iogi = _iog_vec[si];
+4 −7
Original line number Diff line number Diff line
@@ -628,7 +628,6 @@ def print_model_summary(scatterer, geometry):
    avgX = 0.0
    avgY = 0.0
    avgZ = 0.0
    avgROS = 0.0
    Rmin = 0.0
    Rmax = 0.0
    Reqm = 0.0
@@ -636,22 +635,20 @@ def print_model_summary(scatterer, geometry):
    Rcirc = 0.0
    square_farthest = 0.0
    for i in range(scatterer['nsph']):
        sph_type_index = scatterer['vec_types'][i] - 1
        ros = scatterer['ros'][sph_type_index]
        avgX += (ros * geometry['vec_sph_x'][i])
        avgY += (ros * geometry['vec_sph_y'][i])
        avgZ += (ros * geometry['vec_sph_z'][i])
        avgROS += ros
        sph_type_index = scatterer['vec_types'][i] - 1
        R3tot += math.pow(ros, 3.0)
        if (ros > Rmax):
            Rmax = ros
        if (Rmin == 0.0 or ros < Rmin):
            Rmin = ros
    Reqm = math.pow(R3tot, 1.0 / 3.0)
    avgROS /= scatterer['nsph']
    avgX /= (avgROS * scatterer['nsph'])
    avgY /= (avgROS * scatterer['nsph'])
    avgZ /= (avgROS * scatterer['nsph'])
    avgX /= scatterer['nsph']
    avgY /= scatterer['nsph']
    avgZ /= scatterer['nsph']
    for i in range(scatterer['nsph']):
        sph_type_index = scatterer['vec_types'][i] - 1
        ros = scatterer['ros'][sph_type_index]