2727#define TANHDIFFUSE_HPP
2828
2929#include < iosfwd>
30+ #include < tuple>
3031
3132#include " Config.hpp"
3233
4041class TanhDiffuse
4142{
4243private:
44+ // / Dielectric constant on the left of the interface
4345 double epsilon1_;
46+ // / Dielectric constant one the right of the interface
4447 double epsilon2_;
48+ // / Width of the transition layer
4549 double width_;
50+ // / Center of the transition layer
4651 double center_;
52+ /* ! Returns value of dielectric profile at given point
53+ * \param[in] point where to evaluate the profile
54+ */
4755 double value (double point) const {
4856 double epsPlus = (epsilon1_ + epsilon2_) / 2.0 ;
4957 double epsMinus = (epsilon2_ - epsilon1_) / 2.0 ;
5058 double tanh_r = std::tanh ((point - center_) / width_);
5159 return (epsPlus + epsMinus * tanh_r); // epsilon(r)
5260 }
61+ /* ! Returns value of derivative of dielectric profile at given point
62+ * \param[in] point where to evaluate the derivative
63+ */
5364 double derivative (double point) const {
5465 double factor = (epsilon1_ - epsilon2_) / (2.0 * width_);
5566 double tanh_r = std::tanh ((point - center_) / width_);
@@ -59,24 +70,20 @@ class TanhDiffuse
5970 {
6071 os << " Permittivity inside = " << epsilon1_ << std::endl;
6172 os << " Permittivity outside = " << epsilon2_ << std::endl;
62- os << " Profile width = " << width_ << std::endl;
63- os << " Profile center = " << center_;
73+ os << " Profile width = " << width_ << " AU " << std::endl;
74+ os << " Profile center = " << center_ << " AU " ;
6475 return os;
6576 }
6677public:
6778 TanhDiffuse () {}
6879 TanhDiffuse (double e1 , double e2 , double w, double c) :
6980 epsilon1_ (e1 ), epsilon2_(e2 ), width_(w), center_(c) {}
70- /* ! The permittivity profile of the transition layer
71- * \param[out] e the value of the dielectric constant at point r
72- * \param[out] de the value of the derivative of the dielectric constant
73- * at point r
81+ /* ! Returns a tuple holding the permittivity and its derivative
7482 * \param[in] r evaluation point
7583 */
76- void operator ()( double & e , double & de, const double r) const
84+ std::tuple< double , double > operator ()( const double r) const
7785 {
78- e = value (r);
79- de = derivative (r);
86+ return std::make_tuple (value (r), derivative (r));
8087 }
8188 double epsilon1 () const { return epsilon1_; }
8289 double epsilon2 () const { return epsilon2_; }
0 commit comments