Changeset 2f3905 for src/Dynamics/ForceAnnealing.hpp
- Timestamp:
- Apr 10, 2018, 6:43:30 AM (7 years ago)
- Branches:
- AutomationFragmentation_failures, Candidate_v1.6.1, ChemicalSpaceEvaluator, Exclude_Hydrogens_annealWithBondGraph, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_contraction-expansion, Gui_displays_atomic_force_velocity, PythonUI_with_named_parameters, StoppableMakroAction, TremoloParser_IncreasedPrecision
- Children:
- 9861d0
- Parents:
- 038ccd
- git-author:
- Frederik Heber <frederik.heber@…> (06/27/17 21:17:18)
- git-committer:
- Frederik Heber <frederik.heber@…> (04/10/18 06:43:30)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Dynamics/ForceAnnealing.hpp
r038ccd r2f3905 457 457 const double &bondforce = projected_forces[0][side][index]; 458 458 const double &oldbondforce = projected_forces[1][side][index]; 459 const double bondforcedifference = (bondforce - oldbondforce); 459 const double bondforcedifference = fabs(bondforce - oldbondforce); 460 LOG(4, "DEBUG: bondforce for " << (side == leftside ? "left" : "right") 461 << " side of bond is " << bondforce); 462 LOG(4, "DEBUG: oldbondforce for " << (side == leftside ? "left" : "right") 463 << " side of bond is " << oldbondforce); 460 464 // if difference or bondforce itself is zero, do nothing 461 465 if ((fabs(bondforce) < MYEPSILON) || (fabs(bondforcedifference) < MYEPSILON)) 462 466 continue; 467 468 // get BondVector to bond 463 469 const BondVectors::mapped_t::const_iterator bviter = 464 470 bondvectors.find(current_bond); 465 471 ASSERT( bviter != bondvectors.end(), 466 472 "ForceAnnealing() - cannot find current_bond ?"); 473 ASSERT( fabs(bviter->second.Norm() -1.) < MYEPSILON, 474 "ForceAnnealing() - norm of BondVector is not one"); 467 475 const Vector &BondVector = bviter->second; 468 476 … … 484 492 485 493 // calculate step width 486 Vector PositionUpdate;487 494 double stepwidth = 488 495 fabs(projected_PositionDifference)/bondforcedifference; … … 491 498 if (currentStep != 1) 492 499 ELOG(1, "INFO: Barzilai-Borwein stepwidth is zero, using deltat " << currentDeltat << " instead."); 493 PositionUpdate = currentDeltat * BondVector;500 stepwidth = currentDeltat; 494 501 } 495 LOG(3, "DEBUG: Update would be " << PositionUpdate); 502 Vector PositionUpdate = stepwidth * currentGradient; 503 LOG(3, "DEBUG: Update would be " << stepwidth << "*" << currentGradient << " = " << PositionUpdate); 496 504 497 505 // add PositionUpdate for all nodes in the bondside_set … … 502 510 ASSERT( diter != distance_map[side].end(), 503 511 "ForceAnnealing() - could not find distance to an atom."); 504 const double factor = pow(damping_factor, diter->second );512 const double factor = pow(damping_factor, diter->second+1); 505 513 LOG(3, "DEBUG: Update for atom #" << *setiter << " will be " 506 514 << factor << "*" << PositionUpdate);
Note:
See TracChangeset
for help on using the changeset viewer.