21 "vx", 0.0,
"X-component of the volume extrusion vector");
23 "vy", 0.0,
"Y-component of the volume extrusion vector");
25 "vz", 1.0,
"Z-component of the volume extrusion vector");
32 r_(params.GetParamValue<double>(
"r")),
33 x0_(params.GetParamValue<double>(
"x0")),
34 y0_(params.GetParamValue<double>(
"y0")),
35 z0_(params.GetParamValue<double>(
"z0")),
36 vx_(params.GetParamValue<double>(
"vx")),
37 vy_(params.GetParamValue<double>(
"vy")),
38 vz_(params.GetParamValue<double>(
"vz"))
46 const auto& pr = point;
49 const Vec3 k_hat(0.0, 0.0, 1.0);
51 const Vec3 p0r = pr - p0;
52 const Vec3 cyl_unit_dir = cyl_dir_vec.Normalized();
53 const double cyl_length = cyl_dir_vec.Norm();
57 const double p0r_dot_cud = p0r.Dot(cyl_unit_dir);
58 if (p0r_dot_cud < 0.0 or p0r_dot_cud > cyl_length)
return false;
66 if (std::abs(cyl_dir_vec.Dot(k_hat) / cyl_dir_vec.Norm()) > (1.0 - 1.0e-12))
68 binorm = Vec3(0.0, 1.0, 0.0);
69 tangent = Vec3(1.0, 0.0, 0.0);
73 binorm = k_hat.Cross(cyl_dir_vec);
74 binorm = binorm / binorm.Norm();
75 tangent = binorm.Cross(cyl_dir_vec);
76 tangent = tangent / tangent.Norm();
81 const Vec3 p0r_projected(p0r.Dot(tangent), p0r.Dot(binorm), 0.0);
85 if (p0r_projected.NormSquare() <=
r_ *
r_)
return true;
static chi::InputParameters GetInputParameters()
bool Inside(const chi_mesh::Vector3 &point) const override
static chi::InputParameters GetInputParameters()
RCCLogicalVolume(const chi::InputParameters ¶ms)
RegisterChiObject(chi_mesh, BooleanLogicalVolume)