20#include <shapes/SimplePore.hpp>
38std::pair<double, double> SimplePore::dist_half_pore(
double r,
double z)
const {
61 if ((z <= c_z) && (r <= (c_z + c_r - z))) {
63 return {m_rad - r, 0};
65 if (((z >= c_z) && (r >= c_r)) || ((z <= c_z) && (r > (c_z + c_r - z)))) {
67 return {0, m_half_length - z};
71 auto const dr = c_r - r;
72 auto const dz = c_z - z;
75 auto const d = std::sqrt(
dr *
dr +
dz *
dz);
76 auto const fac = (d - m_smoothing_rad) / d;
85 auto const c_dist = pos - m_center;
86 auto const z = e_z *
c_dist;
92 auto const e_r = (r == 0.) ? e_r_axis :
r_vec / r;
97 auto [
dr,
dz] = dist_half_pore(r, std::abs(z));
100 if (((
dz == 0.)
and (r <= m_rad)) ||
101 ((
dr == 0.)
and (std::abs(z) > m_half_length))) {
105 if (std::abs(z) >= c_z) {
Vector implementation and trait types for boost qvm interoperability.
void calculate_dist(const Utils::Vector3d &pos, double &dist, Utils::Vector3d &vec) const override
cudaStream_t stream[1]
CUDA streams for parallel computing on CPU and GPU.
DEVICE_QUALIFIER constexpr T sqr(T x)
Calculates the SQuaRe of x.