80 auto const z = e_z * c_dist;
81 auto const r_vec = c_dist - z * e_z;
82 auto const r = r_vec.
norm();
86 auto const e_r = (r == 0) ? e_r_axis : r_vec / r;
91 auto [dr, dz] = dist_half_pore(r, std::abs(z));
94 if (((dz == 0) && (r <= m_rad)) ||
95 ((dr == 0) && (std::abs(z) > m_half_length))) {
99 if (std::abs(z) >= c_z) {
100 auto const angle = std::asin((std::abs(z) - c_z) / m_smoothing_rad);
101 auto const dist_offset =
102 m_smoothing_rad - (std::cos(angle) * m_smoothing_rad);
103 if (m_half_length < std::abs(z) || r <= (m_rad + dist_offset)) {
113 dist = std::sqrt(dr * dr + dz * dz) * side;
114 vec = -dr * e_r - dz * e_z;