Changeset f01769 for src/Analysis
- Timestamp:
- Jul 24, 2015, 4:44:34 PM (10 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:
- a58c16
- Parents:
- 1259df
- git-author:
- Frederik Heber <heber@…> (06/01/15 16:57:36)
- git-committer:
- Frederik Heber <heber@…> (07/24/15 16:44:34)
- Location:
- src/Analysis
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Analysis/analysis_bonds.cpp
r1259df rf01769 182 182 // go through every atom 183 183 typedef std::set<const molecule *> Moleculeset; 184 for(molecule::const_iterator Walker = (*MolWalker)->begin();185 Walker !=(*MolWalker)->end();184 for(molecule::const_iterator Walker = const_cast<const molecule *>(*MolWalker)->begin(); 185 Walker != const_cast<const molecule *>(*MolWalker)->end(); 186 186 ++Walker) { 187 187 // go through every oxygen -
src/Analysis/analysis_correlation.cpp
r1259df rf01769 155 155 std::map<atomId_t, Vector> ZeroVector; 156 156 BOOST_FOREACH(molecule *_mol, molecules) { 157 const Vector Dipole = getDipole(_mol->begin(), _mol->end()); 158 for(molecule::const_iterator iter = _mol->begin(); iter != _mol->end(); ++iter) 157 const Vector Dipole = 158 getDipole( 159 const_cast<const molecule *>(_mol)->begin(), 160 const_cast<const molecule *>(_mol)->end()); 161 for(molecule::const_iterator iter = const_cast<const molecule *>(_mol)->begin(); 162 iter != const_cast<const molecule *>(_mol)->end(); 163 ++iter) 159 164 ZeroVector[(*iter)->getId()] = Dipole; 160 165 LOG(2,"INFO: Zero alignment for molecule " << _mol->getId() << " is " << Dipole); … … 208 213 size_t Counter_rejections = 0; 209 214 BOOST_FOREACH(molecule *_mol, molecules) { 210 const Vector Dipole = getDipole(_mol->begin(), _mol->end()); 215 const Vector Dipole = 216 getDipole( 217 const_cast<const molecule *>(_mol)->begin(), 218 const_cast<const molecule *>(_mol)->end()); 211 219 LOG(3,"INFO: Dipole vector at time step " << timestep << " for for molecule " 212 220 << _mol->getId() << " is " << Dipole); 213 221 // check that all atoms are valid (zeroVector known) 214 molecule::const_iterator iter = _mol->begin();215 for(; iter != _mol->end(); ++iter) {222 molecule::const_iterator iter = const_cast<const molecule *>(_mol)->begin(); 223 for(; iter != const_cast<const molecule *>(_mol)->end(); ++iter) { 216 224 if (!ZeroVector.count((*iter)->getId())) 217 225 break; 218 226 } 219 if (iter != _mol->end()) {227 if (iter != const_cast<const molecule *>(_mol)->end()) { 220 228 ELOG(2, "Skipping molecule " << _mol->getName() << " as not all atoms have a valid zeroVector."); 221 229 ++Counter_rejections; 222 230 continue; 223 231 } else 224 iter = _mol->begin();232 iter = const_cast<const molecule *>(_mol)->begin(); 225 233 std::map<atomId_t, Vector>::const_iterator zeroValue = ZeroVector.find((*iter)->getId()); //due to iter is const 226 234 double angle = 0.; … … 281 289 MolWalker != molecules.end(); ++MolWalker) { 282 290 LOG(2, "INFO: Current molecule is " << (*MolWalker)->getId() << "."); 283 const Vector Dipole = getDipole((*MolWalker)->begin(), (*MolWalker)->end()); 291 const Vector Dipole = 292 getDipole( 293 const_cast<const molecule *>(*MolWalker)->begin(), 294 const_cast<const molecule *>(*MolWalker)->end()); 284 295 std::vector<molecule *>::const_iterator MolOtherWalker = MolWalker; 285 296 for (++MolOtherWalker; … … 287 298 ++MolOtherWalker) { 288 299 LOG(2, "INFO: Current other molecule is " << (*MolOtherWalker)->getId() << "."); 289 const Vector OtherDipole = getDipole((*MolOtherWalker)->begin(), (*MolOtherWalker)->end()); 300 const Vector OtherDipole = getDipole( 301 const_cast<const molecule *>(*MolOtherWalker)->begin(), 302 const_cast<const molecule *>(*MolOtherWalker)->end()); 290 303 const double angle = Dipole.Angle(OtherDipole) * (180./M_PI); 291 304 LOG(1, "Angle is " << angle << "."); … … 410 423 for (std::vector<molecule *>::const_iterator MolWalker = molecules.begin(); MolWalker != molecules.end(); MolWalker++) { 411 424 LOG(2, "Current molecule is " << *MolWalker << "."); 412 for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) { 425 for (molecule::const_iterator iter = const_cast<const molecule *>(*MolWalker)->begin(); 426 iter != const_cast<const molecule *>(*MolWalker)->end(); 427 ++iter) { 413 428 LOG(3, "Current atom is " << **iter << "."); 414 429 for (vector<const element *>::const_iterator type = elements.begin(); type != elements.end(); ++type) … … 456 471 RealSpaceMatrix FullInverseMatrix = World::getInstance().getDomain().getMinv(); 457 472 LOG(2, "Current molecule is " << *MolWalker << "."); 458 for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) { 473 for (molecule::const_iterator iter = const_cast<const molecule *>(*MolWalker)->begin(); 474 iter != const_cast<const molecule *>(*MolWalker)->end(); 475 ++iter) { 459 476 LOG(3, "Current atom is " << **iter << "."); 460 477 for (vector<const element *>::const_iterator type = elements.begin(); type != elements.end(); ++type) … … 509 526 if ((*MolWalker)->empty()) 510 527 LOG(2, "\t is empty."); 511 for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) { 528 for (molecule::const_iterator iter = const_cast<const molecule *>(*MolWalker)->begin(); 529 iter != const_cast<const molecule *>(*MolWalker)->end(); 530 ++iter) { 512 531 LOG(3, "\tCurrent atom is " << *(*iter) << "."); 513 532 for (vector<const element *>::const_iterator type = elements.begin(); type != elements.end(); ++type) … … 566 585 RealSpaceMatrix FullInverseMatrix = World::getInstance().getDomain().getMinv(); 567 586 LOG(2, "Current molecule is " << *MolWalker << "."); 568 for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) { 587 for (molecule::const_iterator iter = const_cast<const molecule *>(*MolWalker)->begin(); 588 iter != const_cast<const molecule *>(*MolWalker)->end(); 589 ++iter) { 569 590 LOG(3, "Current atom is " << **iter << "."); 570 591 for (vector<const element *>::const_iterator type = elements.begin(); type != elements.end(); ++type)
Note:
See TracChangeset
for help on using the changeset viewer.