Changeset 8cbb97 for src/atom_trajectoryparticle.cpp
- Timestamp:
- Apr 29, 2010, 1:55:21 PM (16 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, Candidate_v1.7.0, 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:
- d79639
- Parents:
- 632bc3 (diff), 753f02 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 edited
-
src/atom_trajectoryparticle.cpp (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/atom_trajectoryparticle.cpp
r632bc3 r8cbb97 34 34 { 35 35 for (int i=NDIM;i--;) 36 *temperature += type->mass * Trajectory.U.at(step) .x[i]* Trajectory.U.at(step).x[i];36 *temperature += type->mass * Trajectory.U.at(step)[i]* Trajectory.U.at(step)[i]; 37 37 }; 38 38 … … 49 49 // set forces 50 50 for (int i=NDIM;i++;) 51 Force->Matrix[0][nr][5+i] += 2.*constant*sqrt(Trajectory.R.at(startstep).Distance( &Sprinter->Trajectory.R.at(endstep)));51 Force->Matrix[0][nr][5+i] += 2.*constant*sqrt(Trajectory.R.at(startstep).Distance(Sprinter->Trajectory.R.at(endstep))); 52 52 }; 53 53 … … 60 60 { 61 61 for(int d=0;d<NDIM;d++) { 62 Trajectory.U.at(Step) .x[d] -= CoGVelocity->x[d];63 *ActualTemp += 0.5 * type->mass * Trajectory.U.at(Step) .x[d] * Trajectory.U.at(Step).x[d];62 Trajectory.U.at(Step)[d] -= CoGVelocity->at(d); 63 *ActualTemp += 0.5 * type->mass * Trajectory.U.at(Step)[d] * Trajectory.U.at(Step)[d]; 64 64 } 65 65 }; … … 89 89 90 90 for (int n=NDIM;n--;) { 91 Trajectory.R.at(dest) .x[n] = Trajectory.R.at(src).x[n];92 Trajectory.U.at(dest) .x[n] = Trajectory.U.at(src).x[n];93 Trajectory.F.at(dest) .x[n] = Trajectory.F.at(src).x[n];91 Trajectory.R.at(dest)[n] = Trajectory.R.at(src)[n]; 92 Trajectory.U.at(dest)[n] = Trajectory.U.at(src)[n]; 93 Trajectory.F.at(dest)[n] = Trajectory.F.at(src)[n]; 94 94 } 95 95 }; … … 105 105 //a = configuration.Deltat*0.5/walker->type->mass; // (F+F_old)/2m = a and thus: v = (F+F_old)/2m * t = (F + F_old) * a 106 106 for (int d=0; d<NDIM; d++) { 107 Trajectory.F.at(NextStep) .x[d] = -Force->Matrix[0][nr][d+5]*(configuration->GetIsAngstroem() ? AtomicLengthToAngstroem : 1.);108 Trajectory.R.at(NextStep) .x[d] = Trajectory.R.at(NextStep-1).x[d];109 Trajectory.R.at(NextStep) .x[d] += configuration->Deltat*(Trajectory.U.at(NextStep-1).x[d]); // s(t) = s(0) + v * deltat + 1/2 a * deltat^2110 Trajectory.R.at(NextStep) .x[d] += 0.5*configuration->Deltat*configuration->Deltat*(Trajectory.F.at(NextStep).x[d]/type->mass); // F = m * a and s =107 Trajectory.F.at(NextStep)[d] = -Force->Matrix[0][nr][d+5]*(configuration->GetIsAngstroem() ? AtomicLengthToAngstroem : 1.); 108 Trajectory.R.at(NextStep)[d] = Trajectory.R.at(NextStep-1)[d]; 109 Trajectory.R.at(NextStep)[d] += configuration->Deltat*(Trajectory.U.at(NextStep-1)[d]); // s(t) = s(0) + v * deltat + 1/2 a * deltat^2 110 Trajectory.R.at(NextStep)[d] += 0.5*configuration->Deltat*configuration->Deltat*(Trajectory.F.at(NextStep)[d]/type->mass); // F = m * a and s = 111 111 } 112 112 // Update U 113 113 for (int d=0; d<NDIM; d++) { 114 Trajectory.U.at(NextStep) .x[d] = Trajectory.U.at(NextStep-1).x[d];115 Trajectory.U.at(NextStep) .x[d] += configuration->Deltat * (Trajectory.F.at(NextStep).x[d]+Trajectory.F.at(NextStep-1).x[d]/type->mass); // v = F/m * t114 Trajectory.U.at(NextStep)[d] = Trajectory.U.at(NextStep-1)[d]; 115 Trajectory.U.at(NextStep)[d] += configuration->Deltat * (Trajectory.F.at(NextStep)[d]+Trajectory.F.at(NextStep-1)[d]/type->mass); // v = F/m * t 116 116 } 117 117 // Update R (and F) … … 134 134 *TotalMass += type->mass; // sum up total mass 135 135 for(int d=0;d<NDIM;d++) { 136 TotalVelocity-> x[d] += Trajectory.U.at(Step).x[d]*type->mass;136 TotalVelocity->at(d) += Trajectory.U.at(Step)[d]*type->mass; 137 137 } 138 138 }; … … 145 145 void TrajectoryParticle::Thermostat_Woodcock(double ScaleTempFactor, int Step, double *ekin) 146 146 { 147 double *U = Trajectory.U.at(Step).x;147 Vector &U = Trajectory.U.at(Step); 148 148 if (FixedIon == 0) // even FixedIon moves, only not by other's forces 149 149 for (int d=0; d<NDIM; d++) { … … 160 160 void TrajectoryParticle::Thermostat_Gaussian_init(int Step, double *G, double *E) 161 161 { 162 double *U = Trajectory.U.at(Step).x;163 double *F = Trajectory.F.at(Step).x;162 Vector &U = Trajectory.U.at(Step); 163 Vector &F = Trajectory.F.at(Step); 164 164 if (FixedIon == 0) // even FixedIon moves, only not by other's forces 165 165 for (int d=0; d<NDIM; d++) { … … 177 177 void TrajectoryParticle::Thermostat_Gaussian_least_constraint(int Step, double G_over_E, double *ekin, config *configuration) 178 178 { 179 double *U = Trajectory.U.at(Step).x;179 Vector &U = Trajectory.U.at(Step); 180 180 if (FixedIon == 0) // even FixedIon moves, only not by other's forces 181 181 for (int d=0; d<NDIM; d++) { … … 194 194 { 195 195 double sigma = sqrt(configuration->TargetTemp/type->mass); // sigma = (k_b T)/m (Hartree/atomicmass = atomiclength/atomictime) 196 double *U = Trajectory.U.at(Step).x;196 Vector &U = Trajectory.U.at(Step); 197 197 if (FixedIon == 0) { // even FixedIon moves, only not by other's forces 198 198 // throw a dice to determine whether it gets hit by a heat bath particle … … 218 218 void TrajectoryParticle::Thermostat_Berendsen(int Step, double ScaleTempFactor, double *ekin, config *configuration) 219 219 { 220 double *U = Trajectory.U.at(Step).x;220 Vector &U = Trajectory.U.at(Step); 221 221 if (FixedIon == 0) { // even FixedIon moves, only not by other's forces 222 222 for (int d=0; d<NDIM; d++) { … … 233 233 void TrajectoryParticle::Thermostat_NoseHoover_init(int Step, double *delta_alpha) 234 234 { 235 double *U = Trajectory.U.at(Step).x;235 Vector &U = Trajectory.U.at(Step); 236 236 if (FixedIon == 0) { // even FixedIon moves, only not by other's forces 237 237 for (int d=0; d<NDIM; d++) { … … 248 248 void TrajectoryParticle::Thermostat_NoseHoover_scale(int Step, double *ekin, config *configuration) 249 249 { 250 double *U = Trajectory.U.at(Step).x;250 Vector &U = Trajectory.U.at(Step); 251 251 if (FixedIon == 0) { // even FixedIon moves, only not by other's forces 252 252 for (int d=0; d<NDIM; d++) {
Note:
See TracChangeset
for help on using the changeset viewer.
