Ignore:
Timestamp:
Sep 10, 2016, 4:14:01 PM (9 years ago)
Author:
Frederik Heber <heber@…>
Branches:
SaturateAtoms_singleDegree
Children:
022d3b
Parents:
19bfb5
git-author:
Frederik Heber <heber@…> (05/10/16 20:35:40)
git-committer:
Frederik Heber <heber@…> (09/10/16 16:14:01)
Message:

Added Logging to SphericalPointDistribution for debugging.

Location:
src/Fragmentation/Exporters
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Fragmentation/Exporters/SphericalPointDistribution.cpp

    r19bfb5 r0096a40  
    106106
    107107  if (_Matching.size() > 1) {
    108     // convert matching into two vectors to calculate distance among another
     108    LOG(3, "INFO: Matching is " << _Matching);
    109109
    110110    // calculate all pair-wise distances
     
    127127      errors.second += gap*gap;
    128128    }
    129   }
     129  } else
     130    ELOG(2, "calculateErrorOfMatching() - Given matching is empty.");
     131  LOG(3, "INFO: Resulting errors for matching (L1, L2): "
     132      << errors.first << "," << errors.second << ".");
    130133
    131134  return errors;
     
    140143  IndexArray_t indices(_matchingindices.begin(), _matchingindices.end());
    141144  std::sort(indices.begin(), indices.end());
     145  LOG(4, "DEBUG: sorted matching is " << indices);
    142146  IndexArray_t::const_iterator valueiter = indices.begin();
    143147  SphericalPointDistribution::Polygon_t::const_iterator pointiter =
     
    150154      remainingreturnpolygon.push_back(*pointiter);
    151155  }
     156  LOG(4, "DEBUG: remaining indices are " << remainingreturnpolygon);
    152157
    153158  return remainingreturnpolygon;
     
    177182      "rotatePolygon() - not exactly "+toString(3)+" angles given.");
    178183  rotation.setRotation(_angles[0] * M_PI/180., _angles[1] * M_PI/180., _angles[2] * M_PI/180.);
     184  LOG(4, "DEBUG: Rotation matrix is " << rotation);
    179185
    180186  // apply rotation angles
     
    209215    unsigned int _matchingsize)
    210216{
     217  LOG(4, "DEBUG: Recursing with current matching " << _matching
     218      << ", remaining indices " << _indices
     219      << ", and sought size " << _matchingsize);
    211220  //!> threshold for L1 error below which matching is immediately acceptable
    212221  const double L1THRESHOLD = 1e-2;
    213222  if (!_MCS.foundflag) {
     223    LOG(3, "INFO: Current matching has size " << _matching.size() << " of " << _matchingsize);
    214224    if (_matching.size() < _matchingsize) {
    215225      // go through all indices
     
    218228        // add index to matching
    219229        _matching.push_back(*iter);
     230        LOG(4, "DEBUG: Adding " << *iter << " to matching.");
    220231        // remove index but keep iterator to position (is the next to erase element)
    221232        IndexList_t::iterator backupiter = _indices.erase(iter);
     
    231242      _MCS.foundflag = true;
    232243    } else {
     244      LOG(3, "INFO: Found matching " << _matching);
    233245      // calculate errors
    234246      std::pair<double, double> errors = calculateErrorOfMatching(
     
    255267  VectorArray_t remainingold(_polygon.begin(), _polygon.end());
    256268  VectorArray_t remainingnew(_newpolygon.begin(), _newpolygon.end());
     269  LOG(3, "INFO: Matching old polygon " << _polygon
     270      << " with new polygon " << _newpolygon);
    257271
    258272  if (_polygon.size() > 0) {
     
    276290      recurseMatchings(MCS, matching, indices, matchingsize);
    277291    }
     292    LOG(3, "INFO: Best matching is " << MCS.bestmatching);
    278293
    279294    // determine rotation angles to align the two point distributions with
     
    292307      oldCenter *= 1./(double)i;
    293308      newCenter *= 1./(double)i;
     309      LOG(3, "INFO: oldCenter is " << oldCenter << ", newCenter is " << newCenter);
    294310
    295311      Vector direction(0.,0.,0.);
  • src/Fragmentation/Exporters/SphericalPointDistribution.hpp

    r19bfb5 r0096a40  
    7272      );
    7373
    74 
    7574  //!> default radius of the spherical distribution
    7675  const double Bondlength;
Note: See TracChangeset for help on using the changeset viewer.