Included redirection in drift velocity generator

This commit is contained in:
2024-03-07 10:56:01 +01:00
parent 95461433c2
commit dc534dcd9d
3 changed files with 23 additions and 2 deletions
@@ -23,4 +23,23 @@ std::shared_ptr<DriftVelocity> buildDriftVelocity(
return nullptr;
}
}
std::shared_ptr<DriftVelocity> buildDriftVelocityIncludingRedirection(
Parameter& parameter, const json_path& path_to_drift_velocity) {
std::stringstream cpath;
if (parameter.jsonObjectFromBase(
json_path_append(path_to_drift_velocity, {"CreateSameAs"}))) {
DEBUG_LEVEL_2("Creating Drift velocity: CreateSameAs.");
json_path path_to_same = json_path_get(parameter.jsonObjectFromBase(
json_path_append(path_to_drift_velocity, {"CreateSameAs"})));
std::stringstream path;
for (auto& p : path_to_same) {
path << p << " ";
}
DEBUG_LEVEL_3("From path: " + path.str());
return buildDriftVelocityIncludingRedirection(parameter, path_to_same);
} else {
return buildDriftVelocity(parameter, path_to_drift_velocity);
}
}
}; // namespace generator