Ignore:
Timestamp:
Sep 9, 2014, 7:42:32 PM (11 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:
a090e3
Parents:
2d701e
git-author:
Frederik Heber <heber@…> (09/01/14 15:54:02)
git-committer:
Frederik Heber <heber@…> (09/09/14 19:42:32)
Message:

FIX: Changes to function signatures in molecule_geometry.

  • no more returning allocated pointer (Vector *)
  • no more Pointers as parameters.
  • removed functions that are only convenience and have nothing to do with the molecule.
  • changes elsewhere due to signature changes.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Analysis/unittests/CountBondsUnitTest.cpp

    r2d701e r833b15  
    148148void CountBondsTest::HydrogenBridgeBondsTest()
    149149{
    150   double *mirror = new double[3];
     150  double mirror[3];
    151151  CPPUNIT_ASSERT(mirror != NULL && "could not create array of doubles");
    152152  for (int i=0;i<3;i++)
     
    161161  cout << "Case 1: offset of (3,0,0), hence angles are (104.5, 0, 75.5, 180) < 30." << endl;
    162162  Translator  = Vector(3,0,0);
    163   TestMolecule1->Translate(&Translator);
     163  TestMolecule1->Translate(Translator);
    164164  CPPUNIT_ASSERT_EQUAL( 1 , CountHydrogenBridgeBonds(molecules, NULL, NULL) );
    165165  CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, oxygen, NULL) );
    166166  Translator = Vector(-3,0,0);
    167   TestMolecule1->Translate(&Translator);
     167  TestMolecule1->Translate(Translator);
    168168
    169169  cout << "Case 2: offset of (0,3,0), hence angle are (14.5, 165.5, 90) < 30 (only three, because other 90 is missing due to first H01 only fulfilling H-bond criteria)." << endl;
    170170  Translator = Vector(0,3,0);
    171   TestMolecule1->Translate(&Translator);
     171  TestMolecule1->Translate(Translator);
    172172  CPPUNIT_ASSERT_EQUAL( 1 , CountHydrogenBridgeBonds(molecules, NULL, NULL) );
    173173  Translator = Vector(0,-3,0);
    174   TestMolecule1->Translate(&Translator);
     174  TestMolecule1->Translate(Translator);
    175175
    176176  cout << "Case 3: offset of (0,-3,0) and mirror, hence angle are (165.5, 90, 165.5, 90) > 30." << endl;
    177177  Translator = Vector(0,-3,0);
    178   TestMolecule1->Scale((const double ** const)&mirror);
    179   TestMolecule1->Translate(&Translator);
     178  TestMolecule1->Scale(&mirror[0]);
     179  TestMolecule1->Translate(Translator);
    180180  CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL, NULL) );
    181181  Translator = Vector(0,3,0);
    182   TestMolecule1->Translate(&Translator);
    183   TestMolecule1->Scale((const double ** const)&mirror);
     182  TestMolecule1->Translate(Translator);
     183  TestMolecule1->Scale(&mirror[0]);
    184184
    185185  cout << "Case 4: offset of (2,1,0), hence angle are (78, 26.6, 102, 153.4) < 30." << endl;
    186186  Translator = Vector(2,1,0);
    187   TestMolecule1->Translate(&Translator);
     187  TestMolecule1->Translate(Translator);
    188188  CPPUNIT_ASSERT_EQUAL( 1 , CountHydrogenBridgeBonds(molecules, NULL, NULL) );
    189189  Translator = Vector(-2,-1,0);
    190   TestMolecule1->Translate(&Translator);
     190  TestMolecule1->Translate(Translator);
    191191
    192192  cout << "Case 5: offset of (0,0,3), hence angle are (90, 90, 90, 90) > 30." << endl;
    193193  Translator = Vector(0,0,3);
    194   TestMolecule1->Translate(&Translator);
     194  TestMolecule1->Translate(Translator);
    195195  CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL, NULL) );
    196196  Translator = Vector(0,0,-3);
    197   TestMolecule1->Translate(&Translator);
     197  TestMolecule1->Translate(Translator);
    198198
    199199  cout << "Case 6: offset of (-3,0,0) and mirror, hence angle are (75.5, 180, 104.5, 180) > 30." << endl;
    200200  Translator = Vector(-3,0,0);
    201   TestMolecule1->Scale((const double ** const)&mirror);
    202   TestMolecule1->Translate(&Translator);
     201  TestMolecule1->Scale(&mirror[0]);
     202  TestMolecule1->Translate(Translator);
    203203  CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL, NULL) );
    204204  Translator = Vector(3,0,0);
    205   TestMolecule1->Translate(&Translator);
    206   TestMolecule1->Scale((const double ** const)&mirror);
     205  TestMolecule1->Translate(Translator);
     206  TestMolecule1->Scale(&mirror[0]);
    207207
    208208  cout << "Case 7: offset of (3,0,0) and mirror, hence angles are (104.5, 0, 104.5, 0) < 30, but interfering hydrogens." << endl;
    209209  Translator = Vector(3,0,0);
    210   TestMolecule1->Scale((const double ** const)&mirror);
    211   TestMolecule1->Translate(&Translator);
     210  TestMolecule1->Scale(&mirror[0]);
     211  TestMolecule1->Translate(Translator);
    212212  CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL, NULL) );
    213213  Translator = Vector(-3,0,0);
    214   TestMolecule1->Translate(&Translator);
    215   TestMolecule1->Scale((const double ** const)&mirror);
     214  TestMolecule1->Translate(Translator);
     215  TestMolecule1->Scale(&mirror[0]);
    216216
    217217  cout << "Case 8: offset of (0,3,0), hence angle are (14.5, 90, 14.5, 90) < 30, but interfering hydrogens." << endl;
    218218  Translator = Vector(0,3,0);
    219   TestMolecule1->Scale((const double ** const)&mirror);
    220   TestMolecule1->Translate(&Translator);
     219  TestMolecule1->Scale(&mirror[0]);
     220  TestMolecule1->Translate(Translator);
    221221  CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL, NULL) );
    222222  Translator = Vector(0,-3,0);
    223   TestMolecule1->Translate(&Translator);
    224   TestMolecule1->Scale((const double ** const)&mirror);
    225 
    226   delete[](mirror);
    227 };
     223  TestMolecule1->Translate(Translator);
     224  TestMolecule1->Scale(&mirror[0]);
     225};
Note: See TracChangeset for help on using the changeset viewer.