Ignore:
Timestamp:
Jun 17, 2010, 2:55:56 PM (16 years ago)
Author:
Tillmann Crueger <crueger@…>
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, Candidate_v1.7.0, Candidate_v1.7.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:
b47bfc
Parents:
992fd7 (diff), 5f5a7b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'stable' into QT4Refactoring

Conflicts:

molecuilder/src/Actions/TesselationAction/ConvexEnvelopeAction.hpp
molecuilder/src/Helpers/MemDebug.hpp
molecuilder/src/Makefile.am
molecuilder/src/UIElements/Dialog.cpp
molecuilder/src/UIElements/MainWindow.cpp
molecuilder/src/UIElements/TextUI/TextUIFactory.cpp
molecuilder/src/builder.cpp

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/unittests/AnalysisCorrelationToSurfaceUnitTest.cpp

    r992fd7 r257c77  
    1717#include "AnalysisCorrelationToSurfaceUnitTest.hpp"
    1818
    19 #include "World.hpp"
    2019#include "atom.hpp"
    2120#include "boundary.hpp"
     
    2625#include "tesselation.hpp"
    2726#include "World.hpp"
     27#include "Helpers/Assert.hpp"
    2828
    2929#include "Helpers/Assert.hpp"
     
    4040void AnalysisCorrelationToSurfaceUnitTest::setUp()
    4141{
    42   //ASSERT_DO(Assert::Throw);
     42  ASSERT_DO(Assert::Throw);
    4343
    4444  atom *Walker = NULL;
     
    4747  TestList = NULL;
    4848  TestSurfaceMolecule = NULL;
    49   hydrogen = NULL;
    50   tafel = NULL;
    5149  surfacemap = NULL;
    5250  binmap = NULL;
     
    5452  LC = NULL;
    5553
    56   // construct element
    57   hydrogen = new element;
    58   hydrogen->Z = 1;
    59   strcpy(hydrogen->name, "hydrogen");
    60   strcpy(hydrogen->symbol, "H");
    61   carbon = new element;
    62   carbon->Z = 6;
    63   strcpy(carbon->name, "carbon");
    64   strcpy(carbon->symbol, "C");
    65 
    66   // construct periodentafel
    67   tafel = World::getInstance().getPeriode();
    68   tafel->AddElement(hydrogen);
    69   tafel->AddElement(carbon);
     54  // prepare element list
     55  hydrogen = World::getInstance().getPeriode()->FindElement(1);
     56  CPPUNIT_ASSERT(hydrogen != NULL && "hydrogen element not found");
     57  elements.clear();
    7058
    7159  // construct molecule (tetraeder of hydrogens) base
    7260  TestSurfaceMolecule = World::getInstance().createMolecule();
     61
    7362  Walker = World::getInstance().createAtom();
    7463  Walker->type = hydrogen;
    7564  *Walker->node = Vector(1., 0., 1. );
    76 
    77   TestSurfaceMolecule->AddAtom(Walker);
     65  TestSurfaceMolecule->AddAtom(Walker);
     66
    7867  Walker = World::getInstance().createAtom();
    7968  Walker->type = hydrogen;
    8069  *Walker->node = Vector(0., 1., 1. );
    8170  TestSurfaceMolecule->AddAtom(Walker);
     71
    8272  Walker = World::getInstance().createAtom();
    8373  Walker->type = hydrogen;
    8474  *Walker->node = Vector(1., 1., 0. );
    8575  TestSurfaceMolecule->AddAtom(Walker);
     76
    8677  Walker = World::getInstance().createAtom();
    8778  Walker->type = hydrogen;
     
    9081
    9182  // check that TestMolecule was correctly constructed
    92   CPPUNIT_ASSERT_EQUAL( TestSurfaceMolecule->AtomCount, 4 );
     83  CPPUNIT_ASSERT_EQUAL( TestSurfaceMolecule->getAtomCount(), 4 );
    9384
    9485  TestList = World::getInstance().getMolecules();
     
    10293
    10394  // add outer atoms
     95  carbon = World::getInstance().getPeriode()->FindElement(6);
    10496  TestSurfaceMolecule = World::getInstance().createMolecule();
    10597  Walker = World::getInstance().createAtom();
     
    10799  *Walker->node = Vector(4., 0., 4. );
    108100  TestSurfaceMolecule->AddAtom(Walker);
     101
    109102  Walker = World::getInstance().createAtom();
    110103  Walker->type = carbon;
    111104  *Walker->node = Vector(0., 4., 4. );
    112105  TestSurfaceMolecule->AddAtom(Walker);
     106
    113107  Walker = World::getInstance().createAtom();
    114108  Walker->type = carbon;
    115109  *Walker->node = Vector(4., 4., 0. );
    116110  TestSurfaceMolecule->AddAtom(Walker);
     111
    117112  // add inner atoms
    118113  Walker = World::getInstance().createAtom();
     
    120115  *Walker->node = Vector(0.5, 0.5, 0.5 );
    121116  TestSurfaceMolecule->AddAtom(Walker);
     117
    122118  TestSurfaceMolecule->ActiveFlag = true;
    123119  TestList->insert(TestSurfaceMolecule);
     
    141137  delete(LC);
    142138  World::purgeInstance();
    143   MemoryUsageObserver::purgeInstance();
    144139  logger::purgeInstance();
    145140};
     
    150145void AnalysisCorrelationToSurfaceUnitTest::SurfaceTest()
    151146{
    152   CPPUNIT_ASSERT_EQUAL( 4, TestSurfaceMolecule->AtomCount );
     147  CPPUNIT_ASSERT_EQUAL( 4, TestSurfaceMolecule->getAtomCount() );
    153148  CPPUNIT_ASSERT_EQUAL( (size_t)2, TestList->ListOfMolecules.size() );
    154149  CPPUNIT_ASSERT_EQUAL( (size_t)4, Surface->PointsOnBoundary.size() );
     
    160155{
    161156  // do the pair correlation
    162   surfacemap = CorrelationToSurface( TestList, hydrogen, Surface, LC );
     157  elements.push_back(hydrogen);
     158  surfacemap = CorrelationToSurface( TestList, elements, Surface, LC );
    163159//  OutputCorrelationToSurface ( (ofstream *)&cout, surfacemap );
    164160  CPPUNIT_ASSERT( surfacemap != NULL );
     
    169165{
    170166  BinPairMap::iterator tester;
    171   surfacemap = CorrelationToSurface( TestList, hydrogen, Surface, LC );
     167  elements.push_back(hydrogen);
     168  surfacemap = CorrelationToSurface( TestList, elements, Surface, LC );
    172169  // put pair correlation into bins and check with no range
    173170//  OutputCorrelationToSurface ( (ofstream *)&cout, surfacemap );
     
    184181{
    185182  BinPairMap::iterator tester;
    186   surfacemap = CorrelationToSurface( TestList, hydrogen, Surface, LC );
     183  elements.push_back(hydrogen);
     184  surfacemap = CorrelationToSurface( TestList, elements, Surface, LC );
    187185//  OutputCorrelationToSurface ( (ofstream *)&cout, surfacemap );
    188186  // ... and check with [0., 2.] range
     
    202200{
    203201  BinPairMap::iterator tester;
    204   surfacemap = CorrelationToSurface( TestList, carbon, Surface, LC );
     202  elements.push_back(carbon);
     203  surfacemap = CorrelationToSurface( TestList, elements, Surface, LC );
    205204//  OutputCorrelationToSurface ( (ofstream *)&cout, surfacemap );
    206205  // put pair correlation into bins and check with no range
     
    221220{
    222221  BinPairMap::iterator tester;
    223   surfacemap = CorrelationToSurface( TestList, carbon, Surface, LC );
     222  elements.push_back(carbon);
     223  surfacemap = CorrelationToSurface( TestList, elements, Surface, LC );
    224224//  OutputCorrelationToSurface ( (ofstream *)&cout, surfacemap );
    225225  // ... and check with [0., 2.] range
Note: See TracChangeset for help on using the changeset viewer.