Changeset 90050b for src


Ignore:
Timestamp:
Apr 10, 2018, 6:43:31 AM (7 years ago)
Author:
Frederik Heber <frederik.heber@…>
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:
441d40
Parents:
07d4b1
git-author:
Frederik Heber <frederik.heber@…> (08/02/17 20:28:00)
git-committer:
Frederik Heber <frederik.heber@…> (04/10/18 06:43:31)
Message:

Center of weight translation removed from GatheredUpdates.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Dynamics/ForceAnnealing.hpp

    r07d4b1 r90050b  
    501501    }
    502502
     503    // remove center of weight translation from gathered updates
     504    Vector CommonTranslation;
     505    for (std::map<atomId_t, Vector>::const_iterator iter = GatheredUpdates.begin();
     506        iter != GatheredUpdates.end(); ++iter) {
     507      const Vector &update = iter->second;
     508      CommonTranslation += update;
     509    }
     510    CommonTranslation *= 1./(double)GatheredUpdates.size();
     511    LOG(3, "DEBUG: Subtracting common translation " << CommonTranslation
     512        << " from all updates.");
     513
    503514    // apply the gathered updates and set remnant gradients for atomic annealing
    504515    for (std::map<atomId_t, Vector>::const_iterator iter = GatheredUpdates.begin();
     
    513524      walker->setPosition(
    514525          walker->getPositionAtStep(CurrentTimeStep-1>=0 ? CurrentTimeStep - 1 : 0)
    515           + update);
     526          + update - CommonTranslation);
    516527      walker->setAtomicVelocity(update);
    517528//      walker->setAtomicForce( RemnantGradient_per_atom[walker->getId()] );
Note: See TracChangeset for help on using the changeset viewer.