50
50
*
51
51
* Calculates the diagonal elements of S as:
52
52
* \f[
53
- * S_{ii} = factor_ * \sqrt{\frac{4\pi}{a_i}}
53
+ * S_{ii} = factor * \sqrt{\frac{4\pi}{a_i}}
54
54
* \f]
55
55
* while the diagonal elements of D are:
56
56
* \f[
57
- * D_{ii} = -factor_ * \sqrt{\frac{\pi}{a_i}} \frac{1}{R_I}
57
+ * D_{ii} = -factor * \sqrt{\frac{\pi}{a_i}} \frac{1}{R_I}
58
58
* \f]
59
59
*/
60
60
61
61
struct CollocationIntegrator
62
62
{
63
- CollocationIntegrator () : factor_(1.07 ) {}
63
+ CollocationIntegrator () : factor(1.07 ) {}
64
+ CollocationIntegrator (double f) : factor(f) {}
64
65
~CollocationIntegrator () {}
65
66
66
67
/* *@{ Single and double layer potentials for a Vacuum Green's function by collocation */
@@ -71,7 +72,7 @@ struct CollocationIntegrator
71
72
template <typename DerivativeTraits>
72
73
Eigen::MatrixXd singleLayer (const Vacuum<DerivativeTraits, CollocationIntegrator> & gf, const std::vector<Element> & e) const {
73
74
return integrator::singleLayer (e,
74
- pcm::bind (integrator::SI, this ->factor_ , 1.0 , pcm::_1),
75
+ pcm::bind (integrator::SI, this ->factor , 1.0 , pcm::_1),
75
76
pcm::bind (&Vacuum<DerivativeTraits, CollocationIntegrator>::kernelS, gf, pcm::_1, pcm::_2));
76
77
}
77
78
/* ! \tparam DerivativeTraits how the derivatives of the Greens's function are calculated
@@ -81,7 +82,7 @@ struct CollocationIntegrator
81
82
template <typename DerivativeTraits>
82
83
Eigen::MatrixXd doubleLayer (const Vacuum<DerivativeTraits, CollocationIntegrator> & gf, const std::vector<Element> & e) const {
83
84
return integrator::doubleLayer (e,
84
- pcm::bind (integrator::DI, this ->factor_ , pcm::_1),
85
+ pcm::bind (integrator::DI, this ->factor , pcm::_1),
85
86
pcm::bind (&Vacuum<DerivativeTraits, CollocationIntegrator>::kernelD, gf, pcm::_1, pcm::_2, pcm::_3));
86
87
}
87
88
/* *@}*/
@@ -94,7 +95,7 @@ struct CollocationIntegrator
94
95
template <typename DerivativeTraits>
95
96
Eigen::MatrixXd singleLayer (const UniformDielectric<DerivativeTraits, CollocationIntegrator> & gf, const std::vector<Element> & e) const {
96
97
return integrator::singleLayer (e,
97
- pcm::bind (integrator::SI, this ->factor_ , gf.epsilon (), pcm::_1),
98
+ pcm::bind (integrator::SI, this ->factor , gf.epsilon (), pcm::_1),
98
99
pcm::bind (&UniformDielectric<DerivativeTraits, CollocationIntegrator>::kernelS, gf, pcm::_1, pcm::_2));
99
100
}
100
101
/* ! \tparam DerivativeTraits how the derivatives of the Greens's function are calculated
@@ -104,7 +105,7 @@ struct CollocationIntegrator
104
105
template <typename DerivativeTraits>
105
106
Eigen::MatrixXd doubleLayer (const UniformDielectric<DerivativeTraits, CollocationIntegrator> & gf, const std::vector<Element> & e) const {
106
107
return integrator::doubleLayer (e,
107
- pcm::bind (integrator::DI, this ->factor_ , pcm::_1),
108
+ pcm::bind (integrator::DI, this ->factor , pcm::_1),
108
109
pcm::bind (&UniformDielectric<DerivativeTraits, CollocationIntegrator>::kernelD, gf, pcm::_1, pcm::_2, pcm::_3));
109
110
}
110
111
/* *@}*/
@@ -148,7 +149,7 @@ struct CollocationIntegrator
148
149
for (size_t i = 0 ; i < mat_size; ++i) {
149
150
// Fill diagonal
150
151
// Diagonal of S inside the cavity
151
- double Sii_I = factor_ * std::sqrt (4 * M_PI / e[i].area ());
152
+ double Sii_I = factor * std::sqrt (4 * M_PI / e[i].area ());
152
153
// "Diagonal" of Coulomb singularity separation coefficient
153
154
double coulomb_coeff = gf.coefficientCoulomb (e[i].center (), e[i].center ());
154
155
// "Diagonal" of the image Green's function
@@ -177,9 +178,9 @@ struct CollocationIntegrator
177
178
double area = e[i].area ();
178
179
double radius = e[i].sphere ().radius ;
179
180
// Diagonal of S inside the cavity
180
- double Sii_I = factor_ * std::sqrt (4 * M_PI / area);
181
+ double Sii_I = factor * std::sqrt (4 * M_PI / area);
181
182
// Diagonal of D inside the cavity
182
- double Dii_I = -factor_ * std::sqrt (M_PI/ area) * (1.0 / radius);
183
+ double Dii_I = -factor * std::sqrt (M_PI/ area) * (1.0 / radius);
183
184
// "Diagonal" of Coulomb singularity separation coefficient
184
185
double coulomb_coeff = gf.coefficientCoulomb (e[i].center (), e[i].center ());
185
186
// "Diagonal" of the directional derivative of the Coulomb singularity separation coefficient
@@ -205,7 +206,7 @@ struct CollocationIntegrator
205
206
/* *@}*/
206
207
207
208
// / Scaling factor for the collocation formulas
208
- double factor_ ;
209
+ double factor ;
209
210
};
210
211
211
212
#endif // COLLOCATIONINTEGRATOR_HPP
0 commit comments