Changeset ef7d30
- Timestamp:
- Jun 29, 2010, 1:04:40 PM (15 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:
- 8e0c63
- Parents:
- 52d777
- Location:
- src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/MoleculeAction/VerletIntegrationAction.cpp
r52d777 ref7d30 62 62 char outputname[MAXSTRINGSIZE]; 63 63 strcpy(outputname, filename.c_str()); 64 if (!mol->VerletForceIntegration(outputname, *(World::getInstance().getConfig()) ))64 if (!mol->VerletForceIntegration(outputname, *(World::getInstance().getConfig()), 0)) 65 65 DoLog(2) && (Log() << Verbose(2) << "File not found." << endl); 66 66 else -
src/atom_trajectoryparticle.cpp
r52d777 ref7d30 106 106 * \param *Force matrix with forces 107 107 */ 108 void TrajectoryParticle::VelocityVerletUpdate(int NextStep, config *configuration, ForceMatrix *Force )108 void TrajectoryParticle::VelocityVerletUpdate(int NextStep, config *configuration, ForceMatrix *Force, const size_t offset) 109 109 { 110 110 //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 111 111 for (int d=0; d<NDIM; d++) { 112 Trajectory.F.at(NextStep)[d] = -Force->Matrix[0][nr][d+ 5]*(configuration->GetIsAngstroem() ? AtomicLengthToAngstroem : 1.);112 Trajectory.F.at(NextStep)[d] = -Force->Matrix[0][nr][d+offset]*(configuration->GetIsAngstroem() ? AtomicLengthToAngstroem : 1.); 113 113 Trajectory.R.at(NextStep)[d] = Trajectory.R.at(NextStep-1)[d]; 114 114 Trajectory.R.at(NextStep)[d] += configuration->Deltat*(Trajectory.U.at(NextStep-1)[d]); // s(t) = s(0) + v * deltat + 1/2 a * deltat^2 -
src/atom_trajectoryparticle.hpp
r52d777 ref7d30 50 50 void ResizeTrajectory(int MaxSteps); 51 51 void CopyStepOnStep(int dest, int src); 52 void VelocityVerletUpdate(int MDSteps, config *configuration, ForceMatrix *Force );52 void VelocityVerletUpdate(int MDSteps, config *configuration, ForceMatrix *Force, const size_t offset); 53 53 void SumUpKineticEnergy( int Step, double *TotalMass, Vector *TotalVelocity ) const; 54 54 -
src/molecule.hpp
r52d777 ref7d30 279 279 void SetBoxDimension(Vector *dim); 280 280 void ScanForPeriodicCorrection(); 281 bool VerletForceIntegration(char *file, config &configuration );281 bool VerletForceIntegration(char *file, config &configuration, const size_t offset); 282 282 void Thermostats(config &configuration, double ActualTemp, int Thermostat); 283 283 void PrincipalAxisSystem(bool DoRotate); -
src/molecule_dynamics.cpp
r52d777 ref7d30 540 540 * have to transform them). 541 541 * This adds a new MD step to the config file. 542 * \param *out output stream for debugging543 542 * \param *file filename 544 543 * \param config structure with config::Deltat, config::IsAngstroem, config::DoConstrained 545 * \param delta_t time step width in atomic units 546 * \param IsAngstroem whether coordinates are in angstroem (true) or bohrradius (false) 547 * \param DoConstrained whether we perform a constrained (>0, target step in molecule::trajectories) or unconstrained (0) molecular dynamics, \sa molecule::MinimiseConstrainedPotential() 544 * \param offset offset in matrix file to the first force component 548 545 * \return true - file found and parsed, false - file not found or imparsable 549 546 * \todo This is not yet checked if it is correctly working with DoConstrained set to true. 550 547 */ 551 bool molecule::VerletForceIntegration(char *file, config &configuration )548 bool molecule::VerletForceIntegration(char *file, config &configuration, const size_t offset) 552 549 { 553 550 Info FunctionInfo(__func__); … … 561 558 CountElements(); // make sure ElementsInMolecule is up to date 562 559 560 const int AtomCount = getAtomCount(); 563 561 // check file 564 562 if (input == NULL) { … … 571 569 return false; 572 570 } 573 if (Force.RowCounter[0] != getAtomCount()) {571 if (Force.RowCounter[0] != AtomCount) { 574 572 DoeLog(0) && (eLog()<< Verbose(0) << "Mismatch between number of atoms in file " << Force.RowCounter[0] << " and in molecule " << getAtomCount() << "." << endl); 575 573 performCriticalExit(); … … 578 576 // correct Forces 579 577 Velocity.Zero(); 580 for(int i=0;i< getAtomCount();i++)578 for(int i=0;i<AtomCount;i++) 581 579 for(int d=0;d<NDIM;d++) { 582 Velocity[d] += Force.Matrix[0][i][d+ 5];580 Velocity[d] += Force.Matrix[0][i][d+offset]; 583 581 } 584 for(int i=0;i< getAtomCount();i++)582 for(int i=0;i<AtomCount;i++) 585 583 for(int d=0;d<NDIM;d++) { 586 Force.Matrix[0][i][d+ 5] -= Velocity[d]/static_cast<double>(getAtomCount());584 Force.Matrix[0][i][d+offset] -= Velocity[d]/static_cast<double>(AtomCount); 587 585 } 588 586 // solve a constrained potential if we are meant to … … 599 597 //ActOnAllAtoms( &atom::ResizeTrajectory, MDSteps+10 ); 600 598 601 ActOnAllAtoms( &atom::VelocityVerletUpdate, MDSteps+1, &configuration, &Force );599 ActOnAllAtoms( &atom::VelocityVerletUpdate, MDSteps+1, &configuration, &Force, (const size_t) 0); 602 600 } 603 601 // correct velocities (rather momenta) so that center of mass remains motionless
Note:
See TracChangeset
for help on using the changeset viewer.