Add HorizontalCylinder form factor
A separate FormFactorHorizontalCylinder class is needed in order to support slicing. Slicing support will extend to particles that are rotated in plane, but not out of plane.
(The alternative would be to equip the extant FormFactorCylinder class with slicing support for arbitrary rotations. However, this would be much more effort, would be numerically inefficient in the case of horizontal cylinders, and is currently not required.)
The particle geometry shall allow for optional upper and lower truncation in z. Thereby slices of FormFactorHorizontalCylinder are again of type FormFactorHorizontalCylinder. Accordingly, the constructor shall be
FormFactorHorizontalCylinder::FormFactorHorizontalCylinder(double radius, double zmin, double zmax, double length)
with the constraints
radius > 0
length > 0
-radius <= zmin < zmax <= +radius
Implementation steps:
-
Copy and paste all code that involves FormFactorCylinder, renaming every occurence of "Cylinder" into "VerticalCylinder". This step creates a verbatim copy that has exactly the same functionality as the original class. Also copy, paste & modify tests that specifically address the cylindrical form factor - but not all tests that involve cylinders (a mixture of prisms and cylinders is currently used as standard sample in many tests). -
Create numeric specialization test that ensures FormFactorCylinder and FormFactorVerticalCylinder yield the same F(q). -
Modify FormFactorHorizontalCylinder from vertical to horizontal. Add a 90 deg rotation to the specialization test to keep it passing. -
Add support for truncation. Create numeric specialization test to ensure correct result for untruncated cylinders and for sum of two truncated cylinders. -
Add support for slicing.