Changeset 4fc828 for src/Analysis


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

DipoleAngularCorrelation working with multi-timestep PDBs with CONECT entries.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/Analysis/analysis_correlation.cpp

    rdf8759 r4fc828  
    6666    // go through all bonds
    6767    const BondList& ListOfBonds = (*atomiter)->getListOfBonds();
     68    ASSERT(ListOfBonds.begin() != ListOfBonds.end(),
     69        "getDipole() - no bonds in molecule!");
    6870    for (BondList::const_iterator bonditer = ListOfBonds.begin();
    6971        bonditer != ListOfBonds.end();
     
    7779        BondDipoleVector.Normalize();
    7880        BondDipoleVector *= DeltaEN;
     81        LOG(3,"INFO: Dipole vector from bond " << **bonditer << " is " << BondDipoleVector);
    7982        DipoleVector += BondDipoleVector;
    8083        SumOfVectors++;
     
    8285    }
    8386  }
    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;
    8591  DoLog(1) && (Log() << Verbose(1) << "Resulting dipole vector is " << DipoleVector << std::endl);
    8692
     
    111117  World::getInstance().setTime(0);
    112118
     119  BOOST_FOREACH(atom *_atom, World::getInstance().getAllAtoms())
     120    LOG(2, "INFO: Atom " << _atom->getId() << " "
     121        << *dynamic_cast<AtomInfo *>(_atom) <<".");
     122
    113123  // get highest trajectory size
     124  LOG(0,"STATUS: Retrieving maximum amount of time steps ...");
    114125  size_t max_timesteps = 0;
     126  size_t min_timesteps = -1;
    115127  BOOST_FOREACH(molecule *_mol, molecules) {
    116128    for(molecule::const_iterator iter = _mol->begin();
     
    119131      if ((*iter)->getTrajectorySize() > max_timesteps)
    120132        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
    123140  // get zero orientation for each molecule.
     141  LOG(0,"STATUS: Calculating dipoles for first time step ...");
    124142  std::vector<Vector> ZeroVector;
    125143  ZeroVector.resize(molecules.size(), zeroVec);
     
    128146    const Vector Dipole = getDipole(_mol->begin(), _mol->end());
    129147    ZeroVector[i] = Dipole;
     148    LOG(2,"INFO: Zero alignment for molecule " << _mol->getId() << " is " << ZeroVector[i]);
    130149    ++i;
    131150  }
     151  LOG(1,"INFO: There is a total of " << i << " molecules.");
     152
    132153  // go through every time step
     154  LOG(0,"STATUS: Calculating dipoles of following time steps ...");
    133155  for (size_t step = 1; step < max_timesteps; ++step) {
    134156    World::getInstance().setTime(step);
     
    136158    BOOST_FOREACH(molecule *_mol, molecules) {
    137159      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);
    138161      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 << ".");
    141163      outmap->insert ( make_pair (angle, _mol ) );
    142164      ++i;
     
    147169  // set original time step again
    148170  World::getInstance().setTime(oldtime);
     171  LOG(0,"STATUS: Done.");
    149172
    150173  // and return results
     
    568591void OutputDipoleAngularCorrelation_Header( ofstream * const file )
    569592{
    570   *file << "\tMolecule1\tMolecule2";
     593  *file << "\tMolecule";
    571594};
    572595
Note: See TracChangeset for help on using the changeset viewer.