Changeset 08a0f52


Ignore:
Timestamp:
Apr 3, 2012, 8:00:19 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:
108968
Parents:
ccb487
git-author:
Frederik Heber <heber@…> (03/13/12 17:36:46)
git-committer:
Frederik Heber <heber@…> (04/03/12 08:00:19)
Message:

AtomInfo has new functions getElement() and getElementNo().

  • getElement() shall replace getType() which still returns a pointer instead of a reference, is marked as deprecated.
  • getElementNo() is a faster way if only the atomicNumber_t of the atom is desired as no lookup in the World is necessary.
Location:
src/Atom
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Atom/atom_atominfo.cpp

    rccb487 r08a0f52  
    2020#include "CodePatterns/MemDebug.hpp"
    2121
     22#include "CodePatterns/Verbose.hpp"
     23
     24#include "atom_atominfo.hpp"
    2225#include "CodePatterns/Log.hpp"
    23 #include "CodePatterns/Verbose.hpp"
    2426#include "config.hpp"
    2527#include "Element/element.hpp"
     
    2830#include "World.hpp"
    2931#include "WorldTime.hpp"
    30 #include "atom_atominfo.hpp"
    3132
    3233#include <iomanip>
     
    4445  AtomicForce.reserve(1);
    4546  AtomicForce.push_back(zeroVec);
     47
    4648};
    4749
     
    9193  const element *elem = World::getInstance().getPeriode()->FindElement(AtomicElement);
    9294  return elem;
     95}
     96
     97const element &AtomInfo::getElement() const
     98{
     99  const element &elem = *World::getInstance().getPeriode()->FindElement(AtomicElement);
     100  return elem;
     101}
     102
     103atomicNumber_t AtomInfo::getElementNo() const
     104{
     105  return AtomicElement;
    93106}
    94107
  • src/Atom/atom_atominfo.hpp

    rccb487 r08a0f52  
    1919#endif
    2020
     21#include <boost/function.hpp>
    2122#include <vector>
    2223
     
    5354  virtual void UpdateSteps()=0;
    5455
     56  /** DEPRECATED: Getter for element indicated by AtomicElement.
     57   *
     58   * \deprecated This function is deprecated, use getElement() instead.
     59   *
     60   * @return constant pointer to element for AtomicElement
     61   */
     62  const element *getType() const;
     63
     64  /** Getter for element indicated by AtomicElement.
     65   *
     66   * \note Looking up the element requires looking the World instance and is
     67   * thus significantly slower than instead just returning the internally
     68   * stored atomicNumber_t. So, if possible use getElementNo() instead and
     69   * check soundly whether you truely need access to all of element's member
     70   * variables.
     71   *
     72   * @return const reference to element indicated by AtomicElement
     73   */
     74  const element & getElement() const;
     75
    5576  /** Getter for AtomicElement.
    5677   *
    57    * @return constant reference to AtomicElement
    58    */
    59   const element *getType() const;
     78   * @return AtomicElement
     79   */
     80  atomicNumber_t getElementNo() const;
     81
    6082  /** Setter for AtomicElement.
    6183   *
Note: See TracChangeset for help on using the changeset viewer.