Changeset 7188b1 for src/atom_atominfo.cpp
- Timestamp:
- Oct 6, 2011, 4:06:10 PM (14 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:
- db7e6d
- Parents:
- e638f9
- git-author:
- Frederik Heber <heber@…> (09/01/11 13:49:14)
- git-committer:
- Frederik Heber <heber@…> (10/06/11 16:06:10)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/atom_atominfo.cpp
re638f9 r7188b1 121 121 void AtomInfo::set(size_t i, const double value) 122 122 { 123 OBSERVE; 124 NOTIFY(AtomObservable::PositionChanged); 123 125 ASSERT(AtomicPosition.size() > WorldTime::getTime(), 124 126 "AtomInfo::set() - Access out of range: " … … 146 148 } 147 149 148 void AtomInfo::setType(const element* _type) { 150 void AtomInfo::setType(const element* _type) 151 { 152 OBSERVE; 153 NOTIFY(AtomObservable::ElementChanged); 149 154 AtomicElement = _type; 150 155 } 151 156 152 void AtomInfo::setType(const int Z) { 157 void AtomInfo::setType(const int Z) 158 { 159 OBSERVE; 160 NOTIFY(AtomObservable::ElementChanged); 153 161 const element *elem = World::getInstance().getPeriode()->FindElement(Z); 154 162 setType(elem); … … 187 195 void AtomInfo::setAtomicVelocity(const Vector &_newvelocity) 188 196 { 197 OBSERVE; 198 NOTIFY(AtomObservable::VelocityChanged); 189 199 ASSERT(WorldTime::getTime() < AtomicVelocity.size(), 190 200 "AtomInfo::setAtomicVelocity() - Access out of range: " … … 196 206 void AtomInfo::setAtomicVelocityAtStep(const unsigned int _step, const Vector &_newvelocity) 197 207 { 208 OBSERVE; 209 if (WorldTime::getTime() == _step) 210 NOTIFY(AtomObservable::VelocityChanged); 198 211 const unsigned int size = AtomicVelocity.size(); 199 212 ASSERT(_step <= size, … … 229 242 void AtomInfo::setAtomicForce(const Vector &_newforce) 230 243 { 244 OBSERVE; 245 NOTIFY(AtomObservable::VelocityChanged); 231 246 ASSERT(WorldTime::getTime() < AtomicForce.size(), 232 247 "AtomInfo::setAtomicForce() - Access out of range: " … … 238 253 void AtomInfo::setAtomicForceAtStep(const unsigned int _step, const Vector &_newforce) 239 254 { 255 OBSERVE; 256 if (WorldTime::getTime() == _step) 257 NOTIFY(AtomObservable::VelocityChanged); 240 258 const unsigned int size = AtomicForce.size(); 241 259 ASSERT(_step <= size, … … 258 276 void AtomInfo::setFixedIon(const bool _fixedion) 259 277 { 278 OBSERVE; 279 NOTIFY(AtomObservable::PropertyChanged); 260 280 FixedIon = _fixedion; 261 281 } … … 263 283 void AtomInfo::setPosition(const Vector& _vector) 264 284 { 285 OBSERVE; 286 NOTIFY(AtomObservable::PositionChanged); 265 287 ASSERT(WorldTime::getTime() < AtomicPosition.size(), 266 288 "AtomInfo::setPosition() - Access out of range: " … … 273 295 void AtomInfo::setPositionAtStep(unsigned int _step, const Vector& _vector) 274 296 { 297 OBSERVE; 298 if (WorldTime::getTime() == _step) 299 NOTIFY(AtomObservable::PositionChanged); 275 300 const unsigned int size = AtomicPosition.size(); 276 301 ASSERT(_step <= size, … … 289 314 const VectorInterface& AtomInfo::operator+=(const Vector& b) 290 315 { 316 OBSERVE; 317 NOTIFY(AtomObservable::PositionChanged); 291 318 ASSERT(WorldTime::getTime() < AtomicPosition.size(), 292 319 "AtomInfo::operator+=() - Access out of range: " … … 299 326 const VectorInterface& AtomInfo::operator-=(const Vector& b) 300 327 { 328 OBSERVE; 329 NOTIFY(AtomObservable::PositionChanged); 301 330 ASSERT(WorldTime::getTime() < AtomicPosition.size(), 302 331 "AtomInfo::operator-=() - Access out of range: " … … 367 396 VectorInterface &AtomInfo::operator=(const Vector& _vector) 368 397 { 398 OBSERVE; 399 NOTIFY(AtomObservable::PositionChanged); 369 400 ASSERT(WorldTime::getTime() < AtomicPosition.size(), 370 401 "AtomInfo::operator=() - Access out of range: " … … 377 408 void AtomInfo::ScaleAll(const double *factor) 378 409 { 410 OBSERVE; 411 NOTIFY(AtomObservable::PositionChanged); 379 412 ASSERT(WorldTime::getTime() < AtomicPosition.size(), 380 413 "AtomInfo::ScaleAll() - Access out of range: " … … 386 419 void AtomInfo::ScaleAll(const Vector &factor) 387 420 { 421 OBSERVE; 422 NOTIFY(AtomObservable::PositionChanged); 388 423 ASSERT(WorldTime::getTime() < AtomicPosition.size(), 389 424 "AtomInfo::ScaleAll() - Access out of range: " … … 395 430 void AtomInfo::Scale(const double factor) 396 431 { 432 OBSERVE; 433 NOTIFY(AtomObservable::PositionChanged); 397 434 ASSERT(WorldTime::getTime() < AtomicPosition.size(), 398 435 "AtomInfo::Scale() - Access out of range: " … … 404 441 void AtomInfo::Zero() 405 442 { 443 OBSERVE; 444 NOTIFY(AtomObservable::PositionChanged); 406 445 ASSERT(WorldTime::getTime() < AtomicPosition.size(), 407 446 "AtomInfo::Zero() - Access out of range: " … … 413 452 void AtomInfo::One(const double one) 414 453 { 454 OBSERVE; 455 NOTIFY(AtomObservable::PositionChanged); 415 456 ASSERT(WorldTime::getTime() < AtomicPosition.size(), 416 457 "AtomInfo::One() - Access out of range: " … … 422 463 void AtomInfo::LinearCombinationOfVectors(const Vector &x1, const Vector &x2, const Vector &x3, const double * const factors) 423 464 { 465 OBSERVE; 466 NOTIFY(AtomObservable::PositionChanged); 424 467 ASSERT(WorldTime::getTime() < AtomicPosition.size(), 425 468 "AtomInfo::LinearCombinationOfVectors() - Access out of range: " … … 432 475 * returns the kinetic energy of this atom at a given time step 433 476 */ 434 double AtomInfo::getKineticEnergy(const unsigned int _step) const{ 477 double AtomInfo::getKineticEnergy(const unsigned int _step) const 478 { 435 479 ASSERT(_step < AtomicPosition.size(), 436 480 "AtomInfo::getKineticEnergy() - Access out of range: " … … 440 484 } 441 485 442 Vector AtomInfo::getMomentum(const unsigned int _step) const{ 486 Vector AtomInfo::getMomentum(const unsigned int _step) const 487 { 443 488 ASSERT(_step < AtomicPosition.size(), 444 489 "AtomInfo::getMomentum() - Access out of range: " … … 475 520 if (dest == src) // self assignment check 476 521 return; 522 523 if (WorldTime::getTime() == dest){ 524 NOTIFY(AtomObservable::PositionChanged); 525 NOTIFY(AtomObservable::VelocityChanged); 526 NOTIFY(AtomObservable::ForceChanged); 527 } 477 528 478 529 ASSERT(dest < AtomicPosition.size(),
Note:
See TracChangeset
for help on using the changeset viewer.