Included redirection in geometry generator
This commit is contained in:
@@ -12,6 +12,8 @@ namespace generator {
|
|||||||
std::shared_ptr<Geometry> buildGeometry(Parameter& parameter,
|
std::shared_ptr<Geometry> buildGeometry(Parameter& parameter,
|
||||||
const json_path& path_to_geometry);
|
const json_path& path_to_geometry);
|
||||||
|
|
||||||
|
std::shared_ptr<Geometry> buildGeometryIncludingRedirection(
|
||||||
|
Parameter& parameter, const json_path& path_to_geometry);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* GEOMETRY_GENERATOR_H */
|
#endif /* GEOMETRY_GENERATOR_H */
|
||||||
|
|||||||
@@ -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
|
}; // namespace generator
|
||||||
@@ -17,7 +17,7 @@ namespace generator {
|
|||||||
parameter.jsonFile(), {"PoissonSolver"});
|
parameter.jsonFile(), {"PoissonSolver"});
|
||||||
//create geometry
|
//create geometry
|
||||||
if (json_object_by_path(object, {"BoundaryGeometry"})) {
|
if (json_object_by_path(object, {"BoundaryGeometry"})) {
|
||||||
geometry = buildGeometry(parameter,
|
geometry = buildGeometryIncludingRedirection(parameter,
|
||||||
json_path_append({"PoissonSolver"}, {"BoundaryGeometry"}));
|
json_path_append({"PoissonSolver"}, {"BoundaryGeometry"}));
|
||||||
} else {
|
} else {
|
||||||
ERROR("Cannot find boundary geometry for poisson solver.");
|
ERROR("Cannot find boundary geometry for poisson solver.");
|
||||||
|
|||||||
@@ -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 interactions: " + std::to_string(max_interactions));
|
||||||
DEBUG_LEVEL_3("with max time alive: " + std::to_string(max_time_alive));
|
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"}));
|
parameter, json_path_append(path_to_terminator, {"BoundaryGeometry"}));
|
||||||
|
|
||||||
return std::shared_ptr<Terminator>(
|
return std::shared_ptr<Terminator>(
|
||||||
|
|||||||
Reference in New Issue
Block a user