Changeset 056e70 for src/Thermostats


Ignore:
Timestamp:
Feb 24, 2011, 5:56:03 PM (14 years ago)
Author:
Frederik Heber <heber@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
Children:
6b020f
Parents:
6625c3
Message:

Suffixed getters and setters for AtomInfo trajecories with AtStep.

  • AtomInfo:: getters are now const members
  • added lots of ASSERTS to getters with time step to assure no out-of-bounds access.
Location:
src/Thermostats
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/Thermostats/Berendsen.cpp

    r6625c3 r056e70  
    6363  double ScaleTempFactor = getContainer().TargetTemp/ActualTemp;
    6464  for(ForwardIterator iter=begin;iter!=end;++iter){
    65     Vector &U = (*iter)->getAtomicVelocity(step);
     65    Vector U = (*iter)->getAtomicVelocityAtStep(step);
    6666    if ((*iter)->getFixedIon() == 0) { // even FixedIon moves, only not by other's forces
    6767      U *= sqrt(1+(World::getInstance().getConfig()->Deltat/TempFrequency)*(ScaleTempFactor-1));
    6868      ekin += 0.5*(*iter)->getType()->getMass() * U.NormSquared();
    6969    }
     70    (*iter)->setAtomicVelocityAtStep(step, U);
    7071  }
    7172  return ekin;
  • src/Thermostats/GaussianThermostat.cpp

    r6625c3 r056e70  
    7070  double ekin =0;
    7171  for(ForwardIterator iter=begin;iter!=end;++iter){
    72     Vector &U = (*iter)->getAtomicVelocity(step);
     72    Vector U = (*iter)->getAtomicVelocityAtStep(step);
    7373    if ((*iter)->getFixedIon() == 0) {// even FixedIon moves, only not by other's forces
    7474      U += World::getInstance().getConfig()->Deltat * G_over_E * U;
    7575      ekin += (*iter)->getType()->getMass() * U.NormSquared();
    7676    }
     77    (*iter)->setAtomicVelocityAtStep(step, U);
    7778  }
    7879  return ekin;
     
    8485  G=0;
    8586  for(ForwardIterator iter=begin;iter!=end;++iter){
    86     const Vector &U = (*iter)->getAtomicVelocity(step);
    87     const Vector &F = (*iter)->getAtomicForce(step);
     87    const Vector &U = (*iter)->getAtomicVelocityAtStep(step);
     88    const Vector &F = (*iter)->getAtomicForceAtStep(step);
    8889    if ((*iter)->getFixedIon() == 0){ // even FixedIon moves, only not by other's forces
    8990      G += U.ScalarProduct(F);
  • src/Thermostats/Langevin.cpp

    r6625c3 r056e70  
    8989    rng_distribution = new boost::normal_distribution<>(0,sigma);
    9090    boost::variate_generator<boost::mt19937&, boost::normal_distribution<> > rng(*rng_engine, *rng_distribution);
    91     Vector &U = (*iter)->getAtomicVelocity(step);
     91    Vector U = (*iter)->getAtomicVelocityAtStep(step);
    9292    if ((*iter)->getFixedIon() == 0) { // even FixedIon moves, only not by other's forces
    9393      // throw a dice to determine whether it gets hit by a heat bath particle
     
    102102      ekin += 0.5*(*iter)->getType()->getMass() * U.NormSquared();
    103103    }
     104    (*iter)->setAtomicVelocityAtStep(step, U);
    104105    delete rng_distribution;
    105106    rng_distribution = NULL;
  • src/Thermostats/NoseHoover.cpp

    r6625c3 r056e70  
    6868  double ekin =0;
    6969  for(ForwardIterator iter=begin;iter!=end;++iter){
    70     Vector &U = (*iter)->getAtomicVelocity(step);
     70    Vector U = (*iter)->getAtomicVelocityAtStep(step);
    7171    if ((*iter)->getFixedIon() == 0) { // even FixedIon moves, only not by other's forces
    7272      U += World::getInstance().getConfig()->Deltat/(*iter)->getType()->getMass() * (alpha * (U * (*iter)->getType()->getMass()));
    7373      ekin += (0.5*(*iter)->getType()->getMass()) * U.NormSquared();
    7474    }
     75    (*iter)->setAtomicVelocityAtStep(step, U);
    7576  }
    7677  return ekin;
     
    8283  count=0;
    8384  for(ForwardIterator iter = begin;iter!=end;++iter){
    84     const Vector &U = (*iter)->getAtomicVelocity(step);
     85    const Vector &U = (*iter)->getAtomicVelocityAtStep(step);
    8586    if ((*iter)->getFixedIon() == 0) { // even FixedIon moves, only not by other's forces
    8687      delta_alpha += U.NormSquared()*(*iter)->getType()->getMass();
  • src/Thermostats/Woodcock.cpp

    r6625c3 r056e70  
    6767    double ekin;
    6868    for (ForwardIterator iter = begin; iter!=end;++iter){
    69       Vector &U = (*iter)->getAtomicVelocity(step);
     69      Vector U = (*iter)->getAtomicVelocityAtStep(step);
    7070      if ((*iter)->getFixedIon() == 0){ // even FixedIon moves, only not by other's forces
    7171        U *= ScaleTempFactor;
    7272        ekin += 0.5*(*iter)->getType()->getMass() * U.NormSquared();
    7373      }
     74      (*iter)->setAtomicVelocityAtStep(step, U);
    7475    }
    7576  }
Note: See TracChangeset for help on using the changeset viewer.