Ignore:
Timestamp:
Mar 2, 2011, 9:53:07 PM (15 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, Candidate_v1.7.0, Candidate_v1.7.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:
53d6b2
Parents:
c6123b
git-author:
Frederik Heber <heber@…> (02/25/11 15:40:39)
git-committer:
Frederik Heber <heber@…> (03/02/11 21:53:07)
Message:

Moved FillBondStructureFromReference from MoleculeLeafClass to molecule.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/moleculelist.cpp

    rc6123b r99752a  
    777777};
    778778
    779 /** Fills the bond structure of this chain list subgraphs that are derived from a complete \a *reference molecule.
    780  * Calls this routine in each MoleculeLeafClass::next subgraph if it's not NULL.
    781  * \param *out output stream for debugging
    782  * \param *reference reference molecule with the bond structure to be copied
    783  * \param **&ListOfLocalAtoms Lookup table for this subgraph and index of each atom in \a *reference, may be NULL on start, then it is filled
    784  * \param FreeList true - ***ListOfLocalAtoms is free'd before return, false - it is not
    785  * \return true - success, false - failure
    786  */
    787 bool MoleculeLeafClass::FillBondStructureFromReference(const molecule * const reference, atom **&ListOfLocalAtoms, bool FreeList)
    788 {
    789   atom *OtherWalker = NULL;
    790   atom *Father = NULL;
    791   bool status = true;
    792   int AtomNo;
    793 
    794   DoLog(1) && (Log() << Verbose(1) << "Begin of FillBondStructureFromReference." << endl);
    795   // fill ListOfLocalAtoms if NULL was given
    796   if (!Leaf->FillListOfLocalAtoms(ListOfLocalAtoms, reference->getAtomCount())) {
    797     DoLog(1) && (Log() << Verbose(1) << "Filling of ListOfLocalAtoms failed." << endl);
    798     return false;
    799   }
    800 
    801   if (status) {
    802     DoLog(1) && (Log() << Verbose(1) << "Creating adjacency list for subgraph " << Leaf << "." << endl);
    803     // remove every bond from the list
    804     for_each(Leaf->begin(), Leaf->end(),
    805         boost::bind(&BondedParticle::ClearBondsAtStep,_1,WorldTime::getTime()));
    806 
    807 
    808     for(molecule::const_iterator iter = Leaf->begin(); iter != Leaf->end(); ++iter) {
    809       Father = (*iter)->GetTrueFather();
    810       AtomNo = Father->getNr(); // global id of the current walker
    811       const BondList& ListOfBonds = Father->getListOfBonds();
    812       for (BondList::const_iterator Runner = ListOfBonds.begin();
    813           Runner != ListOfBonds.end();
    814           ++Runner) {
    815         OtherWalker = ListOfLocalAtoms[(*Runner)->GetOtherAtom((*iter)->GetTrueFather())->getNr()]; // local copy of current bond partner of walker
    816         if (OtherWalker != NULL) {
    817           if (OtherWalker->getNr() > (*iter)->getNr())
    818             Leaf->AddBond((*iter), OtherWalker, (*Runner)->BondDegree);
    819         } else {
    820           DoLog(1) && (Log() << Verbose(1) << "OtherWalker = ListOfLocalAtoms[" << (*Runner)->GetOtherAtom((*iter)->GetTrueFather())->getNr() << "] is NULL!" << endl);
    821           status = false;
    822         }
    823       }
    824     }
    825   }
    826 
    827   if ((FreeList) && (ListOfLocalAtoms != NULL)) {
    828     // free the index lookup list
    829     delete[](ListOfLocalAtoms);
    830   }
    831   DoLog(1) && (Log() << Verbose(1) << "End of FillBondStructureFromReference." << endl);
    832   return status;
    833 };
    834 
    835779/** Fills the root stack for sites to be used as root in fragmentation depending on order or adaptivity criteria
    836780 * Again, as in \sa FillBondStructureFromReference steps recursively through each Leaf in this chain list of molecule's.
Note: See TracChangeset for help on using the changeset viewer.