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
+26
View File
@@ -23,6 +23,32 @@ std::shared_ptr<Geometry> buildGeometry(Parameter& parameter,
DEBUG_LEVEL_3("with height: " + std::to_string(height) + " m");
#endif
return std::shared_ptr<Geometry>(new Cylinder(radius, height));
} else if(parameter.jsonObjectFromBase(
json_path_append(path_to_geometry, {"HalfCylinderWithCone"}))) {
#ifdef debug
DEBUG("Creating geometry: half cylinder with cone.");
#endif
double radius =
json_read_length(parameter.jsonObjectFromBase(json_path_append(
path_to_geometry, {"HalfCylinderWithCone", "Radius"})),
"m");
double heightcylinder =
json_read_length(parameter.jsonObjectFromBase(json_path_append(
path_to_geometry, {"HalfCylinderWithCone", "HeightCylinder"})),
"m");
double heightcone =
json_read_length(parameter.jsonObjectFromBase(json_path_append(
path_to_geometry, {"HalfCylinderWithCone", "HeightCone"})),
"m");
#ifdef debug
std::stringstream out;
out << "height cyl: " << heightcylinder << ", height cone: " << heightcone << ", radius: " << radius << "\n";
DEBUG(out.str());
#endif
return std::shared_ptr<Geometry>(
new HalfCylinderWithCone(radius, heightcylinder, heightcone));
} else {
ERROR("This geometry is not implemented.");
return nullptr;