Changeset 99b87a for src/Analysis


Ignore:
Timestamp:
Oct 31, 2011, 11:48:45 AM (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:
72105a
Parents:
a860a1
git-author:
Frederik Heber <heber@…> (05/11/11 09:57:47)
git-committer:
Frederik Heber <heber@…> (10/31/11 11:48:45)
Message:

DipoleAngularCorrelation() can be told not to reset time to old value.

  • this should save some unnecessary re-creation of bond structure when the method is used by AnalysisDipoleAngularCorrelationAction::performCall().
  • new enum ResetWorldTime in analysis_correlation.hpp to make reset statement in call verbose.
Location:
src/Analysis
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Analysis/analysis_correlation.cpp

    ra860a1 r99b87a  
    152152 * \param ZeroVector map with Zero orientation vector for each atom in \a atoms.
    153153 *   Is filled from initial time step if size of map does not match size of \a atoms.
     154 * \param DontResetTime don't reset time to old value (triggers re-creation of bond system)
    154155 * \return Map of doubles with values the pair of the two atoms.
    155156 */
     
    157158    std::vector<atom *> &atoms,
    158159    const size_t timestep,
    159     std::map<atomId_t, Vector> &ZeroVector
     160    std::map<atomId_t, Vector> &ZeroVector,
     161    const enum ResetWorldTime DoTimeReset
    160162    )
    161163{
     
    169171  }
    170172
    171   // store original time step
    172   const unsigned int oldtime = WorldTime::getTime();
     173  unsigned int oldtime = 0;
     174  if (DoTimeReset == DoResetTime) {
     175    // store original time step
     176    oldtime = WorldTime::getTime();
     177  }
    173178
    174179  // set time step
     
    205210    ++i;
    206211  }
    207 
    208   // re-set to original time step again
    209   World::getInstance().setTime(oldtime);
    210   LOG(0,"STATUS: Done.");
     212  LOG(0,"STATUS: Done with calculating dipoles.");
     213
     214  if (DoTimeReset == DoResetTime) {
     215    // re-set to original time step again
     216    World::getInstance().setTime(oldtime);
     217  }
    211218
    212219  // and return results
  • src/Analysis/analysis_correlation.hpp

    ra860a1 r99b87a  
    5353typedef map<double, int> BinPairMap;
    5454
     55enum ResetWorldTime {
     56  DontResetTime,
     57  DoResetTime
     58};
     59
    5560/********************************************** declarations *******************************/
    5661
     
    5863std::map<atomId_t, Vector> CalculateZeroAngularDipole(std::vector<atom *> &atoms);
    5964
    60 DipoleAngularCorrelationMap *DipoleAngularCorrelation(std::vector<atom *> &atoms, const size_t timestep, std::map<atomId_t, Vector> &ZeroVector);
     65DipoleAngularCorrelationMap *DipoleAngularCorrelation(std::vector<atom *> &atoms, const size_t timestep, std::map<atomId_t, Vector> &ZeroVector, const enum ResetWorldTime DoTimeReset = DontResetTime);
    6166DipoleCorrelationMap *DipoleCorrelation(std::vector<molecule *> &molecules);
    6267PairCorrelationMap *PairCorrelation(std::vector<molecule *> &molecules, const std::vector<const element *> &elements);
Note: See TracChangeset for help on using the changeset viewer.