Ignore:
Timestamp:
Apr 1, 2010, 6:52:09 PM (15 years ago)
Author:
Frederik Heber <heber@…>
Children:
6dd8d3
Parents:
794482
Message:

Enhanced CountHydrogenBridgeBonds() a bit.

File:
1 edited

Legend:

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

    r794482 r6250e5  
    159159  //OutputTestMolecule(TestMolecule1, "testmolecule1.xyz");
    160160
    161   // offset of (3,0,0), hence angles are (104.5, 0, 75.5, 180) < 30
     161  cout << "Case 1: offset of (3,0,0), hence angles are (104.5, 0, 75.5, 180) < 30." << endl;
    162162  Translator.Init(3,0,0);
    163163  TestMolecule2->Translate(&Translator);
     
    168168  TestMolecule2->Translate(&Translator);
    169169
    170   // 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)
     170  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;
    171171  Translator.Init(0,3,0);
    172172  TestMolecule2->Translate(&Translator);
     
    176176  TestMolecule2->Translate(&Translator);
    177177
    178   // offset of (0,-3,0) and mirror, hence angle are (165.5, 90, 165.5, 90) > 30
     178  cout << "Case 3: offset of (0,-3,0) and mirror, hence angle are (165.5, 90, 165.5, 90) > 30." << endl;
    179179  Translator.Init(0,-3,0);
    180180  TestMolecule2->Scale((const double ** const)&mirror);
     
    186186  TestMolecule2->Scale((const double ** const)&mirror);
    187187
    188   // offset of (2,1,0), hence angle are (78, 26.6, 102, 153.4) < 30
     188  cout << "Case 4: offset of (2,1,0), hence angle are (78, 26.6, 102, 153.4) < 30." << endl;
    189189  Translator.Init(2,1,0);
    190190  TestMolecule2->Translate(&Translator);
     
    194194  TestMolecule2->Translate(&Translator);
    195195
    196   // offset of (0,0,3), hence angle are (90, 90, 90, 90) > 30
     196  cout << "Case 5: offset of (0,0,3), hence angle are (90, 90, 90, 90) > 30." << endl;
    197197  Translator.Init(0,0,3);
    198198  TestMolecule2->Translate(&Translator);
     
    202202  TestMolecule2->Translate(&Translator);
    203203
    204   // offset of (-3,0,0) and mirror, hence angle are (75.5, 180, 104.5, 180) > 30
     204  cout << "Case 6: offset of (-3,0,0) and mirror, hence angle are (75.5, 180, 104.5, 180) > 30." << endl;
    205205  Translator.Init(-3,0,0);
    206206  TestMolecule2->Scale((const double ** const)&mirror);
     
    211211  TestMolecule2->Translate(&Translator);
    212212  TestMolecule2->Scale((const double ** const)&mirror);
     213
     214  cout << "Case 7: offset of (3,0,0) and mirror, hence angles are (104.5, 0, 104.5, 0) < 30, but interfering hydrogens." << endl;
     215  Translator.Init(3,0,0);
     216  TestMolecule2->Scale((const double ** const)&mirror);
     217  TestMolecule2->Translate(&Translator);
     218  CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL) );
     219  //OutputTestMolecule(TestMolecule2, "testmolecule2-7.xyz");
     220  Translator.Init(-3,0,0);
     221  TestMolecule2->Translate(&Translator);
     222  TestMolecule2->Scale((const double ** const)&mirror);
     223
     224  cout << "Case 8: offset of (0,3,0), hence angle are (14.5, 90, 14.5, 90) < 30, but interfering hydrogens." << endl;
     225  Translator.Init(0,3,0);
     226  TestMolecule2->Scale((const double ** const)&mirror);
     227  TestMolecule2->Translate(&Translator);
     228  //OutputTestMolecule(TestMolecule2, "testmolecule2-8.xyz");
     229  CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL) );
     230  Translator.Init(0,-3,0);
     231  TestMolecule2->Translate(&Translator);
     232  TestMolecule2->Scale((const double ** const)&mirror);
     233
    213234  delete(mirror);
    214235};
Note: See TracChangeset for help on using the changeset viewer.