Changeset 69459d for src/LinkedCell


Ignore:
Timestamp:
Jan 2, 2012, 1:34:58 PM (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:
7c0191
Parents:
2ced6b
git-author:
Frederik Heber <heber@…> (12/22/11 09:33:28)
git-committer:
Frederik Heber <heber@…> (01/02/12 13:34:58)
Message:

Added unit test on changing box to LinkedCell_ControllerUnitTest.

Location:
src/LinkedCell
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/LinkedCell/LinkedCell_View.hpp

    r2ced6b r69459d  
    1818#include "LinkedCell/types.hpp"
    1919
     20class LinkedCell_ControllerTest;
    2021class LinkedCell_ViewTest;
    2122class TesselPoint;
     
    3839  class LinkedCell_View
    3940  {
    40     //!> grant unit test access to private parts
     41    //!> grant view unit test access to private parts
    4142    friend class ::LinkedCell_ViewTest;
     43    //!> grant controller unit test access to private parts (needs to check on modelwrapper)
     44    friend class ::LinkedCell_ControllerTest;
    4245  public:
    4346    LinkedCell_View(const LinkedCell_View &_view);
  • src/LinkedCell/unittests/LinkedCell_ControllerUnitTest.cpp

    r2ced6b r69459d  
    3030#include "LinkedCell/LinkedCell_Controller.hpp"
    3131#include "LinkedCell/LinkedCell_View.hpp"
     32#include "LinkedCell/LinkedCell_View_ModelWrapper.hpp"
    3233#include "LinkedCell/unittests/defs.hpp"
    3334#include "LinkedCell/PointCloudAdaptor.hpp"
     
    262263void LinkedCell_ControllerTest::updateBoxTest()
    263264{
    264   CPPUNIT_ASSERT(true);
    265 }
     265  /// sign on to domain
     266  domain->signOn(controller, Box::MatrixChanged);
     267
     268  /// obtain a view
     269  const double edgelength = controller->upper_threshold;
     270  CPPUNIT_ASSERT_EQUAL( (size_t)0, controller->ModelsMap.size() );
     271  LinkedCell::LinkedCell_View view = controller->getView(edgelength, *emptyset);
     272  CPPUNIT_ASSERT_EQUAL( (size_t)1, controller->ModelsMap.size() );
     273  const LinkedCell::LinkedCell_Model * const model = view.LC->getModel();
     274
     275  /// change box matrix
     276  domain->setM(*BoxM);
     277
     278  /// check that model has changed
     279  CPPUNIT_ASSERT( model != view.LC->getModel() );
     280
     281  /// sign off
     282  domain->signOff(controller, Box::MatrixChanged);
     283}
  • src/LinkedCell/unittests/stubs/ObserverBoxStub.cpp

    r2ced6b r69459d  
    6464}
    6565
     66void Box::setM(RealSpaceMatrix _M)
     67{
     68  OBSERVE;
     69  NOTIFY(MatrixChanged);
     70  delete M;
     71  M = new RealSpaceMatrix(_M);
     72  *Minv = M->invert();
     73}
Note: See TracChangeset for help on using the changeset viewer.