| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent bafd5b8 commit c6b359b
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -123,19 +123,10 @@ class GreensFunction: public IGreensFunction | |||
| 123 | 123 | { | |
| 124 | 124 | Eigen::Vector3d gradient = Eigen::Vector3d::Zero(); | |
| 125 | 125 | ||
| 126 | - DerivativeTraits t1[3], t2[3], grad; | ||
| 127 | - t1[0] = p1(0); | ||
| 128 | - t1[0][1] = 1; | ||
| 129 | - t1[1] = p1(1); | ||
| 130 | - t1[1][2] = 1; | ||
| 131 | - t1[2] = p1(2); | ||
| 132 | - t1[2][3] = 1; | ||
| 133 | - t2[0] = p2(0); | ||
| 134 | - t2[1] = p2(1); | ||
| 135 | - t2[2] = p2(2); | ||
| 136 | - grad = this->operator()(t1, t2); | ||
| 126 | + gradient(0) = derivativeSource(Eigen::Vector3d::UnitX(), p1, p2); | ||
| 127 | + gradient(1) = derivativeSource(Eigen::Vector3d::UnitY(), p1, p2); | ||
| 128 | + gradient(2) = derivativeSource(Eigen::Vector3d::UnitZ(), p1, p2); | ||
| 137 | 129 | ||
| 138 | - gradient << grad[1], grad[2], grad[3]; | ||
| 139 | 130 | return gradient; | |
| 140 | 131 | } | |
| 141 | 132 | /*! Returns full gradient of Greens's function for the pair of points p1, p2: | |
@@ -149,19 +140,10 @@ class GreensFunction: public IGreensFunction | |||
| 149 | 140 | { | |
| 150 | 141 | Eigen::Vector3d gradient = Eigen::Vector3d::Zero(); | |
| 151 | 142 | ||
| 152 | - DerivativeTraits t1[3], t2[3], grad; | ||
| 153 | - t1[0] = p1(0); | ||
| 154 | - t1[1] = p1(1); | ||
| 155 | - t1[2] = p1(2); | ||
| 156 | - t2[0] = p2(0); | ||
| 157 | - t2[0][1] = 1; | ||
| 158 | - t2[1] = p2(1); | ||
| 159 | - t2[1][2] = 1; | ||
| 160 | - t2[2] = p2(2); | ||
| 161 | - t2[2][3] = 1; | ||
| 162 | - grad = this->operator()(t1, t2); | ||
| 143 | + gradient(0) = derivativeProbe(Eigen::Vector3d::UnitX(), p1, p2); | ||
| 144 | + gradient(1) = derivativeProbe(Eigen::Vector3d::UnitY(), p1, p2); | ||
| 145 | + gradient(2) = derivativeProbe(Eigen::Vector3d::UnitZ(), p1, p2); | ||
| 163 | 146 | ||
| 164 | - gradient << grad[1], grad[2], grad[3]; | ||
| 165 | 147 | return gradient; | |
| 166 | 148 | } | |
| 167 | 149 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -43,9 +43,9 @@ | |||
| 43 | 43 | #include "GePolCavity.hpp" | |
| 44 | 44 | #include "CollocationIntegrator.hpp" | |
| 45 | 45 | #include "PhysicalConstants.hpp" | |
| 46 | - #include "TanhSphericalDiffuse.hpp" | ||
| 47 | - #include "UniformDielectric.hpp" | ||
| 46 | + #include "SphericalDiffuse.hpp" | ||
| 48 | 47 | #include "TestingMolecules.hpp" | |
| 48 | + #include "UniformDielectric.hpp" | ||
| 49 | 49 | #include "Vacuum.hpp" | |
| 50 | 50 | ||
| 51 | 51 | struct CollocationIntegratorTest { | |
@@ -70,7 +70,7 @@ struct CollocationIntegratorTest { | |||
| 70 | 70 | }; | |
| 71 | 71 | ||
| 72 | 72 | /*! \class CollocationIntegrator | |
| 73 | - * \test \b CollocationIntegratorTest_vacuum tests the numerical evaluation of the vacuum onal elements of S and D | ||
| 73 | + * \test \b CollocationIntegratorTest_vacuum tests the numerical evaluation of the vacuum diagonal elements of S and D | ||
| 74 | 74 | */ | |
| 75 | 75 | BOOST_FIXTURE_TEST_CASE(vacuum, CollocationIntegratorTest) | |
| 76 | 76 | { | |
@@ -79,7 +79,7 @@ BOOST_FIXTURE_TEST_CASE(vacuum, CollocationIntegratorTest) | |||
| 79 | 79 | BOOST_TEST_MESSAGE("Vacuum"); | |
| 80 | 80 | Eigen::VectorXd S_results = Eigen::VectorXd::Zero(cavity.size()); | |
| 81 | 81 | for (int i = 0; i < cavity.size(); ++i) { | |
| 82 | - S_results(i) = gf.onalS(cavity.elements(i)); | ||
| 82 | + S_results(i) = gf.diagonalS(cavity.elements(i)); | ||
| 83 | 83 | } | |
| 84 | 84 | // In case you need to update the reference files... | |
| 85 | 85 | /* | |
@@ -94,15 +94,15 @@ BOOST_FIXTURE_TEST_CASE(vacuum, CollocationIntegratorTest) | |||
| 94 | 94 | for (int i = 0; i < cavity.size(); ++i) { | |
| 95 | 95 | BOOST_REQUIRE_CLOSE(S_reference(i), S_results(i), 1.0e-12); | |
| 96 | 96 | } | |
| 97 | - BOOST_TEST_MESSAGE("S operator onal by collocation"); | ||
| 97 | + BOOST_TEST_MESSAGE("S operator diagonal by collocation"); | ||
| 98 | 98 | for (int i = 0; i < cavity.size(); ++i) { | |
| 99 | 99 | BOOST_TEST_MESSAGE("S_{" << i+1 << ", " << i+1 << "} = " | |
| 100 | 100 | << std::setprecision(std::numeric_limits<long double>::digits10) << S_results(i)); | |
| 101 | 101 | } | |
| 102 | 102 | ||
| 103 | 103 | Eigen::VectorXd D_results = Eigen::VectorXd::Zero(cavity.size()); | |
| 104 | 104 | for (int i = 0; i < cavity.size(); ++i) { | |
| 105 | - D_results(i) = gf.onalD(cavity.elements(i)); | ||
| 105 | + D_results(i) = gf.diagonalD(cavity.elements(i)); | ||
| 106 | 106 | } | |
| 107 | 107 | // In case you need to update the reference files... | |
| 108 | 108 | /* | |
@@ -115,15 +115,15 @@ BOOST_FIXTURE_TEST_CASE(vacuum, CollocationIntegratorTest) | |||
| 115 | 115 | for (int i = 0; i < cavity.size(); ++i) { | |
| 116 | 116 | BOOST_REQUIRE_CLOSE(D_reference(i), D_results(i), 1.0e-12); | |
| 117 | 117 | } | |
| 118 | - BOOST_TEST_MESSAGE("D operator onal by collocation"); | ||
| 118 | + BOOST_TEST_MESSAGE("D operator diagonal by collocation"); | ||
| 119 | 119 | for (int i = 0; i < cavity.size(); ++i) { | |
| 120 | 120 | BOOST_TEST_MESSAGE("D_{" << i+1 << ", " << i+1 << "} = " | |
| 121 | 121 | << std::setprecision(std::numeric_limits<long double>::digits10) << D_results(i)); | |
| 122 | 122 | } | |
| 123 | 123 | } | |
| 124 | 124 | ||
| 125 | 125 | /*! \class CollocationIntegrator | |
| 126 | - * \test \b CollocationIntegratorTest_uniformdielectric tests the numerical evaluation of the uniform dielectric onal elements of S and D | ||
| 126 | + * \test \b CollocationIntegratorTest_uniformdielectric tests the numerical evaluation of the uniform dielectric diagonal elements of S and D | ||
| 127 | 127 | */ | |
| 128 | 128 | BOOST_FIXTURE_TEST_CASE(uniformdielectric, CollocationIntegratorTest) | |
| 129 | 129 | { | |
@@ -132,7 +132,7 @@ BOOST_FIXTURE_TEST_CASE(uniformdielectric, CollocationIntegratorTest) | |||
| 132 | 132 | BOOST_TEST_MESSAGE("UniformDielectric"); | |
| 133 | 133 | Eigen::VectorXd S_results = Eigen::VectorXd::Zero(cavity.size()); | |
| 134 | 134 | for (int i = 0; i < cavity.size(); ++i) { | |
| 135 | - S_results(i) = gf.onalS(cavity.elements(i)); | ||
| 135 | + S_results(i) = gf.diagonalS(cavity.elements(i)); | ||
| 136 | 136 | } | |
| 137 | 137 | // In case you need to update the reference files... | |
| 138 | 138 | /* | |
@@ -147,15 +147,15 @@ BOOST_FIXTURE_TEST_CASE(uniformdielectric, CollocationIntegratorTest) | |||
| 147 | 147 | for (int i = 0; i < cavity.size(); ++i) { | |
| 148 | 148 | BOOST_REQUIRE_CLOSE(S_reference(i), S_results(i), 1.0e-12); | |
| 149 | 149 | } | |
| 150 | - BOOST_TEST_MESSAGE("S operator onal by collocation"); | ||
| 150 | + BOOST_TEST_MESSAGE("S operator diagonal by collocation"); | ||
| 151 | 151 | for (int i = 0; i < cavity.size(); ++i) { | |
| 152 | 152 | BOOST_TEST_MESSAGE("S_{" << i+1 << ", " << i+1 << "} = " | |
| 153 | 153 | << std::setprecision(std::numeric_limits<long double>::digits10) << S_results(i)); | |
| 154 | 154 | } | |
| 155 | 155 | ||
| 156 | 156 | Eigen::VectorXd D_results = Eigen::VectorXd::Zero(cavity.size()); | |
| 157 | 157 | for (int i = 0; i < cavity.size(); ++i) { | |
| 158 | - D_results(i) = gf.onalD(cavity.elements(i)); | ||
| 158 | + D_results(i) = gf.diagonalD(cavity.elements(i)); | ||
| 159 | 159 | } | |
| 160 | 160 | // In case you need to update the reference files... | |
| 161 | 161 | /* | |
@@ -168,7 +168,7 @@ BOOST_FIXTURE_TEST_CASE(uniformdielectric, CollocationIntegratorTest) | |||
| 168 | 168 | for (int i = 0; i < cavity.size(); ++i) { | |
| 169 | 169 | BOOST_REQUIRE_CLOSE(D_reference(i), D_results(i), 1.0e-12); | |
| 170 | 170 | } | |
| 171 | - BOOST_TEST_MESSAGE("D operator onal by collocation"); | ||
| 171 | + BOOST_TEST_MESSAGE("D operator diagonal by collocation"); | ||
| 172 | 172 | for (int i = 0; i < cavity.size(); ++i) { | |
| 173 | 173 | BOOST_TEST_MESSAGE("D_{" << i+1 << ", " << i+1 << "} = " | |
| 174 | 174 | << std::setprecision(std::numeric_limits<long double>::digits10) << D_results(i)); | |
@@ -179,12 +179,12 @@ BOOST_FIXTURE_TEST_CASE(tanhsphericaldiffuse, CollocationIntegratorTest) | |||
| 179 | 179 | { | |
| 180 | 180 | double width = 5.0; | |
| 181 | 181 | double sphereRadius = 100.0; | |
| 182 | - TanhSphericalDiffuse gf(epsilon, epsilon, width, sphereRadius, Eigen::Vector3d::Zero()); | ||
| 182 | + SphericalDiffuse<CollocationIntegrator<Numerical, TanhDiffuse>, TanhDiffuse> gf(epsilon, epsilon, width, sphereRadius, Eigen::Vector3d::Zero()); | ||
| 183 | 183 | ||
| 184 | 184 | BOOST_TEST_MESSAGE("TanhSphericalDiffuse"); | |
| 185 | 185 | Eigen::VectorXd S_results = Eigen::VectorXd::Zero(cavity.size()); | |
| 186 | 186 | for (int i = 0; i < cavity.size(); ++i) { | |
| 187 | - S_results(i) = gf.onalS(cavity.elements(i)); | ||
| 187 | + S_results(i) = gf.diagonalS(cavity.elements(i)); | ||
| 188 | 188 | } | |
| 189 | 189 | // In case you need to update the reference files... | |
| 190 | 190 | /* | |
@@ -199,15 +199,15 @@ BOOST_FIXTURE_TEST_CASE(tanhsphericaldiffuse, CollocationIntegratorTest) | |||
| 199 | 199 | for (int i = 0; i < cavity.size(); ++i) { | |
| 200 | 200 | BOOST_CHECK_CLOSE(S_reference(i), S_results(i), 1.0e-08); | |
| 201 | 201 | } | |
| 202 | - BOOST_TEST_MESSAGE("S operator onal by collocation"); | ||
| 202 | + BOOST_TEST_MESSAGE("S operator diagonal by collocation"); | ||
| 203 | 203 | for (int i = 0; i < cavity.size(); ++i) { | |
| 204 | 204 | BOOST_TEST_MESSAGE("S_{" << i+1 << ", " << i+1 << "} = " | |
| 205 | 205 | << std::setprecision(std::numeric_limits<long double>::digits10) << S_results(i)); | |
| 206 | 206 | } | |
| 207 | 207 | ||
| 208 | 208 | Eigen::VectorXd D_results = Eigen::VectorXd::Zero(cavity.size()); | |
| 209 | 209 | for (int i = 0; i < cavity.size(); ++i) { | |
| 210 | - D_results(i) = gf.onalD(cavity.elements(i)); | ||
| 210 | + D_results(i) = gf.diagonalD(cavity.elements(i)); | ||
| 211 | 211 | } | |
| 212 | 212 | // In case you need to update the reference files... | |
| 213 | 213 | /* | |
@@ -220,7 +220,7 @@ BOOST_FIXTURE_TEST_CASE(tanhsphericaldiffuse, CollocationIntegratorTest) | |||
| 220 | 220 | for (int i = 0; i < cavity.size(); ++i) { | |
| 221 | 221 | BOOST_CHECK_CLOSE(D_reference(i), D_results(i), 1.0e-06); | |
| 222 | 222 | } | |
| 223 | - BOOST_TEST_MESSAGE("D operator onal by collocation"); | ||
| 223 | + BOOST_TEST_MESSAGE("D operator diagonal by collocation"); | ||
| 224 | 224 | for (int i = 0; i < cavity.size(); ++i) { | |
| 225 | 225 | BOOST_TEST_MESSAGE("D_{" << i+1 << ", " << i+1 << "} = " | |
| 226 | 226 | << std::setprecision(std::numeric_limits<long double>::digits10) << D_results(i)); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments