Changeset 8cbb97 for src/unittests/LinkedCellUnitTest.cpp
- Timestamp:
- Apr 29, 2010, 1:55:21 PM (15 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:
- d79639
- Parents:
- 632bc3 (diff), 753f02 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/unittests/LinkedCellUnitTest.cpp
r632bc3 r8cbb97 61 61 Walker = World::getInstance().createAtom(); 62 62 Walker->type = hydrogen; 63 Walker->node->Init(x, y, z );63 *Walker->node = Vector(x, y, z ); 64 64 TestMolecule->AddAtom(Walker); 65 65 } … … 207 207 Walker->Name = Malloc<char>(6, "LinkedCellTest::SetIndexToNodeTest - Walker"); 208 208 strcpy(Walker->Name, "test"); 209 Walker->x .Init(1,1,1);209 Walker->x= Vector(1,1,1); 210 210 CPPUNIT_ASSERT_EQUAL( false, LC->SetIndexToNode(Walker) ); 211 211 World::getInstance().destroyAtom(Walker); … … 215 215 Walker->Name = Malloc<char>(6, "LinkedCellTest::SetIndexToNodeTest - Walker"); 216 216 strcpy(Walker->Name, "test"); 217 Walker->x .Init(0,-1,0);217 Walker->x = Vector(0,-1,0); 218 218 CPPUNIT_ASSERT_EQUAL( false, LC->SetIndexToNode(Walker) ); 219 219 World::getInstance().destroyAtom(Walker); … … 231 231 for (double y=0.5;y<3;y+=1.) 232 232 for (double z=0.5;z<3;z+=1.) { 233 tester .Init(x,y,z);233 tester = Vector(x,y,z); 234 234 CPPUNIT_ASSERT_EQUAL( true, LC->SetIndexToVector(&tester) ); 235 235 } … … 238 238 for (double y=1.;y<4;y+=1.) 239 239 for (double z=1.;z<4;z+=1.) { 240 tester .Init(x,y,z);240 tester= Vector(x,y,z); 241 241 cout << "Tester is at " << tester << "." << endl; 242 242 CPPUNIT_ASSERT_EQUAL( true, LC->SetIndexToVector(&tester) ); … … 246 246 for (double y=0.5-1e-10;y<5;y+=3.1) 247 247 for (double z=0.5-1e-10;z<5;z+=3.1) { 248 tester .Init(x,y,z);248 tester = Vector(x,y,z); 249 249 cout << "The following test is supposed to fail and produce an ERROR." << endl; 250 250 CPPUNIT_ASSERT_EQUAL( false, LC->SetIndexToVector(&tester) ); 251 251 } 252 252 // check nonsense vectors 253 tester .Init(-423598,3245978,29349);253 tester= Vector(-423598,3245978,29349); 254 254 cout << "The following test is supposed to fail and produce an ERROR." << endl; 255 255 CPPUNIT_ASSERT_EQUAL( false, LC->SetIndexToVector(&tester) ); … … 264 264 int lower[NDIM], upper[NDIM]; 265 265 266 tester .Init(0.5,0.5,0.5);266 tester= Vector(0.5,0.5,0.5); 267 267 LC->SetIndexToVector(&tester); 268 268 LC->GetNeighbourBounds(lower, upper); … … 284 284 285 285 // get all atoms 286 tester .Init(1.5,1.5,1.5);286 tester= Vector(1.5,1.5,1.5); 287 287 CPPUNIT_ASSERT_EQUAL ( true, LC->SetIndexToVector(&tester) ); 288 288 ListOfPoints = LC->GetallNeighbours(); … … 303 303 304 304 // get all atoms in one corner 305 tester .Init(0.5, 0.5, 0.5);305 tester= Vector(0.5, 0.5, 0.5); 306 306 CPPUNIT_ASSERT_EQUAL ( true, LC->SetIndexToVector(&tester) ); 307 307 ListOfPoints = LC->GetallNeighbours(); … … 311 311 while (Walker->next != TestMolecule->end) { 312 312 Walker = Walker->next; 313 if ((Walker->x .x[0] <2) && (Walker->x.x[1] <2) && (Walker->x.x[2] <2)) {313 if ((Walker->x[0] <2) && (Walker->x[1] <2) && (Walker->x[2] <2)) { 314 314 ListOfPoints->remove(Walker); 315 315 size--; … … 323 323 324 324 // get all atoms from one corner 325 tester .Init(0.5, 0.5, 0.5);325 tester = Vector(0.5, 0.5, 0.5); 326 326 CPPUNIT_ASSERT_EQUAL ( true, LC->SetIndexToVector(&tester) ); 327 327 ListOfPoints = LC->GetallNeighbours(3); … … 352 352 353 353 // get all points around central arom with radius 1. 354 tester .Init(1.5,1.5,1.5);354 tester= Vector(1.5,1.5,1.5); 355 355 CPPUNIT_ASSERT_EQUAL ( true, LC->SetIndexToVector(&tester) ); 356 356 ListOfPoints = LC->GetPointsInsideSphere(1., &tester); … … 360 360 while (Walker->next != TestMolecule->end) { 361 361 Walker = Walker->next; 362 if ((Walker->x.DistanceSquared( &tester) - 1.) < MYEPSILON ) {362 if ((Walker->x.DistanceSquared(tester) - 1.) < MYEPSILON ) { 363 363 ListOfPoints->remove(Walker); 364 364 size--;
Note:
See TracChangeset
for help on using the changeset viewer.