Changeset 5f612ee for src/molecule_dynamics.cpp
- Timestamp:
- Apr 27, 2010, 2:25:42 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:
- 632bc3
- Parents:
- 13d5a9 (diff), c695c9 (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/molecule_dynamics.cpp (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/molecule_dynamics.cpp
r13d5a9 r5f612ee 208 208 doubles++; 209 209 if (doubles >0) 210 Log() << Verbose(2) << "Found " << doubles << " Doubles." << endl;210 DoLog(2) && (Log() << Verbose(2) << "Found " << doubles << " Doubles." << endl); 211 211 Free(&DoubleList); 212 212 // Log() << Verbose(2) << zeile1.str() << endl << zeile2.str() << endl; … … 250 250 Params.DoubleList[Params.DistanceList[Walker->nr]->begin()->second->nr]++; // increase this target's source count (>1? not injective) 251 251 Params.DistanceIterators[Walker->nr] = Params.DistanceList[Walker->nr]->begin(); // and remember which one we picked 252 Log() << Verbose(2) << *Walker << " starts with distance " << Params.DistanceList[Walker->nr]->begin()->first << "." << endl;252 DoLog(2) && (Log() << Verbose(2) << *Walker << " starts with distance " << Params.DistanceList[Walker->nr]->begin()->first << "." << endl); 253 253 } 254 254 }; … … 278 278 Params.DistanceIterators[Walker->nr] = NewBase; 279 279 OldPotential = Potential; 280 Log() << Verbose(3) << "Found a new permutation, new potential is " << OldPotential << "." << endl;280 DoLog(3) && (Log() << Verbose(3) << "Found a new permutation, new potential is " << OldPotential << "." << endl); 281 281 } 282 282 } … … 307 307 for (int i=mol->AtomCount; i--;) // now each single entry in the DoubleList should be <=1 308 308 if (Params.DoubleList[i] > 1) { 309 eLog() << Verbose(0) << "Failed to create an injective PermutationMap!" << endl;309 DoeLog(0) && (eLog()<< Verbose(0) << "Failed to create an injective PermutationMap!" << endl); 310 310 performCriticalExit(); 311 311 } 312 Log() << Verbose(1) << "done." << endl;312 DoLog(1) && (Log() << Verbose(1) << "done." << endl); 313 313 }; 314 314 … … 359 359 Params.PenaltyConstants[2] = 1e+7; // just a huge penalty 360 360 // generate the distance list 361 Log() << Verbose(1) << "Allocating, initializting and filling the distance list ... " << endl;361 DoLog(1) && (Log() << Verbose(1) << "Allocating, initializting and filling the distance list ... " << endl); 362 362 FillDistanceList(this, Params); 363 363 … … 366 366 367 367 // make the PermutationMap injective by checking whether we have a non-zero constants[2] term in it 368 Log() << Verbose(1) << "Making the PermutationMap injective ... " << endl;368 DoLog(1) && (Log() << Verbose(1) << "Making the PermutationMap injective ... " << endl); 369 369 MakeInjectivePermutation(this, Params); 370 370 Free(&Params.DoubleList); 371 371 372 372 // argument minimise the constrained potential in this injective PermutationMap 373 Log() << Verbose(1) << "Argument minimising the PermutationMap." << endl;373 DoLog(1) && (Log() << Verbose(1) << "Argument minimising the PermutationMap." << endl); 374 374 OldPotential = 1e+10; 375 375 round = 0; 376 376 do { 377 Log() << Verbose(2) << "Starting round " << ++round << ", at current potential " << OldPotential << " ... " << endl;377 DoLog(2) && (Log() << Verbose(2) << "Starting round " << ++round << ", at current potential " << OldPotential << " ... " << endl); 378 378 OlderPotential = OldPotential; 379 379 do { … … 425 425 } else { 426 426 Params.DistanceIterators[Runner->nr] = Rider; // if successful also move the pointer in the iterator list 427 Log() << Verbose(3) << "Found a better permutation, new potential is " << Potential << " vs." << OldPotential << "." << endl;427 DoLog(3) && (Log() << Verbose(3) << "Found a better permutation, new potential is " << Potential << " vs." << OldPotential << "." << endl); 428 428 OldPotential = Potential; 429 429 } 430 430 if (Potential > Params.PenaltyConstants[2]) { 431 eLog() << Verbose(1) << "The two-step permutation procedure did not maintain injectivity!" << endl;431 DoeLog(1) && (eLog()<< Verbose(1) << "The two-step permutation procedure did not maintain injectivity!" << endl); 432 432 exit(255); 433 433 } 434 434 //Log() << Verbose(0) << endl; 435 435 } else { 436 eLog() << Verbose(1) << *Runner << " was not the owner of " << *Sprinter << "!" << endl;436 DoeLog(1) && (eLog()<< Verbose(1) << *Runner << " was not the owner of " << *Sprinter << "!" << endl); 437 437 exit(255); 438 438 } … … 444 444 } while (Walker->next != end); 445 445 } while ((OlderPotential - OldPotential) > 1e-3); 446 Log() << Verbose(1) << "done." << endl;446 DoLog(1) && (Log() << Verbose(1) << "done." << endl); 447 447 448 448 … … 467 467 { 468 468 /// evaluate forces (only the distance to target dependent part) with the final PermutationMap 469 Log() << Verbose(1) << "Calculating forces and adding onto ForceMatrix ... " << endl;469 DoLog(1) && (Log() << Verbose(1) << "Calculating forces and adding onto ForceMatrix ... " << endl); 470 470 ActOnAllAtoms( &atom::EvaluateConstrainedForce, startstep, endstep, PermutationMap, Force ); 471 Log() << Verbose(1) << "done." << endl;471 DoLog(1) && (Log() << Verbose(1) << "done." << endl); 472 472 }; 473 473 … … 504 504 505 505 // go through all steps and add the molecular configuration to the list and to the Trajectories of \a this molecule 506 Log() << Verbose(1) << "Filling intermediate " << MaxSteps << " steps with MDSteps of " << MDSteps << "." << endl;506 DoLog(1) && (Log() << Verbose(1) << "Filling intermediate " << MaxSteps << " steps with MDSteps of " << MDSteps << "." << endl); 507 507 for (int step = 0; step <= MaxSteps; step++) { 508 508 mol = World::getInstance().createMolecule(); … … 569 569 // parse file into ForceMatrix 570 570 if (!Force.ParseMatrix(file, 0,0,0)) { 571 eLog() << Verbose(0) << "Could not parse Force Matrix file " << file << "." << endl;571 DoeLog(0) && (eLog()<< Verbose(0) << "Could not parse Force Matrix file " << file << "." << endl); 572 572 performCriticalExit(); 573 573 return false; 574 574 } 575 575 if (Force.RowCounter[0] != AtomCount) { 576 eLog() << Verbose(0) << "Mismatch between number of atoms in file " << Force.RowCounter[0] << " and in molecule " << AtomCount << "." << endl;576 DoeLog(0) && (eLog()<< Verbose(0) << "Mismatch between number of atoms in file " << Force.RowCounter[0] << " and in molecule " << AtomCount << "." << endl); 577 577 performCriticalExit(); 578 578 return false; … … 653 653 switch(Thermostat) { 654 654 case None: 655 Log() << Verbose(2) << "Applying no thermostat..." << endl;655 DoLog(2) && (Log() << Verbose(2) << "Applying no thermostat..." << endl); 656 656 break; 657 657 case Woodcock: 658 658 if ((configuration.ScaleTempStep > 0) && ((MDSteps-1) % configuration.ScaleTempStep == 0)) { 659 Log() << Verbose(2) << "Applying Woodcock thermostat..." << endl;659 DoLog(2) && (Log() << Verbose(2) << "Applying Woodcock thermostat..." << endl); 660 660 ActOnAllAtoms( &atom::Thermostat_Woodcock, sqrt(ScaleTempFactor), MDSteps, &ekin ); 661 661 } 662 662 break; 663 663 case Gaussian: 664 Log() << Verbose(2) << "Applying Gaussian thermostat..." << endl;664 DoLog(2) && (Log() << Verbose(2) << "Applying Gaussian thermostat..." << endl); 665 665 ActOnAllAtoms( &atom::Thermostat_Gaussian_init, MDSteps, &G, &E ); 666 666 667 Log() << Verbose(1) << "Gaussian Least Constraint constant is " << G/E << "." << endl;667 DoLog(1) && (Log() << Verbose(1) << "Gaussian Least Constraint constant is " << G/E << "." << endl); 668 668 ActOnAllAtoms( &atom::Thermostat_Gaussian_least_constraint, MDSteps, G/E, &ekin, &configuration); 669 669 670 670 break; 671 671 case Langevin: 672 Log() << Verbose(2) << "Applying Langevin thermostat..." << endl;672 DoLog(2) && (Log() << Verbose(2) << "Applying Langevin thermostat..." << endl); 673 673 // init random number generator 674 674 gsl_rng_env_setup(); … … 680 680 681 681 case Berendsen: 682 Log() << Verbose(2) << "Applying Berendsen-VanGunsteren thermostat..." << endl;682 DoLog(2) && (Log() << Verbose(2) << "Applying Berendsen-VanGunsteren thermostat..." << endl); 683 683 ActOnAllAtoms( &atom::Thermostat_Berendsen, MDSteps, ScaleTempFactor, &ekin, &configuration ); 684 684 break; 685 685 686 686 case NoseHoover: 687 Log() << Verbose(2) << "Applying Nose-Hoover thermostat..." << endl;687 DoLog(2) && (Log() << Verbose(2) << "Applying Nose-Hoover thermostat..." << endl); 688 688 // dynamically evolve alpha (the additional degree of freedom) 689 689 delta_alpha = 0.; … … 691 691 delta_alpha = (delta_alpha - (3.*AtomCount+1.) * configuration.TargetTemp)/(configuration.HooverMass*Units2Electronmass); 692 692 configuration.alpha += delta_alpha*configuration.Deltat; 693 Log() << Verbose(3) << "alpha = " << delta_alpha << " * " << configuration.Deltat << " = " << configuration.alpha << "." << endl;693 DoLog(3) && (Log() << Verbose(3) << "alpha = " << delta_alpha << " * " << configuration.Deltat << " = " << configuration.alpha << "." << endl); 694 694 // apply updated alpha as additional force 695 695 ActOnAllAtoms( &atom::Thermostat_NoseHoover_scale, MDSteps, &ekin, &configuration ); 696 696 break; 697 697 } 698 Log() << Verbose(1) << "Kinetic energy is " << ekin << "." << endl;699 }; 698 DoLog(1) && (Log() << Verbose(1) << "Kinetic energy is " << ekin << "." << endl); 699 };
Note:
See TracChangeset
for help on using the changeset viewer.
