Ignore:
Timestamp:
Oct 25, 2011, 3:31:54 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:
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)
Message:

World::setTime() now updates bond structure of system and related changes to DipoleAngularCorrelation.

  • extended regression test Analysis/DipoleAngularCorrelation with xyz example whose bond structure is updated per time step.
  • FIX: DepthFirstSearchAnalysis::operator() did not reset bonds to unused.
  • FIX: DipoleAngularCorrelationAction has to work on atoms not molecules as the latter are subject to changes due to changing bond structure.
  • FIX: DipoleAngularCorrelation() re-calculates current set of molecules from the select atoms and stores first atom in values file, not molecule name.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Analysis/analysis_correlation.cpp

    r4fc828 r4b8630  
    3131#include "CodePatterns/Log.hpp"
    3232#include "CodePatterns/Verbose.hpp"
     33#include "Descriptors/MoleculeOfAtomSelectionDescriptor.hpp"
    3334#include "Formula.hpp"
    3435#include "LinearAlgebra/Vector.hpp"
     
    9899 * Note given element order is unimportant (i.e. g(Si, O) === g(O, Si))
    99100 * 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)
    101103 * \return Map of doubles with values the pair of the two atoms.
    102104 */
    103 DipoleAngularCorrelationMap *DipoleAngularCorrelation(std::vector<molecule *> &molecules)
     105DipoleAngularCorrelationMap *DipoleAngularCorrelation(std::vector<atom *> &atoms)
    104106{
    105107  Info FunctionInfo(__func__);
    106108  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;
    114110
    115111  // store original time step
    116112  const unsigned int oldtime = WorldTime::getTime();
    117113  World::getInstance().setTime(0);
     114  // calculate molecules for this time step
     115  BOOST_FOREACH(atom *_atom, atoms)
     116    molecules.insert(_atom->getMolecule());
    118117
    119118  BOOST_FOREACH(atom *_atom, World::getInstance().getAllAtoms())
     
    155154  for (size_t step = 1; step < max_timesteps; ++step) {
    156155    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());
    157160    size_t i=0;
    158161    BOOST_FOREACH(molecule *_mol, molecules) {
     
    161164      const double angle = Dipole.Angle(ZeroVector[i]) * (180./M_PI);
    162165      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() ) );
    164167      ++i;
    165168    }
     
    591594void OutputDipoleAngularCorrelation_Header( ofstream * const file )
    592595{
    593   *file << "\tMolecule";
     596  *file << "\tFirstAtomOfMolecule";
    594597};
    595598
     
    601604void OutputDipoleAngularCorrelation_Value( ofstream * const file, DipoleAngularCorrelationMap::const_iterator &runner )
    602605{
    603   *file << runner->second->getId();
     606  *file << runner->second->getName();
    604607};
    605608
Note: See TracChangeset for help on using the changeset viewer.