Changeset 4b8630 for src/Analysis/analysis_correlation.cpp
- Timestamp:
- Oct 25, 2011, 3:31:54 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:
- be0c61
- Parents:
- 4fc828
- git-author:
- Frederik Heber <heber@…> (02/19/11 00:09:43)
- git-committer:
- Frederik Heber <heber@…> (10/25/11 15:31:54)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Analysis/analysis_correlation.cpp
r4fc828 r4b8630 31 31 #include "CodePatterns/Log.hpp" 32 32 #include "CodePatterns/Verbose.hpp" 33 #include "Descriptors/MoleculeOfAtomSelectionDescriptor.hpp" 33 34 #include "Formula.hpp" 34 35 #include "LinearAlgebra/Vector.hpp" … … 98 99 * Note given element order is unimportant (i.e. g(Si, O) === g(O, Si)) 99 100 * Angles are given in degrees. 100 * \param *molecules vector of molecules 101 * \param &atoms list of atoms of the molecules taking part (Note: molecules may 102 * change over time as bond structure is recalculated, hence we need the atoms) 101 103 * \return Map of doubles with values the pair of the two atoms. 102 104 */ 103 DipoleAngularCorrelationMap *DipoleAngularCorrelation(std::vector< molecule *> &molecules)105 DipoleAngularCorrelationMap *DipoleAngularCorrelation(std::vector<atom *> &atoms) 104 106 { 105 107 Info FunctionInfo(__func__); 106 108 DipoleAngularCorrelationMap *outmap = new DipoleAngularCorrelationMap; 107 // double distance = 0.; 108 // Box &domain = World::getInstance().getDomain(); 109 // 110 if (molecules.empty()) { 111 DoeLog(1) && (eLog()<< Verbose(1) <<"No molecule given." << endl); 112 return outmap; 113 } 109 std::set<molecule *> molecules; 114 110 115 111 // store original time step 116 112 const unsigned int oldtime = WorldTime::getTime(); 117 113 World::getInstance().setTime(0); 114 // calculate molecules for this time step 115 BOOST_FOREACH(atom *_atom, atoms) 116 molecules.insert(_atom->getMolecule()); 118 117 119 118 BOOST_FOREACH(atom *_atom, World::getInstance().getAllAtoms()) … … 155 154 for (size_t step = 1; step < max_timesteps; ++step) { 156 155 World::getInstance().setTime(step); 156 // recalculate molecules for this time step 157 molecules.clear(); 158 BOOST_FOREACH(atom *_atom, atoms) 159 molecules.insert(_atom->getMolecule()); 157 160 size_t i=0; 158 161 BOOST_FOREACH(molecule *_mol, molecules) { … … 161 164 const double angle = Dipole.Angle(ZeroVector[i]) * (180./M_PI); 162 165 LOG(1,"INFO: Resulting relative angle for molecule " << _mol->getId() << " is " << angle << "."); 163 outmap->insert ( make_pair (angle, _mol) );166 outmap->insert ( make_pair (angle, *_mol->begin() ) ); 164 167 ++i; 165 168 } … … 591 594 void OutputDipoleAngularCorrelation_Header( ofstream * const file ) 592 595 { 593 *file << "\t Molecule";596 *file << "\tFirstAtomOfMolecule"; 594 597 }; 595 598 … … 601 604 void OutputDipoleAngularCorrelation_Value( ofstream * const file, DipoleAngularCorrelationMap::const_iterator &runner ) 602 605 { 603 *file << runner->second->get Id();606 *file << runner->second->getName(); 604 607 }; 605 608
Note:
See TracChangeset
for help on using the changeset viewer.