Added a half-cylinder with a cone end as a geometry.

The cone starts at z=0 and has a height H_cone, the
cylinder starts at H_cone and ends at H_cone + H_cyl.
The radii of the cone and the cylinder are matched.
It's important to note that the injector still injects particles
across the whole "bounding cylinder", but particles
outside of the actual region are removed after their
first movement step without being deposited.
This commit is contained in:
2026-04-28 14:00:10 +02:00
parent 32f4703f4e
commit a6a9ac388c
3 changed files with 94 additions and 0 deletions
+33
View File
@@ -26,4 +26,37 @@ class Cylinder : public Geometry {
const double height_;
};
/*
/|‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾|‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾\ ‾‾‾
/ | | \ ^
/ | | \ |
/ | | \ | R_cylinder
/ | | \ ⌄
|<-->|<------------------>|<------------------><---> ---
z=0 ^ ^ |
| | |
H_cone H_cylinder symmetry axis
The geometry will only know 3 regions, "inside", "hull", "top". Meaning the
cone will always have the same boundary condition as the cylinder boundary.
*/
/*
Geometry of a cylinder with a cone as the end at z=0.
*/
class HalfCylinderWithCone : public Geometry {
public:
HalfCylinderWithCone(double radiusCylinder, double heightCylinder,
double heightCone);
bool isInside(const Coordinate& position) const;
GeometryPositioning isWhere(const Coordinate& position) const;
private:
const double cylinder_radius_;
const double cylinder_height_;
const double cone_height_;
double localRadius(double z) const;
};
#endif /* GEOMETRY_H */