Changeset 4fc828 for src/Analysis
- Timestamp:
- Oct 25, 2011, 3:28:27 PM (13 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:
- 4b8630
- Parents:
- df8759
- git-author:
- Frederik Heber <heber@…> (02/16/11 12:56:48)
- git-committer:
- Frederik Heber <heber@…> (10/25/11 15:28:27)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/Analysis/analysis_correlation.cpp ¶
rdf8759 r4fc828 66 66 // go through all bonds 67 67 const BondList& ListOfBonds = (*atomiter)->getListOfBonds(); 68 ASSERT(ListOfBonds.begin() != ListOfBonds.end(), 69 "getDipole() - no bonds in molecule!"); 68 70 for (BondList::const_iterator bonditer = ListOfBonds.begin(); 69 71 bonditer != ListOfBonds.end(); … … 77 79 BondDipoleVector.Normalize(); 78 80 BondDipoleVector *= DeltaEN; 81 LOG(3,"INFO: Dipole vector from bond " << **bonditer << " is " << BondDipoleVector); 79 82 DipoleVector += BondDipoleVector; 80 83 SumOfVectors++; … … 82 85 } 83 86 } 84 DipoleVector *= 1./(double)SumOfVectors; 87 LOG(3,"INFO: Sum over all bond dipole vectors is " 88 << DipoleVector << " with " << SumOfVectors << " in total."); 89 if (SumOfVectors != 0) 90 DipoleVector *= 1./(double)SumOfVectors; 85 91 DoLog(1) && (Log() << Verbose(1) << "Resulting dipole vector is " << DipoleVector << std::endl); 86 92 … … 111 117 World::getInstance().setTime(0); 112 118 119 BOOST_FOREACH(atom *_atom, World::getInstance().getAllAtoms()) 120 LOG(2, "INFO: Atom " << _atom->getId() << " " 121 << *dynamic_cast<AtomInfo *>(_atom) <<"."); 122 113 123 // get highest trajectory size 124 LOG(0,"STATUS: Retrieving maximum amount of time steps ..."); 114 125 size_t max_timesteps = 0; 126 size_t min_timesteps = -1; 115 127 BOOST_FOREACH(molecule *_mol, molecules) { 116 128 for(molecule::const_iterator iter = _mol->begin(); … … 119 131 if ((*iter)->getTrajectorySize() > max_timesteps) 120 132 max_timesteps = (*iter)->getTrajectorySize(); 121 } 122 } 133 if (((*iter)->getTrajectorySize() <= max_timesteps) && (min_timesteps == (size_t)-1)) 134 min_timesteps = (*iter)->getTrajectorySize(); 135 } 136 } 137 LOG(1,"INFO: Minimum number of time steps found is " << min_timesteps); 138 LOG(1,"INFO: Maximum number of time steps found is " << max_timesteps); 139 123 140 // get zero orientation for each molecule. 141 LOG(0,"STATUS: Calculating dipoles for first time step ..."); 124 142 std::vector<Vector> ZeroVector; 125 143 ZeroVector.resize(molecules.size(), zeroVec); … … 128 146 const Vector Dipole = getDipole(_mol->begin(), _mol->end()); 129 147 ZeroVector[i] = Dipole; 148 LOG(2,"INFO: Zero alignment for molecule " << _mol->getId() << " is " << ZeroVector[i]); 130 149 ++i; 131 150 } 151 LOG(1,"INFO: There is a total of " << i << " molecules."); 152 132 153 // go through every time step 154 LOG(0,"STATUS: Calculating dipoles of following time steps ..."); 133 155 for (size_t step = 1; step < max_timesteps; ++step) { 134 156 World::getInstance().setTime(step); … … 136 158 BOOST_FOREACH(molecule *_mol, molecules) { 137 159 const Vector Dipole = getDipole(_mol->begin(), _mol->end()); 160 LOG(2,"INFO: Dipole vector at time step " << step << " for for molecule " << _mol->getId() << " is " << Dipole); 138 161 const double angle = Dipole.Angle(ZeroVector[i]) * (180./M_PI); 139 DoLog(1) && (Log() << Verbose(1) << "Angle for molecule " 140 << _mol->getId() << " at time step " << step << " is " << angle << "." << endl); 162 LOG(1,"INFO: Resulting relative angle for molecule " << _mol->getId() << " is " << angle << "."); 141 163 outmap->insert ( make_pair (angle, _mol ) ); 142 164 ++i; … … 147 169 // set original time step again 148 170 World::getInstance().setTime(oldtime); 171 LOG(0,"STATUS: Done."); 149 172 150 173 // and return results … … 568 591 void OutputDipoleAngularCorrelation_Header( ofstream * const file ) 569 592 { 570 *file << "\tMolecule 1\tMolecule2";593 *file << "\tMolecule"; 571 594 }; 572 595
Note:
See TracChangeset
for help on using the changeset viewer.