Changeset 056e70 for src/Thermostats
- Timestamp:
- Feb 24, 2011, 5:56:03 PM (14 years ago)
- 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
- Location:
- src/Thermostats
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Thermostats/Berendsen.cpp
r6625c3 r056e70 63 63 double ScaleTempFactor = getContainer().TargetTemp/ActualTemp; 64 64 for(ForwardIterator iter=begin;iter!=end;++iter){ 65 Vector &U = (*iter)->getAtomicVelocity(step);65 Vector U = (*iter)->getAtomicVelocityAtStep(step); 66 66 if ((*iter)->getFixedIon() == 0) { // even FixedIon moves, only not by other's forces 67 67 U *= sqrt(1+(World::getInstance().getConfig()->Deltat/TempFrequency)*(ScaleTempFactor-1)); 68 68 ekin += 0.5*(*iter)->getType()->getMass() * U.NormSquared(); 69 69 } 70 (*iter)->setAtomicVelocityAtStep(step, U); 70 71 } 71 72 return ekin; -
src/Thermostats/GaussianThermostat.cpp
r6625c3 r056e70 70 70 double ekin =0; 71 71 for(ForwardIterator iter=begin;iter!=end;++iter){ 72 Vector &U = (*iter)->getAtomicVelocity(step);72 Vector U = (*iter)->getAtomicVelocityAtStep(step); 73 73 if ((*iter)->getFixedIon() == 0) {// even FixedIon moves, only not by other's forces 74 74 U += World::getInstance().getConfig()->Deltat * G_over_E * U; 75 75 ekin += (*iter)->getType()->getMass() * U.NormSquared(); 76 76 } 77 (*iter)->setAtomicVelocityAtStep(step, U); 77 78 } 78 79 return ekin; … … 84 85 G=0; 85 86 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); 88 89 if ((*iter)->getFixedIon() == 0){ // even FixedIon moves, only not by other's forces 89 90 G += U.ScalarProduct(F); -
src/Thermostats/Langevin.cpp
r6625c3 r056e70 89 89 rng_distribution = new boost::normal_distribution<>(0,sigma); 90 90 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); 92 92 if ((*iter)->getFixedIon() == 0) { // even FixedIon moves, only not by other's forces 93 93 // throw a dice to determine whether it gets hit by a heat bath particle … … 102 102 ekin += 0.5*(*iter)->getType()->getMass() * U.NormSquared(); 103 103 } 104 (*iter)->setAtomicVelocityAtStep(step, U); 104 105 delete rng_distribution; 105 106 rng_distribution = NULL; -
src/Thermostats/NoseHoover.cpp
r6625c3 r056e70 68 68 double ekin =0; 69 69 for(ForwardIterator iter=begin;iter!=end;++iter){ 70 Vector &U = (*iter)->getAtomicVelocity(step);70 Vector U = (*iter)->getAtomicVelocityAtStep(step); 71 71 if ((*iter)->getFixedIon() == 0) { // even FixedIon moves, only not by other's forces 72 72 U += World::getInstance().getConfig()->Deltat/(*iter)->getType()->getMass() * (alpha * (U * (*iter)->getType()->getMass())); 73 73 ekin += (0.5*(*iter)->getType()->getMass()) * U.NormSquared(); 74 74 } 75 (*iter)->setAtomicVelocityAtStep(step, U); 75 76 } 76 77 return ekin; … … 82 83 count=0; 83 84 for(ForwardIterator iter = begin;iter!=end;++iter){ 84 const Vector &U = (*iter)->getAtomicVelocity (step);85 const Vector &U = (*iter)->getAtomicVelocityAtStep(step); 85 86 if ((*iter)->getFixedIon() == 0) { // even FixedIon moves, only not by other's forces 86 87 delta_alpha += U.NormSquared()*(*iter)->getType()->getMass(); -
src/Thermostats/Woodcock.cpp
r6625c3 r056e70 67 67 double ekin; 68 68 for (ForwardIterator iter = begin; iter!=end;++iter){ 69 Vector &U = (*iter)->getAtomicVelocity(step);69 Vector U = (*iter)->getAtomicVelocityAtStep(step); 70 70 if ((*iter)->getFixedIon() == 0){ // even FixedIon moves, only not by other's forces 71 71 U *= ScaleTempFactor; 72 72 ekin += 0.5*(*iter)->getType()->getMass() * U.NormSquared(); 73 73 } 74 (*iter)->setAtomicVelocityAtStep(step, U); 74 75 } 75 76 }
Note:
See TracChangeset
for help on using the changeset viewer.