Changeset be0c61


Ignore:
Timestamp:
Oct 25, 2011, 3:33:14 PM (13 years ago)
Author:
Frederik Heber <heber@…>
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:
1cc661
Parents:
4b8630
git-author:
Frederik Heber <heber@…> (05/11/11 07:42:43)
git-committer:
Frederik Heber <heber@…> (10/25/11 15:33:14)
Message:

FIX: DipoleAngularCorrelation() - ZeroVector is now map over atoms, not vector over molecules.

  • Molecules are not consistent over trajectories, atoms however are.
  • hence, we store the ZeroVector for each atom of a molecule, not per molecule.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Analysis/analysis_correlation.cpp

    r4b8630 rbe0c61  
    139139  // get zero orientation for each molecule.
    140140  LOG(0,"STATUS: Calculating dipoles for first time step ...");
    141   std::vector<Vector> ZeroVector;
    142   ZeroVector.resize(molecules.size(), zeroVec);
    143   size_t i=0;
     141  std::map<atomId_t, Vector> ZeroVector;
    144142  BOOST_FOREACH(molecule *_mol, molecules) {
    145143    const Vector Dipole = getDipole(_mol->begin(), _mol->end());
    146     ZeroVector[i] = Dipole;
    147     LOG(2,"INFO: Zero alignment for molecule " << _mol->getId() << " is " << ZeroVector[i]);
    148     ++i;
    149   }
    150   LOG(1,"INFO: There is a total of " << i << " molecules.");
     144    for(molecule::const_iterator iter = _mol->begin(); iter != _mol->end(); ++iter)
     145      ZeroVector[(*iter)->getId()] = Dipole;
     146    LOG(2,"INFO: Zero alignment for molecule " << _mol->getId() << " is " << Dipole);
     147  }
     148  LOG(1,"INFO: We calculated zero orientation for a total of " << molecules.size() << " molecules.");
    151149
    152150  // go through every time step
     
    162160      const Vector Dipole = getDipole(_mol->begin(), _mol->end());
    163161      LOG(2,"INFO: Dipole vector at time step " << step << " for for molecule " << _mol->getId() << " is " << Dipole);
    164       const double angle = Dipole.Angle(ZeroVector[i]) * (180./M_PI);
    165       LOG(1,"INFO: Resulting relative angle for molecule " << _mol->getId() << " is " << angle << ".");
    166       outmap->insert ( make_pair (angle, *_mol->begin() ) );
     162      molecule::const_iterator iter = _mol->begin();
     163      ASSERT(ZeroVector.count((*iter)->getId()),
     164          "DipoleAngularCorrelation() - ZeroVector for atom "+toString(**iter)+" not present.");
     165      const double angle = Dipole.Angle(ZeroVector[(*iter)->getId()]) * (180./M_PI);
     166      LOG(1,"INFO: Resulting relative angle for molecule " << **iter << " is " << angle << ".");
     167      outmap->insert ( make_pair (angle, *iter ) );
    167168      ++i;
    168169    }
Note: See TracChangeset for help on using the changeset viewer.