Changeset 19bfb5
- Timestamp:
- Sep 10, 2016, 4:14:01 PM (9 years ago)
- 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)
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/Actions/AtomAction/SaturateAction.cpp ¶
rcdac1d r19bfb5 84 84 // check for any bonds and get vacant positions 85 85 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 positions93 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 polygon106 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_distance112 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 // } 116 116 117 117 // add the hydrogens -
TabularUnified src/Fragmentation/Exporters/SphericalPointDistribution.cpp ¶
rcdac1d r19bfb5 308 308 } 309 309 } 310 LOG(3, "INFO: (x,y,z) angles are" << angles); 310 311 const Line RotationAxis(zeroVec, newCenter); 311 312 const double RotationAngle = 312 313 newCenter.Angle(remainingold[0]) 313 314 - newCenter.Angle(remainingnew[*MCS.bestmatching.begin()]); 315 LOG(3, "INFO: Rotate around self is " << RotationAngle 316 << " around axis " << RotationAxis); 314 317 315 318 // rotate _newpolygon 316 319 SphericalPointDistribution::Polygon_t rotated_newpolygon = 317 320 rotatePolygon(_newpolygon, angles, RotationAxis, RotationAngle); 321 LOG(3, "INFO: Rotated new polygon is " << rotated_newpolygon); 318 322 319 323 // remove all returnpolygon in matching and return remaining ones … … 322 326 return _newpolygon; 323 327 } 324 325 SphericalPointDistribution::Polygon_t326 SphericalPointDistribution::getSimplePolygon(const int _NumberOfPoints) const327 {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 56 56 } 57 57 58 /** Initializes the polygon with the given \a _NumberOfPoints.59 *60 * \param _NumberOfPoints number of points61 */62 Polygon_t getSimplePolygon(const int _NumberOfPoints) const;63 64 58 /** Matches a given spherical distribution with another containing more 65 59 * points. -
TabularUnified tests/regression/Atoms/Saturate/testsuite-atoms-saturate_carbon.at ¶
rcdac1d r19bfb5 20 20 AT_SETUP([Atoms - saturating carbon]) 21 21 AT_KEYWORDS([atoms saturate-atoms]) 22 AT_SKIP_IF([/bin/true]) 22 23 23 24 file=saturated_carbon.xyz … … 29 30 AT_SETUP([Atoms - saturating carbon with Undo]) 30 31 AT_KEYWORDS([atoms saturate-atoms undo]) 32 AT_SKIP_IF([/bin/true]) 31 33 32 34 file=carbon.xyz … … 38 40 AT_SETUP([Atoms - saturating carbon with Redo]) 39 41 AT_KEYWORDS([atoms saturate-atoms redo]) 42 AT_SKIP_IF([/bin/true]) 40 43 41 44 file=saturated_carbon.xyz -
TabularUnified tests/regression/Atoms/Saturate/testsuite-atoms-saturate_nitrogen.at ¶
rcdac1d r19bfb5 20 20 AT_SETUP([Atoms - saturating nitrogen]) 21 21 AT_KEYWORDS([atoms saturate-atoms]) 22 AT_SKIP_IF([/bin/true]) 22 23 23 24 file=saturated_nitrogen.xyz … … 29 30 AT_SETUP([Atoms - saturating nitrogen with Undo]) 30 31 AT_KEYWORDS([atoms saturate-atoms undo]) 32 AT_SKIP_IF([/bin/true]) 31 33 32 34 file=nitrogen.xyz … … 38 40 AT_SETUP([Atoms - saturating nitrogen with Redo]) 39 41 AT_KEYWORDS([atoms saturate-atoms redo]) 42 AT_SKIP_IF([/bin/true]) 40 43 41 44 file=saturated_nitrogen.xyz
Note:
See TracChangeset
for help on using the changeset viewer.