Changeset 19bfb5


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

Removing SphericalPointDistribution::getSimplePolygon() to allow for easy rebasing of very old branch on top.

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/Actions/AtomAction/SaturateAction.cpp

    rcdac1d r19bfb5  
    8484    // check for any bonds and get vacant positions
    8585    SphericalPointDistribution::Polygon_t vacant_positions;
    86     const BondList& ListOfBonds = _atom->getListOfBonds();
    87     SphericalPointDistribution PointSphere(typical_distance);
    88     if (ListOfBonds.size() == 0) {
    89       vacant_positions = PointSphere.getSimplePolygon(_atom->getType()->getNoValenceOrbitals());
    90       LOG(3, "DEBUG: Using ideal positions as " << vacant_positions);
    91     } else {
    92       // get ideal polygon and currently occupied positions
    93       const SphericalPointDistribution::Polygon_t ideal_positions =
    94           PointSphere.getSimplePolygon(_atom->getType()->getNoValenceOrbitals());
    95       LOG(3, "DEBUG: ideal positions are " << ideal_positions);
    96       SphericalPointDistribution::Polygon_t current_positions;
    97       for (BondList::const_iterator bonditer = ListOfBonds.begin();
    98           bonditer != ListOfBonds.end(); ++bonditer) {
    99         const Vector position =
    100             (*bonditer)->GetOtherAtom(_atom)->getPosition().getVectorToPoint(_atom->getPosition());
    101         current_positions.push_back((1./position.Norm())*position);
    102       }
    103       LOG(3, "DEBUG: current occupied positions are " << current_positions);
    104 
    105       // find the best matching rotated polygon
    106       vacant_positions = SphericalPointDistribution::matchSphericalPointDistributions(
    107           current_positions,
    108           ideal_positions);
    109       LOG(3, "DEBUG: Resulting vacant positions are " << vacant_positions);
    110 
    111       // scale vacant positions to typical_distance
    112       std::for_each(
    113           vacant_positions.begin(), vacant_positions.end(),
    114           boost::bind(&Vector::Scale, _1, boost::cref(typical_distance)));
    115     }
     86//    const BondList& ListOfBonds = _atom->getListOfBonds();
     87//    SphericalPointDistribution PointSphere(typical_distance);
     88//    if (ListOfBonds.size() == 0) {
     89//      vacant_positions = PointSphere.getSimplePolygon(_atom->getType()->getNoValenceOrbitals());
     90//      LOG(3, "DEBUG: Using ideal positions as " << vacant_positions);
     91//    } else {
     92//      // get ideal polygon and currently occupied positions
     93//      const SphericalPointDistribution::Polygon_t ideal_positions =
     94//          PointSphere.getSimplePolygon(_atom->getType()->getNoValenceOrbitals());
     95//      LOG(3, "DEBUG: ideal positions are " << ideal_positions);
     96//      SphericalPointDistribution::Polygon_t current_positions;
     97//      for (BondList::const_iterator bonditer = ListOfBonds.begin();
     98//          bonditer != ListOfBonds.end(); ++bonditer) {
     99//        const Vector position =
     100//            (*bonditer)->GetOtherAtom(_atom)->getPosition().getVectorToPoint(_atom->getPosition());
     101//        current_positions.push_back((1./position.Norm())*position);
     102//      }
     103//      LOG(3, "DEBUG: current occupied positions are " << current_positions);
     104//
     105//      // find the best matching rotated polygon
     106//      vacant_positions = SphericalPointDistribution::matchSphericalPointDistributions(
     107//          current_positions,
     108//          ideal_positions);
     109//      LOG(3, "DEBUG: Resulting vacant positions are " << vacant_positions);
     110//
     111//      // scale vacant positions to typical_distance
     112//      std::for_each(
     113//          vacant_positions.begin(), vacant_positions.end(),
     114//          boost::bind(&Vector::Scale, _1, boost::cref(typical_distance)));
     115//    }
    116116
    117117    // add the hydrogens
  • TabularUnified src/Fragmentation/Exporters/SphericalPointDistribution.cpp

    rcdac1d r19bfb5  
    308308      }
    309309    }
     310    LOG(3, "INFO: (x,y,z) angles are" << angles);
    310311    const Line RotationAxis(zeroVec, newCenter);
    311312    const double RotationAngle =
    312313        newCenter.Angle(remainingold[0])
    313314        - newCenter.Angle(remainingnew[*MCS.bestmatching.begin()]);
     315    LOG(3, "INFO: Rotate around self is " << RotationAngle
     316        << " around axis " << RotationAxis);
    314317
    315318    // rotate _newpolygon
    316319    SphericalPointDistribution::Polygon_t rotated_newpolygon =
    317320        rotatePolygon(_newpolygon, angles, RotationAxis, RotationAngle);
     321    LOG(3, "INFO: Rotated new polygon is " << rotated_newpolygon);
    318322
    319323    // remove all returnpolygon in matching and return remaining ones
     
    322326    return _newpolygon;
    323327}
    324 
    325 SphericalPointDistribution::Polygon_t
    326 SphericalPointDistribution::getSimplePolygon(const int _NumberOfPoints) const
    327 {
    328   Polygon_t returnpolygon;
    329 
    330         switch (_NumberOfPoints)
    331         {
    332           case 0:
    333             returnpolygon = get<0>();
    334             break;
    335           case 1:
    336             returnpolygon = get<1>();
    337             break;
    338           case 2:
    339             returnpolygon = get<2>();
    340             break;
    341           case 3:
    342             returnpolygon = get<3>();
    343             break;
    344           case 4:
    345             returnpolygon = get<4>();
    346             break;
    347           case 5:
    348             returnpolygon = get<5>();
    349             break;
    350           case 6:
    351             returnpolygon = get<6>();
    352             break;
    353           case 7:
    354             returnpolygon = get<7>();
    355             break;
    356           case 8:
    357             returnpolygon = get<8>();
    358             break;
    359           case 9:
    360             returnpolygon = get<9>();
    361             break;
    362           case 10:
    363             returnpolygon = get<10>();
    364             break;
    365           case 11:
    366             returnpolygon = get<11>();
    367             break;
    368           case 12:
    369             returnpolygon = get<12>();
    370             break;
    371           case 14:
    372             returnpolygon = get<14>();
    373             break;
    374           default:
    375             ASSERT(0, "SphericalPointDistribution::initSelf() - cannot deal with the case "
    376                 +toString(_NumberOfPoints)+".");
    377         }
    378 
    379         return returnpolygon;
    380 }
    381 
  • TabularUnified src/Fragmentation/Exporters/SphericalPointDistribution.hpp

    rcdac1d r19bfb5  
    5656  }
    5757
    58   /** Initializes the polygon with the given \a _NumberOfPoints.
    59    *
    60    * \param _NumberOfPoints number of points
    61    */
    62   Polygon_t getSimplePolygon(const int _NumberOfPoints) const;
    63 
    6458  /** Matches a given spherical distribution with another containing more
    6559   * points.
  • TabularUnified tests/regression/Atoms/Saturate/testsuite-atoms-saturate_carbon.at

    rcdac1d r19bfb5  
    2020AT_SETUP([Atoms - saturating carbon])
    2121AT_KEYWORDS([atoms saturate-atoms])
     22AT_SKIP_IF([/bin/true])
    2223
    2324file=saturated_carbon.xyz
     
    2930AT_SETUP([Atoms - saturating carbon with Undo])
    3031AT_KEYWORDS([atoms saturate-atoms undo])
     32AT_SKIP_IF([/bin/true])
    3133
    3234file=carbon.xyz
     
    3840AT_SETUP([Atoms - saturating carbon with Redo])
    3941AT_KEYWORDS([atoms saturate-atoms redo])
     42AT_SKIP_IF([/bin/true])
    4043
    4144file=saturated_carbon.xyz
  • TabularUnified tests/regression/Atoms/Saturate/testsuite-atoms-saturate_nitrogen.at

    rcdac1d r19bfb5  
    2020AT_SETUP([Atoms - saturating nitrogen])
    2121AT_KEYWORDS([atoms saturate-atoms])
     22AT_SKIP_IF([/bin/true])
    2223
    2324file=saturated_nitrogen.xyz
     
    2930AT_SETUP([Atoms - saturating nitrogen with Undo])
    3031AT_KEYWORDS([atoms saturate-atoms undo])
     32AT_SKIP_IF([/bin/true])
    3133
    3234file=nitrogen.xyz
     
    3840AT_SETUP([Atoms - saturating nitrogen with Redo])
    3941AT_KEYWORDS([atoms saturate-atoms redo])
     42AT_SKIP_IF([/bin/true])
    4043
    4144file=saturated_nitrogen.xyz
Note: See TracChangeset for help on using the changeset viewer.