42 cylinderToCell::typeName,
43 "\n Usage: cylinderToCell (p1X p1Y p1Z) (p2X p2Y p2Z) radius\n\n"
44 " Select all cells with cell centre within bounding cylinder\n\n"
50 void Foam::cylinderToCell::combine(topoSet&
set,
const bool add)
const
52 const vector axis = p2_ - p1_;
53 const scalar rad2 =
sqr(radius_);
54 const scalar magAxis2 =
magSqr(axis);
61 scalar magD = d & axis;
63 if ((magD > 0) && (magD < magAxis2))
65 scalar d2 = (d &
d) -
sqr(magD)/magAxis2;
135 Info<<
" Adding cells with centre within cylinder, with p1 = "
136 << p1_ <<
", p2 = " << p2_ <<
" and radius = " << radius_ <<
endl;
142 Info<<
" Removing cells with centre within cylinder, with p1 = "
143 << p1_ <<
", p2 = " << p2_ <<
" and radius = " << radius_ <<
endl;