Changeset 83f176 for src/atom_trajectoryparticle.cpp
- Timestamp:
- Aug 19, 2010, 3:23:37 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:
- 2a7457
- Parents:
- 1ee380f
- git-author:
- Frederik Heber <heber@…> (08/17/10 17:21:25)
- git-committer:
- Frederik Heber <heber@…> (08/19/10 15:23:37)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/atom_trajectoryparticle.cpp
r1ee380f r83f176 50 50 { 51 51 for (int i=NDIM;i--;) 52 *temperature += getType()-> mass* Trajectory.U.at(step)[i]* Trajectory.U.at(step)[i];52 *temperature += getType()->getMass() * Trajectory.U.at(step)[i]* Trajectory.U.at(step)[i]; 53 53 }; 54 54 … … 77 77 for(int d=0;d<NDIM;d++) { 78 78 Trajectory.U.at(Step)[d] -= CoGVelocity->at(d); 79 *ActualTemp += 0.5 * getType()-> mass* Trajectory.U.at(Step)[d] * Trajectory.U.at(Step)[d];79 *ActualTemp += 0.5 * getType()->getMass() * Trajectory.U.at(Step)[d] * Trajectory.U.at(Step)[d]; 80 80 } 81 81 }; … … 125 125 Trajectory.R.at(NextStep)[d] = Trajectory.R.at(NextStep-1)[d]; 126 126 Trajectory.R.at(NextStep)[d] += configuration->Deltat*(Trajectory.U.at(NextStep-1)[d]); // s(t) = s(0) + v * deltat + 1/2 a * deltat^2 127 Trajectory.R.at(NextStep)[d] += 0.5*configuration->Deltat*configuration->Deltat*(Trajectory.F.at(NextStep)[d]/getType()-> mass); // F = m * a and s =127 Trajectory.R.at(NextStep)[d] += 0.5*configuration->Deltat*configuration->Deltat*(Trajectory.F.at(NextStep)[d]/getType()->getMass()); // F = m * a and s = 128 128 } 129 129 // Update U 130 130 for (int d=0; d<NDIM; d++) { 131 131 Trajectory.U.at(NextStep)[d] = Trajectory.U.at(NextStep-1)[d]; 132 Trajectory.U.at(NextStep)[d] += configuration->Deltat * (Trajectory.F.at(NextStep)[d]+Trajectory.F.at(NextStep-1)[d]/getType()-> mass); // v = F/m * t132 Trajectory.U.at(NextStep)[d] += configuration->Deltat * (Trajectory.F.at(NextStep)[d]+Trajectory.F.at(NextStep-1)[d]/getType()->getMass()); // v = F/m * t 133 133 } 134 134 // Update R (and F) … … 149 149 void TrajectoryParticle::SumUpKineticEnergy( int Step, double *TotalMass, Vector *TotalVelocity ) const 150 150 { 151 *TotalMass += getType()-> mass; // sum up total mass151 *TotalMass += getType()->getMass(); // sum up total mass 152 152 for(int d=0;d<NDIM;d++) { 153 TotalVelocity->at(d) += Trajectory.U.at(Step)[d]*getType()-> mass;153 TotalVelocity->at(d) += Trajectory.U.at(Step)[d]*getType()->getMass(); 154 154 } 155 155 }; … … 166 166 for (int d=0; d<NDIM; d++) { 167 167 U[d] *= ScaleTempFactor; 168 *ekin += 0.5*getType()-> mass* U[d]*U[d];168 *ekin += 0.5*getType()->getMass() * U[d]*U[d]; 169 169 } 170 170 }; … … 182 182 for (int d=0; d<NDIM; d++) { 183 183 *G += U[d] * F[d]; 184 *E += U[d]*U[d]*getType()-> mass;184 *E += U[d]*U[d]*getType()->getMass(); 185 185 } 186 186 }; … … 197 197 if (FixedIon == 0) // even FixedIon moves, only not by other's forces 198 198 for (int d=0; d<NDIM; d++) { 199 U[d] += configuration->Deltat/getType()-> mass * ( (G_over_E) * (U[d]*getType()->mass) );200 *ekin += getType()-> mass* U[d]*U[d];199 U[d] += configuration->Deltat/getType()->getMass() * ( (G_over_E) * (U[d]*getType()->getMass()) ); 200 *ekin += getType()->getMass() * U[d]*U[d]; 201 201 } 202 202 }; … … 210 210 void TrajectoryParticle::Thermostat_Langevin(int Step, gsl_rng * r, double *ekin, config *configuration) 211 211 { 212 double sigma = sqrt(configuration->Thermostats->TargetTemp/getType()-> mass); // sigma = (k_b T)/m (Hartree/atomicmass = atomiclength/atomictime)212 double sigma = sqrt(configuration->Thermostats->TargetTemp/getType()->getMass()); // sigma = (k_b T)/m (Hartree/atomicmass = atomiclength/atomictime) 213 213 Vector &U = Trajectory.U.at(Step); 214 214 if (FixedIon == 0) { // even FixedIon moves, only not by other's forces … … 223 223 } 224 224 for (int d=0; d<NDIM; d++) 225 *ekin += 0.5*getType()-> mass* U[d]*U[d];225 *ekin += 0.5*getType()->getMass() * U[d]*U[d]; 226 226 } 227 227 }; … … 239 239 for (int d=0; d<NDIM; d++) { 240 240 U[d] *= sqrt(1+(configuration->Deltat/configuration->Thermostats->TempFrequency)*(ScaleTempFactor-1)); 241 *ekin += 0.5*getType()-> mass* U[d]*U[d];241 *ekin += 0.5*getType()->getMass() * U[d]*U[d]; 242 242 } 243 243 } … … 253 253 if (FixedIon == 0) { // even FixedIon moves, only not by other's forces 254 254 for (int d=0; d<NDIM; d++) { 255 *delta_alpha += U[d]*U[d]*getType()-> mass;255 *delta_alpha += U[d]*U[d]*getType()->getMass(); 256 256 } 257 257 } … … 268 268 if (FixedIon == 0) { // even FixedIon moves, only not by other's forces 269 269 for (int d=0; d<NDIM; d++) { 270 U[d] += configuration->Deltat/getType()-> mass * (configuration->Thermostats->alpha * (U[d] * getType()->mass));271 *ekin += (0.5*getType()-> mass) * U[d]*U[d];270 U[d] += configuration->Deltat/getType()->getMass() * (configuration->Thermostats->alpha * (U[d] * getType()->getMass())); 271 *ekin += (0.5*getType()->getMass()) * U[d]*U[d]; 272 272 } 273 273 }
Note:
See TracChangeset
for help on using the changeset viewer.