- Timestamp:
- Oct 12, 2011, 2:10:48 PM (13 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:
- 220cf64
- Parents:
- b60804
- git-author:
- Frederik Heber <heber@…> (10/12/11 13:00:32)
- git-committer:
- Frederik Heber <heber@…> (10/12/11 14:10:48)
- Location:
- src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/atom_atominfo.cpp
rb60804 r35a25a 35 35 */ 36 36 AtomInfo::AtomInfo() : 37 AtomicElement( NULL),37 AtomicElement(-1), 38 38 FixedIon(false) 39 39 { … … 60 60 61 61 AtomInfo::AtomInfo(const VectorInterface &_v) : 62 AtomicElement( NULL),62 AtomicElement(-1), 63 63 FixedIon(false) 64 64 { … … 89 89 const element *AtomInfo::getType() const 90 90 { 91 return AtomicElement; 91 const element *elem = World::getInstance().getPeriode()->FindElement(AtomicElement); 92 ASSERT(elem != NULL, 93 "AtomInfo::getType() - there is not element stored under Z="+ 94 toString(AtomicElement)+" in the periodentafel."); 95 return elem; 92 96 } 93 97 … … 150 154 void AtomInfo::setType(const element* _type) 151 155 { 152 OBSERVE; 153 NOTIFY(AtomObservable::ElementChanged); 154 AtomicElement = _type; 156 if (_type->getNumber() != AtomicElement) { 157 OBSERVE; 158 NOTIFY(AtomObservable::ElementChanged); 159 AtomicElement = _type->getNumber(); 160 } 155 161 } 156 162 157 163 void AtomInfo::setType(const int Z) 158 164 { 159 OBSERVE;160 NOTIFY(AtomObservable::ElementChanged);161 165 const element *elem = World::getInstance().getPeriode()->FindElement(Z); 162 setType(elem); 166 if (elem != NULL) { 167 OBSERVE; 168 NOTIFY(AtomObservable::ElementChanged); 169 AtomicElement = Z; 170 } 163 171 } 164 172 … … 508 516 } 509 517 510 double AtomInfo::getMass() const{ 511 return AtomicElement->getMass(); 518 double AtomInfo::getMass() const 519 { 520 return getType()->getMass(); 512 521 } 513 522 -
src/atom_atominfo.hpp
rb60804 r35a25a 22 22 23 23 #include "atom_observable.hpp" 24 25 #include "types.hpp" 24 26 25 27 #include "LinearAlgebra/Vector.hpp" … … 263 265 264 266 private: 265 const element *AtomicElement; //!< pointing to element267 atomicNumber_t AtomicElement; //!< contains atomic number (i.e. Z of element) or "-1" if unset 266 268 bool FixedIon; 267 269 };
Note:
See TracChangeset
for help on using the changeset viewer.