Changeset 2390e6
- Timestamp:
- Apr 28, 2021, 10:02:49 PM (5 years ago)
- Branches:
- Candidate_v1.7.0, stable
- Children:
- e0e77e
- Parents:
- 87c1cc
- git-author:
- Frederik Heber <frederik.heber@…> (04/17/21 09:41:33)
- git-committer:
- Frederik Heber <frederik.heber@…> (04/28/21 22:02:49)
- Files:
-
- 6 edited
-
doc/userguide/userguide.xml (modified) (1 diff)
-
src/Actions/AtomAction/SaturateAction.cpp (modified) (2 diffs)
-
src/Actions/AtomAction/SaturateAction.def (modified) (1 diff)
-
src/Fragmentation/Exporters/SphericalPointDistribution.cpp (modified) (3 diffs)
-
src/Fragmentation/Exporters/SphericalPointDistribution.hpp (modified) (1 diff)
-
src/Fragmentation/Exporters/unittests/SphericalPointDistributionUnitTest.cpp (modified) (45 diffs)
Legend:
- Unmodified
- Added
- Removed
-
doc/userguide/userguide.xml
r87c1cc r2390e6 1070 1070 and approximately with same distance to their nearest neighbor 1071 1071 hydrogens. Already present bonds (i.e. the position of neighboring 1072 atoms) are taken into account and left intact.</para> 1072 atoms) are taken into account and left intact.</para> 1073 <programlisting>^M 1074 ... --saturate-atoms --use-outer-shell 1^M 1075 </programlisting> 1076 <para>This will not simply consider the number of unoccupied orbitals 1077 of the respective element. Instead it will take the outermost shell 1078 into consideration and use the number of orbitals in total as the 1079 ideal polyhedra but only taking the number of unoccupied orbitals as 1080 free nodes, i.e. where to saturate with hydrogens. For example, 1081 nitrogen will then fill an tetrahedron (4 orbitals in outer shell) 1082 where one orbital is already fully occupied and 3 nodes in the 1083 tetrahedron remain to fill up with hydrogens. 1084 Without the outer shell, saturate atoms would simply consider a 1085 triangle as the ideal polyhedron and fill its 3 corners.</para> 1073 1086 </section> 1074 1087 <section xml:id="atoms.bondify-atom"> -
src/Actions/AtomAction/SaturateAction.cpp
r87c1cc r2390e6 86 86 const BondList& ListOfBonds = _atom->getListOfBonds(); 87 87 SphericalPointDistribution PointSphere(typical_distance); 88 int num_orbitals_outer_shell; 89 int num_unoccupied_orbitals; 90 if (params.useOuterShell.get()) { 91 /* 92 * Number of valence electrons (getValence()) + number of unoccupied 93 * orbitals (getNoValenceOrbitals()) is the number of electrons able 94 * to fit into the outer shell. Hence, half the number gives the number 95 * of orbitals in the outer shell 96 */ 97 num_orbitals_outer_shell = 98 (((int)_atom->getType()->getValence())+_atom->getType()->getNoValenceOrbitals())/2; 99 num_unoccupied_orbitals = _atom->getType()->getNoValenceOrbitals(); 100 } else { 101 /** 102 * Here, same number of points on the polyhedra and available ones. 103 */ 104 num_orbitals_outer_shell = num_unoccupied_orbitals = _atom->getType()->getNoValenceOrbitals(); 105 } 88 106 if (ListOfBonds.size() == 0) { 89 vacant_positions = PointSphere.getSimplePolygon(_atom->getType()->getNoValenceOrbitals()); 107 vacant_positions = PointSphere.getSimplePolygon(num_orbitals_outer_shell); 108 109 // if less available then present in the ideal polygon, remove some 110 if (num_unoccupied_orbitals < vacant_positions.size()) 111 vacant_positions.resize(num_unoccupied_orbitals); 112 90 113 LOG(3, "DEBUG: Using ideal positions as " << vacant_positions); 91 114 } else { 92 // get ideal polygon and currently occupied positions93 const SphericalPointDistribution::Polygon_t ideal_positions =94 PointSphere.getSimplePolygon(_atom->getType()->getNoValenceOrbitals());95 LOG(3, "DEBUG: ideal positions are " << ideal_positions);96 115 SphericalPointDistribution::WeightedPolygon_t current_positions; 97 116 for (BondList::const_iterator bonditer = ListOfBonds.begin(); … … 104 123 LOG(3, "DEBUG: current occupied positions are " << current_positions); 105 124 125 // get ideal polygon and currently occupied positions 126 const SphericalPointDistribution::Polygon_t ideal_positions = 127 PointSphere.getSimplePolygon(num_orbitals_outer_shell); 128 LOG(3, "DEBUG: ideal positions are " << ideal_positions); 129 106 130 // find the best matching rotated polygon 107 131 vacant_positions = PointSphere.getRemainingPoints( 108 132 current_positions, 109 _atom->getType()->getNoValenceOrbitals()); 133 num_orbitals_outer_shell, 134 num_unoccupied_orbitals); 110 135 LOG(3, "DEBUG: Resulting vacant positions are " << vacant_positions); 111 136 -
src/Actions/AtomAction/SaturateAction.def
r87c1cc r2390e6 7 7 8 8 // all includes and forward declarations necessary for non-integral types below 9 #include "Atom/AtomicInfo.hpp" 9 10 #include "Parameters/Validators/DummyValidator.hpp" 10 11 11 12 // i.e. there is an integer with variable name Z that can be found in 12 13 // ValueStorage by the token "Z" -> first column: int, Z, "Z" 13 14 // "undefine" if no parameters are required, use (NOPARAM_DEFAULT) for each (undefined) default value 14 # undef paramtypes15 # undef paramtokens16 # undef paramdescriptions17 # undef paramreferences18 # undef paramdefaults19 # undef paramvalids15 #define paramtypes (bool) 16 #define paramtokens ("use-outer-shell") 17 #define paramdescriptions ("whether to just look at valencies (false) or take the occupancy of the outer shell into account (true) for the polyhedra") 18 #define paramreferences (useOuterShell) 19 #define paramdefaults (PARAM_DEFAUALT(0)) 20 #define paramvalids (DummyValidator<bool>()) 20 21 21 22 #define statetypes (std::vector<AtomicInfo>) -
src/Fragmentation/Exporters/SphericalPointDistribution.cpp
r87c1cc r2390e6 882 882 SphericalPointDistribution::getRemainingPoints( 883 883 const WeightedPolygon_t &_polygon, 884 const int _N) 884 const int _num_spots, 885 const int _num_spots_available) 885 886 { 886 887 SphericalPointDistribution::Polygon_t remainingpoints; 887 888 888 889 // initialze to given number of points 889 initSelf(_ N);890 initSelf(_num_spots); 890 891 LOG(2, "INFO: Matching old polygon " << _polygon 891 892 << " with new polygon " << points); 892 893 893 894 // check whether any points will remain vacant 894 int RemainingPoints = _ N;895 int RemainingPoints = _num_spots_available; 895 896 for (WeightedPolygon_t::const_iterator iter = _polygon.begin(); 896 897 iter != _polygon.end(); ++iter) … … 899 900 return remainingpoints; 900 901 901 if (_ N> 0) {902 if (_num_spots_available > 0) { 902 903 IndexList_t bestmatching = findBestMatching(_polygon); 903 904 LOG(2, "INFO: Best matching is " << bestmatching); … … 1024 1025 SphericalPointDistribution::Polygon_t remainingpoints = 1025 1026 removeMatchingPoints(rotatednewSet); 1027 // when less spots unoccupied than the ideal polygon has nodes, remove some 1028 if (RemainingPoints < remainingpoints.size()) 1029 remainingpoints.resize(RemainingPoints); 1026 1030 LOG(2, "INFO: Remaining points are " << remainingpoints); 1027 1031 return remainingpoints; -
src/Fragmentation/Exporters/SphericalPointDistribution.hpp
r87c1cc r2390e6 87 87 * 88 88 * \param _polygon already filled places to match 89 * \param _N desired total number fo points 90 */ 91 Polygon_t getRemainingPoints(const WeightedPolygon_t &_polygon, const int _N); 89 * \param _num_spots number of nodes in the polyhedra (e.g., number of orbitals in outer shell) 90 * \param _num_spots_available nodes available (e.g., number of orbitals not fully occupied) 91 */ 92 Polygon_t getRemainingPoints( 93 const WeightedPolygon_t &_polygon, 94 const int _num_spots, 95 const int _num_spots_available); 92 96 93 97 //!> default radius of the spherical distribution -
src/Fragmentation/Exporters/unittests/SphericalPointDistributionUnitTest.cpp
r87c1cc r2390e6 748 748 expected += Vector(-1.,0.,0.); 749 749 SphericalPointDistribution::Polygon_t remaining = 750 SPD.getRemainingPoints(polygon, 2 );750 SPD.getRemainingPoints(polygon, 2, 2); 751 751 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 752 752 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 760 760 expected += Vector(0.,-1.,0.); 761 761 SphericalPointDistribution::Polygon_t remaining = 762 SPD.getRemainingPoints(polygon, 2 );762 SPD.getRemainingPoints(polygon, 2, 2); 763 763 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 764 764 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 772 772 expected += Vector(0.,0.,1.); 773 773 SphericalPointDistribution::Polygon_t remaining = 774 SPD.getRemainingPoints(polygon, 2 );774 SPD.getRemainingPoints(polygon, 2, 2); 775 775 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 776 776 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 785 785 expected += RotationAxis.rotateVector(Vector(-1.,0.,0.), 47.6/180*M_PI); 786 786 SphericalPointDistribution::Polygon_t remaining = 787 SPD.getRemainingPoints(polygon, 2 );787 SPD.getRemainingPoints(polygon, 2, 2); 788 788 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 789 789 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 805 805 expected.pop_front(); // remove first point 806 806 SphericalPointDistribution::Polygon_t remaining = 807 SPD.getRemainingPoints(polygon, 3 );807 SPD.getRemainingPoints(polygon, 3, 3); 808 808 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 809 809 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 823 823 } 824 824 SphericalPointDistribution::Polygon_t remaining = 825 SPD.getRemainingPoints(polygon, 3 );825 SPD.getRemainingPoints(polygon, 3, 3); 826 826 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 827 827 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 838 838 expected.pop_front(); // remove second point 839 839 SphericalPointDistribution::Polygon_t remaining = 840 SPD.getRemainingPoints(polygon, 3 );840 SPD.getRemainingPoints(polygon, 3, 3); 841 841 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 842 842 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 861 861 *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI); 862 862 SphericalPointDistribution::Polygon_t remaining = 863 SPD.getRemainingPoints(polygon, 3 );863 SPD.getRemainingPoints(polygon, 3, 3); 864 864 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 865 865 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 880 880 SphericalPointDistribution::Polygon_t expected; // empty cause none are vacant 881 881 SphericalPointDistribution::Polygon_t remaining = 882 SPD.getRemainingPoints(polygon, 3 );882 SPD.getRemainingPoints(polygon, 3, 3); 883 883 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 884 884 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 901 901 SphericalPointDistribution::Polygon_t expected; // empty cause none are vacant 902 902 SphericalPointDistribution::Polygon_t remaining = 903 SPD.getRemainingPoints(polygon, 3 );903 SPD.getRemainingPoints(polygon, 3, 3); 904 904 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 905 905 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 925 925 expected.pop_front(); // remove first point 926 926 SphericalPointDistribution::Polygon_t remaining = 927 SPD.getRemainingPoints(polygon, 4 );927 SPD.getRemainingPoints(polygon, 4, 4); 928 928 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 929 929 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 943 943 } 944 944 SphericalPointDistribution::Polygon_t remaining = 945 SPD.getRemainingPoints(polygon, 4 );945 SPD.getRemainingPoints(polygon, 4, 4); 946 946 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 947 947 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 958 958 expected.pop_front(); // remove second point 959 959 SphericalPointDistribution::Polygon_t remaining = 960 SPD.getRemainingPoints(polygon, 4 );960 SPD.getRemainingPoints(polygon, 4, 4); 961 961 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 962 962 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 977 977 expected.pop_front(); // remove second point 978 978 SphericalPointDistribution::Polygon_t remaining = 979 SPD.getRemainingPoints(polygon, 4 );979 SPD.getRemainingPoints(polygon, 4, 4); 980 980 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 981 981 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1000 1000 *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI); 1001 1001 SphericalPointDistribution::Polygon_t remaining = 1002 SPD.getRemainingPoints(polygon, 4 );1002 SPD.getRemainingPoints(polygon, 4, 4); 1003 1003 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1004 1004 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1021 1021 expected.pop_front(); // remove third point 1022 1022 SphericalPointDistribution::Polygon_t remaining = 1023 SPD.getRemainingPoints(polygon, 4 );1023 SPD.getRemainingPoints(polygon, 4, 4); 1024 1024 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1025 1025 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1046 1046 *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI); 1047 1047 SphericalPointDistribution::Polygon_t remaining = 1048 SPD.getRemainingPoints(polygon, 4 );1048 SPD.getRemainingPoints(polygon, 4, 4); 1049 1049 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1050 1050 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1073 1073 expected += Vector(-0.5773502691896,-5.551115123126e-17,-0.8164965809277); 1074 1074 SphericalPointDistribution::Polygon_t remaining = 1075 SPD.getRemainingPoints(polygon, 4 );1075 SPD.getRemainingPoints(polygon, 4, 4); 1076 1076 // std::cout << std::setprecision(13) << "Matched polygon is " << remaining << std::endl; 1077 1077 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); … … 1090 1090 expected += Vector(-0.3535533905933,-0.3535533905933,-0.8660254037844); 1091 1091 SphericalPointDistribution::Polygon_t remaining = 1092 SPD.getRemainingPoints(polygon, 5 );1092 SPD.getRemainingPoints(polygon, 5, 5); 1093 1093 std::cout << std::setprecision(13) << "Matched polygon is " << remaining << std::endl; 1094 1094 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); … … 1108 1108 expected += Vector(0.3535534025157,-0.3535533856548,0.8660254009332); 1109 1109 SphericalPointDistribution::Polygon_t remaining = 1110 SPD.getRemainingPoints(polygon, 5 );1110 SPD.getRemainingPoints(polygon, 5, 5); 1111 1111 // std::cout << std::setprecision(13) << "Matched polygon is " << remaining << std::endl; 1112 1112 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); … … 1125 1125 expected += Vector(0.,0.,-1.); 1126 1126 SphericalPointDistribution::Polygon_t remaining = 1127 SPD.getRemainingPoints(polygon, 6 );1127 SPD.getRemainingPoints(polygon, 6, 6); 1128 1128 // std::cout << std::setprecision(13) << "Matched polygon is " << remaining << std::endl; 1129 1129 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); … … 1146 1146 expected.pop_front(); // remove first point 1147 1147 SphericalPointDistribution::Polygon_t remaining = 1148 SPD.getRemainingPoints(polygon, 5 );1148 SPD.getRemainingPoints(polygon, 5, 5); 1149 1149 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1150 1150 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1164 1164 } 1165 1165 SphericalPointDistribution::Polygon_t remaining = 1166 SPD.getRemainingPoints(polygon, 5 );1166 SPD.getRemainingPoints(polygon, 5, 5); 1167 1167 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1168 1168 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1179 1179 expected.pop_front(); // remove second point 1180 1180 SphericalPointDistribution::Polygon_t remaining = 1181 SPD.getRemainingPoints(polygon, 5 );1181 SPD.getRemainingPoints(polygon, 5, 5); 1182 1182 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1183 1183 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1202 1202 *iter = RotationAxis.rotateVector(*iter, 47.6/180.*M_PI); 1203 1203 SphericalPointDistribution::Polygon_t remaining = 1204 SPD.getRemainingPoints(polygon, 5 );1204 SPD.getRemainingPoints(polygon, 5, 5); 1205 1205 // the three remaining points sit on a plane that may be rotated arbitrarily 1206 1206 // so we cannot simply check for equality between expected and remaining … … 1228 1228 expected.pop_front(); // remove third point 1229 1229 SphericalPointDistribution::Polygon_t remaining = 1230 SPD.getRemainingPoints(polygon, 5 );1230 SPD.getRemainingPoints(polygon, 5, 5); 1231 1231 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1232 1232 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1253 1253 *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI); 1254 1254 SphericalPointDistribution::Polygon_t remaining = 1255 SPD.getRemainingPoints(polygon, 5 );1255 SPD.getRemainingPoints(polygon, 5, 5); 1256 1256 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1257 1257 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1277 1277 expected.pop_front(); // remove first point 1278 1278 SphericalPointDistribution::Polygon_t remaining = 1279 SPD.getRemainingPoints(polygon, 6 );1279 SPD.getRemainingPoints(polygon, 6, 6); 1280 1280 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1281 1281 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1295 1295 } 1296 1296 SphericalPointDistribution::Polygon_t remaining = 1297 SPD.getRemainingPoints(polygon, 6 );1297 SPD.getRemainingPoints(polygon, 6, 6); 1298 1298 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1299 1299 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1310 1310 expected.pop_front(); // remove second spoint 1311 1311 SphericalPointDistribution::Polygon_t remaining = 1312 SPD.getRemainingPoints(polygon, 6 );1312 SPD.getRemainingPoints(polygon, 6, 6); 1313 1313 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1314 1314 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1333 1333 *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI); 1334 1334 SphericalPointDistribution::Polygon_t remaining = 1335 SPD.getRemainingPoints(polygon, 6 );1335 SPD.getRemainingPoints(polygon, 6, 6); 1336 1336 // the four remaining points sit on a plane that may have been rotated arbitrarily 1337 1337 // so we cannot simply check for equality between expected and remaining … … 1359 1359 expected.pop_front(); // remove third point 1360 1360 SphericalPointDistribution::Polygon_t remaining = 1361 SPD.getRemainingPoints(polygon, 6 );1361 SPD.getRemainingPoints(polygon, 6, 6); 1362 1362 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1363 1363 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1384 1384 *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI); 1385 1385 SphericalPointDistribution::Polygon_t remaining = 1386 SPD.getRemainingPoints(polygon, 6 );1386 SPD.getRemainingPoints(polygon, 6, 6); 1387 1387 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1388 1388 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1408 1408 expected.pop_front(); // remove first point 1409 1409 SphericalPointDistribution::Polygon_t remaining = 1410 SPD.getRemainingPoints(polygon, 7 );1410 SPD.getRemainingPoints(polygon, 7, 7); 1411 1411 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1412 1412 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1426 1426 } 1427 1427 SphericalPointDistribution::Polygon_t remaining = 1428 SPD.getRemainingPoints(polygon, 7 );1428 SPD.getRemainingPoints(polygon, 7, 7); 1429 1429 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1430 1430 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1441 1441 expected.pop_front(); // remove second point 1442 1442 SphericalPointDistribution::Polygon_t remaining = 1443 SPD.getRemainingPoints(polygon, 7 );1443 SPD.getRemainingPoints(polygon, 7, 7); 1444 1444 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1445 1445 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1464 1464 *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI); 1465 1465 SphericalPointDistribution::Polygon_t remaining = 1466 SPD.getRemainingPoints(polygon, 7 );1466 SPD.getRemainingPoints(polygon, 7, 7); 1467 1467 // the five remaining points sit on a plane that may have been rotated arbitrarily 1468 1468 // so we cannot simply check for equality between expected and remaining … … 1490 1490 expected.pop_front(); // remove third point 1491 1491 SphericalPointDistribution::Polygon_t remaining = 1492 SPD.getRemainingPoints(polygon, 7 );1492 SPD.getRemainingPoints(polygon, 7, 7); 1493 1493 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1494 1494 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1515 1515 *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI); 1516 1516 SphericalPointDistribution::Polygon_t remaining = 1517 SPD.getRemainingPoints(polygon, 7 );1517 SPD.getRemainingPoints(polygon, 7, 7); 1518 1518 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1519 1519 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1539 1539 expected.pop_front(); // remove first point 1540 1540 SphericalPointDistribution::Polygon_t remaining = 1541 SPD.getRemainingPoints(polygon, 8 );1541 SPD.getRemainingPoints(polygon, 8, 8); 1542 1542 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1543 1543 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1557 1557 } 1558 1558 SphericalPointDistribution::Polygon_t remaining = 1559 SPD.getRemainingPoints(polygon, 8 );1559 SPD.getRemainingPoints(polygon, 8, 8); 1560 1560 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1561 1561 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1572 1572 expected.pop_front(); // remove second point 1573 1573 SphericalPointDistribution::Polygon_t remaining = 1574 SPD.getRemainingPoints(polygon, 8 );1574 SPD.getRemainingPoints(polygon, 8, 8); 1575 1575 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1576 1576 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1595 1595 *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI); 1596 1596 SphericalPointDistribution::Polygon_t remaining = 1597 SPD.getRemainingPoints(polygon, 8 );1597 SPD.getRemainingPoints(polygon, 8, 8); 1598 1598 // the six remaining points sit on two planes that may have been rotated arbitrarily 1599 1599 // so we cannot simply check for equality between expected and remaining … … 1625 1625 expected.pop_front(); // remove third point 1626 1626 SphericalPointDistribution::Polygon_t remaining = 1627 SPD.getRemainingPoints(polygon, 8 );1627 SPD.getRemainingPoints(polygon, 8, 8); 1628 1628 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1629 1629 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); … … 1650 1650 *iter = RotationAxis.rotateVector(*iter, 47.6/180*M_PI); 1651 1651 SphericalPointDistribution::Polygon_t remaining = 1652 SPD.getRemainingPoints(polygon, 8 );1653 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1654 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 1655 // also slightly perturbed 1656 const double amplitude = 0.05; 1657 perturbPolygon(polygon, amplitude); 1658 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) ); 1659 } 1660 } 1652 SPD.getRemainingPoints(polygon, 8, 8); 1653 // CPPUNIT_ASSERT_EQUAL( expected, remaining ); 1654 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) ); 1655 // also slightly perturbed 1656 const double amplitude = 0.05; 1657 perturbPolygon(polygon, amplitude); 1658 CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, amplitude) ); 1659 } 1660 }
Note:
See TracChangeset
for help on using the changeset viewer.
