Included redirection in geometry generator

This commit is contained in:
2024-03-15 14:09:00 +01:00
parent 1dbecc86ce
commit 55c51f8434
4 changed files with 22 additions and 2 deletions
+2
View File
@@ -12,6 +12,8 @@ namespace generator {
std::shared_ptr<Geometry> buildGeometry(Parameter& parameter,
const json_path& path_to_geometry);
std::shared_ptr<Geometry> buildGeometryIncludingRedirection(
Parameter& parameter, const json_path& path_to_geometry);
};
#endif /* GEOMETRY_GENERATOR_H */
+18
View File
@@ -25,4 +25,22 @@ std::shared_ptr<Geometry> buildGeometry(Parameter& parameter,
}
}
std::shared_ptr<Geometry> buildGeometryIncludingRedirection(
Parameter& parameter, const json_path& path_to_geometry) {
if (parameter.jsonObjectFromBase(
json_path_append(path_to_geometry, {"CreateSameAs"}))) {
DEBUG_LEVEL_2("Creating geometry: CreateSameAs.");
json_path path_to_same = json_path_get(parameter.jsonObjectFromBase(
json_path_append(path_to_geometry, {"CreateSameAs"})));
std::stringstream path;
for (auto& p : path_to_same) {
path << p << " ";
}
DEBUG_LEVEL_3("From path: " + path.str());
return buildGeometryIncludingRedirection(parameter, path_to_same);
} else {
return buildGeometry(parameter, path_to_geometry);
}
}
}; // namespace generator
+1 -1
View File
@@ -17,7 +17,7 @@ namespace generator {
parameter.jsonFile(), {"PoissonSolver"});
//create geometry
if (json_object_by_path(object, {"BoundaryGeometry"})) {
geometry = buildGeometry(parameter,
geometry = buildGeometryIncludingRedirection(parameter,
json_path_append({"PoissonSolver"}, {"BoundaryGeometry"}));
} else {
ERROR("Cannot find boundary geometry for poisson solver.");
+1 -1
View File
@@ -15,7 +15,7 @@ std::shared_ptr<Terminator> buildTerminator(
DEBUG_LEVEL_3("with max interactions: " + std::to_string(max_interactions));
DEBUG_LEVEL_3("with max time alive: " + std::to_string(max_time_alive));
std::shared_ptr<Geometry> geometry = buildGeometry(
std::shared_ptr<Geometry> geometry = buildGeometryIncludingRedirection(
parameter, json_path_append(path_to_terminator, {"BoundaryGeometry"}));
return std::shared_ptr<Terminator>(