- Timestamp:
- Apr 6, 2012, 11:46:16 AM (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:
- c0ed1e
- Parents:
- 760c4c
- git-author:
- Frederik Heber <heber@…> (04/06/12 11:03:57)
- git-committer:
- Frederik Heber <heber@…> (04/06/12 11:46:16)
- Location:
- src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Box.cpp
r760c4c rd00370 119 119 ASSERT(_M.determinant()!=0,"Matrix in Box construction was not invertible"); 120 120 OBSERVE; 121 NOTIFY(MatrixChanged); 121 if (_M != *M) 122 NOTIFY(MatrixChanged); 122 123 *M =_M; 123 124 *Minv = M->invert(); … … 343 344 { 344 345 OBSERVE; 345 NOTIFY(BoundaryConditionsChanged); 346 if (conditions.get(i) != _condition) 347 NOTIFY(BoundaryConditionsChanged); 346 348 conditions.set(i, _condition); 347 349 } … … 350 352 { 351 353 OBSERVE; 354 if (conditions.get() != _conditions) 352 355 NOTIFY(BoundaryConditionsChanged); 353 356 conditions.set(_conditions); -
src/unittests/BoxUnitTest.cpp
r760c4c rd00370 1629 1629 UpdateCountObserver *observer_general = new UpdateCountObserver(); 1630 1630 NotificationObserver *observer_matrix = new NotificationObserver( 1631 unitBox->getChannel(Box::MatrixChanged));1631 stretchedBox1->getChannel(Box::MatrixChanged)); 1632 1632 NotificationObserver *observer_bc = new NotificationObserver( 1633 unitBox->getChannel(Box::BoundaryConditionsChanged));1633 stretchedBox1->getChannel(Box::BoundaryConditionsChanged)); 1634 1634 CPPUNIT_ASSERT_EQUAL((int)0, observer_general->updates); 1635 1635 CPPUNIT_ASSERT_EQUAL(false, observer_matrix->wasNotified); 1636 1636 CPPUNIT_ASSERT_EQUAL(false, observer_bc->wasNotified); 1637 unitBox->signOn(observer_general);1638 unitBox->signOn(observer_matrix, Box::MatrixChanged);1639 unitBox->signOn(observer_bc, Box::BoundaryConditionsChanged);1637 stretchedBox1->signOn(observer_general); 1638 stretchedBox1->signOn(observer_matrix, Box::MatrixChanged); 1639 stretchedBox1->signOn(observer_bc, Box::BoundaryConditionsChanged); 1640 1640 1641 1641 // create update MatrixChanged 1642 unitBox->setM(*unit);1642 stretchedBox1->setM(*unit); 1643 1643 CPPUNIT_ASSERT_EQUAL((int)1, observer_general->updates); 1644 1644 CPPUNIT_ASSERT_EQUAL(true, observer_matrix->wasNotified); … … 1646 1646 observer_matrix->wasNotified = false; 1647 1647 1648 // create update BoundaryConditionsChanged1649 unitBox->setCondition(0, BoundaryConditions::Wrap);1648 // same matrix does not notify but update 1649 stretchedBox1->setM(*unit); 1650 1650 CPPUNIT_ASSERT_EQUAL((int)2, observer_general->updates); 1651 1651 CPPUNIT_ASSERT_EQUAL(false, observer_matrix->wasNotified); 1652 CPPUNIT_ASSERT_EQUAL(false, observer_bc->wasNotified); 1653 1654 // create update BoundaryConditionsChanged 1655 stretchedBox1->setCondition(0, BoundaryConditions::Bounce); 1656 CPPUNIT_ASSERT_EQUAL((int)3, observer_general->updates); 1657 CPPUNIT_ASSERT_EQUAL(false, observer_matrix->wasNotified); 1652 1658 CPPUNIT_ASSERT_EQUAL(true, observer_bc->wasNotified); 1659 observer_bc->wasNotified = false; 1660 1661 // set same conditions does not notify but update 1662 stretchedBox1->setCondition(0, BoundaryConditions::Bounce); 1663 CPPUNIT_ASSERT_EQUAL((int)4, observer_general->updates); 1664 CPPUNIT_ASSERT_EQUAL(false, observer_matrix->wasNotified); 1665 CPPUNIT_ASSERT_EQUAL(false, observer_bc->wasNotified); 1653 1666 1654 1667 // remove observers again 1655 unitBox->signOff(observer_general);1656 unitBox->signOff(observer_matrix, Box::MatrixChanged);1657 unitBox->signOff(observer_bc, Box::BoundaryConditionsChanged);1668 stretchedBox1->signOff(observer_general); 1669 stretchedBox1->signOff(observer_matrix, Box::MatrixChanged); 1670 stretchedBox1->signOff(observer_bc, Box::BoundaryConditionsChanged); 1658 1671 delete observer_general; 1659 1672 delete observer_matrix;
Note:
See TracChangeset
for help on using the changeset viewer.