- Timestamp:
- Feb 11, 2016, 8:07:50 AM (9 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:
- db842b
- Parents:
- 29f7c1
- git-author:
- Frederik Heber <heber@…> (12/29/15 19:50:22)
- git-committer:
- Frederik Heber <heber@…> (02/11/16 08:07:50)
- Location:
- src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/molecule.cpp
r29f7c1 r951aa6 957 957 } 958 958 959 /** Brings molecule::AtomCount and atom::*Name up-to-date.960 * \param *out output stream for debugging961 */962 size_t molecule::doCountNoNonHydrogen() const963 {964 int temp = 0;965 // go through atoms and look for new ones966 for (molecule::const_iterator iter = begin(); iter != end(); ++iter)967 if ((*iter)->getType()->getAtomicNumber() != 1) // count non-hydrogen atoms whilst at it968 ++temp;969 return temp;970 };971 972 /** Counts the number of present bonds.973 * \return number of bonds974 */975 int molecule::doCountBonds() const976 {977 unsigned int counter = 0;978 for(molecule::const_iterator AtomRunner = begin(); AtomRunner != end(); ++AtomRunner) {979 const BondList& ListOfBonds = (*AtomRunner)->getListOfBonds();980 for(BondList::const_iterator BondRunner = ListOfBonds.begin();981 BondRunner != ListOfBonds.end();982 ++BondRunner)983 if ((*BondRunner)->leftatom == *AtomRunner)984 counter++;985 }986 return counter;987 }988 989 990 959 /** Returns an index map for two father-son-molecules. 991 960 * The map tells which atom in this molecule corresponds to which one in the other molecul with their fathers. … … 1202 1171 } 1203 1172 1204 void molecule::resetFormula()1205 {1206 // clear1207 formula.clear();1208 1209 for (molecule::const_iterator iter = const_cast<const molecule *>(this)->begin();1210 iter != const_cast<const molecule *>(this)->end(); ++iter)1211 formula+=(*iter)->getType();1212 }1213 1214 1173 void molecule::select() 1215 1174 { -
src/molecule.hpp
r29f7c1 r951aa6 135 135 const std::string getName() const; 136 136 int getAtomCount() const; 137 size_t doCountNoNonHydrogen() const;138 int doCountBonds() const;139 137 size_t getNoNonHydrogen() const{ 140 138 return NoNonHydrogen; … … 275 273 */ 276 274 void setAtomName(atom *_atom) const; 277 278 /** Resets the formula for this molecule.279 *280 * This is required in case an atom changes its element as we then don't281 * have any knowledge about its previous element anymore.282 */283 void resetFormula();284 275 285 276 //!> grant World (only) access to selection state changers
Note:
See TracChangeset
for help on using the changeset viewer.